VMD-L Mailing List
From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Tue Jan 07 2014 - 14:22:10 CST
- Next message: flavio seixas: "Re: Surface Area Calculation"
- Previous message: Ajasja Ljubetič: "Re: Surface Area Calculation"
- In reply to: flavio seixas: "Surface Area Calculation"
- Next in thread: flavio seixas: "Re: Surface Area Calculation"
- Reply: flavio seixas: "Re: Surface Area Calculation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi Flavio,
Your order of operations is a bit wonky. You've set the variable sasa,
and then never update inside the loop. Try the following instead:
set fp [open "SASA-output.dat" w]
set nf [molinfo top get numframes]
set sel [atomselect top "protein and noh"]
for { set i 0 } { $i < $nf } { incr i } {
$sel frame $i
set sasa [measure sasa 1.40 $sel -restrict]
puts $fp "$i $sasa"
}
close $fp
-Josh Vermaas
On 01/07/2014 12:40 PM, flavio seixas 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
>
- Next message: flavio seixas: "Re: Surface Area Calculation"
- Previous message: Ajasja Ljubetič: "Re: Surface Area Calculation"
- In reply to: flavio seixas: "Surface Area Calculation"
- Next in thread: flavio seixas: "Re: Surface Area Calculation"
- Reply: flavio seixas: "Re: Surface Area Calculation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]