Hi Antonio,

I got the same error message after the second line but this worked for me.

/Applications/PyMOL.app/Contents/bin/python
>>>from pymol import cmd
>>>fcmd.fetch("5da6")
>>>fcmd.do("show sticks; hide cartoon;orient")
>>>fcmd.util.cbac('all')
>>>fcmd.png("testcbacSticks.png")

Best regards,

Blaine

Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular Biology
College of Medicine
University of Oklahoma Health Sciences Center
S.L. Young Biomedical Research Center (BRC) Rm. 466
975 NE 10th Street, BRC 466
Oklahoma City, OK 73104-5419

________________________________________
From: Antonio Serrano [aserra...@ucam.edu]
Sent: Monday, September 14, 2020 10:57 AM
To: pymol mailinglist
Subject: [EXTERNAL] [PyMOL] Color by Atom from CLI (not PyMol's GUI)

Hi. I'm working with PyMol's Python API from the terminal. I would like to 
color the molecules in my session by atom using the command util.cbac(). I want 
them in cyan because I'm deleting the two molecules involved and reopening the 
files with those molecules several times inside a loop. My first attempt was 
this:

import pymol2
sess = pymol2.PyMOL()
sess.start()
sess.cmd.load("./cyclodextrin_rec.mol2", object = "rec")
sess.cmd.load("./cyclodextrin_lig.mol2", object = "lig")
sess.cmd.util.cbac("all")

After that last command, I get the following warning message: "PyMOL not 
running, entering library mode (experimental)". It is supposed to work, but I 
don't get the molecules colored by atom. I also tried with the following last 
command instead of sess.cmd.util.cbac("all"):

import pymol
pymol.util.cbac("all")

But still doesn't work. Any clue? Thx.

Antonio Serrano

[http://ucam.edu/logo-firma-electronica.png]
________________________________
"Este mensaje es privado y confidencial y se dirige exclusivamente a su 
destinatario. Si usted recibe este mensaje por error, no debe revelar, 
distribuir o copiar este e-mail. Por favor, comuníquelo al remitente y borre el 
mensaje y los archivos adjuntos de su sistema. No hay renuncia a la 
confidencialidad ni a ningún privilegio a causa de una transmisión errónea o 
por mal funcionamiento".

"This message is private and confidential and it is intended exclusively for 
the addressee. If your receive this message by mistake, you should not 
disseminate, distribute or copy this e-mail. Please inform the sender and 
delete the message and attachments from your system. No confidentiality or any 
privilege regarding the information is waived or lost by any mistransmission or 
malfunction".

No me imprimas si no es necesario.
Don't print me unless it's necessary.



_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Reply via email to