Class: GraphAdaptUtils

Kekule. GraphAdaptUtils

new GraphAdaptUtils()

Util class to help to convert other structures (e.g., molecule ctab) to graph.
Source:

Methods

(static) chemObjToGraph(obj, graph, options) → {Kekule.Graph}

Create corresponding graph from any chem object.
Parameters:
Name Type Description
obj Kekule.ChemObject
graph Kekule.Graph If not set, a new graph will be created.
options Hash Options to convert to graph. Can include fields: { connectorClasses: array, only connector instanceof those classes will be included in graph. bondTypes: array, only bond types in this array will be converted into edge in graph. expandSubStructures: bool, when put nodes and connectors in graph also. Default is true. ignoreBondedHydrogen: Whether bonded hydrogen atom are converted into graph. Default is true. }
Source:
Returns:
Type
Kekule.Graph

(static) ctabToGraph(connTab, graph, options) → {Kekule.Graph}

Create corresponding graph from a ctab.
Parameters:
Name Type Description
connTab Kekule.StructureConnectionTable
graph Kekule.Graph If not set, a new graph will be created.
options Hash Options to convert to graph. Can include fields: { nodeClasses: array, only node instanceof those classes will be included in graph. connectorClasses: array, only connector instanceof those classes will be included in graph. bondTypes: array, only bond types in this array will be converted into edge in graph. expandSubStructures: bool, when put nodes and connectors in graph also. Default is true. ignoreBondedHydrogen: Whether bonded hydrogen atom (on bond end) are converted into graph. Default is true. nodeFilter: func(node, allCtabConnectors), returns bool, a custom function, if false returned, this node will be ignored connectorFilter: func(connector, allCtabNodes), returns bool, a custom function, if false returned, this connector will be ignored }
Source:
Returns:
Original node and connector can be retrieved by vertexOrEdge.getData('object').
Type
Kekule.Graph

(static) molToGraph(mol, graph, options) → {Kekule.Graph}

Create corresponding graph from a molecule ctab.
Parameters:
Name Type Description
mol Kekule.StructureFragment
graph Kekule.Graph If not set, a new graph will be created.
options Hash Options to convert to graph. Can include fields: { connectorClasses: array, only connector instanceof those classes will be included in graph. bondTypes: array, only bond types in this array will be converted into edge in graph. expandSubStructures: bool, when put nodes and connectors in graph also. Default is true. ignoreBondedHydrogen: Whether bonded hydrogen atom are converted into graph. Default is true. }
Source:
Returns:
Type
Kekule.Graph