public final class SuperPositionQCP extends SuperPositionAbstract
Usage:
The input consists of 2 Point3d arrays of equal length. The input coordinates are not changed.
Point3d[] x = ... Point3d[] y = ... SuperPositionQCP qcp = new SuperPositionQCP(); qcp.set(x, y);
or with weighting factors [0 - 1]]
double[] weights = ... qcp.set(x, y, weights);
For maximum efficiency, create a SuperPositionQCP object once and reuse it.
A. Calculate rmsd only
double rmsd = qcp.getRmsd();
B. Calculate a 4x4 transformation (rotation and translation) matrix
Matrix4d rottrans = qcp.getTransformationMatrix();
C. Get transformated points (y superposed onto the reference x)
Point3d[] ySuperposed = qcp.getTransformedCoordinates();
Citations:
Liu P, Agrafiotis DK, & Theobald DL (2011) Reply to comment on: "Fast determination of the optimal rotation matrix for macromolecular superpositions." Journal of Computational Chemistry 32(1):185-186. [http://dx.doi.org/10.1002/jcc.21606]
Liu P, Agrafiotis DK, & Theobald DL (2010) "Fast determination of the optimal rotation matrix for macromolecular superpositions." Journal of Computational Chemistry 31(7):1561-1563. [http://dx.doi.org/10.1002/jcc.21439]
Douglas L Theobald (2005) "Rapid calculation of RMSDs using a quaternion-based characteristic polynomial." Acta Crystallogr A 61(4):478-480. [http://dx.doi.org/10.1107/S0108767305015266 ]
This is an adoption of the original C code QCProt 1.4 (2012, October 10) to Java. The original C source code is available from http://theobald.brandeis.edu/qcp/ and was developed by
Douglas L. Theobald Department of Biochemistry MS 009 Brandeis University 415 South St Waltham, MA 02453 USA
dtheobald@brandeis.edu
Pu Liu Johnson & Johnson Pharmaceutical Research and Development, L.L.C. 665 Stockton Drive Exton, PA 19341 USA
pliu24@its.jnj.com
Constructor and Description |
---|
SuperPositionQCP(boolean centered)
Default constructor for the quaternion based superposition algorithm.
|
SuperPositionQCP(boolean centered,
double evec_prec,
double eval_prec)
Constructor with option to set the precision values.
|
Modifier and Type | Method and Description |
---|---|
double |
getRmsd(javax.vecmath.Point3d[] fixed,
javax.vecmath.Point3d[] moved)
Calculate the RMSD between two arrays of equivalent points that are not
superposed.
|
double |
getWeightedRmsd(javax.vecmath.Point3d[] fixed,
javax.vecmath.Point3d[] moved,
double[] weight) |
javax.vecmath.Matrix4d |
superpose(javax.vecmath.Point3d[] fixed,
javax.vecmath.Point3d[] moved)
Obtain the superposition matrix that minimizes the RMSD between two
arrays of equivalent points.
|
javax.vecmath.Matrix4d |
superposeAfterRmsd()
The QCP method can be used as a two-step calculation: first compute the
RMSD (fast) and then compute the superposition.
|
javax.vecmath.Matrix4d |
weightedSuperpose(javax.vecmath.Point3d[] fixed,
javax.vecmath.Point3d[] moved,
double[] weight)
Weighted superposition.
|
checkInput, setCentered, superposeAndTransform
public SuperPositionQCP(boolean centered)
centered
- true if the point arrays are centered at the origin (faster),
false otherwisepublic SuperPositionQCP(boolean centered, double evec_prec, double eval_prec)
centered
- true if the point arrays are centered at the origin (faster),
false otherwiseevec_prec
- required eigenvector precisioneval_prec
- required eigenvalue precisionpublic javax.vecmath.Matrix4d weightedSuperpose(javax.vecmath.Point3d[] fixed, javax.vecmath.Point3d[] moved, double[] weight)
fixed
- moved
- weight
- array of weigths for each equivalent point positionpublic double getRmsd(javax.vecmath.Point3d[] fixed, javax.vecmath.Point3d[] moved)
SuperPosition
This is equivalent to first superposing the point arrays with
SuperPosition.superposeAndTransform(Point3d[], Point3d[])
and
then calculating the RMSD of the superposed point arrays with
CalcPoint.rmsd(Point3d[], Point3d[])
, but it will be faster when
the transformation matrix is not needed.
The two point arrays have to be of the same length and the order of points have to be the same, so that a specific position in the one array is equivalent to the same position in the other array.
fixed
- an array of points. Original coordinates will not be modified.moved
- an array of points. Original coordinates will not be modified.public javax.vecmath.Matrix4d superpose(javax.vecmath.Point3d[] fixed, javax.vecmath.Point3d[] moved)
SuperPosition
The two point arrays have to be of the same length and the order of points have to be the same, so that a specific position in the one array is equivalent to the same position in the other array.
fixed
- point array as reference, onto which the other point array is
superposed. Original coordinates will not be modified.moved
- point array to which the resulting transformation matrix is
applied. Original coordinates will not be modified.public double getWeightedRmsd(javax.vecmath.Point3d[] fixed, javax.vecmath.Point3d[] moved, double[] weight)
fixed
- moved
- weight
- array of weigths for each equivalent point positionpublic javax.vecmath.Matrix4d superposeAfterRmsd()
getRmsd(Point3d[], Point3d[])
method
and calculates the transformation of the same two point arrays.fixed
- moved
- Copyright © 2000–2019 BioJava. All rights reserved.