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 inpdb
. This class used for adding fields not found in the PDB that may be useful for analysis. This class also simplifies code by combiningATOM
andHETATM
objects into a single class.- __init__(atom=None, type_='ATOM', residue=None)[source]
Initialize the new Atom object by using the old object.
- add_bond(bondedatom)[source]
Add a bond to the list of bonds.
- Parameters:
bondedatom (ATOM) – the atom to bond to
- property coords
Return the x,y,z coordinates of the atom.
- classmethod from_pqr_line(line)[source]
Create an atom from a PQR line.
- Parameters:
- Returns:
new atom or None (for REMARK and similar lines)
- Return type:
- Raises:
ValueError – for problems parsing
- classmethod from_qcd_line(line, atom_serial)[source]
Create an atom from a QCD (UHBD QCARD format) line.
- Parameters:
- Returns:
new atom or None (for REMARK and similar lines)
- Return type:
- 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 beATOM
orHETATM
as necessary. This is used to create the output for PQR and PDB files.- Returns:
string with ATOM/HETATM field set appropriately
- Return type:
- get_pdb_string()[source]
Returns a string of the atom type.
Uses the
ATOM
string output but changes the first field to either beATOM
orHETATM
as necessary. This is for the PDB representation of the atom. Thepropka
module depends on this being correct.- Returns:
string with ATOM/HETATM field set appropriately
- Return type:
- 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 beATOM
orHETATM
as necessary. This is used to create the output for PQR files.- Returns:
string with ATOM/HETATM field set appropriately
- Return type:
- property 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:
- property is_backbone
Return True if atom name is in backbone, otherwise False.
- Returns:
whether atom is in backbone
- Return type:
- 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