linchemin.cgu.convert.converter

linchemin.cgu.convert.converter(graph: MonopartiteReacSynGraph | MonopartiteMolSynGraph | BipartiteSynGraph, out_data_model: str) MonopartiteReacSynGraph | MonopartiteMolSynGraph | BipartiteSynGraph[source]

To convert a SynGraph object in other types of SynGraph

Parameters:

graph: SynGraph

The input graph as instance of one of the available SynGraph subclasses

out_data_model: str

The desired output data model.

Returns:

converted graph: Union[MonopartiteReacSynGraph, BipartiteSynGraph, MonopartiteMolSynGraph]

The converted graph

Raises:

TypeError: if the input graph is of the wrong type

KeyError: if the selected output data model is not available

Example:

>>> mp_syngraph = converter(bp_syngraph, 'monopartite_molecules')