[Chimera-users] Calculating the total areaSAS from a series of PDB files
ros
rodrigogalindo at gmail.com
Wed Oct 21 11:03:11 PDT 2015
Hello!
I would like to measure the SAS from a series of PDB files to see how
the surface value changes over time (the PDB files are from an MD
simulation). I know that If I open a PDB file and calculate the
surface, I get the areaSAS value, but I do not want to do this 5000
times.
I am making progress on a python script to automate the process, which is:
--------------------------------------------
import os
from chimera import runCommand as rc
from chimera import replyobj
os.chdir("/home/tmp/pdb")
file_names = [fn for fn in os.listdir(".") if fn.endswith(".pdb")]
for fn in file_names:
replyobj.status("Processing " + fn)
rc("open " + fn)
rc("surf")
rc("sel :1-6")
from chimera.selection import currentResidues
residues = currentResidues()
outf = open("/home/tmp/sas.dat", "w")
for r in residues:
print>>outf, r, r.areaSAS
rc("stop now")
--------------------------------------------
The PDB's consist of only 6 residues (DNA residues). With this
script, I get the output:
#1 DA 1 320.8377808
#2 DC 3 277.614161432
#2 DG 4 323.883637217
#1 DC 3 284.934065707
#2 DT 6 221.04715555
#0 DA 1 321.883850728
#1 DC 5 345.231659889
#0 DC 2 179.379177183
#2 DC 5 350.455405176
#0 DC 3 285.785918236
#1 DT 6 245.048330456
#0 DG 4 303.501165912
#1 DG 4 314.409510799
#0 DC 5 352.639633257
#1 DC 2 193.509086639
#0 DT 6 214.883334659
#2 DC 2 183.766654447
#2 DA 1 344.369126737
using 3 test pdb's.
Is there a way to get the total value of areaSAS of each model and not
for each residue? I am interested in having a file just like (using
for example 3 pdb's):
Model # total areaSAS value
#0 123123.123122
#1 123123.12312
#3 123123.12312
...
etc.
I have tried deleting the residues loop, but I do not know how the
total areaSAS attribute is stored or how to assign it to a variable.
Thank you for your help!
Rodrigo.
PS. The main goal is to be able to do this without the PDB files and
just reading an AMBER topology/trajectory...
More information about the Chimera-users
mailing list