Class: CmlUtils

Kekule.IO. CmlUtils

new CmlUtils()

A help class to handle CML
Source:

Methods

(static) cmlBondOrderToKekule(cmlOrder) → {Int}

Turn a CML bond order value to a Kekule one.
Parameters:
Name Type Description
cmlOrder String
Source:
Returns:
Value from {Kekule.BondOrder}
Type
Int

(static) cmlBondStereoToKekule(cmlStereo) → {Int}

Turn a CML bond stereo value to a Kekule one.
Parameters:
Name Type Description
cmlStereo String
Source:
Returns:
Value from {Kekule.BondStereo}
Type
Int

(static) createNodeByCmdElementType(id, elemType, massNumber) → {Kekule.ChemStructureNode}

Create a proper structure node by elementType of CML.
Parameters:
Name Type Description
id String
elemType String
massNumber Number Can be null.
Source:
Returns:
Type
Kekule.ChemStructureNode

(static) getNodeElementType(node) → {String}

Get element symbol (used as elementType in CML) of a Kekule.ChemStructureNode.
Parameters:
Name Type Description
node Kekule.ChemStructureNode
Source:
Returns:
Type
String

(static) isAtomListElementType(value) → {Bool}

Check if an element type is standing for an atom list. NOTE: atom list is not native CML concept, just borrowed from MDL.
Parameters:
Name Type Description
value String
Source:
Returns:
Type
Bool

(static) isDummyElementType(value) → {Bool}

Check if an element type is standing for a dummy atom.
Parameters:
Name Type Description
value String
Source:
Returns:
Type
Bool

(static) isRGroupElementType(value) → {Bool}

Check if an element type is standing for a RGroup.
Parameters:
Name Type Description
value String
Source:
Returns:
Type
Bool

(static) kekuleBondOrderToCml(kekuleOrder) → {String}

Turn a Kekule bond order value to a CML string.
Parameters:
Name Type Description
kekuleOrder Int
Source:
Returns:
Type
String

(static) kekuleBondStereoToCml(kekuleStereo) → {Hash}

Turn a Kekule bond stereo value to a CML string. Note Kekule has invert stereo enumerations, when translate to CML, you have to manually invert the bond atom refs to get a correct stereo result.
Parameters:
Name Type Description
kekuleStereo Int Value from {Kekule.BondStereo}
Source:
Returns:
{value, invert}
Type
Hash

(static) kekuleReagentRoleToCml(kekuleRole) → {String}

Turn a Kekule role value of reactant, product or substance to a CML one. If it is not a standard CML role, returns the origin value.
Parameters:
Name Type Description
kekuleRole String
Source:
Returns:
Type
String

(static) reagentRoleToKekule(cmlRole) → {String}

Turn a CML role value of reactant, product or substance to a Kekule one in Kekule.ReactionRole. If it is not a standard Kekule role, returns the origin value.
Parameters:
Name Type Description
cmlRole String
Source:
Returns:
Type
String