Package org.jmol.minimize.forcefield
Class ForceFieldMMFF
java.lang.Object
org.jmol.minimize.forcefield.ForceField
org.jmol.minimize.forcefield.ForceFieldMMFF
MMFF94 implementation 5/14/2012
- fully validated for atom types and charges
- reasonably well validated for energies (see below)
- TODO: add UFF for preliminary/backup calculation
- Author:
- Bob Hanson hansonr@stolaf.edu Java implementation by Bob Hanson 5/2012 based loosely on chemKit code by Kyle Lutz and OpenBabel code by Tim Vandermeersch but primarily from what is described in T. A. Halgren; "Merck Molecular Force Field. V. Extension of MMFF94 Using Experimental Data, Additional Computational Data, and Empirical Rules", J. Comp. Chem. 5 & 6 616-641 (1996). Parameter files are clipped from the original Wiley FTP site supplemental material: ftp://ftp.wiley.com/public/journals/jcc/suppmat/17/490/MMFF-I_AppendixB.ascii Original work, as listed at http://towhee.sourceforge.net/forcefields/mmff94.html: T. A. Halgren; "Merck Molecular Force Field. I. Basis, Form, Scope, Parameterization, and Performance of MMFF94", J. Comp. Chem. 5 & 6 490-519 (1996). T. A. Halgren; "Merck Molecular Force Field. II. MMFF94 van der Waals and Electrostatic Parameters for Intermolecular Interactions", J. Comp. Chem. 5 & 6 520-552 (1996). T. A. Halgren; "Merck Molecular Force Field. III. Molecular Geometries and Vibrational Frequencies for MMFF94", J. Comp. Chem. 5 & 6 553-586 (1996). T. A. Halgren; R. B. Nachbar; "Merck Molecular Force Field. IV. Conformational Energies and Geometries for MMFF94", J. Comp. Chem. 5 & 6 587-615 (1996). T. A. Halgren; "Merck Molecular Force Field. V. Extension of MMFF94 Using Experimental Data, Additional Computational Data, and Empirical Rules", J. Comp. Chem. 5 & 6 616-641 (1996). T. A. Halgren; "MMFF VII. Characterization of MMFF94, MMFF94s, and Other Widely Available Force Fields for Conformational Energies and for Intermolecular-Interaction Energies and Geometries", J. Comp. Chem. 7 730-748 (1999). Validation carried out using MMFF94_opti.log and MMFF94_dative.mol2 (or MMFF94_hypervalent.mol2) including 761 models using org/jmol/minimize/forcefield/mmff/validate/checkmm.spt (checkAllEnergies) All typical compounds validate. The following 7 structures do not validate to within 0.1 kcal/mol total energy; version=12.3.26_dev # code: adding empirical rules to MMFF94 calculation # # checkmm.spt;checkAllEnergies # # checking calculated energies for 761 models # 1 COMKAQ E= -7.3250003 Eref= -7.6177 diff= 0.2926998 # 2 DUVHUX10 E= 64.759995 Eref= 64.082855 diff= 0.6771393 # 3 FORJIF E= 35.978 Eref= 35.833878 diff= 0.14412308 # 4 JADLIJ E= 25.104 Eref= 24.7038 diff= 0.4001999 # 5 PHOSLA10 E= 111.232994 Eref= 112.07078 diff= 0.8377838 # 6 PHOSLB10 E= -93.479004 Eref= -92.64081 diff= 0.8381958 # # for 761 atoms, 6 have energy differences outside the range -0.1 to 0.1 # with a standard deviation of 0.05309403 # # a comment about empirical bond parameter calculation: # # // Well, guess what? As far as I can tell, in Eqn 18 on page 625, # // the reduction term and delta are zero. # # // -- at least in the program run that is at the validation site: # // OPTIMOL: Molecular and Macromolecular Optimization Package 17-Nov-98 16:01:23 # // SGI double-precision version ... Updated 5/6/98 # // # // This calculation is run only for the following three structures. In each case the # // reported validation values and values from Jmol 12.3.26_dev are shown. Clearly # // the r0 calculated and final energies are very good. subtracting off 0.008 from # // r0 would certainly not give the reported values. Something is odd there. # // # // bond red* r0(here/valid) kb(here/valid) Etotal(here/valid) # // --------------------------------------------------------------------------------------- # // OHWM1 H1-O1 0.03 0.978/0.978 7.510/7.51 -21.727/-21.72690 # // ERULE_03 Si1-P1 0.0 2.223/2.224 1.614/1.609 -2.983/ -2.93518 # // ERULE_06 N1-F1 0.0 1.381/1.379 5.372/5.438 1.582/ 1.58172 # // # // *reduction and delta terms not used in Jmol's calculation # # COMKAQ -- BATCHMIN ignores 1 of 5-membered ring torsions for a 1-oxo-2-oxa-bicyclo[3.2.0]heptane -- MMFF94_bmin.log: WARNING - Conformational Energies May Not Be Accurate DUVHUX10 -- BATCHMIN ignores 5-membered ring issue for S-S-containing ring -- MMFF94_bmin.log: WARNING - Conformational Energies May Not Be Accurate FORJIF -- BATCHMIN misses four standard 5-membered C-C ring bonds -- MMFF94_bmin.log: WARNING - Conformational Energies May Not Be Accurate JADLIJ -- BATCHMIN ignores 5-membered ring for S (note, however, this is not the case in BODKOU) -- MMFF94_bmin.log: WARNING - Conformational Energies May Not Be Accurate PHOSLA10 -- BATCHMIN ignores all 5-membered ring torsions in ring with P -- (note, however, this is not the case in CUVGAB) -- MMFF94_bmin.log: WARNING - Conformational Energies May Not Be Accurate PHOSLB10 -- BATCHMIN ignores all 5-membered ring torsions in ring with P -- (note, however, this is not the case in CUVGAB) -- MMFF94_bmin.log: WARNING - Conformational Energies May Not Be Accurate OHMW1 -- H2O complexed with hydroxide OH(-) -- I don't understand (a) why the OH(-) bond has mltb=1, and even with that I am not getting the correct ro/kb for that bond from empirical rules. Still working on that....
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private static final int
private static final int
private static javajs.util.Lst<AtomType>
private static final int[]
private static final int
private static final int
private static final int
private static final int
private static final int
private String
private static final String
private int[]
private int[]
private float[]
private static final int[]
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private int[]
private static final int[]
private javajs.util.Lst<javajs.util.BS>[]
Fields inherited from class org.jmol.minimize.forcefield.ForceField
ABI_IJ, ABI_JK, bsFixed, calc, currentStep, EANGLE, EBOND, EELECTROSTATIC, ENERGY, EOOP, ESTRBND, ETORSION, EVDW, minAngles, minAtomCount, minAtoms, minBondCount, minBonds, minimizer, minPositions, minTorsions, name, R3, R4, R5, Raromatic, TBI_AB, TBI_BC, TBI_CD, trustRadius
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Integer
applyEmpiricalRules
(MinObject o, double[] ddata, int ktype) float[]
calculatePartialCharges
(Bond[] bonds, int[] bTypes, Atom[] atoms, int[] aTypes, javajs.util.BS bsAtoms, boolean doRound) assign partial charges ala MMFF94private boolean
checkRings
(javajs.util.Lst<javajs.util.BS> v, int[] minlist, int n) void
clear()
private double
dval
(int i, int j) private int
fixOrder
(int[] a, int i, int j) private static boolean
fixTypeOrder
(int[] a, int i, int j) private boolean
fixTypes()
private float
fval
(int i, int j) String[]
static String[]
getAtomTypeDescs
(int[] types) private void
private int
getBondType
(Bond bond, AtomType at1, AtomType at2, int index1, int index2) Get the bond type: 1 biphenyl or 0 any otherprivate static double
getCovalentRadius
(int elemno) private static double
getCParam
(int elemno) private static int
getEquivalentType
(int type, int level) equivalent types for OOP and torsionsprivate Integer
(package private) double
getOutOfPlaneParameter
(int[] data) getParameters
(boolean isQuick) float[]
private double
private int
getRowFor
(int i) private static double
getRuleBondLength
(MinAtom a, MinAtom b, int boAB, boolean isAromatic) private Integer
getTorsionKey
(int type, int i, int j) private static double
getUParam
(int elemno) private static double
getVParam
(int elemno) private static double
getZParam
(int elemno) private boolean
isAromaticBond
(int a1, int a2) private static boolean
isSpecialBondType
(AtomType at1, AtomType at2) From forcefieldmmff94.cpp (flag BTij) a) single bond between atoms i and j, both i and j are not aromatic and both types have sbmb set in mmffprop.par, or b) between two aromatic atoms, but the bond is not aromatic (e.g.private int
ival
(int i, int j) private void
readParams
(BufferedReader br, int dataType, Map<Object, Object> data) private int
setAngleType
(MinAngle angle) Get the angle type: 0 The angle i-j-k is a "normal" bond angle 1 Either bond i-j or bond j-k has a bond type of 1 2 Bonds i-j and j-k each have bond types of 1; the sum is 2.boolean
setArrays
(Atom[] atoms, javajs.util.BS bsAtoms, Bond[] bonds, int rawBondCount, boolean doRound, boolean allowUnknowns) private static int[]
setAtomTypes
(Atom[] atoms, javajs.util.BS bsAtoms, SmilesMatcherInterface smartsMatcher, javajs.util.Lst<javajs.util.BS>[] vRings, boolean allowUnknowns) The file MMFF94-smarts.txt is derived from MMFF94-smarts.xlsx.private int[]
setBondTypes
(Bond[] bonds, int bondCount, javajs.util.BS bsAtoms) private static void
boolean
setModel
(javajs.util.BS bsElements, int elemnoMax) private int
Get the torsion type for [a,b,c,d], also called "FF class".private static void
sortOop
(int[] typeData) private static void
swap
(int[] a, int i, int j) private int
typeOf
(int iAtom) Methods inherited from class org.jmol.minimize.forcefield.ForceField
detectExplosion, energyAngle, energyBond, energyES, energyFull, energyOOP, energyStretchBend, energyTorsion, energyVDW, getAtomList, getBufferedReader, getCurrentStep, getEnergy, getEnergyDiff, getLogData, getNormalizedDE, log, setConstraints, setModelFields, steepestDescentInitialize, steepestDescentTakeNSteps, toUserUnits
-
Field Details
-
A4_VDW
private static final int A4_VDW- See Also:
-
A4_BNDK
private static final int A4_BNDK- See Also:
-
A4_CHRG
private static final int A4_CHRG- See Also:
-
A4_SB
private static final int A4_SB- See Also:
-
A4_SBDEF
private static final int A4_SBDEF- See Also:
-
KEY_SBDEF
private static final int KEY_SBDEF- See Also:
-
KEY_PBCI
private static final int KEY_PBCI- See Also:
-
KEY_VDW
private static final int KEY_VDW- See Also:
-
KEY_BNDK
private static final int KEY_BNDK- See Also:
-
KEY_OOP
private static final int KEY_OOP- See Also:
-
TYPE_PBCI
private static final int TYPE_PBCI- See Also:
-
TYPE_VDW
private static final int TYPE_VDW- See Also:
-
TYPE_BNDK
private static final int TYPE_BNDK- See Also:
-
TYPE_CHRG
private static final int TYPE_CHRG- See Also:
-
TYPE_BOND
private static final int TYPE_BOND- See Also:
-
TYPE_ANGLE
private static final int TYPE_ANGLE- See Also:
-
TYPE_SB
private static final int TYPE_SB- See Also:
-
TYPE_SBDEF
private static final int TYPE_SBDEF- See Also:
-
TYPE_TORSION
private static final int TYPE_TORSION- See Also:
-
TYPE_OOP
private static final int TYPE_OOP- See Also:
-
atomTypes
-
mmffParams
-
ffParams
-
rawAtomTypes
private int[] rawAtomTypes -
rawBondTypes
private int[] rawBondTypes -
rawMMFF94Charges
private float[] rawMMFF94Charges -
vRings
private javajs.util.Lst<javajs.util.BS>[] vRings -
mmff2DParams
-
names
- See Also:
-
types
private static final int[] types -
line
-
sbMap
private static final int[] sbMap -
typeData
private int[] typeData -
equivalentTypes
private static final int[] equivalentTypes
-
-
Constructor Details
-
ForceFieldMMFF
- Throws:
JmolAsyncException
-
-
Method Details
-
getAtomTypeDescriptions
-
getPartialCharges
public float[] getPartialCharges() -
clear
public void clear()- Specified by:
clear
in classForceField
-
setModel
public boolean setModel(javajs.util.BS bsElements, int elemnoMax) - Specified by:
setModel
in classForceField
-
setArrays
-
getParameters
- Throws:
JmolAsyncException
-
readParams
- Throws:
Exception
-
ival
private int ival(int i, int j) -
fval
private float fval(int i, int j) -
dval
private double dval(int i, int j) -
getAtomTypes
- Throws:
JmolAsyncException
-
setFlags
-
calculatePartialCharges
public float[] calculatePartialCharges(Bond[] bonds, int[] bTypes, Atom[] atoms, int[] aTypes, javajs.util.BS bsAtoms, boolean doRound) assign partial charges ala MMFF94- Parameters:
bonds
-bTypes
-atoms
-aTypes
-bsAtoms
-doRound
-- Returns:
- full array of partial charges
-
isSpecialBondType
From forcefieldmmff94.cpp (flag BTij) a) single bond between atoms i and j, both i and j are not aromatic and both types have sbmb set in mmffprop.par, or b) between two aromatic atoms, but the bond is not aromatic (e.g. connecting bond in biphenyl) (sbmb is 2, 3, 4, 9, 30, 37, 39, 54, 57, 58, 63, 64, 67, 75, 78, 80, 81)- Parameters:
at1
-at2
-- Returns:
- 0 or 1
-
getBondType
Get the bond type: 1 biphenyl or 0 any other- Parameters:
bond
-at1
-at2
-index1
-index2
-- Returns:
- 0 or 1
-
isAromaticBond
private boolean isAromaticBond(int a1, int a2) -
getAtomTypeDescs
-
setAtomTypes
private static int[] setAtomTypes(Atom[] atoms, javajs.util.BS bsAtoms, SmilesMatcherInterface smartsMatcher, javajs.util.Lst<javajs.util.BS>[] vRings, boolean allowUnknowns) The file MMFF94-smarts.txt is derived from MMFF94-smarts.xlsx. This file contains records for unique atom type/formal charge sharing/H atom type. For example, the MMFF94 type 6 is distributed over eight AtomTypes, each with a different SMARTS match. H atom types are given in the file as properties of other atom types, not as their own individual SMARTS searches. H atom types are determined based on their attached atom's atom type.- Parameters:
atoms
-bsAtoms
-smartsMatcher
-vRings
-allowUnknowns
-- Returns:
- array of indexes into AtomTypes or, for H, negative of mmType
-
setBondTypes
-
fixTypes
private boolean fixTypes() -
setAngleType
Get the angle type: 0 The angle i-j-k is a "normal" bond angle 1 Either bond i-j or bond j-k has a bond type of 1 2 Bonds i-j and j-k each have bond types of 1; the sum is 2. 3 The angle occurs in a three-membered ring 4 The angle occurs in a four-membered ring 5 Is in a three-membered ring and the sum of the bond types is 1 6 Is in a three-membered ring and the sum of the bond types is 2 7 Is in a four-membered ring and the sum of the bond types is 1 8 Is in a four-membered ring and the sum of the bond types is 2- Parameters:
angle
-- Returns:
- type (0-8)
-
setTorsionType
Get the torsion type for [a,b,c,d], also called "FF class". One of the following, determined in this order: 4: 4-membered ring 1: ab-cd 0: biphenyl and not 5-membered ring 5: 5-membered ring 2: a-x=x-b- Parameters:
t
-- Returns:
- type (0, 1, 2, 4, or 5)
-
typeOf
private int typeOf(int iAtom) -
checkRings
private boolean checkRings(javajs.util.Lst<javajs.util.BS> v, int[] minlist, int n) -
getKey
-
getTorsionKey
-
applyEmpiricalRules
-
getR0
-
getRowFor
private int getRowFor(int i) -
getOutOfPlaneParameter
double getOutOfPlaneParameter(int[] data) -
sortOop
private static void sortOop(int[] typeData) -
fixTypeOrder
private static boolean fixTypeOrder(int[] a, int i, int j) - Parameters:
a
-i
-j
-- Returns:
- true if swapped; false if not
-
fixOrder
private int fixOrder(int[] a, int i, int j) - Parameters:
a
-i
-j
-- Returns:
- 1 if in order, 0 if same, -1 if reversed
-
swap
private static void swap(int[] a, int i, int j) -
getEquivalentType
private static int getEquivalentType(int type, int level) equivalent types for OOP and torsions- Parameters:
type
- mmFF94 atom typelevel
- 0, 1, or 2.- Returns:
- equivalent type or 0
-
getZParam
private static double getZParam(int elemno) -
getCParam
private static double getCParam(int elemno) -
getUParam
private static double getUParam(int elemno) -
getVParam
private static double getVParam(int elemno) -
getCovalentRadius
private static double getCovalentRadius(int elemno) -
getRuleBondLength
-