linchemin.rem.route_descriptors.descriptor_calculator¶
- linchemin.rem.route_descriptors.descriptor_calculator(graph: BipartiteSynGraph | MonopartiteReacSynGraph | MonopartiteMolSynGraph, descriptor: str) int | float | list[source]¶
To compute a route descriptor.
Parameters:¶
- graph: Union[BipartiteSynGraph, MonopartiteReacSynGraph, MonopartiteMolSynGraph]
The route in SynGraph format for which the descriptor must be computed
- descriptor: str
The descriptor to be computed
Returns:¶
- Union[int, float, list]
The value of the selected descriptor for the input graph
Example:¶
>>> graph = json.loads(open(az_path).read()) >>> syngraph = translator('az_retro', graph[4], 'syngraph', out_data_model='bipartite') >>> n_steps = descriptor_calculator(syngraph, 'nr_steps')