From: Giovanni Bellesia (giovanni.bellesia_at_ucd.ie)
Date: Wed Aug 17 2005 - 06:04:38 CDT

Jerry Parks wrote:

>Hello,
>
>Does anyone have a script that will compute the RMSD for a trajectory (dcd
>+ psf files) relative to a pdb file of the same molecule?
>
>Thanks in advance,
>Jerry
>
Hi Jerry,
I guess you're looking for something like this:
(simple modification of the script rmsd.tcl in the namd-tutorial-files)
Giovanni

set psf *.psf
set pdb reference.pdb
set dcd *.dcd
mol load psf $psf pdb $pdb
mol load psf $psf dcd $dcd
set outfile [open outfilename.dat w];
set nf [molinfo top get numframes]
set frame0 [atomselect 0 "protein and backbone and noh" frame 0]
# rmsd calculation loop
for {set i 0} {$i < $nf} {incr i } {
    set sel [atomselect 1 "protein and backbone and noh" frame $i]
    $sel move [measure fit $sel $frame0]
    puts $outfile "[measure rmsd $sel $frame0]"
}
# end of rmsd loop
close $outfile