|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmeshi.util.overlap.Overlap
public class Overlap
Kabsch algorithm for optimal superposition.
The following class implements the procedure for obtaining
the best rotation to relate two sets of vectors as described
in papers:
1. "A solution for the best rotation to relate two sets of vectors". By Wolfgang Kabsch, Acta Cryst. (1976) A 32: 922-923
2. "A discussion of the solution for the best rotation to relate two sets
of vectors". By Wolfgang Kabsch, Acta Cryst. (1978). A34, 827-828 .
| Field Summary | |
|---|---|
private static double[][] |
bvector
|
private static java.lang.String |
comment
|
private static java.lang.String |
comment2
|
private static double[][] |
coor
|
private static double[][] |
coor2
|
private static double[] |
eigenv
|
private static double[][] |
eigenVectors
|
private static double |
eps
|
private static double[][] |
help
|
private static int |
npt
|
private static double |
rms
|
private static double[][] |
temp
|
private static double[][] |
Umatrix
|
| Constructor Summary | |
|---|---|
Overlap(double[][] co,
double[][] co2,
int n,
java.lang.String com,
java.lang.String com2)
|
|
| Method Summary | |
|---|---|
static double[][] |
calcBvectors()
Calculating the B vectors (equation 12 at Kabsch-1976) |
static double[] |
calcCharPol(double[][] mat)
this function will calculate the characteristic polynom after caululating the determinant manually |
static void |
calculateRms()
|
static void |
checkEigenval(double[] eigenval)
We now have to find the corresponding eigenvectors so we check if all eigenvalues are different or not. |
static void |
checkEigenVec()
In order to get the proper rotation matrix (kabsch 1978) when a1,a2,a3 are out eigenvectors we make sure that a1*a2 = a3 |
static double[][] |
copyMat(double[][] mat)
|
static double[][] |
createP()
Building a P matrix according to equation 10 which is R*Rt(1976) |
static double[][] |
createR()
Building the R matrix according to equation 7 at the Kabsch paper (1976) |
static void |
createUmatrix(double[][] bVectors)
Creating the U matrix, the rotation matrix. |
static double[] |
findEigenval(double[] charpol)
In order to find the 3 eigenValues of P, which is a positive definite matrix, we are solving a cubic equation |
static double[][] |
findEigenvec1(double[] eigenval)
Incase all 3 eigenvalues are different (most cases) in order to derive the eigenvectors we use the Gauss elimination procedure with scaled pivoting |
static double[][] |
findEigenvec2(double[] eigenval)
FIND EIGEN VEC 2 |
static double |
findMax(double a,
double b)
|
static double |
findMaxAbs(double a,
double b)
some help functions |
static double |
findMin(double a,
double b)
|
static void |
gravityCenter()
Uniting the gravity center of both proteins to (0,0,0) |
private static void |
initiateFields(double[][] co,
double[][] co2,
int n,
java.lang.String com,
java.lang.String com2)
A function that initializes all the class fields so that all the other functions can use them |
double |
rms()
|
static double |
rmsPartial(double[][] co,
double[][] co2,
int[] partList)
Finds the RMS according to a small subset of the two proteins. |
static double |
rmsPartialAltRMS(double[][] co,
double[][] co2,
int[] partList)
This is exactly the same as 'rmsPartial' except that the rms is calculated on the subset only. |
double[][] |
rotationMatrix()
|
private static double[] |
sortEigenval(double[] eigenval)
this function sorts the eigenvalues in descending order, according to Kabsch(1978) so we obtain the proper rotation matrix |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static double[][] coor
private static double[][] coor2
private static double[][] temp
private static java.lang.String comment
private static java.lang.String comment2
private static int npt
private static double[][] help
private static double[] eigenv
private static double[][] eigenVectors
private static double[][] bvector
private static double[][] Umatrix
private static double eps
private static double rms
| Constructor Detail |
|---|
public Overlap(double[][] co,
double[][] co2,
int n,
java.lang.String com,
java.lang.String com2)
| Method Detail |
|---|
public double[][] rotationMatrix()
public double rms()
private static void initiateFields(double[][] co,
double[][] co2,
int n,
java.lang.String com,
java.lang.String com2)
public static void gravityCenter()
public static double[][] createR()
public static double[][] createP()
public static double[] calcCharPol(double[][] mat)
public static double[] findEigenval(double[] charpol)
private static double[] sortEigenval(double[] eigenval)
public static void checkEigenval(double[] eigenval)
public static double[][] findEigenvec1(double[] eigenval)
public static double[][] findEigenvec2(double[] eigenval)
public static void checkEigenVec()
public static double[][] calcBvectors()
public static void createUmatrix(double[][] bVectors)
public static void calculateRms()
public static double findMaxAbs(double a,
double b)
public static double findMin(double a,
double b)
public static double findMax(double a,
double b)
public static double[][] copyMat(double[][] mat)
public static double rmsPartial(double[][] co,
double[][] co2,
int[] partList)
public static double rmsPartialAltRMS(double[][] co,
double[][] co2,
int[] partList)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||