linchemin.cgu.route_mining.mine_routes

linchemin.cgu.route_mining.mine_routes(input_list: List[MonopartiteReacSynGraph | BipartiteSynGraph | MonopartiteMolSynGraph], root: str | None = None, new_reaction_list: List[str] | None = None) List[MonopartiteReacSynGraph][source]

To mine all the routes that can be found in tree obtained by merging the input list of routes.

Parameters:

input_list: Union[List[Union[MonopartiteReacSynGraph, BipartiteSynGraph, MonopartiteMolSynGraph]]]

A list of SynGraph routes.

rootOptional[Union[str, None]]

The smiles of the target molecule for which routes should be searched. If not provided, the root node will be determined automatically (default None)

new_reaction_listOptional[Union[List[str], None]]

The list of smiles of the chemical reactions to be added. If not provided, only the input graph objects are considered (default None)

Returns:

extracted routesList[MonopartiteReacSynGraph]

A list of MonopartiteReacSynGraph objects corresponding to ALL the mined routes (including the input ones)

Raises:

TypeError: If the input data is not a list of SynGraph objects.

Example:

>>> input_list = [route1, route2]
>>> root = 'CCC(=O)Nc1ccc(cc1)C(=O)N[C@@H](CO)C(=O)O'
>>> new_reaction_list = ['CC(=O)Nc1ccccc1C(=O)O.[O-]S(=O)(=O)C(F)(F)F>>CC(=O)Nc1ccccc1C(=O)OS(=O)(=O)C(F)(F)F']
>>> mine_routes(input_list,root,new_reaction_list)