rxnutils.routes.chemformer_feasibility package¶
Submodules¶
rxnutils.routes.chemformer_feasibility.model_interface module¶
This module contains an interface for calculating reaction feasibility with a REST API to a Chemformer model or output from batch predictions
- class rxnutils.routes.chemformer_feasibility.model_interface.ChemformerReactionFeasibilityCalculator(api_url)¶
Bases:
object
Interface to the Chemformer API to calculate forward feasibility
Once instantiated, the calculator can be called as a function to calculate feasibilities of a set of reactions
scores = calculator(list_of_smiles)
the return value is a dictionary mapping reaction SMILES to the calculated feasibility.
- Parameters:
api_url (str) – the URL to the REST API
- load_batch_output(data)¶
Given an output from the predict function of the chemformer package, and an additional column called reactants this will update the cache with those predictions.
- Parameters:
data (DataFrame) – the batch output
rxnutils.routes.chemformer_feasibility.scoring module¶
Scoring function for feasibility using Chemformer model
- rxnutils.routes.chemformer_feasibility.scoring.reaction_feasibility_score(route, feasibility_calculator, use_reactant_heuristics=True)¶
A scorer that uses the Chemformer API to calculate the feasibility of each reaction and then combine it into a route score.
- Parameters:
route (SynthesisRoute) – the route to score
feasibility_calculator (ChemformerReactionFeasibilityCalculator) – the interface to the Chemformer API
use_reactant_heuristics (bool) – if True, will augment the calculations with heuristics for reactant reactions
- Returns:
the computed score
- Return type:
float