Class: MolStereoUtils

Kekule. MolStereoUtils

new MolStereoUtils()

Util class about stereo chemistry.
Source:

Methods

(static) calcRotationDirection(centerCoord, refCoord, coord1, coord2, coord3, refCoordBehind) → {Int}

Judge the direction of coord1 to coord3 when looking from refCoord to centerCoord (or put refCoord behide center coord if refCoordBehind param is true). All coords should have x/y/z values.
Parameters:
Name Type Description
centerCoord Hash
refCoord Hash
coord1 Hash
coord2 Hash
coord3 Hash
refCoordBehind Bool
Source:
Returns:
Value from Kekule.RotationDir, clockwise, anti-clockwise or unknown.
Type
Int

(static) calcStereoBondParity(connector, coordMode) → {Int}

Calc and returns MDL stereo parity of a stereo double bond. If two superior group (with larger canonicalization index) at the same side of bond, parity = 1, otherwise parity = 2. Note: the parent structure fragment should be canonicalized before calculation.
Parameters:
Name Type Description
connector Kekule.ChemStructureConnector
coordMode Int Use 2D or 3D coord to calculate. //@param {Kekule.StructureFragment} parentMol
Source:
Returns:
Value from Kekule.StereoParity.
Type
Int

(static) calcTetrahedronChiralCenterRotationDirection(coordMode, centerNode, refSibling, siblings, withImplicitSibling, additionalOptions, refSiblingBehind) → {Int}

Returns rotation direction of a tetrahedron chiral center. Rotation follows the sequence of param siblings.
Parameters:
Name Type Description
coordMode Int Use 2D or 3D coord of nodes.
centerNode Kekule.ChemStructureNode Center node used to get center coord. If this param is not set, geometric center of sibling nodes will be used instead.
refSibling Kekule.ChemStructureNode Sibling node to determine the looking direction.
siblings Array Array of Kekule.ChemStructureNode, should not include refSibling.
withImplicitSibling Bool Whether there is a implicit sibling (e.g., implicit H atom). Coord of implicit node will be calculated from other sibling nodes. If this param is true and param refSibling is null, this implicit node will be regarded as refSibling, otherwise the implicit node will be regarded as the last one of siblings.
additionalOptions Hash
refSiblingBehind Bool Whether put refCoord behide center coord.
Source:
Returns:
Value from Kekule.RotationDir, clockwise, anti-clockwise or unknown.
Type
Int

(static) calcTetrahedronChiralCenterRotationDirectionEx(centerNode, refSibling, siblings, options) → {Int}

Returns rotation direction of a tetrahedron chiral center. Rotation follows the sequence of param siblings.
Parameters:
Name Type Description
centerNode Kekule.ChemStructureNode Center node used to get center coord. If this param is not set, geometric center of sibling nodes will be used instead.
refSibling Kekule.ChemStructureNode Sibling node to determine the looking direction.
siblings Array Array of Kekule.ChemStructureNode, should not include refSibling.
options hash Calculation option, may include the following fields:
{
coordMode: Int, use 2D or 3D coord of nodes.
withImplicitSibling: Bool, whether there is a implicit sibling (e.g., implicit H atom). Coord of implicit node will be calculated from other sibling nodes. If this param is true and param refSibling is null, this implicit node will be regarded as refSibling, otherwise the implicit node will be regarded as the last one of siblings.
implicitFischerProjection: Bool, whether the "+" cross of Fischer projection need to be recognized and take into consideration. Default is true. Only works when coord mode is 2D. fischerAllowedError: the allowed error when checking vertical and horizontal line in Fischer projection cross, default is 0.08 (deltaY/deltaX or vice versa, about 4.5 degree). reversedFischer: If true, the node on vertical line will be toward observer instead, allowExplicitHydrogenInFischer: Whether the simplification Fischer projection in saccharide chain form is allowed (H is omitted from structure). Default is true. allowExplicitVerticalHydrogen: Whether the implicit hydrogen on vertical direction is allowed (used in SMILES generation). }
Source:
Returns:
Value from Kekule.RotationDir, clockwise, anti-clockwise or unknown.
Type
Int

