Package CHEM :: Package CombiCDB :: Module SynthesisGenerator :: Class SynthesisGenerator
[hide private]
[frames] | no frames]

Class SynthesisGenerator



Given a set of starting reactant molecules and reagent objects which can perform reactions on appropriate reactants, randomly apply the reagents to the reactants in sequence (and parallel) to generate a product that could conceivably be synthesized with such components.

Furthermore, provide the ordered list of reactants, reagents, and intermediate products to yield the synthesized product.

Instance Methods [hide private]
 
__init__(self, maxSteps=0, maxTries=MAX_TRIES)
Initialization constructor.
 
__call__(self, reactantSmilesList, reagentList)
Primary execution method, expects a list of molecules as the starting reactants and a list of BaseReagent objects that can be applied to the reactants.
 
generateSynthesis(self, reactantSmilesList, reagentList, depth=0)
Same as primary execution method, but this one returns actual molecule objects instead of SMILES strings.
 
generateReactionStep(self, reactantList, reagentList, requiredReactants=None)
Generate a single reaction step, instead of an entire synthesis pathway.
 
betterReactionSteps(self, reactionSteps1, reactionSteps2)
Decide which reaction sequence / synthesis provides a better problem example.
 
retrieveSyntheses(self, synthesisRequest, synthesisCount=1)
Retrieve syntheses from the database based upon the synthesisRequest.
 
preGenerateSyntheses(self, synthesisRequest, synthesisCount=1)
Generates a synthesis based upon the synthesisRequest, and then persists it into the database for rapid retrieval later.
 
clearSynthesisCache(self, synthesisRequest, maxAcceptable=0, maxDesired=0)
Look for pre-generated cached syntheses in the database that match the synthesisRequest.
Static Methods [hide private]
 
atomCount(mol)
Return number of atoms in the molecule, including hydrogens
 
selectBestProduct(productList)
Given a list of product molecules, select the one that is best to carry over or to use as the final target.
Class Variables [hide private]
  maxSteps = <CHEM.DB.rdb.search.NameRxnPatternMatchingModel.Sea...
  maxTries = <CHEM.DB.rdb.search.NameRxnPatternMatchingModel.Sea...
  objectCache = <CHEM.DB.rdb.search.NameRxnPatternMatchingModel....
Method Details [hide private]

__init__(self, maxSteps=0, maxTries=MAX_TRIES)
(Constructor)

 
Initialization constructor. Parameters to specify

__call__(self, reactantSmilesList, reagentList)
(Call operator)

 
Primary execution method, expects a list of molecules as the
starting reactants and a list of BaseReagent objects that can be applied
to the reactants.

Result follows reactionSteps structure of CHEM/Web/cgibin/reaction/PathwayWeb.py
which is just a list of 3-ples, each consisting of:
    (1) List of reactant SMILES strings
    (2) A BaseReagent object
    (3) List of product SMILES strings generated by applying the reagent to the reactants
Assuming these represent a sequential reaction pathway, the final product(s)
would be the product of the last (-1 index) 3-ple.

The length of the reactionSteps results (i.e., number of steps in the synthesis
pathway), is determined by how many sequential steps can be found, 
up to the maxSteps class attribute.

To get results containing actual reactant and product molecule objects,
possibly including additional reaction notes such as warning messages,
use the generateSynthesis method directly.

generateReactionStep(self, reactantList, reagentList, requiredReactants=None)

 
Generate a single reaction step, instead of an entire synthesis pathway. Just randomly go through the reagent list and try applying them to the reactants until a viable product is found. If additional requiredReactants are specified, only return reaction steps that are among the reactants.

betterReactionSteps(self, reactionSteps1, reactionSteps2)

 
Decide which reaction sequence / synthesis provides a better problem example. Factors considered include the longer sequence and which ones yields the least number of multi-product (unfocused) steps

selectBestProduct(productList)
Static Method

 

Given a list of product molecules, select the one that is best to carry over or to use as the final target.

Return one with most carbons but prefer lower warning_level

retrieveSyntheses(self, synthesisRequest, synthesisCount=1)

 
Retrieve syntheses from the database based upon the synthesisRequest. Many could match the criteria, so just randomly select several up to the synthesisCount. If not enough exist, then generate some on the fly right now.

preGenerateSyntheses(self, synthesisRequest, synthesisCount=1)

 
Generates a synthesis based upon the synthesisRequest, and then persists it into the database for rapid retrieval later. Return these as a list as well, just in case they are needed for immediate use.

clearSynthesisCache(self, synthesisRequest, maxAcceptable=0, maxDesired=0)

 
Look for pre-generated cached syntheses in the database that match the synthesisRequest. If there are more than the maxAcceptable, delete all of the oldest ones until maxDesired or less remains.

Class Variable Details [hide private]

maxSteps

Value:
None

maxTries

Value:
None

objectCache

Value:
None