[Bioperl-l] acceptable PDB/structure formats

Jurgen Pletinckx jurgen.pletinckx at algonomics.com
Wed Oct 13 13:54:39 EDT 2004


# Howdy All-
#
# I wanted to check one more time and see if anyone has any advice about
# using structure/PDB files that do not contain all the PDB-formatted
# headers.  See the blurb pasted below (the error is from the following
# small-liner script, where the PDB/structure file was experimentally
# calculated from CNS/XPLOR, rather than downloaded from the actual 'PDB'
# protein data bank):
#
# #!/usr/bin/perl -w
# use Bio::Structure::IO;
# use strict;
# my $structio = Bio::Structure::IO->new(-format => 'pdb', -file =>
# "file.pdb");
# my $struc = $structio->next_structure;
#
# BioPython (using 'from Bio.PDB import *') has no problem reading my
# CNS/XPLOR structure files ... but I'd prefer to use BioPerl (since I'm
# more familiar with perl vs. python, although I could look at this as an
# opportunity to branching out ... but, graduation is close!)
#
# Are structure (PDB) files from the protein data bank, with the proper
# PDB formatting/headers, the only supported structure format?

Currently, that's the case.

Let's see. What are the options?

- adding a HEADER line to your files
- modifying /sw/lib/perl5/Bio/Structure/IO/pdb.pm.
  (Or adding a modified version to your library path
  @INC)

Possible modifications include
- removing these lines:

   $line =~ /^HEADER\s+\S+/ || $self->throw("PDB stream with no HEADER. Not pdb
in my book");
   my($header_line) = unpack "x10 a56", $line;
   $header{'header'} = $header_line;
   my($class, $depdate, $idcode) = unpack "x10 a40 a9 x3 a4", $line;
   $idcode =~ s/^\s*(\S+)\s*$/$1/;
   $struc->id($idcode);
$self->debug("PBD c $class d $depdate id $idcode\n"); # XXX KB

from pdb.pm, at line 139,

or altering them to
if ($line =~ /^HEADER\s+\S+/)
{
   my($header_line) = unpack "x10 a56", $line;
   $header{'header'} = $header_line;
   my($class, $depdate, $idcode) = unpack "x10 a40 a9 x3 a4", $line;
   $idcode =~ s/^\s*(\S+)\s*$/$1/;
   $struc->id($idcode);
   $self->debug("PBD c $class d $depdate id $idcode\n"); # XXX KB
}
else
{
   $self->debug("PDB stream with no HEADER. Not pdb in my book");
}

Untested code - and anything that's not been tested is likely to have
at least two typos in it :/

Note that, in this case, the id attribute of $struc has not been set -
this may or may not be relevant.

# > 1. Are CNS or XPLOR formats supported?
# > 2. Is there an easy way of quickly converting to a 'PDB' authentic
# > format?  It looks like it just wants some header information.

Only 'straight' PDB format.

And the only thing it really needs is a HEADER line, as in
HEADER    ATTACHMENT PROTEIN                      18-JAN-97   1AA0

Best,
--
Jurgen Pletinckx
AlgoNomics NV




More information about the Bioperl-l mailing list