(static) calcTetrahedronChiralNodeParity(node, coordMode, options) → {Int}

Calc and returns MDL stereo parity of a chiral node. Note: the parent structure fragment should be canonicalized.
Parameters:
Name Type Description
node Kekule.ChemStructureNode
coordMode Int Use 2D or 3D coord to calculate.
options Hash Chiral calculation options, including: {
ignoreChiralCheck: Bool, Whether bypass the check to ensure node is a chiral center.
implicitFischerProjection: Bool, whether the "+" cross of Fischer projection need to be recognized and take into consideration. Only works when coord mode is 2D.
fischerAllowedError: the allowed error when checking vertical and horizontal line in Fischer projection cross, default is 0.08 (deltaY/deltaX or vice versa, about 4.5 degree).
reversedFischer: If true, the node on vertical line will be toward observer instead, allowExplicitHydrogenInFischer: Whether the simplification Fischer projection in saccharide chain form is allowed (H is omitted from structure).
} //@param {Kekule.StructureFragment} parentMol
Source:
Returns:
Value from Kekule.StereoParity.
Type
Int

(static) findChiralNodes(structFragmentOrCtab, ignoreCanonicalization) → {Array}

Find chiral nodes in struct fragment or ctab. Note, before finding, if param ignoreCanonicalization is false, the struct fragment will be canonicalized by morgan algorithm to set node cano index.
Parameters:
Name Type Description
structFragmentOrCtab Variant
ignoreCanonicalization Bool
Deprecated:
  • Yes
Source:
Returns:
Type
Array

(static) findStereoConnectors(structFragmentOrCtab, ignoreCanonicalization) → {Array}

Find stereo double bond in struct fragment or ctab. Note, before finding, if param ignoreCanonicalization is false, the struct fragment will be canonicalized by morgan algorithm to set node cano index.
Parameters:
Name Type Description
structFragmentOrCtab Variant
ignoreCanonicalization Bool
Deprecated:
  • Yes
Source:
Returns:
Type
Array

(static) getDihedralAngleOfNodes(n1, n2, n3, n4, coordMode, allowCoordBorrow) → {Float}

Returns dihedral angle of plane (n1, n2, n3) and (n2, n3, n4).
Parameters:
Name Type Description
n1 Kekule.ChemStructureNode
n2 Kekule.ChemStructureNode
n3 Kekule.ChemStructureNode
n4 Kekule.ChemStructureNode
coordMode Int
allowCoordBorrow Bool Default is true.
Source:
Returns:
Type
Float

(static) getParityOfNodeSeq(n1, n2, n3, n4, coordMode, allowCoordBorrow) → {Int}

Returns the stereo parity of node sequence n1 to n4.
Parameters:
Name Type Description
n1 Kekule.ChemStructureNode
n2 Kekule.ChemStructureNode
n3 Kekule.ChemStructureNode
n4 Kekule.ChemStructureNode
coordMode Int
allowCoordBorrow Bool
Source:
Returns:
If n1 and n4 at the same side of line n2-n3, parity is odd(1), otherwise even(2) will be returned.
Type
Int

(static) getStereoBondKeyNodes(connector) → {Array}

Returns essential nodes to determine the stereo of a double bond.
Parameters:
Name Type Description
connector Kekule.ChemStructureConnector
Source:
Returns:
Array of nodes.
Type
Array

(static) getStereoBondRelNodes(connector) → {Array}

Returns all related nodes to determine the stereo of a double bond (including two bond atoms and four possible connected atoms).
Parameters:
Name Type Description
connector Kekule.ChemStructureConnector
Source:
Returns:
Array of nodes. For structure A1/A2 >C1=C2< B1/B2, the return sequence should be [C1, C2, A1, A2, B1, B2] where A1/B1 has superior canonicalization index.
Type
Array

