[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ccp4bb]: Deleting by Chain ID



***  For details on how to be removed from this list visit the  ***
***          CCP4 home page http://www.ccp4.ac.uk         ***

It can be done in O:

make a file called "pickhelix.mac".
It includes everything within the next two dashed lines

------------
! pickhelix.mac macro for o

message "pick an atom in the helix"
wait_id
write .symbols helixatom.o


$ pickhelix.pl

! end of pickhelix.mac macro
---------------------------

add the line

@pickhelix.mac

to your .MENU data block and click it when you want to pick a helix


then make a file called pickhelix.pl (everything between next 2 dashed
lines)

---------------------------
#! /usr/bin/perl -w
# pickhelix.pl perl script

$atomfile = "helixatom.o" ;

open (ATOM, $atomfile) or die "Could not open file \"$atomfile\"" ;

<ATOM> ;
# Might as well save all the symbols to allow program to grow in
# in functionality later if we desire
$ID_M = <ATOM> ;
$ID_R = <ATOM> ;
$ID_A = <ATOM> ;

close (ATOM) ;

($RecordID, $ChainRes) = split (/\s+/, $ID_R) ;

# hack in Jeff Taylor's awk one liner to save doing the same in perl
system ("cat structure.pdb | awk \'{ if (\$5!=\"$ChainRes\") print \$0}\'\
         > $ChainRes_structure.pdb) ;
#
#  All you need to do is change the name of structure.pdb to whatever
#  your file is called
#

# end of pickhelix.pl perl script
---------------------------

Put all of the associated files in your O directory and you have built a
prototype for all of your pdb manipulation needs--using O as a graphical
front end.

DISCLAIMER: Whatever I wrote was written on the fly and has not been
tested at all. Also, the mail system will, at times, insert unwanted
characters and it may need to be debugged in any case. I'm fairly certain
that it won't erase your hard drive, but you never know. Give it a test
first. Though I haven't read the liscense, this code is distributed under
the GPL which means that this disclaimer must be included with it unless
you hack the code to unrecognizability.

James

On Mon, 18 Feb 2002, Paul Hubbard wrote:

> ***  For details on how to be removed from this list visit the  ***
> ***          CCP4 home page http://www.ccp4.ac.uk         ***
>
> Hi,
>
> Thanks for the response. However, I would like to delete while viewing the
> PDB file, as I am looking at a electron density map - and there are alot of
> overlapping helices fit into the density (I want the best of the bunch). It
> would be much easier if I could do it on the fly.
>
> Thanks
>
> Jeff Taylor wrote:
>
> > How about :
> >
> > cat structure.pdb | awk '{ if ($5!="A") print $0}' > new_structure.pdb
> >
> > change the "A" to whatever chain ID you want to delete.  Also, change
> > "awk" to "gawk" if needed.
> >
> > - Jeff Taylor
> >
> > --
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > Dr. Jeffrey S. Taylor       Duke University Medical Center
> > Department of Biochemistry  Box 3711, Nanaline Duke Bld
> > Phone (919) 681-5266        Durham, NC 27710
> >
> > Paul Hubbard wrote:
> >
> > > ***  For details on how to be removed from this list visit the  ***
> > > ***          CCP4 home page http://www.ccp4.ac.uk         ***
> > >
> > > Hi,
> > >
> > > I am looking at an output file generated by FFFEAR, where lots of
> > > potential helices are written to a PDB file. Each helix candidate is
> > > written with a different chain ID. I would like to jump to each
> > > consecutive chain, then delete the whole chain in one go if I don't like
> > > it.
> > >
> > > My question is, what's the best way to do this. I have played with XFIT,
> > > and can't seem to do it there except by deleting 1 residue at a time.
> > > I've also looked at writing an O macro, but wild cards don't work - and
> > > there's no symbol for last picked chain. Ideas gratefully accepted.
> > >
> > > Thanks
> > >
> > > AGS
> > >
> > > --
> > > Paul Hubbard
> > > Dept. of Biochemistry
> > > Medical College of Wisconsin
> > > Phone: 414-456 4305
> > > Fax: 414-456 6510
> > > URL: iris9.biochem.mcw.edu
>
> --
> Paul Hubbard
> Dept. of Biochemistry
> Medical College of Wisconsin
> Phone: 414-456 4305
> Fax: 414-456 6510
> URL: iris9.biochem.mcw.edu
>
>
>