[Chimera-users] Measuring dihedral angles using chimera

Aswani Kumar Kancherla ashwin2952 at gmail.com
Thu Aug 28 22:13:59 PDT 2014

​Hello Chimera Users,
​I have recently installed chimera ​version 1.9 in Linux OpenSuSe 11.4 and
am trying to get acquainted with its features.

I am trying to measure dihedral angles (specifically the angle chiSS
defined by Cb-Sg-Sg'-Cb' about disulfide bonds) for a list of pdb files
containing NMR structure ensembles. ​I was trying to ​do this using a
script (kindly given by a friend and pasted below) to which I can pass the
coordinates of the four atoms and get the measured values for the "reply
log" information.

​I need to put the files in a directory called pdb_files, open ​chimera and
call the script and retrieve information from the "reply log". However,
there is a problem:

Since the coordinates of (Cb,Sg, etc ) will be different for each of the
ensemble (since each ensemble is structure of a different molecule), I need
to pass the coordinates dynamically for each pdbid.

​I have found from Chimera User group  archives that reply log can be saved
using a function.
 So that should solve one issue. I can save the reply log and parse it

​What is the best way to
​m​easure specific dihedral angles from multiple pdb files
? Is it possible to invoke ​
​chimera in tty mode and make it execute functions? In that case, I could
probably write a shell script​ to invoke chimera once for each pdb and ask
it to execute python script having appropriate atom coordinates.

I apologize for slightly long an e-mail. Any hints or directions to enable
me figure out how to get this done efficiently in chimera will be of great
help to me.

​with regards,



*import os*
*import Matrix*
*from chimera import openModels, selection, runCommand*

*#angle #0:resno at CB :resno at SG :resno at SG :resno at CB  34.6289*

*# Directory containing PDB files*
*directory = 'pdb_files'*

*# Get paths to all files in the specfied directory *
*paths = [os.path.join(directory,f) for f in os.listdir(directory) if

 *for pdbfilename in paths:*
*    filename = pdbfilename.split("/")[1]*
*    openModels.open(pdbfilename, baseId = 0)  # Open as model #2*
*    runCommand('angle #0:863 at CB :980 at SG :1130 at SG :1235 at CB')
   # calculate torsion angle*

*    runCommand('close #0')                  # close molecule and map*

K.Aswani Kumar
​Graduate Student
Molecular Biophysics Unit
Indian Institute of Science
Karnataka, India.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20140829/9259ac3b/attachment.html>

More information about the Chimera-users mailing list