Package Bio :: Package PDB :: Module PDBParser' :: Class PDBParser
[hide private]
[frames] | no frames]

Class PDBParser

source code

object --+
         |
        PDBParser


Parse a PDB file and return a Structure object.

Instance Methods [hide private]
 
__init__(self, PERMISSIVE=True, get_header=False, structure_builder=None, QUIET=False)
The PDB parser call a number of standard methods in an aggregated StructureBuilder object.
source code
 
_get_header(self, header_coords_trailer)
Get the header of the PDB file, return the rest.
source code
 
_handle_PDB_exception(self, message, line_counter)
This method catches an exception that occurs in the StructureBuilder object (if PERMISSIVE), or raises it again, this time adding the PDB line number to the error message.
source code
 
_parse(self, header_coords_trailer)
Parse the PDB file.
source code
 
_parse_coordinates(self, coords_trailer)
Parse the atomic data in the PDB file.
source code
 
get_header(self)
Return the header.
source code
 
get_structure(self, id, file)
Return the structure.
source code
 
get_trailer(self)
Return the trailer.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, PERMISSIVE=True, get_header=False, structure_builder=None, QUIET=False)
(Constructor)

source code 

The PDB parser call a number of standard methods in an aggregated
StructureBuilder object. Normally this object is instanciated by the
PDBParser object itself, but if the user provides his/her own
StructureBuilder object, the latter is used instead.

Arguments:

o PERMISSIVE - Evaluated as a Boolean. If false, exceptions in
constructing the SMCRA data structure are fatal. If true (DEFAULT),
the exceptions are caught, but some residues or atoms will be missing.
THESE EXCEPTIONS ARE DUE TO PROBLEMS IN THE PDB FILE!.

o structure_builder - an optional user implemented StructureBuilder class.

o QUIET - Evaluated as a Boolean. If true, warnings issued in constructing
the SMCRA data will be suppressed. If false (DEFAULT), they will be shown.
These warnings might be indicative of problems in the PDB file!

Overrides: object.__init__

get_structure(self, id, file)

source code 
Return the structure.

Arguments:
o id - string, the id that will be used for the structure
o file - name of the PDB file OR an open filehandle