Package org.jmol.smiles
Class SmilesAromatic
- java.lang.Object
-
- org.jmol.smiles.SmilesAromatic
-
public class SmilesAromatic extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static int[][]OS_PI_COUNTSIndex to inner array is covalent bond count (b) + valence (v) + charge (c, carbon only) - 4.
-
Constructor Summary
Constructors Constructor Description SmilesAromatic()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static booleanaddNormal(javajs.util.V3 vTemp, javajs.util.V3 vMean, float maxDev)adds a normal if similarity is within limits(package private) static voidcheckAromaticDefined(Node[] jmolAtoms, BS bsSelected, BS bsAromatic)Set aromatic atoms based on predefined BOND_AROMATIC definitions.private static voidcheckBridges(javajs.util.Lst<?> lst, BS bsBad, javajs.util.Lst<?> lst2, BS bsBad2, BS bs)private static voidcheckFusedRings(javajs.util.Lst<SmilesRing> rings, int[] eCounts, javajs.util.Lst<BS> lstAromatic)Add fused rings based on the Hueckel 4n+2 rule.private static intcheckHueckelAromatic(int nAtoms, Node[] jmolAtoms, BS bsAromatic, BS bsRing, int strictness, int[] eCounts)For each atom in the ring, look up a unique combination of covalent bond count, valence, and charge for each atom and use that as a key into the PI_COUNTS array.private static booleancheckStandardDeviation(javajs.util.V3[] vNorms, javajs.util.V3 vMean, int n, float cutoff)calculates a dot-product standard deviation and reports if it is below a cutoff(package private) static voidfinalizeAromatic(Node[] jmolAtoms, BS bsAromatic, javajs.util.Lst<BS> lstAromatic, javajs.util.Lst<SmilesRing> lstSP2, int[] eCounts, boolean isOpenNotStrict, boolean isStrict)Iteratively trims a set of aromatic atoms that may be initially assigned to be aromatic but because their double bonds extend to non-aromatic atoms must be removed.private static booleanisSp2Ring(int n, Node[] atoms, BS bsSelected, BS bs, float cutoff, boolean checkExplicit, boolean allowSOxide)3D-SEARCH aromaticity test.private static voidremoveBridgingRings(javajs.util.Lst<BS> lstAromatic, javajs.util.Lst<SmilesRing> lstSP2)check for any two rings with more than two common atoms and remove them from the pool(package private) static voidsetAromatic(int n, Node[] jmolAtoms, BS bsSelected, javajs.util.Lst<java.lang.Object> vR, BS bsAromatic, int strictness, boolean isOpenSMILES, boolean justCheckBonding, boolean checkExplicit, VTemp v, javajs.util.Lst<BS> vOK, javajs.util.Lst<SmilesRing> lstSP2, int[] eCounts, boolean doTestAromatic)Main entry point.
-
-
-
Field Detail
-
OS_PI_COUNTS
private static final int[][] OS_PI_COUNTS
Index to inner array is covalent bond count (b) + valence (v) + charge (c, carbon only) - 4. Special cases are listed here as -1. -2 indicates not considered aromatic (probably not possible). Many thanks to John May for the excellent visual guide that I have condensed here.
-
-
Method Detail
-
setAromatic
static void setAromatic(int n, Node[] jmolAtoms, BS bsSelected, javajs.util.Lst<java.lang.Object> vR, BS bsAromatic, int strictness, boolean isOpenSMILES, boolean justCheckBonding, boolean checkExplicit, VTemp v, javajs.util.Lst<BS> vOK, javajs.util.Lst<SmilesRing> lstSP2, int[] eCounts, boolean doTestAromatic)Main entry point. Note that unless bonds are pre-defined as aromatic, Jmol will first check for a flat ring configuration. This is 3D, after all.- Parameters:
n-jmolAtoms-bsSelected-vR-bsAromatic-strictness-isOpenSMILES-justCheckBonding-checkExplicit-v-vOK-lstSP2-eCounts-doTestAromatic-
-
checkAromaticDefined
static void checkAromaticDefined(Node[] jmolAtoms, BS bsSelected, BS bsAromatic)
Set aromatic atoms based on predefined BOND_AROMATIC definitions. Allows for totally customized creation of aromatic SMILES.- Parameters:
jmolAtoms-bsSelected-bsAromatic-
-
isSp2Ring
private static final boolean isSp2Ring(int n, Node[] atoms, BS bsSelected, BS bs, float cutoff, boolean checkExplicit, boolean allowSOxide)3D-SEARCH aromaticity test. A simple and unambiguous test for aromaticity based on 3D geometry and connectivity only, not Hueckel theory.- Parameters:
n-atoms- a set of atoms with coordinate positions and associated bonds.bs- a bitset of atoms within the set of atoms, defining the ringbsSelected- must not be nullcutoff- an arbitrary value to test the standard deviation against. 0.01 is appropriate here. Use Float.MAX_VALUE to just do bond connectivity checkcheckExplicit- check bonds that are explicit only - for XYZ and QM calcsallowSOxide- set TRUE to skip S atoms- Returns:
- true if standard deviation of vNorm.dot.vMean is less than cutoff
-
addNormal
private static final boolean addNormal(javajs.util.V3 vTemp, javajs.util.V3 vMean, float maxDev)adds a normal if similarity is within limits- Parameters:
vTemp-vMean-maxDev-- Returns:
- true if successful
-
checkStandardDeviation
private static final boolean checkStandardDeviation(javajs.util.V3[] vNorms, javajs.util.V3 vMean, int n, float cutoff)calculates a dot-product standard deviation and reports if it is below a cutoff- Parameters:
vNorms-vMean-n-cutoff-- Returns:
- true if stddev < cutoff
-
checkHueckelAromatic
private static int checkHueckelAromatic(int nAtoms, Node[] jmolAtoms, BS bsAromatic, BS bsRing, int strictness, int[] eCounts)For each atom in the ring, look up a unique combination of covalent bond count, valence, and charge for each atom and use that as a key into the PI_COUNTS array. c=X is the only special case. Final trimming will be necesseary if isStrict == true.- Parameters:
nAtoms- this ring's sizejmolAtoms- could also be constructed nodes from a SMILES stringbsAromatic- at least nominally aromatic atomsbsRing- specific atoms of this ringstrictness- 0 (not) 1 (OpenSMILES), 2 (MMFF94) standard organic chemist's Hueckel interpretation, not allowing c=OeCounts-- Returns:
- -1 if absolutely not possible, 0 if possible but not 4n+2, 1 if 4n+2
-
finalizeAromatic
static void finalizeAromatic(Node[] jmolAtoms, BS bsAromatic, javajs.util.Lst<BS> lstAromatic, javajs.util.Lst<SmilesRing> lstSP2, int[] eCounts, boolean isOpenNotStrict, boolean isStrict)
Iteratively trims a set of aromatic atoms that may be initially assigned to be aromatic but because their double bonds extend to non-aromatic atoms must be removed. Checks to see that these atoms really have two adjacent aromatic atoms and are not connected to any nonaromatic atom by a double bond. Could be entered with one of /open/, /open strict/, or /strict/- Parameters:
jmolAtoms-bsAromatic-lstAromatic- all rings passing the sp2 test and (if strict) the Hueckel strict testlstSP2- all rings passing the sp2 testeCounts-isOpenNotStrict- /open/ optionisStrict- remove noncyclic double bonds and do not allow bridging aromatic ring systems (/strict/ option)
-
removeBridgingRings
private static void removeBridgingRings(javajs.util.Lst<BS> lstAromatic, javajs.util.Lst<SmilesRing> lstSP2)
check for any two rings with more than two common atoms and remove them from the pool- Parameters:
lstAromatic-lstSP2-
-
checkBridges
private static void checkBridges(javajs.util.Lst<?> lst, BS bsBad, javajs.util.Lst<?> lst2, BS bsBad2, BS bs)
-
checkFusedRings
private static void checkFusedRings(javajs.util.Lst<SmilesRing> rings, int[] eCounts, javajs.util.Lst<BS> lstAromatic)
Add fused rings based on the Hueckel 4n+2 rule. Note that this may be reverted later if in a STRICT setting, because in at this point in some cases we will have double bonds to exocyclic nonaromatic atoms. We are being careful here to only group FUSED rings -- that is rings that have only one bond in common.- Parameters:
rings-eCounts-lstAromatic- list to be appended to
-
-