Hi Everyone,

I would like to write a script, which writes out intermolecular distances 
shorter than 5A between hydrogens into a text file. Here is what I made so far 
on the basis of the Measure distance script in the respository:

from pymol import cmd

# open dist.txt for writing
f=open('dist.txt','w')

hcpl1=cmd.select('hcpl1', 'resi 1-10 and hydro')
hcpl2=cmd.select('hcpl2', 'resi 11-20 and hydro')
inoe12=cmd.select('inoe12', 'hcpl1 around 5 of hcpl2')

for i in range(len(hcpl1)):
  dst=cmd.distance('tmp', 'hcpl1' ,'hcpl2')
  f.write("%8.3f\n"%dst)
f.close()

What do not understand is the following: 
- why inoe12 selection is not being made (it works from pymol command line as
"select inoe12, hcpl1 around 5 of hcpl2" )
- how can I loop over the atoms of a selection (hcpl1 seems to be not a list, 
but a single interger)

Thanks for any help in advance!
Krisztina


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to