Applies a Chem.Reaction template to the reactant components of a target Chem.Reaction to generate the corresponding product molecules.
More...
Applies a Chem.Reaction template to the reactant components of a target Chem.Reaction to generate the corresponding product molecules.
The reaction pattern (a Chem.Reaction with atom-mapped reactant and product templates) is installed via setReactionPattern(). findReactionSites() then locates all matching substructures on the target reaction's reactants — internally using Chem.ReactionSubstructureSearch — and stores them as Reactor.ReactionSite instances. Calling performReaction() for a given reaction-site copies the matched reactants, applies the bond/atom changes encoded in the pattern, and appends the resulting product molecules to the target reaction's product list.
◆ __init__()
| None CDPL.Chem.Reactor.__init__ |
( |
Reaction |
rxn_pattern | ) |
|
Constructs and initializes a Reactor instance for the specified reaction pattern.
- Parameters
-
| rxn_pattern | The reaction pattern describing the transformation of reactants to products. |
◆ getObjectID()
| int CDPL.Chem.Reactor.getObjectID |
( |
| ) |
|
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python Reactor instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two Reactor instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().
- Returns
- The numeric ID of the internally referenced C++ class instance.
◆ setReactionPattern()
| None CDPL.Chem.Reactor.setReactionPattern |
( |
Reaction |
rxn_pattern | ) |
|
Allows to specify a new reaction pattern for the transformation of reactants to products.
- Parameters
-
| rxn_pattern | The reaction pattern describing the transformation of reactants to products. |
◆ findReactionSites()
| bool CDPL.Chem.Reactor.findReactionSites |
( |
Reaction |
rxn_target | ) |
|
Perceives all possible reaction-sites on the reactants of the given reaction target where the specified reaction pattern can be applied.
The specified Chem.Reaction instance rxn_target serves both as a provider for the starting materials (reactant components) in a later reaction transformation (see performReaction()) as well as a container for the generated reaction products.
- Parameters
-
| rxn_target | The reaction target providing the reactants to be transformed. |
- Returns
True if matching reaction-sites were found, and False otherwise.
- Note
- Any reaction-site mappings that were recorded in a previous call to findReactionSites() will be discarded.
- See also
- performReaction()
◆ getNumReactionSites()
| int CDPL.Chem.Reactor.getNumReactionSites |
( |
| ) |
|
◆ getReactionSite()
Returns a reference to the stored reaction-site data object at index idx.
- Parameters
-
| idx | The zero-based index of the reaction-site data object to return. |
- Returns
- A reference to the reaction-site data object at index idx.
- Exceptions
-
◆ performReaction()
Performs a transformation of the target reactants to corresponding products at the specified reaction-site.
The reactant components of the Chem.Reaction object specified in a prior call to findReactionSites() serve as starting materials for the reaction transformation into corresponding product molecules (according to the set reaction pattern). The input molecules are left unchanged by the transformation. New molecules will be generated that are directly stored as the product components of the given target reaction object. Note that the product molecules generated in a previous call will not be discarded and are still accessible after new products have been generated.
- Parameters
-
| rxn_site | Specifies the reaction-site where the transformation shall take place. |
- See also
- setReactionPattern(), findReactionSites()