From: pbrenne1_at_nd.edu
Date: Wed Jan 12 2005 - 13:10:44 CST

Justin,

Thanks for the good feedback. I was not yet sufficiently familiar with the VMD
tcl scripting to know that you could reference the frames outside of the
atomselect command as shown in one of the examples. I believe John Stone is
noting this for future VMD tutorial updates.

Regards,
Paul

Quoting Justin Gullingsrud <justinrocks_at_gmail.com>:

> This is a recurring theme... In almost every case that I've seen,
> especially those that involve looping over frames, it's almost _never_
> necessary to create or delete atom selections in a loop over frames.
> Instead, create the selections you need at the beginning, then use
> "$sel frame $i" to change the frame of selection $sel to frame $i, and
> use "$sel update" after that to have a selection recompute its atoms
> for the new frame, if the selection is based on time-varying data like
> coordinates.
>
> For example, if you wanted to compute the RMSD between CA atoms in all
> frames:
>
> set n [molinfo top get numframes]
> set ref [atomselect top "name CA"]
> set sel [atomselect top "name CA"]
> for { set i 0 } { $i < $n } { incr i } {
> $ref frame $i
> for { set j $i } { $j < $n } { incr j } {
> $sel frame $j
> set rms($i,$j) [measure rmsds $sel $ref]
> }
> }
>
> The resulting script is usually simpler than if selections are created
> and deleted inside the inner loop of the script.
>
> Cheers,
> Justin
>
>
> On Wed, 12 Jan 2005 09:56:43 -0500, pbrenne1_at_nd.edu <pbrenne1_at_nd.edu> wrote:
> >
> > I was using VMD to calculate the O(number of dcds)^2 RMSD values that I
> need to
> > implement a clustering algorithm and noticed that it is very important to
> > specifically delete atomselect selections in .tcl scripts. The example
> script
> > on page 36 of the tutorial might want to include a "$sel delete" line. I
> > noticed this when the results of some batch jobs with a large number of
> dcds
> > terminated early. They were overflowing a machine with 2GB of memory...
> >
> > Just a comment that I thought would be beneficial in the archive.
> >
> > Paul Brenner
> >
> >
>
>
> --
> The spirit of Plato dies hard. We have been unable to escape the
> philosophical tradition that what we can see and measure in the world
> is merely the superficial and imperfect representation of an
> underlying reality.
> -- S.J. Gould, "The Mismeasure of Man"
>