structures

Simple biomolecular structures.

This module contains the simpler structure objects used in PDB2PQR and their associated methods.

Code author: Todd Dolinsky

Code author: Nathan Baker

class pdb2pqr.structures.Atom(atom=None, type_='ATOM', residue=None)[source]

Represent an atom.

The Atom class inherits from the ATOM object in pdb. This class used for adding fields not found in the PDB that may be useful for analysis. This class also simplifies code by combining ATOM and HETATM objects into a single class.

__init__(atom=None, type_='ATOM', residue=None)[source]

Initialize the new Atom object by using the old object.

Parameters:
  • atom (ATOM) – the original ATOM object (could be None)
  • type (str) – either ATOM or HETATM
  • residue (Residue) – a pointer back to the parent residue object (could be None)
add_bond(bondedatom)[source]

Add a bond to the list of bonds.

Parameters:bondedatom (ATOM) – the atom to bond to
coords

Return the x,y,z coordinates of the atom.

Returns:list of the coordinates
Return type:[float, float, float]
classmethod from_pqr_line(line)[source]

Create an atom from a PQR line.

Parameters:
  • cls (Atom) – class for classmethod
  • line (str) – PQR line
Returns:

new atom or None (for REMARK and similar lines)

Return type:

Atom

Raises:

ValueError – for problems parsing

classmethod from_qcd_line(line, atom_serial)[source]

Create an atom from a QCD (UHBD QCARD format) line.

Parameters:
  • cls (Atom) – class for classmethod
  • line (str) – PQR line
  • atom_serial (int) – atom serial number
Returns:

new atom or None (for REMARK and similar lines)

Return type:

Atom

Raises:

ValueError – for problems parsing

get_common_string_rep(chainflag=False)[source]

Returns a string of the common column of the new atom type.

Uses the ATOM string output but changes the first field to either be ATOM or HETATM as necessary. This is used to create the output for PQR and PDB files.

Returns:string with ATOM/HETATM field set appropriately
Return type:str
get_pdb_string()[source]

Returns a string of the atom type.

Uses the ATOM string output but changes the first field to either be ATOM or HETATM as necessary. This is for the PDB representation of the atom. The propka module depends on this being correct.

Returns:string with ATOM/HETATM field set appropriately
Return type:str
get_pqr_string(chainflag=False)[source]

Returns a string of the atom type.

Uses the ATOM string output but changes the first field to either be ATOM or HETATM as necessary. This is used to create the output for PQR files.

Returns:string with ATOM/HETATM field set appropriately
Return type:str
has_reference

Determine if the object has a reference object or not.

All known atoms should have reference objects.

Returns:whether atom has reference object
Return type:bool
is_backbone

Return True if atom name is in backbone, otherwise False.

Returns:whether atom is in backbone
Return type:bool
is_hydrogen

Is this atom a Hydrogen atom?

Returns:whether this atom is a hydrogen
Return type:bool
class pdb2pqr.structures.Chain(chain_id)[source]

Chain class

The chain class contains information about each chain within a given Biomolecule object.

__init__(chain_id)[source]

Initialize the class.

Parameters:chain_id (str) – ID for this chain as denoted in the PDB
add_residue(residue)[source]

Add a residue to the chain

Parameters:residue (Residue) – residue to be added
atoms

Return a list of Atom objects contained in this chain.

Returns:list of Atom objects
Return type:[Atom]
renumber_residues()[source]

Renumber atoms.

Renumber based on actual residue number and not PDB res_seq