From: Peter Freddolino (petefred_at_ks.uiuc.edu)
Date: Thu Mar 12 2009 - 07:07:14 CDT

Hi Chris,
Rui's fix should work; I'll add that one of the reasons your script
didn't work is that you seem to have misinterpreted what information
measure minmax returns -- notably, it returns the minmax only for one
frame. When one encounters an apparently intractable programming problem
like this it is frequently useful to manually step through what you've
written and identify where the data diverges from what you expect; in
this example you should notice that after line 2, $minmax probably isn't
what you thought it should be.

Best,
Peter

Christopher Hartshorn wrote:
> Hello all. I must apologize up front for my lack of knowledge of the
> TCL scripting interface. But with that said, I can not for the life
> of me figure out why my script is not working. The script:
>
> *set l [atomselect top "resname DMPC" frame 0]*
> *set minmax [measure minmax $l]*
> *set num_steps [molinfo top get numframes]*
> *set outfile [open minmaxDMPC.txt w]*
> *for {set frame 0} {$frame < $num_steps} {incr frame} {puts $outfile
> "[expr {$frame+1}] [lindex $minmax $frame]"}*
> *close $outfile*
>
> In this script, I am trying to spit out the minmax dimensions of a
> given selection (the bilayer, in this case) of my simulation for each
> frame of the trajectory and then have it written to a text file
> (minmaxDMPC.txt). But all I get, no matter what combination I try, is
> a text file with 1-->700 in the first column (there are 700 frames)
> and the minmax for the first frame ONLY in the second column (e.g. one
> set of 6 values in the 1st row of the 2nd column only). I know this
> is a common question on this listserv, but even after looking at
> example scripts and the questions/answers of the listserv I am still
> just not getting it, I guess.
>
> Thank you up front for any help.
>
> Best,
>
> Chris
> WSU