From: L. Michel Espinoza-Fonseca (mef_at_ddt.biochem.umn.edu)
Date: Tue May 30 2006 - 16:53:51 CDT

Hi all,

I have the following script to compute the secondary structure count
of a protein. It works fine; however, when I try to put the results in
an output file, it doesn't work. In addition, I would like to count
the total numer of ss are observed throughout the time, and not
individually.

the script I'm using for such purpose is:

set outfile [open 1-25-p-res1.txt w]
  set numframes [molinfo top get numframes]
  set sel [atomselect top "resid 1 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 "Frame: $frame"
    puts " Alpha helix count: $helixcount, Beta sheet count: $sheetcount"
    puts " turn count: $turncount"
    puts " coil count: $coilcount"
    puts " pihelix count: $pihelixcount"
}
  $sel delete
  close $outfile

Do you have any suggestions?

Thanks a lot!
Michel