belka.geom
Class Kabscher

java.lang.Object
  extended by belka.geom.Kabscher

public class Kabscher
extends Object

The implementation of the Kabsch algorith for least-square fitting of two sets of points as describe in:
W. Kabsch, A solution for the best rotation to relate two sets of vectors. Acta Cryst. (1976). A32, 922-923.
W. Kabsch, A discussion of the solution for the best rotation to relate two sets of vectors. Acta Cryst. (1978). A34, 827-828.
The code is adapted from the protein geometry library http://geometry.molmovdb.org/

Author:
Alexej Abyzov

Constructor Summary
Kabscher()
           
 
Method Summary
 double fit(Atom[] atoms1, Atom[] atoms2)
          The function performs least-square fit of given atoms.
 double fitCA(Chain[] chains1, Chain[] chains2)
          The function performs least-square fit of C-alpha protein or P-phosphate nucleotide atoms and returns RMSD of the fit.
 double fitCA(Chain[] chains1, Chain[] chains2, boolean selected)
          The function performs least-square fit of C-alpha protein or P-phosphate nucleotide atoms and returns RMSD of the fit.
 double fitCA(Chain c1, Chain c2)
          The function performs least-square fit of C-alpha protein or P-phosphate nucleotide atoms and returns RMSD of the fit.
 double fitCA(Chain chain1, Chain chain2, boolean selected)
          The function performs least-square fit of C-alpha protein or P-phosphate nucleotide atoms and returns RMSD of the fit.
 int getNFitted()
          Returns number of fitted atoms.
 double getRMSD()
          Returns RMSD of fit.
 double[][] getRotation()
          Returns rotation matrix.
 double[][] getRotationCopy()
          Returns copy of rotation matrix.
 double[] getTranslation()
          Returns translation vector.
 double[] getTranslationCopy()
          Returns copy translation vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Kabscher

public Kabscher()
Method Detail

getRotation

public double[][] getRotation()
Returns rotation matrix.

Returns:
rotation matrix.

getRotationCopy

public double[][] getRotationCopy()
Returns copy of rotation matrix.

Returns:
copy of rotation matrix.

getTranslation

public double[] getTranslation()
Returns translation vector.

Returns:
translation vector.

getTranslationCopy

public double[] getTranslationCopy()
Returns copy translation vector.

Returns:
copy translation vector.

getNFitted

public int getNFitted()
Returns number of fitted atoms.

Returns:
number of fitted atoms.

getRMSD

public double getRMSD()
Returns RMSD of fit.

Returns:
RMSD of fit.

fitCA

public double fitCA(Chain c1,
                    Chain c2)
The function performs least-square fit of C-alpha protein or P-phosphate nucleotide atoms and returns RMSD of the fit. All aligned atoms are used in the fit. Current alignment of the chains is used.

Parameters:
c1 - first chain.
c2 - second chain.
Returns:
rmsd of the fit.

fitCA

public double fitCA(Chain[] chains1,
                    Chain[] chains2)
The function performs least-square fit of C-alpha protein or P-phosphate nucleotide atoms and returns RMSD of the fit. All aligned atoms are used in the fit. Current alignment of the chains is used.

Parameters:
chains1 - first set of chains.
chains2 - second set of chains.
Returns:
rmsd of the fit.

fitCA

public double fitCA(Chain chain1,
                    Chain chain2,
                    boolean selected)
The function performs least-square fit of C-alpha protein or P-phosphate nucleotide atoms and returns RMSD of the fit. Selected or all aligned atoms can be used in the fit. Current alignment of the chains is used.

Parameters:
chain1 - first chain.
chain2 - second chain.
selected - flag to indicate that only selected atoms must be used.
Returns:
rmsd of the fit.

fitCA

public double fitCA(Chain[] chains1,
                    Chain[] chains2,
                    boolean selected)
The function performs least-square fit of C-alpha protein or P-phosphate nucleotide atoms and returns RMSD of the fit. Selected or all aligned atoms can be used in the fit. Current alignment of the chains is used.

Parameters:
chains1 - first set of chains.
chains2 - second set of chains.
selected - flag to indicate that only selected atoms must be used.
Returns:
rmsd of the fit.

fit

public double fit(Atom[] atoms1,
                  Atom[] atoms2)
The function performs least-square fit of given atoms.

Parameters:
atoms1 - first array with atoms.
atoms2 - second array with atoms.
Returns:
rmsd of the fit.