From: Axel Kohlmeyer (
Date: Wed Sep 26 2007 - 20:01:35 CDT

On Wed, 26 Sep 2007, PARMINDER MANKOO wrote:

PM> Hello,


PM> I want to calculate the surface area of only LYS residue out of
PM> total protein and want to get the time series of it. How can I do
PM> it? How can I modify the following script for time?

you just have to "step" the selections through the frames
with '$sel frame $i'.

also there is no need to re-create all selections.
so you can put a:

foreach r $residlist {
  set res($r) [atomselect top "residue $r"]
in front of the loop and then just use $res($r)
to refer to each of the residues.
and finally [$allsel num] returns the number of
atoms in the selection not the number of frames.


PM> Thanks, Preeti
PM> set outfile [open sasa.dat w]
PM> set allsel [atomselect top "resid 217 to 393 and resname LYS"]
PM> set residlist [lsort -unique [$allsel get residue]]
PM> for {set i 0} { $i < [ $allsel num ] } {incr i } {
PM> foreach r $residlist {
PM> set sel [atomselect top "residue $r"]
PM> set rsasa [measure sasa 1.4 $allsel -restrict $sel]
PM> $sel set user $rsasa
PM> $sel delete
PM> puts $outfile "[residue $r, sasa: $rsasa, time $i]"
PM> }
PM> }
PM> close $outfile

Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.