(static) isChiralNode(node)

Check if a chem structure node is a chiral one. Note: now only C/Si/S/P/N/B atoms are considered, and the parent structure fragment may be standardized.
Parameters:
Name Type Description
node Kekule.ChemStructureNode
Source:

(static) isStereoBond(connector) → {Bool}

Check if a connector is a double bond that connects with two different groups on each end (may has trans or cis configurature). Note: the parent structure should be canonicalized before calling this method.
Parameters:
Name Type Description
connector Kekule.ChemStructureConnector
Source:
Returns:
Type
Bool

(static) perceiveChiralNodes(structFragmentOrCtab, coordMode, ignoreCanonicalization, options) → {Array}

Detect and mark parity of all chiral nodes in structure fragment.
Parameters:
Name Type Description
structFragmentOrCtab Variant
coordMode Int Use 2D or 3D coord to calculate.
ignoreCanonicalization Bool If false, ctab will be canonicalized before perception.
options Hash Chiral calculation options, including: {
implicitFischerProjection: Bool, whether the "+" cross of Fischer projection need to be recognized and take into consideration. Only works when coord mode is 2D.
fischerAllowedError: the allowed error when checking vertical and horizontal line in Fischer projection cross, default is 0.08 (deltaY/deltaX or vice versa, about 4.5 degree).
reversedFischer: If true, the node on vertical line will be toward observer instead, allowExplicitHydrogenInFischer: Whether the simplification Fischer projection in saccharide chain form is allowed (H is omitted from structure).
}
Deprecated:
  • Yes
Source:
Returns:
Array of all chiral nodes.
Type
Array

(static) perceiveStereoConnectors(structFragmentOrCtab, coordMode, ignoreCanonicalization, strictStereoBondGeometry) → {Array}

Detect and mark parity of all stereo bonds in structure fragment.
Parameters:
Name Type Description
structFragmentOrCtab Variant
coordMode Int Use 2D or 3D coord to calculate.
ignoreCanonicalization Bool If false, ctab will be canonicalized before perception.
strictStereoBondGeometry Bool
Deprecated:
  • Yes
Source:
Returns:
Array of all chiral nodes.
Type
Array

(static) perceiveStereos(structFragmentOrCtab, coordMode, ignoreCanonicalization, options) → {Array}

Detect and mark parity of all chiral nodes/connectors in structure fragment.
Parameters:
Name Type Description
structFragmentOrCtab Variant
coordMode Int Use 2D or 3D coord to calculate.
ignoreCanonicalization Bool If false, ctab will be canonicalized before perception.
options Hash Chiral calculation options, including: {
useFlatternedShadow: Bool, use flatterned shadow structure to perceive stereo. Default is true.
perceiveStereoConnectors: Bool, whether find out the all stereo bonds, default is true.
perceiveChiralNodes: Bool, whether find out all stereo atoms, default is true.
calcParity: Bool, whether calculate the parity of stereo bonds and node found, default is true.
strictStereoBondGeometry: Bool, if true, the illegal bond geometry will be ignored in calculation (e.g., two connected atoms on same side of a double bond).
implicitFischerProjection: Bool, whether the "+" cross of Fischer projection need to be recognized and take into consideration. Only works when coord mode is 2D.
fischerAllowedError: the allowed error when checking vertical and horizontal line in Fischer projection cross, default is 0.08 (deltaY/deltaX or vice versa, about 4.5 degree).
reversedFischer: If true, the node on vertical line will be toward observer instead.
allowExplicitHydrogenInFischer: Whether the simplification Fischer projection in saccharide chain form is allowed (H is omitted from structure).
}
Source:
Returns:
Array of all nodes and connectors with special stereo parities.
Type
Array