# vmd script to select and write out the coordinates # from a subsection of a molecule in .xyz format. # load full equilibrated AChE restart set molid [mol new AChE.gro waitfor all] # create a selection set sel [atomselect $molid {resid 200 327 440}] # retrieve number of atoms and get the min/max coordinates from the selection set minmax [measure minmax $sel] # subtract the coordinates of the lower left front corner. $sel moveby [vecscale -1.0 [lindex $minmax 0]] # and shift by 1 angstrom to the middle $sel moveby {1 1 1} # box is the size of the selection plus 2 angstrom set box [vecsub [lindex $minmax 1] [lindex $minmax 0]] set box [vecadd {2 2 2} $box] # update the box size so the pdbfile has that info molinfo $molid set {a b c} $box # write out the result $sel writepdb {triade.pdb} quit