[BioPython] PDBParser, problem with pdb files missing b factors and occupancies

Saskia Villinger saskiavillinger at gmx.de
Wed May 17 16:08:59 UTC 2006


Hi!

I'd like to use the PDBParser for pdb files missing b factors and
occupancies. When I write:

from Bio.PDB.PDBParser import PDBParser
p=PDBParser(PERMISSIVE=1)
s=p.get_structure("test", "test.pdb")

... I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/site-packages/Bio/PDB/PDBParser.py", line 65, in
get_structure
    self._parse(file.readlines())
  File "/usr/lib/python2.3/site-packages/Bio/PDB/PDBParser.py", line 86, in
_parse
    self.trailer=self._parse_coordinates(coords_trailer)
  File "/usr/lib/python2.3/site-packages/Bio/PDB/PDBParser.py", line 149, in
_parse_coordinates
    occupancy=float(line[54:60])
ValueError: empty string for float()


... which is due to the missing occupancies and b factors. I'd like to know,
if there is any option for the PDBParser, so that it gets possible to use
these files? I could probably add random occupancies and b factors to the
file, but I thought maybe there is a simpler solution?

Thank you,

Saskia

-- 
GMX Produkte empfehlen und ganz einfach Geld verdienen!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner



More information about the Biopython mailing list