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.

__init__()

Initialize the class.

set_header(header)

Set header.

set_line_counter(line_counter)

Tracks line in the PDB file that is being parsed.

Arguments:
  • line_counter - int

init_structure(structure_id)

Initialize a new Structure object with given id.

Arguments:
  • id - string

init_model(model_id, serial_num=None)

Create a new Model object with given id.

Arguments:
  • id - int

  • serial_num - int

init_chain(chain_id)

Create a new Chain object with given id.

Arguments:
  • chain_id - string

init_seg(segid)

Flag a change in segid.

Arguments:
  • segid - string

init_residue(resname, field, resseq, icode)

Create a new Residue object.

Arguments:
  • 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(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.

Arguments:
  • 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(anisou_array)

Set anisotropic B factor of current Atom.

set_siguij(siguij_array)

Set standard deviation of anisotropic B factor of current Atom.

set_sigatm(sigatm_array)

Set standard deviation of atom position of current Atom.

get_structure()

Return the structure.

set_symmetry(spacegroup, cell)

Set symmetry.