[Chimera-users] python code to loop over molecules

David Gae ddgae at ucdavis.edu
Tue May 4 16:33:33 PDT 2021


Dear Professor Tirado-Rives,


I have a simple python script with different coloring I picked up few months. As Dr. Meng pointed out hbond is extremely useful after loading the PDB data. 


Sincerely,
David 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LIG4.pdb
Type: application/octet-stream
Size: 399 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20210504/87e8472c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LIG5.pdb
Type: application/octet-stream
Size: 399 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20210504/87e8472c/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LIG3.pdb
Type: application/octet-stream
Size: 399 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20210504/87e8472c/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LIG2.pdb
Type: application/octet-stream
Size: 470 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20210504/87e8472c/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LIG1.pdb
Type: application/octet-stream
Size: 470 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20210504/87e8472c/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: host.pdb
Type: application/octet-stream
Size: 470 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20210504/87e8472c/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: color_ligands_chimera.py
Type: text/x-python-script
Size: 2283 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20210504/87e8472c/attachment.bin>
-------------- next part --------------



> On May 3, 2021, at 5:10 AM, Julian Tirado-Rives <julian.tirado-rives at yale.edu> wrote:
> 
> Dear Chimera (and ChimeraX) team:
> 
>    I need to find some python example or code snippet capable of
> looping over all the molecules in a particular model and do some actions
> separately in each one.
> 
>     In our research we use several different docking programs and other
> ways of generating poses of protein-ligand complexes, and using several
> different programs to analyze them gets quite complicated. Instead,
> we've found that the easiest way is to generate from each code, or using
> conversion utilities such as babel, a pdb file of the host and a sdf or
> mol2 file containing all the ligand poses and read them into chimera.
> An excellent program, by the way. We use it all the time.
> 
>    I would love to automate the process even further by doing all the
> coloring, rendering, Hydrogen Bond and contact analysis, etc. in Python
> rather than manually. I have been trying to do this, but have not found a way to do the following:
> 
> If we have, for instance, the host in model #0, and the ligand poses in model #1 (#1.1, #1.2, ..., #1.N):
> 
> - Get from chimera the number of molecules in model #1 (e.g what is N)
> - loop from the first #1.1 to the last #1.N molecule
> - do some cations there (e.g select, color, find HB's, etc)
> 
>   I think this should be a problem other people have encountered and
> solved  before, but I have not been able to find an example in your
> depository, the mailing lists, or even the book ... I would appreciate
> your input.
> 
> Thanks for your help, and for an excellent program!
> 
>                                             - Julian -
> 
> 
> -- 
> 
>  -----------------------------------------------------------------
> | Julian Tirado-Rives      |                                      |
> | Department of Chemistry  | Phone: (203)432-3356                 |
> | Yale University          | Fax:   (203)432-6144                 |
> | P. O. Box 208107         | email:  Julian.Tirado-Rives at yale.edu |
> | New Haven, CT 06520-8107 |                                      |
>  -----------------------------------------------------------------
> 
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users



More information about the Chimera-users mailing list