SmilesStereo
Date: 2019-10-22

org.jmol.smiles

## Class SmilesStereo

- java.lang.Object
- - org.jmol.smiles.SmilesStereo

-     public class SmilesStereo
      extends java.lang.Object

  This class relates to stereochemical issues

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ALLENE`
    `(package private) int` | `atomCount`
    `private int` | `chiralClass`
    `(package private) int` | `chiralOrder`
    `static int` | `DEFAULT`
    `private java.lang.String` | `details`
    `private java.lang.String` | `directives`
    `private boolean` | `isNot`
    `private Node[]` | `jmolAtoms`
    `static int` | `OCTAHEDRAL`
    `private static int[]` | `PERM_OCT`
    `private static int[]` | `PERM_SS`
    `private static int[]` | `PERM_TB`
    `static int` | `POLYHEDRAL`
    `private int[][]` | `polyhedralOrders`
    `private SmilesSearch` | `search`
    `static int` | `SEESAW`
    `private PolyhedronStereoSorter` | `sorter`
    `static int` | `SQUARE_PLANAR`
    `static int` | `T_SHAPED`
    `static int` | `TETRAHEDRAL`
    `static int` | `TRIGONAL_BIPYRAMIDAL`
    `static int` | `TRIGONAL_PYRAMIDAL`
    `(package private) VTemp` | `v`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SmilesStereo(int chiralClass, int chiralOrder, int atomCount, java.lang.String details, java.lang.String directives)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `addAlleneLonePair(SmilesAtom pAtom, Node[] jn, int k)` for allenes, we must check for missing atoms
    `(package private) static int` | `checkChirality(SmilesSearch search, java.lang.String pattern, int index, SmilesAtom newAtom)`
    `(package private) boolean` | `checkStereoChemistry(SmilesSearch search, VTemp v)`
    `private static boolean` | `checkStereochemistryAll(boolean isNot, SimpleNode atom0, int chiralClass, int order, SimpleNode atom1, SimpleNode atom2, SimpleNode atom3, SimpleNode atom4, SimpleNode atom5, SimpleNode atom6, VTemp v)`
    `int` | `checkStereoForAtom(SmilesAtom pAtom, Node atom0, boolean isNot, boolean haveTopo)`
    `(package private) void` | `fixStereo(SmilesAtom sAtom)` Check number of connections and permute them to match a canonical version
    `Node[]` | `getAlleneAtoms(SmilesAtom pAtom, SmilesAtom pAtom1)`
    `int` | `getChiralClass(SmilesAtom sAtom)`
    `private static int` | `getChiralityClass(java.lang.String xx)`
    `(package private) static int` | `getHandedness(SimpleNode a, SimpleNode b, SimpleNode c, SimpleNode pt, VTemp v)` determine the winding of the circuit a--b--c relative to point pt
    `private Node` | `getJmolAtom(int i)`
    `private int[]` | `getMappedTopoAtoms(SmilesAtom atom, SmilesAtom a2, Node[] cAtoms)`
    `private static void` | `getPlaneNormals(javajs.util.P3 atom1, javajs.util.P3 atom2, javajs.util.P3 atom3, javajs.util.P3 atom4, VTemp v)`
    `private void` | `getPolyhedralOrders()` experimental Jmol polySMILES
    `(package private) static java.lang.String` | `getStereoFlag(SimpleNode atom0, SimpleNode[] atoms, int nAtoms, VTemp v)`
    `private static boolean` | `getTopoMapPt(int[] map, int i, SmilesAtom atom, SmilesAtom cAtom, SmilesBond[] bonds, int n000)`
    `(package private) static boolean` | `isDiaxial(SimpleNode atomA, SimpleNode atomB, SimpleNode atom1, SimpleNode atom2, VTemp v, float f)`
    `static SmilesStereo` | `newStereo(SmilesSearch search)`
    `private boolean` | `normalizeClass(SmilesAtom atom)` re-order bonds to match standard @ and @@ types
    `private int` | `setChiralClass(SmilesAtom sAtom)`
    `boolean` | `setTopoCoordinates(SmilesAtom atom, SmilesAtom sAtom, SmilesAtom sAtom2, Node[] cAtoms)`
    `(package private) void` | `sortBondsByStereo(SimpleNode atom, SimpleNode atomPrev, javajs.util.T3 ref, SimpleEdge[] bonds, javajs.util.V3 vTemp)` Sort bond array as ccw rotation around the axis connecting the atom and the reference point (polyhedron center) as seen from outside the polyhedron looking in.

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

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

- - ### Field Detail

    - #### chiralClass

          private int chiralClass

    - #### chiralOrder

          int chiralOrder

    - #### atomCount

          int atomCount

    - #### details

          private java.lang.String details

    - #### search

          private SmilesSearch search

    - #### jmolAtoms

          private Node[] jmolAtoms

    - #### directives

          private java.lang.String directives

    - #### DEFAULT

          public static final int DEFAULT

      See Also:
        Constant Field Values

    - #### POLYHEDRAL

          public static final int POLYHEDRAL

      See Also:
        Constant Field Values

    - #### ALLENE

          public static final int ALLENE

      See Also:
        Constant Field Values

    - #### TRIGONAL_PYRAMIDAL

          public static final int TRIGONAL_PYRAMIDAL

      See Also:
        Constant Field Values

    - #### TETRAHEDRAL

          public static final int TETRAHEDRAL

      See Also:
        Constant Field Values

    - #### TRIGONAL_BIPYRAMIDAL

          public static final int TRIGONAL_BIPYRAMIDAL

      See Also:
        Constant Field Values

    - #### OCTAHEDRAL

          public static final int OCTAHEDRAL

      See Also:
        Constant Field Values

    - #### SQUARE_PLANAR

          public static final int SQUARE_PLANAR

      See Also:
        Constant Field Values

    - #### T_SHAPED

          public static final int T_SHAPED

      See Also:
        Constant Field Values

    - #### SEESAW

          public static final int SEESAW

      See Also:
        Constant Field Values

    - #### PERM_TB

          private static final int[] PERM_TB

    - #### PERM_OCT

          private static final int[] PERM_OCT

    - #### PERM_SS

          private static final int[] PERM_SS

    - #### v

          VTemp v

    - #### polyhedralOrders

          private int[][] polyhedralOrders

    - #### isNot

          private boolean isNot

    - #### sorter

          private PolyhedronStereoSorter sorter

  - ### Constructor Detail

    - #### SmilesStereo

          SmilesStereo(int chiralClass,
                       int chiralOrder,
                       int atomCount,
                       java.lang.String details,
                       java.lang.String directives)
                throws InvalidSmilesException

      Throws:
        `InvalidSmilesException`

  - ### Method Detail

    - #### getChiralityClass

          private static int getChiralityClass(java.lang.String xx)

    - #### newStereo

          public static SmilesStereo newStereo(SmilesSearch search)
                                        throws InvalidSmilesException

      Throws:
        `InvalidSmilesException`

    - #### getChiralClass

          public int getChiralClass(SmilesAtom sAtom)

    - #### setChiralClass

          private int setChiralClass(SmilesAtom sAtom)

    - #### fixStereo

          void fixStereo(SmilesAtom sAtom)
                  throws InvalidSmilesException

      Check number of connections and permute them to match a canonical version
      Parameters:
        `sAtom` -
      Throws:
        `InvalidSmilesException`

    - #### normalizeClass

          private boolean normalizeClass(SmilesAtom atom)

      re-order bonds to match standard @ and @@ types
      Parameters:
        `atom` -
      Returns:
        true if OK

    - #### setTopoCoordinates

          public boolean setTopoCoordinates(SmilesAtom atom,
                                            SmilesAtom sAtom,
                                            SmilesAtom sAtom2,
                                            Node[] cAtoms)

    - #### getMappedTopoAtoms

          private int[] getMappedTopoAtoms(SmilesAtom atom,
                                           SmilesAtom a2,
                                           Node[] cAtoms)

    - #### getTopoMapPt

          private static boolean getTopoMapPt(int[] map,
                                              int i,
                                              SmilesAtom atom,
                                              SmilesAtom cAtom,
                                              SmilesBond[] bonds,
                                              int n000)

      Parameters:
        `map` -
        `i` -
        `atom` -
        `cAtom` -
        `bonds` -
        `n000` -
      Returns:
        true if found

    - #### getJmolAtom

          private Node getJmolAtom(int i)

    - #### sortBondsByStereo

          void sortBondsByStereo(SimpleNode atom,
                                 SimpleNode atomPrev,
                                 javajs.util.T3 ref,
                                 SimpleEdge[] bonds,
                                 javajs.util.V3 vTemp)

      Sort bond array as ccw rotation around the axis connecting the atom and the reference point (polyhedron center) as seen from outside the polyhedron looking in. Since we are allowing no branching, all atoms will appear as separate components with only numbers after them. These numbers will be processed and listed in this order.
      Parameters:
        `atom` -
        `atomPrev` -
        `ref` -
        `bonds` -
        `vTemp` -

    - #### checkStereoChemistry

          boolean checkStereoChemistry(SmilesSearch search,
                                       VTemp v)

    - #### checkStereoForAtom

          public int checkStereoForAtom(SmilesAtom pAtom,
                                        Node atom0,
                                        boolean isNot,
                                        boolean haveTopo)

    - #### getAlleneAtoms

          public Node[] getAlleneAtoms(SmilesAtom pAtom,
                                       SmilesAtom pAtom1)

    - #### addAlleneLonePair

          private void addAlleneLonePair(SmilesAtom pAtom,
                                         Node[] jn,
                                         int k)

      for allenes, we must check for missing atoms
      Parameters:
        `pAtom` -
        `jn` -
        `k` -

    - #### getStereoFlag

          static java.lang.String getStereoFlag(SimpleNode atom0,
                                                SimpleNode[] atoms,
                                                int nAtoms,
                                                VTemp v)

      Parameters:
        `atom0` -
        `atoms` -
        `nAtoms` -
        `v` -
      Returns:
        String

    - #### checkStereochemistryAll

          private static boolean checkStereochemistryAll(boolean isNot,
                                                         SimpleNode atom0,
                                                         int chiralClass,
                                                         int order,
                                                         SimpleNode atom1,
                                                         SimpleNode atom2,
                                                         SimpleNode atom3,
                                                         SimpleNode atom4,
                                                         SimpleNode atom5,
                                                         SimpleNode atom6,
                                                         VTemp v)

    - #### isDiaxial

          static boolean isDiaxial(SimpleNode atomA,
                                   SimpleNode atomB,
                                   SimpleNode atom1,
                                   SimpleNode atom2,
                                   VTemp v,
                                   float f)

    - #### getHandedness

          static int getHandedness(SimpleNode a,
                                   SimpleNode b,
                                   SimpleNode c,
                                   SimpleNode pt,
                                   VTemp v)

      determine the winding of the circuit a--b--c relative to point pt
      Parameters:
        `a` -
        `b` -
        `c` -
        `pt` -
        `v` -
      Returns:
        1 for "@", 2 for "@@"

    - #### getPlaneNormals

          private static void getPlaneNormals(javajs.util.P3 atom1,
                                              javajs.util.P3 atom2,
                                              javajs.util.P3 atom3,
                                              javajs.util.P3 atom4,
                                              VTemp v)

    - #### checkChirality

          static int checkChirality(SmilesSearch search,
                                    java.lang.String pattern,
                                    int index,
                                    SmilesAtom newAtom)
                             throws InvalidSmilesException

      Throws:
        `InvalidSmilesException`

    - #### getPolyhedralOrders

          private void getPolyhedralOrders()
                                    throws InvalidSmilesException

      experimental Jmol polySMILES
      Throws:
        `InvalidSmilesException`