#!/bin/sh # eval "exec perl -x $0 $*" # #!perl -w # # script to convert a nucleic acid coordinate file from the PDB # to a format closer to CNS # # written by: Paul Adams 25-06-99 # # copyright Yale University # # ========================================================================= # while ( <> ) { if ( /^(ATOM |HETATM)/ ) { substr($_,17,3) = resconv(substr($_,17,3)); s/(\D\d)\*/$1\'/; s/C5M T/C5A T/; } elsif ( /^END / ) { $_ = "END\n"; } print; } sub resconv { local ($resname) = @_; local (%map); my $rn = $resname; $rn =~ s/^ +//; $rn =~ s/ +$//; %map = ( "A" => ADE, "C" => CYT, "G" => GUA, "T" => THY, "U" => URI ); if ( $map{$rn} ) { $resname = $map{$rn}; } return $resname; } __END__