From: Justin Gullingsrud (justinrocks_at_gmail.com)
Date: Mon Jul 18 2005 - 20:22:51 CDT

This script consumes lots of memory. If you had your atom selections
outside the loop in a previous version and it wasn't working, it maybe
because you weren't updating the frame. The following code snippet
should work:

set ref [atomselect $refid $reftext frame 0]
set sel [atomselect $selid $seltext]
set all [atomselect $selid all]
set nf molinfo top get numframes]
for { set i 1 } { $i < $nf } { incr i } {
  $sel frame $i
  $all frame $i
  $all move [measure fit $sel $ref]
  set rms [measure rmsd $sel $ref]
  lappend result $rms
}
return $result

Justin

On 7/18/05, klsale <klsale_at_sandia.gov> wrote:
> Thanks Blake and Christopher. I had already tried having movesel inside
> and/or outside the loop without any luck. Turns out having it inside the
> loop with a reference to the frame is what worked.
>
> proc fit2mols_traj { refid reftext selid seltext } {
> set ref [atomselect $refid $reftext]
>
> set outfile [open rmsd.dat w];
> set nf [molinfo $selid get numframes]
>
> # atom move and rmsd calculation loop
> for {set i 1 } {$i < $nf } { incr i } {
> set sel [atomselect $selid $seltext frame $i]
> set movesel [atomselect $selid all frame $I]
> $movesel move [measure fit $sel $ref]
> puts $outfile "[measure rmsd $sel $ref]"
> }
> close $outfile
> }
>
>

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