A alignment protocol that uses Metropolis Monte Carlo.
Notes
THIS IS CURRENTLY SUPER INEFFICIENT DUE TO THE DEEPCOPIES.
I plan to improve this by aligning arrays of atoms and only
recording the rotation and translation that led to that alignment.
Parameters:
eval_fn (Polypeptide -> float) – A function to evaluate the quality of your fit.
eval_args (list) – A list of static args to be used in the eval_fn, these will
be unpacked into the evaluation function _i.e._
`eval_fn(polypeptide, *eval_args).
polypeptide (Polypeptide) – An ampal polypeptide containing the model to be aligned.
Add an amino acid to the amino_acids.json file used to populate the amino_acid table.
Parameters:
code (str) – New code to be added to amino acid table.
description (str) – Description of the amino acid, e.g. ‘amidated terminal carboxy group’.
letter (str, optional) – One letter code for the amino acid.
Defaults to ‘X’
modified (str or None, optional) – Code of modified amino acid, e.g. ‘ALA’, or None.
Defaults to None
force_add (bool, optional) – If True, will over-write existing dictionary value for code if already in amino_acids.json.
If False, then an IOError is raised if code is already in amino_acids.json.
Raises:
IOError – If code is already in amino_acids.json and force_add is False.
Get dictionary of information relating to a new amino acid code not currently in the database.
Notes
Use this function to get a dictionary that is then to be sent to the function add_amino_acid_to_json().
use to fill in rows of amino_acid table for new amino acid code.
Parameters:
code (str) – Three-letter amino acid code.
Raises:
IOError – If unable to locate the page associated with the amino acid name on the PDBE site.
Returns:
aa_dict – Keys are AminoAcidDB field names.
Values are the str values for the new amino acid, scraped from the PDBE if possible. None if not found.
Alpha angle calculated using points on the primitive of helix and axis.
Notes
The final value is None, since the angle calculation requires pairs
of points along the primitive and axis. This is a generalisation
of the calculation used to measure the tilt of a helix in a
coiled-coil with respect to the central axis of the coiled coil.
Parameters:
p (ampal.Polymer) – Reference Polymer.
reference_axis (list(numpy.array or tuple or list)) – Length of reference_axis must equal length of the Polymer.
Each element of reference_axis represents a point in R^3.
tag (bool, optional) – If True, tags the Chain with the reference axis coordinates
and each Residue with its alpha angle. Alpha angles are stored
at the Residue level, but are calculated using the CA atom.
reference_axis_name (str, optional) – Used to name the keys in tags at Chain and Residue level.
Returns:
alphas – The alpha angle for the Polymer at each point of its primitive,
in degrees.
Return type:
list of float
Raises:
ValueError – If the Polymer and the reference_axis have unequal length.
This function uses the convention 1:g+ 2:t 3:g- as from 10.1006/jmbi.1993.1170
R L Dunbrack Jr, M Karplus (1993) Backbone-dependent rotamer library for proteins.
Application to side-chain prediction.
Returns the Crick angle for each CA atom in the Polymer.
Notes
The final value is in the returned list is None, since the angle
calculation requires pairs of points on both the primitive and
reference_axis.
Parameters:
p (ampal.Polymer) – Reference Polymer.
reference_axis (list(numpy.array or tuple or list)) – Length of reference_axis must equal length of the Polymer.
Each element of reference_axis represents a point in R^3.
tag (bool, optional) – If True, tags the Polymer with the reference axis coordinates
and each Residue with its Crick angle. Crick angles are stored
at the Residue level, but are calculated using the CA atom.
reference_axis_name (str, optional) – Used to name the keys in tags at Chain and Residue level.
Returns:
cr_angles – The crick angles in degrees for each CA atom of the Polymer.
Return type:
list(float)
Raises:
ValueError – If the Polymer and the reference_axis have unequal length.
Flips reference axis if direction opposes the direction of the Polymer.
Notes
If the angle between the vector for the Polymer and the vector
for the reference_axis is > 90 degrees, then the reference axis
is reversed. This is useful to run before running
polymer_to_reference_axis_distances, crick_angles, or alpha_angles.
For more information on the start and end indices, see chain_vector.
Parameters:
p (ampal.Polymer) – Reference Polymer.
reference_axis (list(numpy.array or tuple or list)) – Length of reference_axis must equal length of the Polymer.
Each element of reference_axis represents a point in R^3.
start_index (int, optional) – Default is 0 (start at the N-terminus of the Polymer)
end_index (int, optional) – Default is -1 (start at the C-terminus of the Polymer)
Generates smoothed helix primitives and extrapolates lost ends.
Notes
From an input list of CA coordinates, the running average is
calculated to form a primitive. The smoothing_level dictates how
many times to calculate the running average. A higher
smoothing_level generates a ‘smoother’ primitive - i.e. the
points on the primitive more closely fit a smooth curve in R^3.
Each time the smoothing level is increased by 1, a point is lost
from either end of the primitive. To correct for this, the primitive
is extrapolated at the ends to approximate the lost values. There
is a trade-off then between the smoothness of the primitive and
its accuracy at the ends.
Parameters:
cas_coords (list(numpy.array or float or tuple)) – Each element of the list must have length 3.
smoothing_level (int) – Number of times to run the averaging.
Returns distances between the primitive of a Polymer and a reference_axis.
Notes
Distances are calculated between each point of the Polymer primitive
and the corresponding point in reference_axis. In the special case
of the helical barrel, if the Polymer is a helix and the reference_axis
represents the centre of the barrel, then this function returns the
radius of the barrel at each point on the helix primitive. The points
of the primitive and the reference_axis are run through in the same
order, so take care with the relative orientation of the reference
axis when defining it.
Parameters:
p (ampal.Polymer) –
reference_axis (list(numpy.array or tuple or list)) – Length of reference_axis must equal length of the Polymer.
Each element of reference_axis represents a point in R^3.
tag (bool, optional) – If True, tags the Chain with the reference axis coordinates
and each Residue with its distance to the ref axis.
Distances are stored at the Residue level, but refer to
distances from the CA atom.
reference_axis_name (str, optional) – Used to name the keys in tags at Chain and Residue level.
Returns:
distances – Distance values between corresponding points on the
reference axis and the Polymer Primitive.
Return type:
list(float)
Raises:
ValueError – If the Polymer and the reference_axis have unequal length.
Average coordinates from a set of primitives calculated from Chains.
Parameters:
chains (list(Chain)) –
Returns:
reference_axis – The averaged (x, y, z) coordinates of the primitives for
the list of Chains. In the case of a coiled coil barrel,
this would give the central axis for calculating e.g. Crick
angles.
Return type:
numpy.array
Raises:
ValueError : – If the Chains are not all of the same length.
The number of residues per turn at each Monomer in the Polymer.
Notes
Each element of the returned list is the number of residues
per turn, at a point on the Polymer primitive. Calculated using
the relative positions of the CA atoms and the primitive of the
Polymer. Element i is the calculated from the dihedral angle using
the CA atoms of the Monomers with indices [i, i+1] and the
corresponding atoms of the primitive. The final value is None.
Parameters:
p (ampal.Polypeptide) – Polypeptide from which residues per turn will be calculated.
Explanation of FASTA format: https://en.wikipedia.org/wiki/FASTA_format
Recommendation that all lines of text be shorter than 80
characters is adhered to. Format of PDBID|CHAIN|SEQUENCE is
consistent with files downloaded from the PDB. Uppercase
PDBID used for consistency with files downloaded from the PDB.
Useful for feeding into cdhit and then running sequence clustering.
Returns:
fasta_str – String of the fasta file for the Assembly.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
Base class for all AMPAL objects except ampal.atom.
Raises:
NotImplementedError – BaseAmpal is an abstract base class and is not intended to
be instanciated. A NotImplementedError is raised if a
method is called that is required on a child class but is
not implemented in BaseAmpal.
atoms (OrderedDict or {OrderedDict}, optional) – OrderedDict containing Atoms for the Monomer. OrderedDict
is used to maintain the order items were added to the dictionary.
monomer_id (str, optional) – String used to identify the residue.
parent (Polymer, optional) – A reference to the Polymer containing this Monomer.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
Gets list of coordinates of all reference atoms in the Polymer.
Returns:
ref_coords – List has the same length as the Polymer.
The first, second and third elements of array i contain the
x, y and z coordinates of the i-th reference atom.
Separates parsed DSSP data into groups of secondary structure.
Notes
Example: all residues in a single helix/loop/strand will be gathered
into a list, then the next secondary structure element will be
gathered into a separate list, and so on.
Parameters:
dssp_residues ([tuple]) –
Each internal list contains:
[0] int Residue number
[1] str Secondary structure type
[2] str Chain identifier
[3] str Residue type
[4] float Phi torsion angle
[5] float Psi torsion angle
[6] int dssp solvent accessibility
Returns:
fragments – Lists grouped in continuous regions of secondary structure.
Innermost list has the same format as above.
Uses DSSP to find helices and extracts helices from a pdb file or string.
:param pdb: Path to pdb file or string.
:type pdb: str
:param path: Indicates if pdb is a path or a string.
:type path: bool, optional
A dictionary will be added to the tags dictionary of each
residue called dssp_data, which contains the secondary
structure definition, solvent accessibility phi and psi values
from DSSP. A list of regions of continuous secondary assignments
will also be added to each Polypeptide.
The tags are added in place, so nothing is returned from this
function.
Parameters:
assembly (ampal.Assembly) – An Assembly containing some protein.
loop_assignments (tuple or list) – A tuple containing the DSSP secondary structure identifiers to
that are classed as loop regions.
Functions that have names preceded by an underscore indicate that they are not
to be used by users. However, all of these functions will generally be defined
using cdef and so will not be imported anyway.
This is a trivial function in this particular case. Implemented for compatability with Curve class.
Returns arc length along the curve between the points specified by t and t_ref.
If t_ref > t then the returned value is negative.
Parameters:
t (float) –
t_ref (float) – t and t_ref define points on curve (See self.point()).
List of evenly spaced points along the curve of specified total length.
Parameters:
n_points (int) – The number of points to be returned.
spacing (float) – arc-length spacing of points to be returned.
axis_start (list or tuple or numpy.array of length 3) –
axis_end (list or tuple or numpy.array of length 3) – Coordinates returned will be for a helical path winding around an axis specified by axis_end - axis_start.
t_ref (The value of t for specifying the first point in the coordinates list.) –
Returns:
coords – 3D coordinates of evenly spaced points along the curve.
Calculate angle between two vectors using the dot product.
Notes
All angle-based functions in tools_geometry will return values in degrees by default.
The radians flag can be used to return values in radians.
If a or b is very close to the origin (norm < 1e-7), returns 0.0.
Parameters:
a (list or tuple or numpy.array.) –
b (list or tuple or numpy.array.) –
radians (bool, optional) – If True, returns angle in radians.
If False, returns angle in degrees.
Default value is False.
p0, p1, q0, q1 describe two lines, L1 (p0 -> p1) and L2 (q0 -> q1).
L1 (2) is the infinite extension of the line that passes through a (q0) and has direction p0->p1 (q0->q1).
Two points point_1, and point_2 on L1 and L2 respectively, are returned.
The distance between point_1 and point_2 is smaller than any other points on L1 and L2.
Code adapted from http://geomalgorithms.com/a07-_distance.html, where a more detailed explanation is available.
Parameters:
p0 (list or tuple or numpy.array) –
p1 (list or tuple or numpy.array) –
q0 (list or tuple or numpy.array) –
q1 (list or tuple or numpy.array) –
segments (bool) – If True, the points returned must lie on line segments p0->p1 and q0->q1, rather than their infinite extensions.
Converts from cylindrical to cartesian coordinates system
Notes
Cylindrical coordinates are here defined by a radius, an azimuth angle and a z value.
The azimuth is the angle in the x-y plane, with counter-clockwise direction being positive.
So: azimuth = 0 => lies on x-axis, azimuth = 90 => lies in y axis, zenith = 180 => lies antiparallel to x-axis.
The radius and the z value are the radius and height of the cylinder, respectively.
See https://en.wikipedia.org/wiki/Cylindrical_coordinate_system
and/or http://mathworld.wolfram.com/CylindricalCoordinates.html
for more information.
Parameters:
radius (float) –
azimuth (float) –
z (float) –
radians (bool) – True if azimuth is given in radians instead of degrees.
Returns:
cartesian coordinates corresponding to the input cylindrical coordinates.
Finds the perpendicular foot of a point (p) and a line (ab).
The points a and b define a line in R^3.
There is a point on this line, q, that has the shortest Euclidian distance from the point p.
This point is the perpendicular foot, and is returned by this function.
Notes
See http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html for a useful work-through of the maths.
Parameterise the line ab by t, so that a point on the line is of the form: a + (b-a)*t.
Define f(t) = [distance(t, p)]^2. Want t such that f(t) is at a minimum.
Solve f’(t) = 0 for t.
Substituting this value of t into a + (b-a)*t yields the desired point q.
Parameters:
a (list or tuple or numpy.array) –
b (list or tuple or numpy.array) – Together, the points a and b define a line in R^3.
p (list or tuple or numpy.array) – A point in R^3.
Returns:
q – The point on the line between a and b that is closest to q.
Finds the perpendicular foot of a point (p) and a plane defined by points a, b and c.
The points a, b and c must define a plane in R^3 (i.e. they cannot be collinear).
There is a point on this plane, q, that has the shortest Euclidian distance from the point p.
This point is the perpendicular foot, and is returned by this function.
f(x, y, z) = (x - p[0])^2 + (y - p[1])^2 + (z - p[2])^2
subject to the constraint g(x, y, z) = 0, where g is the equation of the plane.
The Langrangian multiplier L = f(x, y, z) - lambda*(g(x, y, z)).
We calculate the partial deriviatves of this (wrt x, y, z and lambda).
Solve first for lambda gives the equation for the lagrangian_lambda value in this function.
Then substitute lambda back in to get the solution for (x, y, z) = q.
Parameters:
a (list or tuple or numpy.array) –
b (list or tuple or numpy.array) –
c (list or tuple or numpy.array) – Together, the points a, b and c define a plane in R^3.
p (list or tuple or numpy.array) – A point in R^3.
Returns geometrical transformations required to align the vector from s1 -> e1 with the vector from s2 -> e2
Notes
Applying the transformations returned to the line from s1 -> e2, will align it with the line from s2 -> e2.
After transformation, s1 will have been moved onto s2.
Apply the rotation (given by angle, axis and point) first and then the translation (given by translation).
Parameters:
s1 ([float, float, float]) – 3D coordinate. Start of line 1
e1 ([float, float, float]) – 3D coordinate. End of line 1
s2 ([float, float, float]) – 3D coordinate. Start of line 2
e2 ([float, float, float]) – 3D coordinate. End of line 2
radians (bool) – If True, angle will be returned in radians.
Returns:
translation (numpy.array(3)) – 3D vector. Translation to be applied to s1 to move it onto s2.
angle (float) – angle for rotation (default: degrees).
axis (numpy.array(3)) – axis about which to rotate line 1 to align it with line 2.
point (numpy.array(3)) – a point lying on the rotation axis.
Find start and end indices of the part of the list of points ‘subject’ that will intersect with ‘reference’
Notes
This is a function designed to find assemblies from within bundles of helices.
The idea here is to take two lists of points, a subject and a reference. We want to find the part of the subject
(this could be all of it, or none of it) that would intersect the line joining the points in the reference, if
the line joining the points of subject was the prinicipal axis of a cylinder of infinite radius.
If subject was a list of ten points joining (0, 0 , 0) and (0, 0, 10), and reference was a list of 1000 points
joining (10, 0, 7) and (10, 0, 12) this function would return (7, 10).
If the subject and reference for the above example were swapped around, however, the function would return (0, 599).
Parameters:
subject (list of numpy.array) – A list of points in R^3.
reference (list of numpy.array) – A list of points in R^3.
Returns:
start_index (int) – The index of the first point in subject that is part of the intersection described above.
end_index (int) – The index of the final point in subject that is part of the intersection described above.
Finds the minimal distance between two the two lines joining p0 to p1 and q0 to q1.
The points p0, p1, q0 and d are used to construct two lines in R^3.
The first line L1 is from p0 to p1, the second line L2 is from q0 to q1.
The minimal distance between these lines is the length of the line that
connects them and is perpendicular to both L1 and L2.
List of n uniformly distributed (x, y) coordinates on the circumference of a circle.
Parameters:
n (int) – Number of points to return.
radius (float) –
centre (tuple or list or numpy.array) –
rotation (float) – Angle in degrees by which all points will be rotated.
rotation = 0 means that the line from the centre to the first point is parallel to the x-axis.
rotation > 0 => anti-clockwise rotation
Returns:
points – (x, y) coordinates of uniformly distributed points on the circumference of the circle
unit_vect (list or tuple or numpy.array) – Vector about which to rotate.
point (list or tuple or numpy.array, optional.) – Specify a point about which to rotate.
If point is None, then the rotation will be about the origin.
Default value is None.
Converts from spherical to cartesian coordinates system
Notes
Spherical coordinates are here defined by a radius, an azimuth angle and a zenith angle.
The zenith is the angle between the point and the z-axis.
So: zenith = 0 => lies on z-axis, zenith = 90 => lies in x-y plane, zenith = 180 => lies antiparallel to z-axis.
The azimuth is the angle in the x-y plane, with counter-clockwise direction being positive.
So: azimuth = 0 => lies on x-axis, azimuth = 90 => lies in y axis, zenith = 180 => lies antiparallel to x-axis.
See https://en.wikipedia.org/wiki/Spherical_coordinate_system
and/or http://mathworld.wolfram.com/SphericalCoordinates.html
for more information.
If zenith = 0, then x and y are both 0 regardless of azimuth value.
If azimuth = 0, then y is 0 regardless of zenith value.
Parameters:
radius (float) –
azimuth (float) –
zenith (float) –
radians (bool) – True if azimuth and zenith are given in radians instead of degrees.
Returns:
cartesian coordinates corresponding to the input spherical coordinates.
Returns all the covalent bonds in a list of Atom pairs.
Notes
Uses information ELEMENT_DATA, which can be accessed directly
through this module i.e. isambard.ampal.interactions.ELEMENT_DATA.
Parameters:
atoms ([(Atom, Atom)]) – List of pairs of Atoms.
threshold (float, optional) – Allows deviation from ideal covalent bond distance to be included.
For example, a value of 1.1 would allow interactions up to 10% further
from the ideal distance to be included.
ampal (AMPAL Object) – Any AMPAL object with a get_atoms method.
max_range (float, optional) – Used to define the sector size, so interactions at longer ranges
will not be found.
threshold (float, optional) – Allows deviation from ideal covalent bond distance to be included.
For example, a value of 1.1 would allow interactions up to 10% further
from the ideal distance to be included.
tag (bool, optional) – If True, will add the covalent bond to the tags dictionary of
each Atom involved in the interaction under the covalent_bonds
key.
All Monomers that do not have dedicated classes are
represented using the Ligand class.
Parameters:
mol_code (str) – PDB molecule code that represents the monomer.
atoms (OrderedDict, optional) – OrderedDict containing Atoms for the Monomer. OrderedDict
is used to maintain the order items were added to the
dictionary.
monomer_id (str, optional) – String used to identify the residue.
insertion_code (str, optional) – Insertion code of monomer, used if reading from pdb.
is_hetero (bool, optional) – True if is a hetero atom in pdb. Helps with PDB formatting.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
atoms (OrderedDict, optional) – OrderedDict containing Atoms for the Nucleotide. OrderedDict
is used to maintain the order items were added to the
dictionary.
mol_code (str, optional) – One or three letter code that represents the Nucleotide.
monomer_id (str, optional) – String used to identify the Nucleotide.
insertion_code (str, optional) – Insertion code of Nucleotide, used if reading from pdb.
is_hetero (bool, optional) – True if is a hetero atom in pdb. Helps with PDB formatting.
parent (ampal.Polynucleotide, optional) – Reference to Polynucleotide containing the Nucleotide.
The key that corresponds to the reference Atom. This is used
by various functions, for example backbone primitives are
calculated using the Atom defined using this key.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
Type:
dict
Raises:
ValueError – Raised if mol_code is not length 1 or 3.
Polymer type object that represents a Polynucleotide.
Parameters:
monomers (Nucleotide or [Nucleotide], optional) – Nucleotide or list containing Nucleotide objects to form the
Polynucleotide.
polymer_id (str, optional) – An ID that the user can use to identify the Polynucleotide. This is
used when generating a pdb file using Polynucleotide().pdb.
parent (ampal.Assembly, optional) – Reference to Assembly containing the Polynucleotide.
sl (int, optional) – The default smoothing level used when calculating the
backbone primitive.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
This dictionary represents the parse tree of the PDB file.
Each line of the structure is broken down into a key, the
entry label, and a value, the data.
pdb (str) – Either a path to a PDB file or a string containing PDB
format structural data.
path (bool, optional) – If true, flags pdb as a path and not a PDB string.
pdb_id (str, optional) – Identifier for the Assembly.
ignore_end (bool, optional) – If false, parsing of the file will stop when an “END”
record is encountered.
Returns:
ampal – AMPAL object that contains the structural information from
the PDB file provided. If the PDB file has a single state
then an Assembly will be returned, otherwise an
AmpalContainer will be returned.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
Dictionary containing backbone bond angles as lists of floats.
Returns:
bond_angles – Keys are n_ca_c, ca_c_o, ca_c_n and c_n_ca, referring
to the N-CA-C, CA-C=O, CA-C-N and C-N-CA angles respectively.
Values are lists of floats : the bond angles in degrees.
The lists of n_ca_c, ca_c_o are of length k for a Polypeptide
containing k Residues. The list of ca_c_n and c_n_ca are of
length k-1 for a Polypeptide containing k Residues (These
angles are across the peptide bond, and are therefore formed
between successive Residue pairs).
Dictionary containing backbone bond lengths as lists of floats.
Returns:
bond_lengths – Keys are n_ca, ca_c, c_o and c_n, referring to the
N-CA, CA-C, C=O and C-N bonds respectively. Values are
lists of floats : the bond lengths in Angstroms.
The lists of n_ca, ca_c and c_o are of length k for
a Polypeptide containing k Residues. The list of c_n bonds
is of length k-1 for a Polypeptide containing k Residues
(C-N formed between successive Residue pairs).
psi (float, optional) – Psi torsion angle (degrees) between final Residue of self
and first Residue of other.
omega (float, optional) – Omega torsion angle (degrees) between final Residue of
self and first Residue of other.
phi (float, optional) – Phi torsion angle (degrees) between final Residue of self
and first Residue of other.
o_c_n_angle (float or None, optional) – Desired angle between O, C (final Residue of self) and N
(first Residue of other) atoms. If None, default value is
taken from ideal_backbone_bond_angles.
c_n_ca_angle (float or None, optional) – Desired angle between C (final Residue of self) and N, CA
(first Residue of other) atoms. If None, default value is
taken from ideal_backbone_bond_angles.
c_n_length (float or None, optional) – Desired peptide bond length between final Residue of self
and first Residue of other. If None, default value is taken
from ideal_backbone_bond_lengths.
relabel (bool, optional) – If True, relabel_all is run on self before returning.
Raises:
TypeError: – If other is not a Residue or a Polypeptide.
psi (float) – Psi torsion angle (degrees) between final Residue of other
and first Residue of self.
omega (float) – Omega torsion angle (degrees) between final Residue of
other and first Residue of self.
phi (float) – Phi torsion angle (degrees) between final Residue of other
and first Residue of self.
o_c_n_angle (float or None) – Desired angle between O, C (final Residue of other) and N
(first Residue of self) atoms. If None, default value is
taken from ideal_backbone_bond_angles.
c_n_ca_angle (float or None) – Desired angle between C (final Residue of other) and N, CA
(first Residue of self) atoms. If None, default value is taken
from ideal_backbone_bond_angles.
c_n_length (float or None) – Desired peptide bond length between final Residue of other
and first Residue of self. If None, default value is taken
from ideal_backbone_bond_lengths.
relabel (bool) – If True, relabel_all is run on self before returning.
Raises:
TypeError: – If other is not a Residue or a Polypeptide
Tags each monomer with side-chain dihedral angles. For residues that
do not have any rotamers (Alanine and Glycine) the rotamer is tagged as
0 and chi_angles as None.
force: bool, optional
If True the tag will be run even if Residues are
already tagged.
atoms (OrderedDict, optional) – OrderedDict containing Atoms for the Monomer. OrderedDict
is used to maintain the order items were added to the
dictionary.
mol_code (str, optional) – One or three letter code that represents the monomer.
monomer_id (str, optional) – String used to identify the residue.
insertion_code (str, optional) – Insertion code of monomer, used if reading from pdb.
is_hetero (bool, optional) – True if is a hetero atom in pdb. Helps with PDB formatting.
parent (ampal.Polypeptide, optional) – Reference to Polypeptide containing the Residue.
The key that corresponds to the reference atom. This is used
by various functions, for example backbone primitives are
calculated using the atom defined using this key.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
Type:
dict
Raises:
ValueError – Raised if mol_code is not length 1 or 3.
Generates a tuple that uniquely identifies a Monomer in an Assembly.
Notes
The unique_id will uniquely identify each monomer within a polymer.
If each polymer in an assembly has a distinct id, it will uniquely
identify each monomer within the assembly.
The hetero-flag is defined as in Biopython as a string that is
either a single whitespace in the case of a non-hetero atom,
or ‘H_’ plus the name of the hetero-residue (e.g. ‘H_GLC’ in
the case of a glucose molecule), or ‘W’ in the case of a water
molecule.
pseudo_atoms (OrderedDict, optional) – OrderedDict containing Atoms for the PsuedoMonomer. OrderedDict
is used to maintain the order items were added to the
dictionary.
mol_code (str, optional) – One or three letter code that represents the PsuedoMonomer.
monomer_id (str, optional) – String used to identify the PsuedoMonomer.
insertion_code (str, optional) – Insertion code of PsuedoMonomer, used if reading from pdb.
is_hetero (bool, optional) – True if is a hetero atom in pdb. Helps with PDB formatting.
parent (ampal.PseudoGroup, optional) – Reference to PseudoGroup containing the PsuedoMonomer.
The key that corresponds to the reference Atom. This is used
by various functions, for example backbone primitives are
calculated using the Atom defined using this key.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
Type:
dict
Raises:
ValueError – Raised if mol_code is not length 1 or 3.
The radius of curvature at each point on the Polymer primitive.
Notes
Each element of the returned list is the radius of curvature,
at a point on the Polymer primitive. Element i is the radius
of the circumcircle formed from indices [i-1, i, i+1] of the
primitve. The first and final values are None.
The rise per residue at each point on the Primitive.
Notes
Each element of the returned list is the rise per residue,
at a point on the Primitive. Element i is the distance
between primitive[i] and primitive[i + 1]. The final value
is None.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
pseudo_atoms (OrderedDict, optional) – OrderedDict containing Atoms for the PsuedoMonomer. OrderedDict
is used to maintain the order items were added to the
dictionary.
mol_code (str, optional) – One or three letter code that represents the PsuedoMonomer.
monomer_id (str, optional) – String used to identify the PsuedoMonomer.
insertion_code (str, optional) – Insertion code of PsuedoMonomer, used if reading from pdb.
is_hetero (bool, optional) – True if is a hetero atom in pdb. Helps with PDB formatting.
parent (ampal.PseudoGroup, optional) – Reference to PseudoGroup containing the PsuedoMonomer.
The key that corresponds to the reference Atom. This is used
by various functions, for example backbone primitives are
calculated using the Atom defined using this key.
A dictionary containing information about this AMPAL object.
The tags dictionary is used by AMPAL to cache information
about this object, but is also intended to be used by users
to store any relevant information they have.
Type:
dict
Raises:
ValueError – Raised if mol_code is not length 1 or 3.