[Biopython-dev] [Bug 2751] New: PDBParser crashes on empty tempFactor fields
bugzilla-daemon at portal.open-bio.org
bugzilla-daemon at portal.open-bio.org
Thu Feb 5 13:14:19 EST 2009
http://bugzilla.open-bio.org/show_bug.cgi?id=2751
Summary: PDBParser crashes on empty tempFactor fields
Product: Biopython
Version: 1.49
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Main Distribution
AssignedTo: biopython-dev at biopython.org
ReportedBy: eric.talevich at gmail.com
When parsing ATOM lines, Bio.PDB.PDBParser appears to be passing the contents
of indexes 60-66 directly to the float() constructor without checking if the
string is empty (or all spaces).
The PDB spec seems to indicate that the default value for this field should be
0.0:
http://www.wwpdb.org/documentation/format23/sect9.html#ATOM
I interpret that to mean PDBParser should assume 0.0 if the string is blank, at
least in permissive mode; otherwise, perhaps a PDBException should be raised.
Here's a traceback:
File "/usr/lib/python2.5/site-packages/Bio/PDB/PDBParser.py", line 66, in
get_structure
self._parse(file.readlines())
File "/usr/lib/python2.5/site-packages/Bio/PDB/PDBParser.py", line 86, in
_parse
self.trailer=self._parse_coordinates(coords_trailer)
File "/usr/lib/python2.5/site-packages/Bio/PDB/PDBParser.py", line 160, in
_parse_coordinates
bfactor=float(line[60:66])
ValueError: empty string for float()
This occurs when parsing a file that looks like this:
HEADER 1ad5
ATOM 4255 N GLU B 82 -6.363 45.622 156.936 1.00 69.02
ATOM 4256 CA GLU B 82 -6.235 44.414 157.713 1.00 68.26
ATOM 4257 C GLU B 82 -5.067 44.774 158.648 1.00 68.19
ATOM 4258 O GLU B 82 -5.169 45.863 159.227 1.00 67.24
ATOM 4259 CB GLU B 82 -5.903 43.230 156.774 1.00 68.47
ATOM 4260 H1 GLU B 82 -6.252 46.392 157.641 1.00 0
ATOM 4261 H2 GLU B 82 -5.588 45.683 156.246 1.00 0
ATOM 4262 H3 GLU B 82 -7.267 45.667 156.437 1.00 0
ATOM 4263 N ASP B 83 -3.979 43.981 158.770 1.00 67.44
...
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Biopython-dev
mailing list