Bio.PDB.StructureBuilder module

Consumer class that builds a Structure object.

This is used by the PDBParser and MMCIFparser classes.

class Bio.PDB.StructureBuilder.StructureBuilder

Bases: object

Deals with constructing the Structure object.

The StructureBuilder class is used by the PDBParser classes to translate a file to a Structure object.


Initialize the class.

set_header(self, header)

Set header.

set_line_counter(self, line_counter)

Tracks line in the PDB file that is being parsed.

  • line_counter - int

init_structure(self, structure_id)

Initialize a new Structure object with given id.

  • id - string

init_model(self, model_id, serial_num=None)

Create a new Model object with given id.

  • id - int

  • serial_num - int

init_chain(self, chain_id)

Create a new Chain object with given id.

  • chain_id - string

init_seg(self, segid)

Flag a change in segid.

  • segid - string

init_residue(self, resname, field, resseq, icode)

Create a new Residue object.

  • resname - string, e.g. “ASN”

  • field - hetero flag, “W” for waters, “H” for hetero residues, otherwise blank.

  • resseq - int, sequence identifier

  • icode - string, insertion code

init_atom(self, name, coord, b_factor, occupancy, altloc, fullname, serial_number=None, element=None, pqr_charge=None, radius=None, is_pqr=False)

Create a new Atom object.

  • name - string, atom name, e.g. CA, spaces should be stripped

  • coord - Numeric array (Float0, size 3), atomic coordinates

  • b_factor - float, B factor

  • occupancy - float

  • altloc - string, alternative location specifier

  • fullname - string, atom name including spaces, e.g. ” CA “

  • element - string, upper case, e.g. “HG” for mercury

  • pqr_charge - float, atom charge (PQR format)

  • radius - float, atom radius (PQR format)

  • is_pqr - boolean, flag to specify if a .pqr file is being parsed

set_anisou(self, anisou_array)

Set anisotropic B factor of current Atom.

set_siguij(self, siguij_array)

Set standard deviation of anisotropic B factor of current Atom.

set_sigatm(self, sigatm_array)

Set standard deviation of atom position of current Atom.


Return the structure.

set_symmetry(self, spacegroup, cell)

Set symmetry.