Class SuperPositionSVD
- java.lang.Object
-
- org.biojava.nbio.structure.geometry.SuperPositionAbstract
-
- org.biojava.nbio.structure.geometry.SuperPositionSVD
-
- All Implemented Interfaces:
SuperPosition
public class SuperPositionSVD extends SuperPositionAbstract
A class that calculates the superposition between two sets of points using an SVD Matrix Decomposition. It was introduced by Wolfgang Kabsch, hence the alternative name Kabsh algorithm. Inspired by the biopython SVDSuperimposer class.- Since:
- 1.5
- Version:
- %I% %G%
- Author:
- Andreas Prlic, Aleix Lafita
-
-
Field Summary
-
Fields inherited from class org.biojava.nbio.structure.geometry.SuperPositionAbstract
centered
-
-
Constructor Summary
Constructors Constructor Description SuperPositionSVD(boolean centered)
Constructor for the SVD superposition algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getRmsd(javax.vecmath.Point3d[] x, javax.vecmath.Point3d[] y)
Calculate the RMSD between two arrays of equivalent points that are not superposed.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.-
Methods inherited from class org.biojava.nbio.structure.geometry.SuperPositionAbstract
checkInput, setCentered, superposeAndTransform
-
-
-
-
Constructor Detail
-
SuperPositionSVD
public SuperPositionSVD(boolean centered)
Constructor for the SVD superposition algorithm.- Parameters:
centered
- true if the point arrays are centered at the origin (faster), false otherwise
-
-
Method Detail
-
superpose
public javax.vecmath.Matrix4d superpose(javax.vecmath.Point3d[] fixed, javax.vecmath.Point3d[] moved)
Description copied from interface:SuperPosition
Obtain the superposition matrix that minimizes the RMSD between two arrays of equivalent points.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.
- Parameters:
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.- Returns:
- transformation matrix as a Matrix4d to superpose moved onto fixed point arrays
-
getRmsd
public double getRmsd(javax.vecmath.Point3d[] x, javax.vecmath.Point3d[] y)
Description copied from interface:SuperPosition
Calculate the RMSD between two arrays of equivalent points that are not superposed.This is equivalent to first superposing the point arrays with
SuperPosition.superposeAndTransform(Point3d[], Point3d[])
and then calculating the RMSD of the superposed point arrays withCalcPoint.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.
- Parameters:
x
- an array of points. Original coordinates will not be modified.y
- an array of points. Original coordinates will not be modified.- Returns:
- the minimum RMSD between the equivalent point arrays (after superposition)
-
-