Class: ChemStructureUtils

ChemStructureUtils

new ChemStructureUtils()

Util class to manipulate ctab based chem structures.
Source:

Methods

(static) getAbsCoordVectorBetweenObjs(obj1, obj2, coordMode, allowCoordBorrow) → {Hash}

Returns a vector reflect coord2 - coord1.
Parameters:
Name Type Description
obj1 Kekule.ChemStructureObject
obj2 Kekule.ChemStructureObject
coordMode Int
allowCoordBorrow Bool
Source:
Returns:
Type
Hash

(static) getAllStructFragments(chemObj, cascade) → {Array}

Returns all child structure fragments among children of chemObj.
Parameters:
Name Type Description
chemObj Variant
cascade Bool
Source:
Returns:
Type
Array

(static) getCascadeDeleteObjs(chemStructObj) → {Array}

Returns nodes or connectors that should be removed cascadely with chemStructObj.
Parameters:
Name Type Description
chemStructObj Object
Deprecated:
  • Yes
Source:
Returns:
Type
Array

(static) getChildStructureObjs(chemObj, cascade) → {Array}

Returns structured children of chemObj. The type of chemObj can be: Kekule.ChemObjList: returns chemObj.getItems(); Kekule.ChemStructureObjectGroup: returns chemObj.getAllObjs(); Kekule.CompositeMolecule: returns chemObj.getSubMolecules().getAllObjs(). Kekule.ChemSpaceElement or {@link Kekule.ChemSpace}: returns all child structured objects inside it. Other types will simply return [chemObj]. If param cascade is true, each childObj will also be checked.
Parameters:
Name Type Description
chemObj Variant
cascade Bool
Source:
Returns:
Type
Array

(static) getConnectorLengthMedian(connectors, coordMode, allowCoordBorrow) → {Float}

Returns median of all input connector lengths.
Parameters:
Name Type Description
connectors Array
coordMode Int
allowCoordBorrow Bool
Source:
Returns:
Type
Float

(static) getTotalStructFragment(chemObj, newFragmentClass) → {Kekule.StructureFragment}

Find all child structure fragments among children of chemObj, then merge them into one.
Parameters:
Name Type Description
chemObj Variant
newFragmentClass Class If set, new fragment will be based on this class. Otherwise an instance of Kekule.Molecule will be created.
Source:
Returns:
Type
Kekule.StructureFragment

(static) mergeStructFragments(fragments, newFragmentClass) → {Kekule.StructureFragment}

Merge all fragments into a big one (this one may be unconnected).
Parameters:
Name Type Description
fragments Array
newFragmentClass Class If set, new fragment will be based on this class. Otherwise an instance of Kekule.Molecule will be created.
Source:
Returns:
Type
Kekule.StructureFragment

(static) moveChildBetweenStructFragment(target, dest, moveNodes, moveConnectors, ignoreAnchorNodes)

Move nodes and connectors from target to dest structure fragment.
Parameters:
Name Type Description
target Kekule.StructureFragment
dest Kekule.StructureFragment
moveNodes Array
moveConnectors Array
ignoreAnchorNodes Bool
Source:

(static) splitStructFragment(structFragment) → {Array}

Split structFragment with unconnected nodes to multiple ones.
Parameters:
Name Type Description
structFragment Kekule.StructureFragment
Source:
Returns:
Type
Array