## 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 molid top set seltext protein mol load psf $psffile dcd $dcdfile set ref [atomselect $molid $seltext frame 0] set sel [atomselect $molid $seltext] set all [atomselect $molid all] set n [molinfo $molid 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]