# $Id: rmsd.tcl,v 1.3 2005/02/18 16:23:53 mbach Exp $

# This script compares the rmsd between frames in a trajectory with respect to the first.

set outfile [open rmsd.dat w];                                             

set nf [molinfo top get numframes]
set frame0 [atomselect top "protein and backbone and noh" frame 0]
set sel [atomselect top "protein and backbone and noh"]
set all [atomselect top all]

# rmsd calculation loop
for {set i 1 } {$i < $nf } { incr i } {
    $sel frame $i
    $all frame $i
    $all move [measure fit $sel $frame0]
    puts $outfile "[measure rmsd $sel $frame0]"
}

close $outfile

