[Biopython-dev] Bug: Bio.PDB.DSSP fails on PDB files with no header

Jan Kosinski jan.kosinski at gmail.com
Tue Apr 23 08:42:49 UTC 2013


Just get any and remove the header:
wget http://www.rcsb.org/pdb/files/1X9Z.pdb
grep -v HEADER 1X9Z.pdb > 1X9Z.no_header.pdb

The current versions of dssp (2.0.4 or 2.1.0  from
http://swift.cmbi.ru.nl/gv/dssp/) work but give:  .
REFERENCE W. KABSCH AND C.SANDER, BIOPOLYMERS 22 (1983) 2577-2637
                                                   .

                                                   .
COMPND   2 MOLECULE: DNA MISMATCH REPAIR PROTEIN MUTL;

Note the empty line between REFERENCE and COMPND.

Older versions of dssp (e.g. CMBI version by Elmar.Krieger at cmbi.kun.nl /
November 18,2002 ) were giving:
 !!! HEADER-card missing !!!

 !!! COMPOUND-card missing !!!

 !!! SOURCE-card missing !!!

 !!! AUTHOR-card missing !!!
in place of this empty line.


On Tue, Apr 23, 2013 at 10:14 AM, Peter Cock <p.j.a.cock at googlemail.com>wrote:

> On Tue, Apr 23, 2013 at 9:09 AM, Jan Kosinski <jan.kosinski at gmail.com>
> wrote:
> > The following script:
> >
> > import sys
> > import Bio
> > from Bio.PDB.DSSP import DSSP
> > from Bio.PDB.PDBParser import PDBParser
> >
> > pdb_filename = sys.argv[1]
> > p = PDBParser()
> > structure = p.get_structure('chupacabra', pdb_filename)
> > model = structure[0]
> >
> > biodssp = DSSP(model, pdb_filename, dssp="dssp")
> >
> > will fail on files without HEADER with traceback:
> > Traceback (most recent call last):
> >   File "testdssp_fail.py", line 13, in <module>
> >     biodssp = DSSP(model, pdb_filename, dssp="dssp")
> >   File
> >
> "/home/modorama_dev/modorama/ENV_INI/lib/python2.7/site-packages/Bio/PDB/DSSP.py",
> > line 200, in __init__
> >     dssp_dict, dssp_keys = dssp_dict_from_pdb_file(pdb_file, dssp)
> >   File
> >
> "/home/modorama_dev/modorama/ENV_INI/lib/python2.7/site-packages/Bio/PDB/DSSP.py",
> > line 101, in dssp_dict_from_pdb_file
> >     out_dict, keys = make_dssp_dict(out_file.name)
> >   File
> >
> "/home/modorama_dev/modorama/ENV_INI/lib/python2.7/site-packages/Bio/PDB/DSSP.py",
> > line 121, in make_dssp_dict
> >     if sl[1] == "RESIDUE":
> > IndexError: list index out of range
> >
> > This is because in newer dssp versions the header of DSSP output will
> have
> > empty lines if the PDB file had no HEADER and this part of make_dssp_dict
> > function will fail
> >         for l in handle.readlines():
> >             sl = l.split()
> >             if sl[1] == "RESIDUE:
> >
> > Changing it to sth like:
> > if len(sl) > 1 and sl[1] == "RESIDUE":
> > fixes the problem.
> >
> > Cheers,
> > Jan
>
> Hi Jan,
>
> Do you have any (small) sample output we could use for a test case
> to include with Biopython?
>
> Do you know which versions of DSSP are affected?
>
> Thanks,
>
> Peter
>



More information about the Biopython-dev mailing list