SBRG / ssbio

A Python framework for structural systems biology
http://ssbio.readthedocs.io/en/latest/
MIT License
101 stars 28 forks source link

Problematic PDB files: list of IDs #17

Open nmih opened 7 years ago

nmih commented 7 years ago

This issue will be left open for all PDBs that have strange errors...

ID: 5nc5 Problem: Biopython loading of mmcif file fails, says duplicated atom name

yseif commented 6 years ago
from Bio.PDB import *
parser = MMCIFParser()
structure = parser.get_structure('test','4C13.cif')

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-162-a4d420356111> in <module>()
      1 from Bio.PDB import *
      2 parser = MMCIFParser()
----> 3 structure = parser.get_structure('test','4C13.cif')

/usr/local/lib/python2.7/dist-packages/Bio/PDB/MMCIFParser.pyc in get_structure(self, structure_id, filename)
     62                 warnings.filterwarnings("ignore", category=PDBConstructionWarning)
     63             self._mmcif_dict = MMCIF2Dict(filename)
---> 64             self._build_structure(structure_id)
     65 
     66         return self._structure_builder.get_structure()

/usr/local/lib/python2.7/dist-packages/Bio/PDB/MMCIFParser.pyc in _build_structure(self, structure_id)
    184             element = element_list[i] if element_list else None
    185             structure_builder.init_atom(name, coord, tempfactor, occupancy, altloc,
--> 186                 name, element=element)
    187             if aniso_flag == 1:
    188                 u = (aniso_u11[i], aniso_u12[i], aniso_u13[i],

/usr/local/lib/python2.7/dist-packages/Bio/PDB/StructureBuilder.pyc in init_atom(self, name, coord, b_factor, occupancy, altloc, fullname, serial_number, element)
    202                               PDBConstructionWarning)
    203         self.atom = Atom(name, coord, b_factor, occupancy, altloc,
--> 204                          fullname, serial_number, element)
    205         if altloc != " ":
    206             # The atom is disordered

/usr/local/lib/python2.7/dist-packages/Bio/PDB/Atom.pyc in __init__(self, name, coord, bfactor, occupancy, altloc, fullname, serial_number, element)
     68         self.xtra = {}
     69         assert not element or element == element.upper(), element
---> 70         self.element = self._assign_element(element)
     71         self.mass = self._assign_atom_mass()
     72 

/usr/local/lib/python2.7/dist-packages/Bio/PDB/Atom.pyc in _assign_element(self, element)
     84                 # Hs may have digit in [0]
     85                 if self.name[0].isdigit():
---> 86                     putative_element = self.name[1]
     87                 else:
     88                     putative_element = self.name[0]

IndexError: string index out of range