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
ATOMobject inpdb. This class used for adding fields not found in the PDB that may be useful for analysis. This class also simplifies code by combiningATOMandHETATMobjects 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.
- Returns
list of the coordinates
- Return type
[float, float, float]
- classmethod from_qcd_line(line, atom_serial)[source]
Create an atom from a QCD (UHBD QCARD format) line.
- get_common_string_rep(chainflag=False)[source]
Returns a string of the common column of the new atom type.
Uses the
ATOMstring output but changes the first field to either beATOMorHETATMas 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
ATOMstring output but changes the first field to either beATOMorHETATMas necessary. This is for the PDB representation of the atom. Thepropkamodule 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
ATOMstring output but changes the first field to either beATOMorHETATMas necessary. This is used to create the output for PQR files.- Returns
string with ATOM/HETATM field set appropriately
- Return type
str
- 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
bool
- property is_backbone
Return True if atom name is in backbone, otherwise False.
- Returns
whether atom is in backbone
- Return type
bool
- property 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
Biomoleculeobject.- __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