From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Apr 18 2007 - 12:48:36 CDT

Alexandra,
  I think your script is just missing a call to:
molinfo top set frame $frame

You should put that right after the "$sel frame $frame" call.

Also, rather than calling "vmd_calculate_structure top",
call this instead:
  mol ssrecalc top

The old "vmd_calculate_structure" command is only used for compatibility
with very old scripts and should not be used in newly developed scripts.

You could also eliminate the "foreach" loops in your script and
instead use something like:
  set helixcount [llength $helixlist]

Or even:
  set helixcount [llength [$sel get alpha_helix]]

That would make the script easier to read as well...

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Apr 18, 2007 at 05:28:43PM +0100, alexandra.marques_at_fc.up.pt wrote:
>
> Hi
>
> I am using a script found in the mailing list to calculate the secondary
> structure. However the secondary structure calculation is not updated so that I
> obtain the same number of the secondary structure elements in all the frames. I
> don’t see any error in the script…Could someone please help me? Here is the
> script:
>
> set outfile [open secondary.txt w]
> set numframes [molinfo top get numframes]
> set sel [atomselect top "resid 1 to 200 and name CA"]
> for {set frame 0} {$frame < $numframes} {incr frame} {
> animate goto $frame
> vmd_calculate_structure top
> $sel frame $frame
> $sel update
> set helixlist [$sel get alpha_helix]
> set sheetlist [$sel get sheet]
> set coillist [$sel get coil]
> set turnlist [$sel get turn]
> set pihelixlist [$sel get pi_helix]
> set helixcount 0
> foreach i $helixlist {incr helixcount $i}
> set sheetcount 0
> foreach i $sheetlist {incr sheetcount $i}
> set coilcount 0
> foreach i $coillist {incr coilcount $i}
> set turncount 0
> foreach i $turnlist {incr turncount $i}
> set pihelixcount 0
> foreach i $pihelixlist {incr pihelixcount $i}
> puts $outfile "Alpha helix count: $helixcount"
> puts $outfile "Beta sheet count: $sheetcount"
> puts $outfile "turn count: $turncount"
> puts $outfile "coil count: $coilcount"
> puts $outfile "pihelix count: $pihelixcount"
> }
> $sel delete
> close $outfile
>
> Thanks
> Alexandra
>
> -------------------------------------------------------------
> A FCUP utiliza o sistema de webmail Horde/IMP (www.horde.org)
>
> Visite: http://www.fc.up.pt/
>

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078