9.2.7. Fast QCP RMSD structure alignment — MDAnalysis.lib.qcprot

Author:Joshua L. Adelman, University of Pittsburgh
Contact:jla65@pitt.edu
Year:2011
Licence:BSD

PyQCPROT is a python/cython implementation of Douglas Theobald’s QCP method for calculating the minimum RMSD between two structures [Theobald2005] and determining the optimal least-squares rotation matrix [Liu2010].

A full description of the method, along with the original C implementation can be found at http://theobald.brandeis.edu/qcp/

See also

The CalcRMSDRotationalMatrix() function is used in MDAnalysis.analysis.align and MDAnalysis.analysis.rmsd.

References

If you use this QCP rotation calculation method in a publication, please reference:

[Theobald2005]Douglas L. Theobald (2005) “Rapid calculation of RMSD using a quaternion-based characteristic polynomial.” Acta Crystallographica A 61(4):478-480.
[Liu2010]Pu Liu, Dmitris K. Agrafiotis, and Douglas L. Theobald (2010) “Fast determination of the optimal rotational matrix for macromolecular superpositions.” J. Comput. Chem. 31, 1561-1563.

9.2.7.1. Functions

Users will typically use the CalcRMSDRotationalMatrix() function.

MDAnalysis.lib.qcprot.CalcRMSDRotationalMatrix()

Calculate the RMSD & rotational matrix.

Parameters:
  • ref (ndarray, np.float64_t) – reference structure coordinates
  • conf (ndarray, np.float64_t) – condidate structure coordinates
  • N (int) – size of the system
  • rot (ndarray, np.float64_t) – array to store rotation matrix. Must be flat
  • weights (ndarray, npfloat64_t (optional)) – weights for each component
Returns:

rmsd – RMSD value

Return type:

float

MDAnalysis.lib.qcprot.InnerProduct()

Calculate the inner product of two structures.

Parameters:
  • A (ndarray np.float64_t) – result inner product array, modified in place
  • coords1 (ndarray np.float64_t) – reference structure
  • coord2 (ndarray np.float64_t) – candidate structure
  • N (int) – size of system
  • weights (ndarray np.float64_t (optional)) – use to calculate weighted inner product
Returns:

  • E0 (float)
  • 0.5 * (G1 + G2), can be used as input for (func:FastCalcRMSDAndRotation)

Notes

  1. You MUST center the structures, coords1 and coords2, before calling this function.

  2. Please note how the structure coordinates are stored as 3xN arrays, not Nx3 arrays as is also commonly used. The difference is something like this for storage of a structure with 8 atoms:

    Nx3: xyzxyzxyzxyzxyzxyzxyzxyz
    3xN: xxxxxxxxyyyyyyyyzzzzzzzz
    
MDAnalysis.lib.qcprot.FastCalcRMSDAndRotation()

Calculate the RMSD, and/or the optimal rotation matrix.

Parameters:
  • rot (ndarray np.float64_t) – result rotation matrix, modified inplace
  • A (ndarray np.float64_t) – the inner product of two structures
  • E0 (float64) – 0.5 * (G1 + G2)
  • N (int) – size of the system
Returns:

rmsd – RMSD value for two structures

Return type:

float