Hello,
thanks for the prompt reply, it works great!
Cheers
Yusuf
Quoting Warren DeLano <war...@delsci.com>:
Yusuf,
see
http://sourceforge.net/mailarchive/forum.php?thread_id=7495694&forum_id=60
Close! Actually I like you're usage expectation even better than how
PyMOL currently works -- but at the present time you need to convert
those indices into selection strings:
from pymol import cmd
cmd.load("$PYMOL_PATH/test/dat/pept.pdb")
cmd.select('sel01', 'elem c and not (neighbor elem n+o)')
cmd.color('green', 'sel01')
cmd.show('spheres', 'sel01')
atoms = cmd.index('sel01')
di = 0.0
for i in atoms:
for j in atoms:
di += cmd.get_distance("%s`%d"%i,"%s`%d"%j)
print di
Cheers,
Warren
--
Warren L. DeLano, Ph.D.
Principal Scientist
. DeLano Scientific LLC
. 400 Oyster Point Blvd., Suite 213
. South San Francisco, CA 94080 USA
. Biz:(650)-872-0942 Tech:(650)-872-0834
. Fax:(650)-872-0273 Cell:(650)-346-1154
. mailto:war...@delsci.com
-----Original Message-----
From: pymol-users-ad...@lists.sourceforge.net
[mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of
tanri...@stud.uni-frankfurt.de
Sent: Wednesday, June 29, 2005 7:51 AM
To: pymol-users@lists.sourceforge.net
Cc: g.schnei...@chemie.uni-frankfurt.de
Subject: [PyMOL] Sum distances in loop via python script
Hi everybody,
I am new to PyMol and scripting with Python, and I would be
very grateful if
anybody can help me.
After loading serveral superposed molecules, I made a
selection of some atoms as
follows:
from pymol import cmd
cmd.select('sel01', ('elem c and not (neighbor elem n+o)')
cmd.color ('green', 'sel01')
cmd.show ('spheres', 'sel01)
Now, I want to measure the distance from an atom in this
selection to all other
atoms in sel01 and sum it up. How am I supposed to do this in
my Python-Pymol
(.py) script?
I know that it must be something like:
atoms = cmd.index('sel01')
di = 0
for i in atoms
for j in atoms
di += cmd.distance(i,j)
print di
But this actually does not work. Any advise?
Best regards
Yusuf Tanrikulu
--
Yusuf Tanrikulu
Bioinformatics Diploma Student
Department of Biosciences
Johann Wolfgang Goethe-University
Marie-Curie-Str. 11
D-60439 Frankfurt, Germany
Email: tanri...@stud.uni-frankfurt.de
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users