linchemin.cgu.syngraph_operations.add_reaction_to_syngraph

linchemin.cgu.syngraph_operations.add_reaction_to_syngraph(syngraph: SynGraph, reaction_to_add: str) BipartiteSynGraph | MonopartiteMolSynGraph | MonopartiteReacSynGraph[source]

To add a chemical reaction to a SynGraph object

Parameters:

syngraph: Union[MonopartiteReacSynGraph, BipartiteSynGraph, MonopartiteMolSynGraph]

The SynGraph object to be modified

reaction_to_add: str

The smiles of the reaction to be added to the graph

Returns:

new_graph: Union[MonopartiteReacSynGraph, BipartiteSynGraph, MonopartiteMolSynGraph]

The SynGraph object with the addition of the new node and of the same type as the input graph

Raises:

TypeError: if the input graph is not in SynGraph format

SmilesTypeError: if the provided smiles is not a valid reaction smiles