This module defines a class and methods and for comparing coordinate data and measuring quantities.
Return distance matrix. When atoms2 is given, a distance matrix with shape (len(atoms1), len(atoms2)) is built. When atoms2 is None, a symmetric matrix with shape (len(atoms1), len(atoms1)) is built. If unitcell array is provided, periodic boundary conditions will be taken into account.
Parameters: |
|
---|
Return the Euclidean distance between atoms1 and atoms2. Arguments may be Atomic instances or NumPy arrays. Shape of numpy arrays must be ([M,]N,3), where M is number of coordinate sets and N is the number of atoms. If unitcell array is provided, periodic boundary conditions will be taken into account.
Parameters: |
|
---|
Return geometric center of atoms. If weights is given it must be a flat array with length equal to number of atoms. Mass center of atoms can be calculated by setting weights equal to atom masses, i.e. weights=atoms.getMasses().
Return the dihedral angle between atoms in degrees.
Return ω (omega) angle of residue in degrees. This function checks the distance between Cα atoms of two residues and raises an exception if the residues are disconnected. Set dist to None, to avoid this.
Return φ (phi) angle of residue in degrees. This function checks the distance between Cα atoms of two residues and raises an exception if the residues are disconnected. Set dist to None, to avoid this.
Return ψ (psi) angle of residue in degrees. This function checks the distance between Cα atoms of two residues and raises an exception if the residues are disconnected. Set dist to None, to avoid this.
Calculate mean square fluctuation(s) (MSF). coordsets may be an instance of Ensemble, TrajBase, or Atomic. For trajectory objects, e.g. DCDFile, frames will be considered after they are superposed. For other ProDy objects, coordinate sets should be aligned prior to MSF calculation.
Note that using trajectory files that store 32-bit coordinate will result in lower precision in calculations. Over 10,000 frames this may result in up to 5% difference from the values calculated using 64-bit arrays. To ensure higher-precision calculations for DCDFile instances, you may use astype argument, i.e. astype=float, to auto recast coordinate data to double-precision (64-bit) floating-point format.
Return root mean square fluctuation(s) (RMSF). coordsets may be an instance of Ensemble, TrajBase, or Atomic. For trajectory objects, e.g. DCDFile, frames will be considered after they are superposed. For other ProDy objects, coordinate sets should be aligned prior to MSF calculation.
Note that using trajectory files that store 32-bit coordinate will result in lower precision in calculations. Over 10,000 frames this may result in up to 5% difference from the values calculated using 64-bit arrays. To ensure higher-precision calculations for DCDFile instances, you may use astype argument, i.e. astype=float, to auto recast coordinate data to double-precision (64-bit) floating-point format.
Return deformation from from_atoms to atoms_to as a Vector instance.
Return a 3Nx3N symmetric matrix containing anisotropic displacement parameters (ADPs) along the diagonal as 3x3 super elements.
In [1]: from prody import *
In [2]: protein = parsePDB('1ejg')
In [3]: calphas = protein.select('calpha')
In [4]: adp_matrix = buildADPMatrix(calphas)
Return a 3Nx3 array containing principal axes defining anisotropic displacement parameter (ADP, or anisotropic temperature factor) ellipsoids.
Parameters: |
|
---|
Keyword arguments fract, ratio3, or ratio3 can be used to set principal axes to 0 for atoms showing relatively lower degree of anisotropy.
3Nx3 axis contains N times 3x3 matrices, one for each given atom. Columns of these 3x3 matrices are the principal axes which are weighted by square root of their eigenvalues. The first columns correspond to largest principal axes.
The direction of the principal axes for an atom is determined based on the correlation of the axes vector with the principal axes vector of the previous atom.
In [1]: from prody import *
In [2]: protein = parsePDB('1ejg')
In [3]: calphas = protein.select('calpha')
In [4]: adp_axes = calcADPAxes( calphas )
In [5]: adp_axes.shape
Out[5]: (138, 3)
These can be written in NMD format as follows:
In [6]: nma = NMA('ADPs')
In [7]: nma.setEigens(adp_axes)
In [8]: nma
Out[8]: <NMA: ADPs (3 modes; 46 atoms)>
In [9]: writeNMD('adp_axes.nmd', nma, calphas)
Out[9]: 'adp_axes.nmd'
Calculate anisotropic displacement parameters (ADPs) from anisotropic temperature factors (ATFs).
atom must have ATF values set for ADP calculation. ADPs are returned as a tuple, i.e. (eigenvalues, eigenvectors).
Return Atom or Conformation that is closest to the center of obj, which may be an Atomic or Ensemble instance. See also pickCentralAtom(), and pickCentralConf() functions.
Return Atom that is closest to the center, which is calculated using calcCenter().