[Chimera-users] problem with the scripting of rms deviations

Sebastian Kruggel kruggel at chemie.uni-hamburg.de
Mon Aug 24 04:43:01 PDT 2009


Dear Chimera team and users,

I tried to write a small chimera / python script to 
calculate rmsd to the crystal structure for a bunch of 
docked ligands and transform the values in a nice csv - 
because fred22 doesn't do this for me...

The core function rms2ref is the one calculating the rmsd, 
than I save the reply log and afterwards transform this text 
file.

Things worked out fine BUT than I started the script several 
times, and I got different orders in my list every time. 
Because I want to assign rmsd values to scores etc it is 
essential to keep the order provided in the sdf/mol2. I 
thought about problems with the format but the problem 
exists with mol2 and sdf files. Than I thought, chimera 
would change the order in opening the multimolecule files - 
but saving the #1.1 molecule and opening it in a new session 
showed - even more strange - that the molecule is exactly 
the same every time. So there is only the possibility that 
either the calculation of the rmsd or the order of the list 
(extraction of the replyLog.txt) doesn't work - which I 
*really* don't understand at all...

Here is a small example where the rmsds-list has different 
orders every time I start the script...


##############################
from chimera import runCommand
from chimera.tkgui import saveReplyLog

def rms2ref(ref, pose, no):
    runCommand('open %s; open %s' % (ref, pose))
    i = 1
    while i <= no:
       # only hetatms are included --> ~@/element=h
       runCommand('sel #1.%i & ~@/element=h' % i)
       runCommand('rmsd #0 sel')
       i += 1

rms2ref('lig_cryst.pdb', 'poses.sdf', 10)

# generate output from replyLog.txt

saveReplyLog('replyLog.txt')

rmsds = []
for i in open('replyLog.txt').readlines():
    if i.startswith('RMSD between'):
       rmsds.append(i.split()[-2])

print rmsds
##############################


Maybe anybody can help me and tell me about the probably 
stupid mistake I am making - would be really great! I 
attached the lig_cryst.pdb and poses.sdf files just in case 
that anybody wants to try out ;-)

Best regards and thanks in advance,
Sebastian



-- 
Sebastian Kruggel
Institut für Pharmazie
Bundesstr. 45 | Raum 112 (406)
D 20146 Hamburg

Tel:   +49 (0)40 42838-3626 (-3484)
mail:  kruggel at chemie.uni-hamburg.de
http://www.chemie.uni-hamburg.de/pha/phachem/lemcke/mitarbeiter.html
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rmsExample.py
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20090824/daff494b/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lig_cryst.pdb
Type: chemical/x-pdb
Size: 2511 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20090824/daff494b/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: poses.sdf
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20090824/daff494b/attachment-0001.ksh>


More information about the Chimera-users mailing list