## This takes a selection and fits that selection for every frame in the ## molecule (all atoms are moved, but the fit is based on the selection). ## ## For example: fitframes top "protein" ## ## -Jim puts "vmd -dispdev text < fit_frames.tcl -args psffile dcdfile temp_k" set psffile [lindex $argv 0] set dcdfile [lindex $argv 1] set temp [lindex $argv 2] set mol id top set seltext protein mol addfile psf $psffile dcd $dcdfile set ref [atomselect $mol new id $seltext frame 0] set sel [atomselect $mol new id $seltext] set all [atomselect $mol new id all] set n [molinfo $mol new id get numframes] set fin [expr $n-1] for { set i 1 } { $i < $n } { incr i } { $sel frame $i $all frame $i $all move [measure fit $sel $ref] } animate write dcd fitted_$temp.dcd beg 1 end $fin waitfor all sel [atomselect top protein]