CIPData
Date: 2019-10-22

org.jmol.symmetry

## Class CIPData

- java.lang.Object
- - org.jmol.symmetry.CIPData

- Direct Known Subclasses:
    CIPDataSmiles, CIPDataTracker

      public class CIPData
      extends java.lang.Object

  A helper class to handle application-specific analysis and store information needed by CIPChirality and CIPDataSmiles. Subclassed as CIPDataSmiles to also allow Jmol's "...SMILES...".find("SMILES","chirality")

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) SimpleNode[]` | `atoms` all application atoms referenced by bit sets
    `(package private) javajs.util.BS` | `bsAromatic` Jmol's definition of aromatic
    `(package private) javajs.util.BS` | `bsAtoms` bit set of all atoms to process
    `(package private) javajs.util.BS` | `bsAtropisomeric` bit set of all biphenyl-like connections "[!H](.t1:-20,20)a{a(.t2:-20,20)-a}a[!H]"
    `(package private) javajs.util.BS` | `bsAzacyclic` all N atoms that are sp3-hybridized and at small ring fusions
    `(package private) javajs.util.BS` | `bsEnes` all sp2-hybridized atoms that are not Kekule-ambiguous
    `(package private) javajs.util.BS` | `bsHelixM` aromatic atoms at the end of a negative helical turn "A{a}(.t:-10,-40)a(.t:-10,-40)aaa"
    `(package private) javajs.util.BS` | `bsHelixP` aromatic atoms at the end of a positive helical turn "A{a}(.t:10,40)a(.t:10,40)aaa"
    `(package private) javajs.util.BS` | `bsKekuleAmbiguous` atoms that need specially-calculated element number in Rule 1a
    `(package private) javajs.util.BS` | `bsMolecule` atoms in all molecules containing the atoms of interest
    `(package private) javajs.util.BS` | `bsNegativeAromatic` [a-]
    `(package private) javajs.util.BS` | `bsXAromatic` excluded aromatics [r5d3n+0,r5d2o+0]
    `(package private) javajs.util.BS[]` | `lstSmallRings` all 3- to 7-membered rings; used to exclude E/Z and N-SP3 descriptors
    `boolean` | `testRule6Full` A flag that, if set, returns rr for bicyclo[2.2.2]octane
    `(package private) static float` | `TRIGONALITY_MIN` measure of planarity in a trigonal system, in Angstroms
    `protected javajs.util.V3` | `vNorm`
    `protected javajs.util.V3` | `vTemp`
    `(package private) Viewer` | `vwr` Jmol's viewer class

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CIPData()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `addAzacyclicN(int i)`
    `private int` | `checkEne(javajs.util.BS bsAllEnes, javajs.util.BS bsPath, int iLast, int iAtom, int order, javajs.util.BS bsEneAtom1)` Look for a path that contains this ene in a fully conjugated pattern
    `(package private) int` | `checkHandedness(CIPChirality.CIPAtom a)` Determine the ordered CIP winding of this atom.
    `(package private) int` | `couldBeChiralAlkene(SimpleNode a, SimpleEdge edge)` Allow double bonds only if trivalent and first-row atom.
    `(package private) boolean` | `couldBeChiralAtom(SimpleNode a)` Determine whether an atom is one we need to consider.
    `private void` | `getAzacyclic()` Identify bridgehead nitrogens, as these may need to be given chirality designations.
    `(package private) int` | `getBondOrder(SimpleEdge bond)`
    `(package private) void` | `getEneKekule()` Look for conjugated loops of any size that have atoms not already in aromatic rings
    `protected javajs.util.BS[]` | `getList(java.lang.String smarts)` Retrieve an array of bit sets that match a given SMARTS
    `(package private) java.lang.String` | `getRootTrackerResult(CIPChirality.CIPAtom root)` CIPDataTracker only
    `(package private) float` | `getTrigonality(SimpleNode a, javajs.util.V3 vNorm)` Determine the trigonality of an atom in order to determine whether it might have a lone pair.
    `protected void` | `init()` initializer -- called also by CIPDataSmiles
    `(package private) int` | `isCis(CIPChirality.CIPAtom a, CIPChirality.CIPAtom b, CIPChirality.CIPAtom c, CIPChirality.CIPAtom d)` Check cis vs.
    `(package private) int` | `isPositiveTorsion(CIPChirality.CIPAtom a, CIPChirality.CIPAtom b, CIPChirality.CIPAtom c, CIPChirality.CIPAtom d)` Checks the torsion angle and returns true if it is positive
    `(package private) boolean` | `isSmiles()` Subclass identifier
    `protected boolean` | `isTracker()` Subclass identifier
    `protected javajs.util.BS` | `match(java.lang.String smarts)` Return a bit set corresponding to a SMARTS
    `CIPData` | `set(Viewer vwr, javajs.util.BS bsAtoms)` Actual constructor.
    `(package private) boolean` | `setCoord(SimpleNode atom1, CIPChirality.CIPAtom[] atoms)` set the coordinate -- SMILES only
    `void` | `setRule6Full(boolean rrrr)`
    `(package private) void` | `track(CIPChirality cip, CIPChirality.CIPAtom a, CIPChirality.CIPAtom b, int sphere, int finalScore, boolean trackTerminal)` Track this decision - CIPDataTracker only

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TRIGONALITY_MIN

          static final float TRIGONALITY_MIN

      measure of planarity in a trigonal system, in Angstroms
      See Also:
        Constant Field Values

    - #### testRule6Full

          public boolean testRule6Full

      A flag that, if set, returns rr for bicyclo[2.2.2]octane

    - #### vwr

          Viewer vwr

      Jmol's viewer class

    - #### atoms

          SimpleNode[] atoms

      all application atoms referenced by bit sets

    - #### bsAtoms

          javajs.util.BS bsAtoms

      bit set of all atoms to process

    - #### bsMolecule

          javajs.util.BS bsMolecule

      atoms in all molecules containing the atoms of interest

    - #### bsAromatic

          javajs.util.BS bsAromatic

      Jmol's definition of aromatic

    - #### bsXAromatic

          javajs.util.BS bsXAromatic

      excluded aromatics [r5d3n+0,r5d2o+0]

    - #### bsNegativeAromatic

          javajs.util.BS bsNegativeAromatic

      [a-]

    - #### bsAzacyclic

          javajs.util.BS bsAzacyclic

      all N atoms that are sp3-hybridized and at small ring fusions

    - #### bsAtropisomeric

          javajs.util.BS bsAtropisomeric

      bit set of all biphenyl-like connections "[!H](.t1:-20,20)a{a(.t2:-20,20)-a}a[!H]"

    - #### bsHelixM

          javajs.util.BS bsHelixM

      aromatic atoms at the end of a negative helical turn "A{a}(.t:-10,-40)a(.t:-10,-40)aaa"

    - #### bsHelixP

          javajs.util.BS bsHelixP

      aromatic atoms at the end of a positive helical turn "A{a}(.t:10,40)a(.t:10,40)aaa"

    - #### lstSmallRings

          javajs.util.BS[] lstSmallRings

      all 3- to 7-membered rings; used to exclude E/Z and N-SP3 descriptors

    - #### bsKekuleAmbiguous

          javajs.util.BS bsKekuleAmbiguous

      atoms that need specially-calculated element number in Rule 1a

    - #### bsEnes

          javajs.util.BS bsEnes

      all sp2-hybridized atoms that are not Kekule-ambiguous

    - #### vNorm

          protected javajs.util.V3 vNorm

    - #### vTemp

          protected javajs.util.V3 vTemp

  - ### Constructor Detail

    - #### CIPData

          public CIPData()

  - ### Method Detail

    - #### isTracker

          protected boolean isTracker()

      Subclass identifier
      Returns:
        true for CIPDataTracker

    - #### isSmiles

          boolean isSmiles()

      Subclass identifier
      Returns:
        true for CIPDataSmiles

    - #### set

          public CIPData set(Viewer vwr,
                             javajs.util.BS bsAtoms)

      Actual constructor.
      Parameters:
        `vwr` - Jmol viewer
        `bsAtoms` - selected atoms
      Returns:
        this

    - #### init

          protected void init()

      initializer -- called also by CIPDataSmiles

    - #### getList

          protected javajs.util.BS[] getList(java.lang.String smarts)
                                      throws java.lang.Exception

      Retrieve an array of bit sets that match a given SMARTS
      Parameters:
        `smarts` -
      Returns:
        array of matching bit sets
      Throws:
        `java.lang.Exception`

    - #### match

          protected javajs.util.BS match(java.lang.String smarts)
                                  throws java.lang.Exception

      Return a bit set corresponding to a SMARTS
      Parameters:
        `smarts` -
      Returns:
        bit set matching this SMARTS
      Throws:
        `java.lang.Exception`

    - #### getEneKekule

          void getEneKekule()

      Look for conjugated loops of any size that have atoms not already in aromatic rings

    - #### checkEne

          private int checkEne(javajs.util.BS bsAllEnes,
                               javajs.util.BS bsPath,
                               int iLast,
                               int iAtom,
                               int order,
                               javajs.util.BS bsEneAtom1)

      Look for a path that contains this ene in a fully conjugated pattern
      Parameters:
        `bsAllEnes` - all ene carbons
        `bsPath` - current path to loop into
        `iLast` - the last atom
        `iAtom` - this atom
        `order` - expected next order, alternating 2,1,2,1,...
        `bsEneAtom1` - alternating atoms; first of double bond
      Returns:
        the atom number of the loop or -1 if failed

    - #### getAzacyclic

          private void getAzacyclic()

      Identify bridgehead nitrogens, as these may need to be given chirality designations. See AY-236.203 P-93.5.4.1 Sets a bit set of bridgehead nitrogens

    - #### addAzacyclicN

          private void addAzacyclicN(int i)

    - #### couldBeChiralAtom

          boolean couldBeChiralAtom(SimpleNode a)

      Determine whether an atom is one we need to consider.
      Parameters:
        `a` -
      Returns:
        true for selected atoms and hybridizations

    - #### couldBeChiralAlkene

          int couldBeChiralAlkene(SimpleNode a,
                                  SimpleEdge edge)

      Allow double bonds only if trivalent and first-row atom. (IUPAC 2013.P-93.2.4) Currently: a) first row b) doubly bonded c) doubly bonded atom is also first row
      Parameters:
        `a` -
        `edge` - optional bond
      Returns:
        STEREO_M, STEREO_Z, or UNDETERMINED

    - #### getTrigonality

          float getTrigonality(SimpleNode a,
                               javajs.util.V3 vNorm)

      Determine the trigonality of an atom in order to determine whether it might have a lone pair. The global vector vNorm is returned as well, pointing from the atom to the base plane of its first three substituents.
      Parameters:
        `a` -
        `vNorm` - a vector returned with the normal from the atom to the base plane
      Returns:
        distance from plane of first three covalently bonded nodes to this node

    - #### isCis

          int isCis(CIPChirality.CIPAtom a,
                    CIPChirality.CIPAtom b,
                    CIPChirality.CIPAtom c,
                    CIPChirality.CIPAtom d)

      Check cis vs. trans nature of a--b==c--d.
      Parameters:
        `a` -
        `b` -
        `c` -
        `d` -
      Returns:
        true if this is a cis relationship

    - #### isPositiveTorsion

          int isPositiveTorsion(CIPChirality.CIPAtom a,
                                CIPChirality.CIPAtom b,
                                CIPChirality.CIPAtom c,
                                CIPChirality.CIPAtom d)

      Checks the torsion angle and returns true if it is positive
      Parameters:
        `a` -
        `b` -
        `c` -
        `d` -
      Returns:
        true if torsion angle is

    - #### getBondOrder

          int getBondOrder(SimpleEdge bond)

    - #### setCoord

          boolean setCoord(SimpleNode atom1,
                           CIPChirality.CIPAtom[] atoms)

      set the coordinate -- SMILES only
      Parameters:
        `atom1` -
        `atoms` -
      Returns:
        true if coordinate is able to be set

    - #### checkHandedness

          int checkHandedness(CIPChirality.CIPAtom a)

      Determine the ordered CIP winding of this atom. For this, we just take the directed normal through the plane containing the top three substituent atoms and dot that with the vector from any one of them to the fourth ligand (or the root atom if trigonal pyramidal). If this is positive, we have R.
      Parameters:
        `a` -
      Returns:
        1 for "R", 2 for "S"

    - #### track

          void track(CIPChirality cip,
                     CIPChirality.CIPAtom a,
                     CIPChirality.CIPAtom b,
                     int sphere,
                     int finalScore,
                     boolean trackTerminal)

      Track this decision - CIPDataTracker only
      Parameters:
        `cip` -
        `a` -
        `b` -
        `sphere` -
        `finalScore` -
        `trackTerminal` -

    - #### getRootTrackerResult

          java.lang.String getRootTrackerResult(CIPChirality.CIPAtom root)

      CIPDataTracker only
      Parameters:
        `root` -
      Returns:
        string expression of decision path

    - #### setRule6Full

          public void setRule6Full(boolean rrrr)