Transformations
This module defines a class for identifying contacts.
- class prody.measure.transform.Transformation(*args)[source]
A class for storing a transformation matrix.
- apply(atoms)[source]
Apply transformation to atoms, see
applyTransformation()for details.
- prody.measure.transform.alignCoordsets(atoms, weights=None)[source]
Returns atoms after superposing coordinate sets onto its active coordinate set. Transformations will be calculated for atoms and applied to its
AtomGroup, when applicable. Optionally, atomic weights can be passed for weighted superposition.
- prody.measure.transform.applyTransformation(transformation, atoms)[source]
Returns atoms after applying transformation. If atoms is a
Atomicinstance, it will be returned after transformation is applied to its active coordinate set. If atoms is anAtomPointerinstance, transformation will be applied to the corresponding coordinate set in the associatedAtomGroup.
- prody.measure.transform.calcRMSD(reference, target=None, weights=None)[source]
Returns root-mean-square deviation (RMSD) between reference and target coordinates.
- prody.measure.transform.calcTransformation(mobile, target, weights=None)[source]
Returns a
Transformationinstance which, when applied to the atoms in mobile, minimizes the weighted RMSD between mobile and target. mobile and target may be NumPy coordinate arrays, orAtomicinstances, e.g.AtomGroup,Chain, orSelection.
- prody.measure.transform.moveAtoms(atoms, **kwargs)[source]
Move atoms to a new location or by an offset. This method will change the active coordinate set of the atoms. Note that only one of to or by keyword arguments is expected.
Move protein so that its centroid is at the origin,
[0., 0., 0.]:Move protein so that its mass center is at the origin:
Move protein so that centroid of Cα atoms is at the origin:
Move protein by 10 A along each direction:
- Parameters:
by (
numpy.ndarray) – an offset array with shape([1,] 3)or(n_atoms, 3)or a transformation matrix with shape(4, 4)to (
numpy.ndarray) – a point array with shape([1,] 3)ag (bool) – when atoms is a
AtomSubset, apply translation vector (to) or transformation matrix to theAtomGroup, default is Falseweights (
numpy.ndarray) – array of atomic weights with shape(n_atoms[, 1])
When to argument is passed,
calcCenter()function is used to calculate centroid or mass center.
- prody.measure.transform.printRMSD(reference, target=None, weights=None, log=True, msg=None)[source]
Print RMSD to the screen. If target has multiple coordinate sets, minimum, maximum and mean RMSD values are printed. If log is True (default), RMSD is written to the standard error using package logger, otherwise standard output is used. When msg string is given, it is printed before the RMSD value. See also
calcRMSD()function.
- prody.measure.transform.superpose(mobile, target, weights=None)[source]
Returns mobile, after its RMSD minimizing superposition onto target, and the transformation that minimizes the RMSD.
- prody.measure.transform.wrapAtoms(frame, unitcell=None, center=array([0., 0., 0.]))[source]
Wrap atoms into an image of the system simulated under periodic boundary conditions. When frame is a
Frame, unitcell information will be retrieved automatically.Note
This function will wrap all atoms into the specified periodic image, so covalent bonds will be broken.
- Parameters:
frame (
Frame,AtomGroup,numpy.ndarray) – a frame instance or a coordinate setunitcell (
numpy.ndarray) – orthorhombic unitcell array with shape (3,)center (
numpy.ndarray) – coordinates of the center of the wrapping cell, default is the origin of the Cartesian coordinate system