Calculating the total areaSAS from a series of PDB files

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

Hi Rodrigo, One way without using attributes but involving more text processing would be to: (1) open trajectory, show surface for first frame (2) in MD Movie, define per-frame Chimera command script <http://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/movie/movie.html#per-frame> echo <FRAME> … to report the frame number into the Reply Log. Start running that per-frame script. (3) play through trajectory once without looping. That will recalculate surface at each frame and report total area (along with a bunch of extra lines) in the Reply Log. The per-frame script above will put the frame number in to help you parse the output. Save Reply Log to text file and use your favorite text-editing approach to extract only the parts of interest. In my little test using NMR ensemble 1PLX as a trajectory, here’s what I get for the last two frames: ----- 79 /Users/meng/Desktop/Chimera.app/Contents/Resources/bin/mscalc 1.400000 2.000000 0 MSMSLIB 1.3 started on vpn-169-230-25-25.cgl.ucsf.edu Copyright M.F. Sanner (March 2000) Compilation flags Surface 1PLX.pdb, category main, probe radius 1.4, vertex density 2 1 connected surface components Total solvent excluded surface area = 441.217 Total solvent accessible surface area = 699.678 80 /Users/meng/Desktop/Chimera.app/Contents/Resources/bin/mscalc 1.400000 2.000000 0 MSMSLIB 1.3 started on vpn-169-230-25-25.cgl.ucsf.edu Copyright M.F. Sanner (March 2000) Compilation flags Surface 1PLX.pdb, category main, probe radius 1.4, vertex density 2 1 connected surface components Total solvent excluded surface area = 445.855 Total solvent accessible surface area = 713.182 ----- NOTE: The main problem is that the surface calculation will probably fail on some frames. However, that would happen even if you did each one manually. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco On Oct 21, 2015, at 11:03 AM, ros <rodrigogalindo@gmail.com> wrote:
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...

Well! This did the trick perfectly. All it took is: grep 'accessible' reply.log and I got a nice column with the areaSAS numbers for each frame. Perfect! Thank you very much! Rodrigo. On Wed, Oct 21, 2015 at 12:22 PM, Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Rodrigo, One way without using attributes but involving more text processing would be to:
(1) open trajectory, show surface for first frame
(2) in MD Movie, define per-frame Chimera command script <http://www.rbvi.ucsf.edu/chimera/docs/ContributedSoftware/movie/movie.html#per-frame>
echo <FRAME>
… to report the frame number into the Reply Log. Start running that per-frame script.
(3) play through trajectory once without looping. That will recalculate surface at each frame and report total area (along with a bunch of extra lines) in the Reply Log. The per-frame script above will put the frame number in to help you parse the output. Save Reply Log to text file and use your favorite text-editing approach to extract only the parts of interest.
In my little test using NMR ensemble 1PLX as a trajectory, here’s what I get for the last two frames: ----- 79 /Users/meng/Desktop/Chimera.app/Contents/Resources/bin/mscalc 1.400000 2.000000 0 MSMSLIB 1.3 started on vpn-169-230-25-25.cgl.ucsf.edu Copyright M.F. Sanner (March 2000) Compilation flags
Surface 1PLX.pdb, category main, probe radius 1.4, vertex density 2 1 connected surface components Total solvent excluded surface area = 441.217 Total solvent accessible surface area = 699.678 80 /Users/meng/Desktop/Chimera.app/Contents/Resources/bin/mscalc 1.400000 2.000000 0 MSMSLIB 1.3 started on vpn-169-230-25-25.cgl.ucsf.edu Copyright M.F. Sanner (March 2000) Compilation flags
Surface 1PLX.pdb, category main, probe radius 1.4, vertex density 2 1 connected surface components Total solvent excluded surface area = 445.855 Total solvent accessible surface area = 713.182 -----
NOTE: The main problem is that the surface calculation will probably fail on some frames. However, that would happen even if you did each one manually.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco
On Oct 21, 2015, at 11:03 AM, ros <rodrigogalindo@gmail.com> wrote:
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...
participants (2)
-
Elaine Meng
-
ros