[BioPython] can PDBParser work on a pdb file without residue sequence information?

Jing Zhou jingzhou2005 at gmail.com
Wed Mar 21 15:49:20 UTC 2007


I want to parse a pseudo pdb file I generated for a bunch of points in
space. There is no physical meaning to assign residue number or chain number
to it. Here is the example of one line:
ATOM      1  C                  -7.083  -6.182  50.181  1.00
(the atom type has no physical meaning either)
I just want to be able to display the positions of these points in viewer.
What I want to do is to use biopython to parse this pseudo pdb file and
display it in vtk. (I am already able to see the points in pymol using this
pseudo pdb file)

Here is the function I tried to use to parse this pseudo pdb file:
from Bio.PDB import PDBParser
parser = PDBParser()
structure = parser.get_structure('mypdb',mypseudopdbfile)

Here is the error message:
    structure = parser.get_structure('mypdb',mypseudopdbfile)
  File "C:\Python24\lib\site-packages\Bio\PDB\PDBParser.py", line 66, in
get_structure
    self._parse(file.readlines())
  File "C:\Python24\lib\site-packages\Bio\PDB\PDBParser.py", line 87, in
_parse
    self.trailer=self._parse_coordinates(coords_trailer)
  File "C:\Python24\lib\site-packages\Bio\PDB\PDBParser.py", line 144, in
_parse_coordinates
    resseq=int(split(line[22:26])[0])   # sequence identifier
IndexError: list index out of range

It seems that the error happens to seek residue sequence information at
column 22-26. Sure, I can try to add fake resseq info. but my question is
whether there is another way around to neglect the index of residue sequence
number? I just want to directly get the array of coordinates and display
them.

Thanks

Jing



More information about the Biopython mailing list