Package org.jmol.quantum
Class NMRNoeMatrix
- java.lang.Object
-
- org.jmol.quantum.NMRNoeMatrix
-
public class NMRNoeMatrix extends java.lang.ObjectClass for calculating NOE intensities by full matrix relaxation approach.create an instance of the class:
NoeMatrix n = new NoeMatrix();
Create the atom list:
n.makeAtomList(x);
where x is the number of atoms (methyls count as 1). add the atoms in turn with:
n.addAtom(x,y,z);
where x y and z are the atom coordinates, or:
n.addMethyl(x,y,z,x1,y1,z1,x2,y2,z2);
which does the same for a methyl. T
hen just call calcNOEs:
double[][] results = n.calcNOEs();
This will need to be in a try statement as this routine throws an exception if the atoms have not been set up properly.
- Author:
- YE91009
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classNMRNoeMatrix.NOEAtomstatic classNMRNoeMatrix.NOEParams
-
Field Summary
Fields Modifier and Type Field Description (package private) intatomCounterprivate int[]atomMap(package private) NMRNoeMatrix.NOEAtom[]atomsprivate intbaseIndexfirst index for this frame(package private) double[][]distanceMatrix(package private) double[][]eigenValues(package private) double[][]eigenVectors(package private) inti(package private) static intid(package private) intj(package private) intk(package private) intm(package private) intn(package private) intnHAtoms(package private) double[][]noeM(package private) intpprivate NMRNoeMatrix.NOEParamsparams(package private) intq(package private) double[][]relaxMatrix
-
Constructor Summary
Constructors Modifier Constructor Description privateNMRNoeMatrix()privateNMRNoeMatrix(NMRNoeMatrix.NOEParams params)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAtom(double x, double y, double z)add a proton to the atom listvoidaddEquiv(double[] xa, double[] ya, double[] za)voidaddMethyl(double x, double y, double z, double x1, double y1, double z1, double x2, double y2, double z2)Add a methyl group to the atom listprivate voidcalcNoeMatrix()voidcalcNOEs()calculate the NOESY spectrum at a particular mixing time.private voidcalcRelaxMatrix()private static javajs.util.Lst<java.lang.Object>createHAtomList(Viewer viewer, javajs.util.BS bsMol, javajs.util.BS bsH, java.util.Map<Atom,java.lang.String> labels, java.util.Map<java.lang.String,javajs.util.Lst<Atom>> labelMap)private static java.util.Map<java.lang.String,javajs.util.Lst<Atom>>createLabelMapAndIndex(Viewer viewer, javajs.util.BS bsMol, java.lang.String[] labelArray, javajs.util.BS bsH, java.util.Map<Atom,java.lang.String> labels, java.util.Map<Atom,java.lang.Integer> indexAtomInMol)static NMRNoeMatrixcreateMatrix(Viewer viewer, javajs.util.BS bsMol, java.lang.String[] labelArray, NMRNoeMatrix.NOEParams params)private static NMRNoeMatrixcreateNOEMatrix(javajs.util.Lst<java.lang.Object> hAtoms, java.util.Map<Atom,java.lang.Integer> indexAtomInMol, int atomCount, int baseIndex, NMRNoeMatrix.NOEParams params)Create noeMatix and indexAtomInNoeMatrix from hAtoms and indexAtomInMol.private intDiagonalise()private doubledistanceSqrd(NMRNoeMatrix.NOEAtom a, NMRNoeMatrix.NOEAtom b)private doublegetDistance(int i, int j)doublegetJmolDistance(int a, int b)doublegetJmolNoe(int a, int b)private doublegetNoe(int i, int j)NMRNoeMatrix.NOEParamsgetParams()voidinitArrays(int n)create an empty atom list for subsequent population with atomsprivate static doubleJ(double w, double tau)private doublemaxOffDiag()private voidrotate()private intsign(double x)java.lang.StringtoString()java.lang.StringtoStringNormRow()
-
-
-
Field Detail
-
id
static int id
-
eigenValues
double[][] eigenValues
-
eigenVectors
double[][] eigenVectors
-
relaxMatrix
double[][] relaxMatrix
-
noeM
double[][] noeM
-
distanceMatrix
double[][] distanceMatrix
-
atoms
NMRNoeMatrix.NOEAtom[] atoms
-
nHAtoms
int nHAtoms
-
atomCounter
int atomCounter
-
i
int i
-
j
int j
-
k
int k
-
m
int m
-
n
int n
-
p
int p
-
q
int q
-
atomMap
private int[] atomMap
-
baseIndex
private int baseIndex
first index for this frame
-
params
private final NMRNoeMatrix.NOEParams params
-
-
Constructor Detail
-
NMRNoeMatrix
private NMRNoeMatrix()
-
NMRNoeMatrix
private NMRNoeMatrix(NMRNoeMatrix.NOEParams params)
-
-
Method Detail
-
createMatrix
public static NMRNoeMatrix createMatrix(Viewer viewer, javajs.util.BS bsMol, java.lang.String[] labelArray, NMRNoeMatrix.NOEParams params)
-
getParams
public NMRNoeMatrix.NOEParams getParams()
-
createNOEMatrix
private static NMRNoeMatrix createNOEMatrix(javajs.util.Lst<java.lang.Object> hAtoms, java.util.Map<Atom,java.lang.Integer> indexAtomInMol, int atomCount, int baseIndex, NMRNoeMatrix.NOEParams params)
Create noeMatix and indexAtomInNoeMatrix from hAtoms and indexAtomInMol.- Parameters:
hAtoms-indexAtomInMol-atomCount-baseIndex-params-- Returns:
- NoeMatrix object
-
calcNOEs
public void calcNOEs() throws java.lang.Exceptioncalculate the NOESY spectrum at a particular mixing time. Onc eyou have created and built the atom list, this is the only function you need to call.- Throws:
java.lang.Exception- Description of the Exceptionjava.lang.Exception- Throws an exception when the atom list has not been created or is not properly filled with atoms
-
initArrays
public void initArrays(int n)
create an empty atom list for subsequent population with atoms- Parameters:
n- the number of atoms to be added
-
addAtom
public void addAtom(double x, double y, double z)add a proton to the atom list- Parameters:
x- the x position of the atom (in Angstroms)y- the x position of the atom (in Angstroms)z- the z position of the atom (in Angstroms)
-
addMethyl
public void addMethyl(double x, double y, double z, double x1, double y1, double z1, double x2, double y2, double z2)Add a methyl group to the atom list- Parameters:
x- the x position of atom 1 (in Angstroms)y- the y position of atom 1 (in Angstroms)z- the z position of atom 1 (in Angstroms)x1- the x position of atom 2 (in Angstroms)y1- the y position of atom 2 (in Angstroms)z1- the z position of atom 2 (in Angstroms)x2- the x position of atom 3 (in Angstroms)y2- the y position of atom 3 (in Angstroms)z2- the z position of atom 3 (in Angstroms)
-
addEquiv
public void addEquiv(double[] xa, double[] ya, double[] za)
-
calcRelaxMatrix
private void calcRelaxMatrix()
-
J
private static double J(double w, double tau)
-
sign
private int sign(double x)
-
calcNoeMatrix
private void calcNoeMatrix()
-
Diagonalise
private int Diagonalise()
-
maxOffDiag
private double maxOffDiag()
-
rotate
private void rotate()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStringNormRow
public java.lang.String toStringNormRow()
-
distanceSqrd
private double distanceSqrd(NMRNoeMatrix.NOEAtom a, NMRNoeMatrix.NOEAtom b)
-
createLabelMapAndIndex
private static java.util.Map<java.lang.String,javajs.util.Lst<Atom>> createLabelMapAndIndex(Viewer viewer, javajs.util.BS bsMol, java.lang.String[] labelArray, javajs.util.BS bsH, java.util.Map<Atom,java.lang.String> labels, java.util.Map<Atom,java.lang.Integer> indexAtomInMol)
-
createHAtomList
private static javajs.util.Lst<java.lang.Object> createHAtomList(Viewer viewer, javajs.util.BS bsMol, javajs.util.BS bsH, java.util.Map<Atom,java.lang.String> labels, java.util.Map<java.lang.String,javajs.util.Lst<Atom>> labelMap)
-
getJmolDistance
public double getJmolDistance(int a, int b)
-
getDistance
private double getDistance(int i, int j)
-
getJmolNoe
public double getJmolNoe(int a, int b)
-
getNoe
private double getNoe(int i, int j)
-
-