​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 later.

​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,
Aswani



script:
================================================================​

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

#angle #0:resno@CB :resno@SG :resno@SG :resno@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 f.endswith('.pdb')]

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

    runCommand('close #0')                  # close molecule and map
​=================================================================​




--
K.Aswani Kumar
​Graduate Student
Molecular Biophysics Unit
Indian Institute of Science
Bangalore-560012
Karnataka, India.