## This takes a selection and moves that selection for every frame in the ## molecule so that the center of the selection is fixed (all atoms are ## moved, but the move is based on the selection). ## ## For example: moveframes top "protein" ## proc moveframes { molid seltext } { set ref [atomselect $molid $seltext frame 0] set vr [measure center $ref] set sel [atomselect $molid $seltext] set all [atomselect $molid all] set n [molinfo $molid get numframes] for { set i 1 } { $i < $n } { incr i } { $sel frame $i $all frame $i $all moveby [vecsub $vr [measure center $sel]] } return }