Package org.jmol.quantum
Class NMRCalculation
- java.lang.Object
-
- org.jmol.quantum.NMRCalculation
-
- All Implemented Interfaces:
JmolNMRInterface
public class NMRCalculation extends Object implements JmolNMRInterface
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static Hashtable<String,Double>
deltaElectro
Calculate an H-X-X-H or C-X-X-H coupling constant.private static double
DIPOLAR_FACTOR
private static double
e_charge
private static double
h_bar_planck
private static double
h_planck
private Map<String,double[]>
isotopeData
isotopeData keyed by nnnSym, for example: 1H, 19F, etc.; and also by element name itself: H, F, etc., for defaultprivate static double
J_FACTOR
static String
JCH3_AYDIN_GUETHER
static String
JCH3_NONE
static String
JCH3_TVAROSKA_TARAVEL
static String
JCH3_WASYLISHEN_SCHAEFER
private static int
MAGNETOGYRIC_RATIO
static int
MODE_CALC_2JHH
static int
MODE_CALC_3JCH
static int
MODE_CALC_3JHH
static int
MODE_CALC_ALL
static int
MODE_CALC_INVALID
static int
MODE_CALC_J
static int
MODE_CALC_JHH
static int
MODE_CALC_NOE
(package private) static double[][]
pAltona
private static double
Q_FACTOR
private static int
QUADRUPOLE_MOMENT
private static String
resource
NOTE! Do not change this txt file! Instead, edit trunk/Jmol/_documents/nmr_data.xls and then clip its contents to org/jmol/quantum/nmr_data.txt.private Map<String,Float>
shiftRefsPPM
private Viewer
vwr
-
Constructor Summary
Constructors Constructor Description NMRCalculation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static double[]
calc2JHH(Atom h1, Atom c, Atom h2)
static double[]
calc2or3JorNOE(Viewer viewer, Atom[] atoms, String CHEquation, int mode)
Calculate a 2-bond (geminal) or 3-bond (vicinal) coupling constant or an NOE;static double
calc3JCH(String CHequation, double theta, boolean is23Double)
private static double
calc3JHHOnly(String[][] subElements, javajs.util.V3[][] subVectors, javajs.util.V3 v21, javajs.util.V3 v34, javajs.util.V3 v23, double theta, boolean is23Double)
static double
calcJKarplus(double theta)
static double[]
calcNOE(Viewer viewer, Atom atom1, Atom atom2)
private static double[]
calcNOEImpl(Viewer viewer, Atom atom1, Atom atom2)
private javajs.util.BS
getAtomSiteBS(javajs.util.BS bsA)
Interaction tensors are not repeated for every possible combination.static int
getCalcType(Atom[] atoms, String[] elementsToFill, int mode)
float
getChemicalShift(Atom atom)
If shift reference has not been set, it defaults to 0 and just displays the negative of magnetic shieldingprivate void
getData()
Creates the data set necessary for doing NMR calculations.float
getDipolarConstantHz(Atom a1, Atom a2)
float
getDipolarCouplingHz(Atom a1, Atom a2, javajs.util.V3 vField)
private static double
getIncrementalJValue(int nNonH, String element, javajs.util.V3 sA_cA, javajs.util.V3 v21, javajs.util.V3 v23, double theta, int f)
Object
getInfo(String what)
private static double
getInitialJValue(int nNonH, double theta)
private javajs.util.Lst<Tensor>
getInteractionTensorList(String type, javajs.util.BS bsA)
Returns a list of tensors that are of the specified type and have both atomIndex1 and atomIndex2 in bsA.private String
getISCtype(Atom a1, String type)
float
getIsoOrAnisoHz(boolean isIso, Atom a1, Atom a2, String units, Tensor isc)
If t is null, then a1, a2, and type are used to find the appropriate tensor.private double
getIsotopeData(Atom a, int iType)
Get magnetogyricRatio (gamma/10^7 rad s^-1 T^-1) and quadrupoleMoment (Q/10^-2 fm^2) for a given isotope or for the default isotope of an element.float
getJCouplingHz(Atom a1, Atom a2, String type, Tensor isc)
float
getMagneticShielding(Atom atom)
Map<String,Integer>
getMinDistances(MeasurementData md)
double[]
getNOEorJHH(Atom[] atoms, int mode)
float
getQuadrupolarConstant(Tensor efg)
Quadrupolar constant, directly proportional to Vzz and dependent on the quadrupolar moment of the isotope consideredboolean
getState(javajs.util.SB sb)
private static int
getSubSign(javajs.util.V3 sA_cA, javajs.util.V3 v21, javajs.util.V3 v23, int f)
Look for sign of (v23 x v21).dot.(sA_cA).javajs.util.Lst<Object>
getTensorInfo(String tensorType, String infoType, javajs.util.BS bs)
javajs.util.BS
getUniqueTensorSet(javajs.util.BS bsAtoms)
An attempt to find unique atoms using tensors.boolean
setChemicalShiftReference(String element, float value)
JmolNMRInterface
setViewer(Viewer vwr)
-
-
-
Field Detail
-
MAGNETOGYRIC_RATIO
private static final int MAGNETOGYRIC_RATIO
- See Also:
- Constant Field Values
-
QUADRUPOLE_MOMENT
private static final int QUADRUPOLE_MOMENT
- See Also:
- Constant Field Values
-
e_charge
private static final double e_charge
- See Also:
- Constant Field Values
-
h_planck
private static final double h_planck
- See Also:
- Constant Field Values
-
h_bar_planck
private static final double h_bar_planck
- See Also:
- Constant Field Values
-
DIPOLAR_FACTOR
private static final double DIPOLAR_FACTOR
- See Also:
- Constant Field Values
-
J_FACTOR
private static final double J_FACTOR
- See Also:
- Constant Field Values
-
Q_FACTOR
private static final double Q_FACTOR
- See Also:
- Constant Field Values
-
MODE_CALC_INVALID
public static final int MODE_CALC_INVALID
- See Also:
- Constant Field Values
-
MODE_CALC_2JHH
public static final int MODE_CALC_2JHH
- See Also:
- Constant Field Values
-
MODE_CALC_3JHH
public static final int MODE_CALC_3JHH
- See Also:
- Constant Field Values
-
MODE_CALC_JHH
public static final int MODE_CALC_JHH
- See Also:
- Constant Field Values
-
MODE_CALC_3JCH
public static final int MODE_CALC_3JCH
- See Also:
- Constant Field Values
-
MODE_CALC_J
public static final int MODE_CALC_J
- See Also:
- Constant Field Values
-
MODE_CALC_NOE
public static final int MODE_CALC_NOE
- See Also:
- Constant Field Values
-
MODE_CALC_ALL
public static final int MODE_CALC_ALL
- See Also:
- Constant Field Values
-
vwr
private Viewer vwr
-
isotopeData
private Map<String,double[]> isotopeData
isotopeData keyed by nnnSym, for example: 1H, 19F, etc.; and also by element name itself: H, F, etc., for default
-
resource
private static final String resource
NOTE! Do not change this txt file! Instead, edit trunk/Jmol/_documents/nmr_data.xls and then clip its contents to org/jmol/quantum/nmr_data.txt.- See Also:
- Constant Field Values
-
deltaElectro
static Hashtable<String,Double> deltaElectro
Calculate an H-X-X-H or C-X-X-H coupling constant. Use Altoona equation (Tetrahedron 36, 2783-2792) If there are fewer than three substituents on each central atom, or if either central atom is not carbon, defaults to general Karplus equation.
-
pAltona
static double[][] pAltona
-
JCH3_NONE
public static final String JCH3_NONE
- See Also:
- Constant Field Values
-
JCH3_WASYLISHEN_SCHAEFER
public static final String JCH3_WASYLISHEN_SCHAEFER
- See Also:
- Constant Field Values
-
JCH3_TVAROSKA_TARAVEL
public static final String JCH3_TVAROSKA_TARAVEL
- See Also:
- Constant Field Values
-
JCH3_AYDIN_GUETHER
public static final String JCH3_AYDIN_GUETHER
- See Also:
- Constant Field Values
-
-
Method Detail
-
setViewer
public JmolNMRInterface setViewer(Viewer vwr)
- Specified by:
setViewer
in interfaceJmolNMRInterface
-
getQuadrupolarConstant
public float getQuadrupolarConstant(Tensor efg)
Description copied from interface:JmolNMRInterface
Quadrupolar constant, directly proportional to Vzz and dependent on the quadrupolar moment of the isotope considered- Specified by:
getQuadrupolarConstant
in interfaceJmolNMRInterface
- Returns:
- float value
-
getInteractionTensorList
private javajs.util.Lst<Tensor> getInteractionTensorList(String type, javajs.util.BS bsA)
Returns a list of tensors that are of the specified type and have both atomIndex1 and atomIndex2 in bsA. If there is just one atom specified, then the list is "all tensors involving this atom". We have to use atom sites, because interaction tensors are not duplicated.- Parameters:
type
-bsA
-- Returns:
- list of Tensors
-
getAtomSiteBS
private javajs.util.BS getAtomSiteBS(javajs.util.BS bsA)
Interaction tensors are not repeated for every possible combination. They are just for the base atom set. These are identified as a.atomIndex == models[b.modelIndex].firstAtomIndex + b.atomSite - 1- Parameters:
bsA
-- Returns:
- new bs in terms of atom sites
-
getUniqueTensorSet
public javajs.util.BS getUniqueTensorSet(javajs.util.BS bsAtoms)
Description copied from interface:JmolNMRInterface
An attempt to find unique atoms using tensors.- Specified by:
getUniqueTensorSet
in interfaceJmolNMRInterface
- Returns:
- bitset of atoms
-
getIsoOrAnisoHz
public float getIsoOrAnisoHz(boolean isIso, Atom a1, Atom a2, String units, Tensor isc)
Description copied from interface:JmolNMRInterface
If t is null, then a1, a2, and type are used to find the appropriate tensor.- Specified by:
getIsoOrAnisoHz
in interfaceJmolNMRInterface
- Returns:
- 0 if not found
-
getDipolarConstantHz
public float getDipolarConstantHz(Atom a1, Atom a2)
- Specified by:
getDipolarConstantHz
in interfaceJmolNMRInterface
- Returns:
- desired constant
-
getDipolarCouplingHz
public float getDipolarCouplingHz(Atom a1, Atom a2, javajs.util.V3 vField)
- Specified by:
getDipolarCouplingHz
in interfaceJmolNMRInterface
- Returns:
- projected value
-
getIsotopeData
private double getIsotopeData(Atom a, int iType)
Get magnetogyricRatio (gamma/10^7 rad s^-1 T^-1) and quadrupoleMoment (Q/10^-2 fm^2) for a given isotope or for the default isotope of an element.- Parameters:
a
-iType
-- Returns:
- g or Q
-
getData
private void getData()
Creates the data set necessary for doing NMR calculations. Values are retrievable using getProperty "nmrInfo" "Xx"; each entry is float[+/-isotopeNumber, g, Q], where [0] < 0 for the default value.
-
getInfo
public Object getInfo(String what)
- Specified by:
getInfo
in interfaceJmolNMRInterface
- Parameters:
what
- "C" or "14C" or "all"- Returns:
- list of double[isotopeNumber,g,Q] if no isotope number is given, or a single double[] if it does.
-
getChemicalShift
public float getChemicalShift(Atom atom)
Description copied from interface:JmolNMRInterface
If shift reference has not been set, it defaults to 0 and just displays the negative of magnetic shielding- Specified by:
getChemicalShift
in interfaceJmolNMRInterface
- Returns:
- value
-
getMagneticShielding
public float getMagneticShielding(Atom atom)
- Specified by:
getMagneticShielding
in interfaceJmolNMRInterface
-
getState
public boolean getState(javajs.util.SB sb)
- Specified by:
getState
in interfaceJmolNMRInterface
-
setChemicalShiftReference
public boolean setChemicalShiftReference(String element, float value)
- Specified by:
setChemicalShiftReference
in interfaceJmolNMRInterface
-
getTensorInfo
public javajs.util.Lst<Object> getTensorInfo(String tensorType, String infoType, javajs.util.BS bs)
- Specified by:
getTensorInfo
in interfaceJmolNMRInterface
-
getMinDistances
public Map<String,Integer> getMinDistances(MeasurementData md)
- Specified by:
getMinDistances
in interfaceJmolNMRInterface
-
calcJKarplus
public static double calcJKarplus(double theta)
-
getInitialJValue
private static double getInitialJValue(int nNonH, double theta)
-
getIncrementalJValue
private static double getIncrementalJValue(int nNonH, String element, javajs.util.V3 sA_cA, javajs.util.V3 v21, javajs.util.V3 v23, double theta, int f)
-
getSubSign
private static int getSubSign(javajs.util.V3 sA_cA, javajs.util.V3 v21, javajs.util.V3 v23, int f)
Look for sign of (v23 x v21).dot.(sA_cA). But note that for the second carbon, we must reverse this.- Parameters:
sA_cA
- C to subv21
- C to Hv23
- C to other Cf
- 1 for carbon A; -1 for carbon B- Returns:
- f or -f (+1 or -1)
-
calc3JHHOnly
private static double calc3JHHOnly(String[][] subElements, javajs.util.V3[][] subVectors, javajs.util.V3 v21, javajs.util.V3 v34, javajs.util.V3 v23, double theta, boolean is23Double)
- Parameters:
subElements
- int[2][3] with element namessubVectors
- V3[2][4] with vectors TO these substituents from their respective centersv21
- vector from cA to hAv34
- vector from cB to hBv23
- vector from cA to cBtheta
- dihedral angle hA-cA-cB-hBis23Double
-- Returns:
- estimated coupling constant
-
calc3JCH
public static double calc3JCH(String CHequation, double theta, boolean is23Double)
- Parameters:
CHequation
- 'was' Simple equation for 3JCH, from Wasylishen and Schaefer Can J Chem (1973) 51 961 used in Kozerski et al. J Chem Soc Perkin 2, (1997) 1811 'tva' Tvaroska and Taravel Adv. Carbohydrate Chem. Biochem. (1995) 51, 15-61 'ayd' Aydin and Guether Mag. Res. Chem. (1990) 28, 448-457theta
- dihedralis23Double
-- Returns:
- 3JCH prediction
-
calc2or3JorNOE
public static double[] calc2or3JorNOE(Viewer viewer, Atom[] atoms, String CHEquation, int mode)
Calculate a 2-bond (geminal) or 3-bond (vicinal) coupling constant or an NOE;- Parameters:
viewer
-atoms
- required Atom[4]; can be just two atoms, then in atom[0] and atom[4]CHEquation
- 'none' or 'was' or 'tva' or 'ayd'mode
-- Returns:
- [theta, jvalue, atom2.i, atom3.i] for 3JHH; [theta, jvalue, center.i] for 2JHH; [distance, noe] for NOE
-
getNOEorJHH
public double[] getNOEorJHH(Atom[] atoms, int mode)
- Specified by:
getNOEorJHH
in interfaceJmolNMRInterface
-
-