Analysis Functions¶
This module defines functions for calculating physical properties from normal modes.

calcCollectivity
(mode, masses=None)[source]¶ Returns collectivity of the mode. This function implements collectivity as defined in equation 5 of [BR95]. If masses are provided, they will be incorporated in the calculation. Otherwise, atoms are assumed to have uniform masses.
[BR95] Bruschweiler R. Collective protein dynamics and nuclear spin relaxation. J Chem Phys 1995 102:33963403. Parameters:  mode (
Mode
orVector
) – mode or vector  masses (
numpy.ndarray
) – atomic masses
 mode (

calcCrossCorr
(modes, n_cpu=1, norm=True)[source]¶ Returns crosscorrelations matrix. For a 3d model, crosscorrelations matrix is an NxN matrix, where N is the number of atoms. Each element of this matrix is the trace of the submatrix corresponding to a pair of atoms. Covariance matrix may be calculated using all modes or a subset of modes of an NMA instance. For large systems, calculation of crosscorrelations matrix may be time consuming. Optionally, multiple processors may be employed to perform calculations by passing
n_cpu=2
or more.

calcFractVariance
(mode)[source]¶ Returns fraction of variance explained by the mode. Fraction of variance is the ratio of the variance along a mode to the trace of the covariance matrix of the model.

calcSqFlucts
(modes)[source]¶ Returns sum of squarefluctuations for given set of normal modes. Square fluctuations for a single mode is obtained by multiplying the square of the mode array with the variance (
Mode.getVariance()
) along the mode. ForPCA
andEDA
models built using coordinate data in Å, unit of squarefluctuations is Å^{2}, forANM
andGNM
, on the other hand, it is arbitrary or relative units.

calcTempFactors
(modes, atoms)[source]¶ Returns temperature (β) factors calculated using modes from a
ANM
orGNM
instance scaled according to the experimental Bfactors from atoms.

calcProjection
(ensemble, modes, rmsd=True, norm=True)[source]¶ Returns projection of conformational deviations onto given modes. ensemble coordinates are used to calculate the deviations that are projected onto modes. For K conformations and M modes, a (K,M) matrix is returned.
Parameters:  ensemble (
Ensemble
,Conformation
,Vector
,Trajectory
) – an ensemble, trajectory or a conformation for which deviation(s) will be projected, or a deformation vector  modes (
Mode
,ModeSet
,NMA
) – up to three normal modes
By default rootmeansquare deviation (RMSD) along the normal mode is calculated. To calculate the projection pass
rmsd=True
.Vector
instances are accepted as ensemble argument to allow for projecting a deformation vector onto normal modes. ensemble (

calcCrossProjection
(ensemble, mode1, mode2, scale=None, **kwargs)[source]¶ Returns projection of conformational deviations onto modes from different models.
Parameters:  ensemble (
Ensemble
) – ensemble for which deviations will be projected  mode1 (
Mode
,Vector
) – normal mode to project conformations onto  mode2 (
Mode
,Vector
) – normal mode to project conformations onto  scale – scale width of the projection onto mode1 (
x
) or mode2(y
), an optimized scaling factor (scalar) will be calculated by default or a value of scalar can be passed.
 ensemble (

calcPairDeformationDist
(model, coords, ind1, ind2, kbt=1.0)[source]¶ Returns distribution of the deformations in the distance contributed by each mode for selected pair of residues ind1 ind2 using model from a
ANM
. Method described in [EB08] equation (10) and figure (2).[EB08] Eyal E., Bahar I. Toward a Molecular Understanding of the Anisotropic Response of Proteins to External Forces: Insights from Elastic Network Models. Biophys J 2008 94:342434355. Parameters:

calcDistFlucts
(modes, n_cpu=1, norm=True)[source]¶ Returns the matrix of distance fluctuations (i.e. an NxN matrix where N is the number of residues, of MSFs in the interresidue distances) computed from the crosscorrelation matrix (see Eq. 12.E.1 in [IB18]). The arguments are the same as in
calcCrossCorr()
.[IB18] Dill K, Jernigan RL, Bahar I. Protein Actions: Principles and Modeling. Garland Science 2017.