From: Blake Charlebois (
Date: Mon Jul 18 2005 - 16:26:56 CDT

I think your "set movesel ..." command needs to be inside the loop with a
reference to the frame number. Also, you may want to use a "$movesel delete"
command, as repeatedly calling atomselect without deleting the atom
selection may make VMD take up a lot of memory. See for an

-----Original Message-----
From: [] On Behalf Of
Sale, Kenneth L
Sent: July 18, 2005 3:48 PM
Subject: vmd-l:

I am trying to overlay each frame of a trajectory onto another structure
using the move command in a loop over the trajectory. However, the only
frame that moves is the very last frame of the trajectory. My script is:

proc fit2mols_traj { refid reftext selid seltext } {
  set ref [atomselect $refid $reftext]
  set sel [atomselect $selid $seltext]
  set movesel [atomselect $selid all]

  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]
      $movesel move [measure fit $sel $ref]
      puts $outfile "[measure rmsd $sel $ref]"
  close $outfile

Is there some way to overlay each frame onto a common structure?