From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue May 30 2006 - 17:01:24 CDT

Hi,
  I hate to point out the obvious, but I don't see any 'puts' calls
set to write to the output file... You must add '$outfile' for each
'puts' call that you want to write to a file:
  puts $outfile "my favorite string"

If you want to see it on the screen too, then you'll want to have both:
  puts "my favorite string"
  puts $outfile "my favorite string"

  John Stone
  vmd_at_ks.uiuc.edu
 
On Tue, May 30, 2006 at 04:53:51PM -0500, L. Michel Espinoza-Fonseca wrote:
> 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

-- 
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