From: OZGE ENGIN (OZENGIN_at_KU.EDU.TR)
Date: Fri Feb 22 2008 - 01:58:26 CST

Hi Jufang,

For my case, the following updating works well.

for { set i 0 } { $i < $n } { incr i } {
 animate goto $i
 display update ui
 $sel frame $i
 mol ssrecalc top
 set secstruct [$sel get structure]
 puts $fileID "$secstruct"
}

-----Original Message-----
From: "Axel Kohlmeyer" <akohlmey_at_cmm.chem.upenn.edu>
To: "Jufang Shan" <jufang.shan_at_gmail.com>
Date: Thu, 21 Feb 2008 23:40:02 -0500
Subject: Re: vmd-l: monitor helicity change

On Thu, Feb 21, 2008 at 8:06 PM, Jufang Shan <jufang.shan_at_gmail.com> wrote:
> Hi,
>
> I wanted to monitor the helicity change of a protein during
> simulations and write a script as the following:
>
> mol new pro.psf
> animate read dcd pro.dcd beg 0 end -1 skip 10 waitfor -1

animate read is obsolescent. please use mol addfile and waitfor all

> set outfile [open helicity.dat w]
>
> set sel [atomselect top "protein and name CA"]
>
> animate goto start

here you should use molinfo top set frame 0

> set nf [molinfo top get numframes]
> for {set i 0 } {$i < $nf } { incr i } {
> animate goto $i

molinfo top set frame $i
$sel set frame $i

> mol ssrecalc top
> set helicity [$sel get structure]
> puts $outfile "$helicity"
> }
>
> close $outfile
>
> But in the output file, the secondary structures for all the frames
> are the same although they are different when I checked them in tcl
> console.

you have to step molinfo and the selection frame.
if that does not work, you may need an display update.
check the docs for details.

cheers,
   axel.
>
> Can anyone tell me why $helicity does not get updated in the loop?
>
> Many thanks,
> Jufang
>
> ------------------------------
> Jufang Shan
> Postdoctoral Associate
> Department of Physiology & Biophysics
> Weill Medical College of Cornell University
> New York, NY 10065
>
>

-- 
=======================================================================
Axel Kohlmeyer akohlmey_at_cmm.chem.upenn.edu http://www.cmm.upenn.edu
 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.
Ozge Engin
=================================
Computational Science & Engineering
Koc University