Package Bio :: Package SeqIO :: Module PdbIO
[hide private]
[frames] | no frames]

Module PdbIO

source code

Functions [hide private]
 
PdbSeqresIterator(handle)
Returns SeqRecord objects for each chain in a PDB file.
source code
 
PdbAtomIterator(handle)
Returns SeqRecord objects for each chain in a PDB file
source code
Variables [hide private]
  __package__ = 'Bio.SeqIO'
Function Details [hide private]

PdbSeqresIterator(handle)

source code 

Returns SeqRecord objects for each chain in a PDB file.

The sequences are derived from the SEQRES lines in the PDB file header, not the atoms of the 3D structure.

Specifically, these PDB records are handled: DBREF, SEQADV, SEQRES, MODRES

See: http://www.wwpdb.org/documentation/format23/sect3.html

This gets called internally via Bio.SeqIO for the SEQRES based interpretation of the PDB file format:

>>> from Bio import SeqIO
>>> for record in SeqIO.parse("PDB/1A8O.pdb", "pdb-seqres"):
...     print("Record id %s, chain %s" % (record.id, record.annotations["chain"]))
...     print(record.dbxrefs)
...
Record id 1A8O:A, chain A
['UNP:P12497', 'UNP:POL_HV1N5']

Equivalently,

>>> with open("PDB/1A8O.pdb") as handle:
...     for record in PdbSeqresIterator(handle):
...         print("Record id %s, chain %s" % (record.id, record.annotations["chain"]))
...         print(record.dbxrefs)
...
Record id 1A8O:A, chain A
['UNP:P12497', 'UNP:POL_HV1N5']

Note the chain is recorded in the annotations dictionary, and any PDB DBREF lines are recorded in the database cross-references list.

PdbAtomIterator(handle)

source code 

Returns SeqRecord objects for each chain in a PDB file

The sequences are derived from the 3D structure (ATOM records), not the SEQRES lines in the PDB file header.

Unrecognised three letter amino acid codes (e.g. "CSD") from HETATM entries are converted to "X" in the sequence.

In addition to information from the PDB header (which is the same for all records), the following chain specific information is placed in the annotation:

record.annotations["residues"] = List of residue ID strings record.annotations["chain"] = Chain ID (typically A, B ,...) record.annotations["model"] = Model ID (typically zero)

Where amino acids are missing from the structure, as indicated by residue numbering, the sequence is filled in with 'X' characters to match the size of the missing region, and None is included as the corresponding entry in the list record.annotations["residues"].

This function uses the Bio.PDB module to do most of the hard work. The annotation information could be improved but this extra parsing should be done in parse_pdb_header, not this module.

This gets called internally via Bio.SeqIO for the atom based interpretation of the PDB file format:

>>> from Bio import SeqIO
>>> for record in SeqIO.parse("PDB/1A8O.pdb", "pdb-atom"):
...     print("Record id %s, chain %s" % (record.id, record.annotations["chain"]))
...
Record id 1A8O:A, chain A

Equivalently,

>>> with open("PDB/1A8O.pdb") as handle:
...     for record in PdbAtomIterator(handle):
...         print("Record id %s, chain %s" % (record.id, record.annotations["chain"]))
...
Record id 1A8O:A, chain A