Protein Data Bank objects (dockerasmus.pdb)¶
Protein (dockerasmus.pdb.protein)¶
-
class
dockerasmus.pdb.
Protein
(id=None, name=None, chains=None)[source]¶ -
classmethod
from_pdb
(handle)[source]¶ Create a new Protein object from a PDB file handle.
Parameters: handle (file handle) – a file-like object opened in binary read mode (must be line-by-line iterable).
-
classmethod
from_pdb_file
(path)[source]¶ Create a new Protein object from a PDB file.
Parameters: path ( str
) – the path to a PDB protein file (supports gzipped or plain text PDB files).
-
mass
¶ The mass of the protein.
Warning
Computed as the sum of the masses of the residues of the chain (it does not take the masses of the atoms in the peptidic bound into account).
-
mass_center
¶ The position of mass center of the protein.
\[\begin{split}mc &= \sum_{i}{\frac{w_i}{W} \begin{pmatrix} x_i \\ y_i \\ z_i \end{pmatrix} }\end{split}\]where \(i\) is the index of each atom, \(x_i\) (resp. \(y_i\)) (resp. \(z_i\)) if the abcissa (resp. ordinate) (resp. height) of the atom \(i\) in the worldspace, and \(W = \sum_i{w_i}\) the approximated mass of the whole protein.
Warning
Uses
Protein.mass
, so only the atoms on the residues of each aminoacid are used for the computation.
-
radius
¶ The radius of the sphere the protein would fit in.
Equals to the norm of the position of the atom of the protein farthest from its mass center.
-
contact_map
(other, mode='nearest')[source]¶ Return a 2D contact map between residues of
self
andother
.Parameters: other ( Protein
) – the other protein with which to create a contact map (chains/residues/atoms must have the same names in both proteins)Keyword Arguments: mode ( str
) – how to compute the contact map. Available modes are:'nearest'
(the distance between the two closest atoms of the two residues),'farthest'
(the distance between the two farthest atoms of the two residues) or'mass_center'
(the distance between the mass center of the two residues).
-
atom
(atom_id)[source]¶ Get atom of
self
with idatom_id
.Raises: KeyError
– when no Atom has the given id.
-
residue
(res_id)[source]¶ Get residue of
self
with idres_id
.Raises: KeyError
– when no Residue has the given id.
-
iteratoms
()[source]¶ Yield every atom in
self
.Yields: Atom
– every atom of the protein, ordered by the id of their chain and the id of their residue.
-
classmethod
Chain (dockerasmus.pdb.chain)¶
Residue (dockerasmus.pdb.residue)¶
-
class
dockerasmus.pdb.
Residue
(id, name=None, atoms=None)[source]¶ -
mass
¶ The mass of the residue.
Computed as sum of the masses of the non-hydrogen atoms of the residue.
-
mass_center
¶ The position of the mass center of the residue.
Computed as the barycenter of the positions of the atoms weighted by their atomic masses.
-
rmsd
(ref)[source]¶ The RMSD of the atoms of the residue, with ref as reference.
Parameters: ref ( numpy.ndarray
orlist
) – the x,y,z coordinates of the reference position.
-
Atom (dockerasmus.pdb.atom)¶
-
class
dockerasmus.pdb.
Atom
(x, y, z, id, name=None, residue=None)[source]¶ -
charge
¶ The electrostatic charge of the atom.
-
pwd
¶ The well depth of the Lennard-Jones potential of the atom.
-
mass
¶ The mass of the atom.
-
pos
¶ The position of the atom.
-
radius
¶ The optimal Van der Waals radius of the atom (empirical).
-
distance_to
(other)[source]¶ Computes the distance to
other
.Parameters: other (
numpy.ndarray
) – the position to compute the distance to (must be array-like of dimension 3)Raises: ValueError
– whenother
is not of dimension 3.TypeError
– whenother
is not a sequence.
-
nearest
(other_atom)[source]¶ The nearest
other_atom
inself.residue
.Parameters: other_atom ( str
) – the name of the other atom to find (can be a generic atom such as ‘C’, ‘O’, ‘N’, etc. or a specific atom such as ‘CA’, ‘OH1’, etc.).- Example: Carbon atom nearest to the oxygen atom in an arginine
>>> oxygen = arginine["O"] >>> oxygen.nearest("C") Atom 36(13.559, 86.257, 95.222) >>> arginine["C"] Atom 36(13.559, 86.257, 95.222)
Raises: ValueError
– when no residue is set or whenother_atom
cannot be found in the residue.
-