Module ReactionModel
Common objects / base classes used to support reaction processing.
Primarily revolves around Reagent object models to predict products
from input reactants. The example code below illustrates how to load
existing reagents from the database using the ReagentSearchModel and
SMIRKSReagent.loadDBInstances method. Once these are ready, and any
settings are made (such as the removal of inherent products), the reagent
as a functor which can take in a list of reactant molecule objects and
generated predicted product molecule objects.
>>> from CHEM.Common.Util import molBySmiles;
>>> from CHEM.CombiCDB.ReactionModel import SMIRKSReagent, ReagentSearchModel, reactionStepStr;
>>> from CHEM.CombiCDB.test.ReagentIdentifiers import HYDROBROMINATION;
>>> reagentQuery = ReagentSearchModel();
>>> reagentQuery.reagentIDs = [HYDROBROMINATION];
>>> reagents = SMIRKSReagent.loadDBInstances( reagentQuery );
>>> reagent = reagents[0];
>>> reagent.removeInherentProducts = True;
>>> print reagent["reagent_id"], reagent["description"];
1 Hydrobromination
>>> reactants = [molBySmiles("CC=C")];
>>> products = reagent( reactants );
>>> reactionStep = ( reactants, reagent, products );
>>> print reactionStepStr( reactionStep ).replace("\t"," ");
CC=C>>CC(C)Br Hydrobromination
|
BaseReagent
Generic object class to model reaction reagents.
|
|
SMIRKSReagent
Specific implementation of BaseReagent that uses SMIRKS string
processing to execute the transformations.
|
|
TrackingDataModel
Simple struct to store tracking variables while processing
reagents.
|
|
SupplementalDataModel
Simple struct to store supplemental data that can be returned
after reagent processing if the caller is interested.
|
|
ReagentSearchModel
Simple struct containing query parameters indicating which
reagents to pull out of the database.
|
|
ReactionStep
Class to represent a single step in a reaction synthesis pathway.
|
|
countAtomCharges(molList,
chargeValue)
Go through every atom of every molecule in the list. |
|
|
|
clearSentinelCharges(mol,
chargeValue)
Look for atoms in the molecule with the specified sentinel charge
value and clear them out to normal values. |
|
|
|
reactionStepStr(reactionStep)
Convenience function for converting a reaction step into a
comprehensible string. |
|
|
|
REACTANTS = 0
|
|
REAGENT = 1
|
|
PRODUCTS = 2
|
countAtomCharges(molList,
chargeValue)
|
|
Go through every atom of every molecule in the list. Count up the
number of them whose formal charge is equal to the specified
chargeValue
|
clearSentinelCharges(mol,
chargeValue)
|
|
Look for atoms in the molecule with the specified sentinel charge
value and clear them out to normal values. Returns whether any such
changes were made.
|
reactionStepStr(reactionStep)
|
|
Convenience function for converting a reaction step into a
comprehensible string. Reaction step model is currently just a 3-ple
consisting of
-
List of reactant SMILES strings (or molecule objects)
-
Reagent object
-
List of product SMILES strings (or molecule objects)
|