Koray,
Use cmd.get_distance when you have two atoms:
x = cmd.get_distance("10/CA", "11/CA")
print x
To script a solution to your problem I'd do:
#
# If your first selection (from residue A) is called "yourFirstSele"
# and your second selection (from resisude B) is called, "yourSecondSele"
# then the following script will print out the distances from atoms in the first
# residue to those in the 2nd.
#
from pymol import stored
stored.listA = []
stored.listB = []
iterate yourFirstSele, stored.listA.append(ID)
iterate yourSecondSele, stored.listB.append(ID)
python
for aa in stored.listA:
for bb in stored.listB:
print "Distance from atom %d to atom %d is %f" %
(aa,bb,cmd.get_distance("ID %d" % aa, "ID %d"% bb))
python end
Feel free to modify that as necessary.
Cheers,
-- Jason
On Thu, Mar 18, 2010 at 8:07 AM, koray <[email protected]> wrote:
> Hi,
>
> I created bond objects between residues I want to observe.
> Now I have 35 bond objects. I want to color them based on the bond length.
> But for that I should get the distance information of the bond object. If I
> say show label, it shows the leght of the bond.
> Is there a way to get this info by a command
> I tried cmd.get_distance(Bond1)
> but it is not working.
> Thanks in advance
>
> Koray KIRLI
> MPI / Goettingen
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> PyMOL-users mailing list ([email protected])
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/[email protected]
>
--
Jason Vertrees, PhD
PyMOL Product Manager
Schrodinger, LLC
(e) [email protected]
(o) +1 (603) 374-7120
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
PyMOL-users mailing list ([email protected])
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/[email protected]