From: Ajasja Ljubetič (ajasja.ljubetic_at_gmail.com)
Date: Tue Jan 07 2014 - 14:04:19 CST

Yes, because you are calculating sasa only for the first frame then
printing the same number over and over again.

You have to do the calculation inside the loop. Something like (untested).

#sasa calculation loop
set fp [open "SASA-output.dat" w]
set nf [molinfo top get numframes]
set complex [atomselect top "protein and noh"]

for { set i 0 } { $i < $nf } { incr i } {
    $complex frame $i
     set sasa [measure sasa $complex]
     puts $fp "$i $sasa"
}
close $fp

Some other problems of your original code:
-sel and complex are the same.
-according to the user manual measure sasa -restricted takes a second
selection

HTH,
Ajasja

On 7 January 2014 19:40, flavio seixas <oivalf_nix_at_yahoo.com> wrote:

> Hi,
> I am trying to generate a file containing Solvent Acessible Surface Area
> from each frame of the trajectory.
> I search in VMD list and user guide and I build the following script,
> which was sourced after loading pdb and dcd files:
>
> #sasa calculation loop
> set fp [open "SASA-output.dat" w]
> set nf [molinfo top get numframes]
> set complex [atomselect top "protein and noh"]
> set sel [atomselect top "protein and noh"]
> set sasa [measure sasa 1.40 $complex -restrict]
> for { set i 0 } { $i < $nf } { incr i } {
> $sel frame $i
> puts $fp "$i $sasa"
> }
> close $fp
>
> However, the output file gives the same value for all frames:
>
> 0 21724.5625
> 1 21724.5625
> 2 21724.5625
> 3 21724.5625
> ...
> 1250 21724.5625
>
> I think the calculation for the first frame was repeated to all others.
>
> I am not expert in TCL language, so I appreciate very much if an
> experienced user could tell me what is wrong with the script.
>
> Thanks in advance
>
> Flavio
>
>