linchemin.cgu.syngraph.MonopartiteMolSynGraph

class linchemin.cgu.syngraph.MonopartiteMolSynGraph(initiator: List[dict] | Iron | None = None)[source]

SynGraph subclass representing a Monopartite (Molecule nodes only) SynGraph

__init__(initiator: List[dict] | Iron | None = None)

To instantiate a new SynGraph instance

Parameters:

initiator: initiator: Union[List[dict], Iron, None]

The initiator of the new SynGraph instance (default None -> an empty graph is initialized)) It can be:

  1. an Iron instance

  2. a list of dictionaries of reaction strings in the form

[{‘query_id’: n, ‘output_string’: reaction}]

Methods

__init__([initiator])

To instantiate a new SynGraph instance

add_node(nodes_tup)

To add a 'parent' node and its 'children' nodes to a SynGraph instance.

build_chemical_equations(string_list[, ...])

To build a list of ChemicalEquation objects from a list of smiles

builder_from_iron(iron_graph)

To build a SynGraph instance from an Iron object

builder_from_reaction_list(chemical_equations)

To build a SynGraph instance from a list of ChemicalEquation objects

get_leaves()

To get the list of leaves of a MonopartiteMolSynGraph instance.

get_roots()

To retrieve the list of 'root' nodes of a SynGraph instance

get_unique_nodes()

To get the set of unique nodes included in a SynGraph instance

remove_node(node_to_remove_id)

To remove a node by its uid from a SynGraph instance

set_name(name)

To set the name attribute of a SynGraph instance

Attributes

uid

To define the SynGraph unique identifier based on the underlying graph