#!/usr/local/bin/perl -w # this is a single-use filter script to move # residues 1-102 and 260-* # to allow the pieces to be packed together # move-residues2.perl < decoys/T0191.cut-and-paste.pdb > decoys/T0191.cut-moved2.pdb while($line=) { if ($line!~/ATOM/) { print $line; next; } $resnum=substr($line,22,4); if ($resnum >102 && $resnum<260) { print $line; next; } $x= substr($line,30,8); $y= substr($line,38,8); $z= substr($line,46,8); if ($resnum<150) { printf "%s%8.3f%8.3f%8.3f%s", substr($line,0,30), $x-11, $y+4, $z-40, substr($line,54); } else { printf "%s%8.3f%8.3f%8.3f%s", substr($line,0,30), $x+17, $y-11, $z-35, substr($line,54); } }