Applies a Chem::Reaction template to the reactant components of a target Chem::Reaction to generate the corresponding product molecules.
More...
#include <Reactor.hpp>
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.
◆ ReactionSite
Stores information about perceived reaction-sites.
◆ ReactionSiteIterator
A mutable random access iterator used to iterate over the perceived reaction-sites.
◆ ConstReactionSiteIterator
A constant random access iterator used to iterate over the perceived reaction-sites.
◆ Reactor() [1/3]
| CDPL::Chem::Reactor::Reactor |
( |
| ) |
|
Constructs and initializes a Reactor instance.
◆ Reactor() [2/3]
| CDPL::Chem::Reactor::Reactor |
( |
const 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. |
◆ Reactor() [3/3]
| CDPL::Chem::Reactor::Reactor |
( |
const Reactor & |
| ) |
|
|
delete |
◆ ~Reactor()
| CDPL::Chem::Reactor::~Reactor |
( |
| ) |
|
Destructor.
Destroys the Reactor instance and frees all allocated resources.
◆ operator=()
◆ setReactionPattern()
| void CDPL::Chem::Reactor::setReactionPattern |
( |
const 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()
| std::size_t CDPL::Chem::Reactor::getNumReactionSites |
( |
| ) |
const |
◆ getReactionSite() [1/2]
| ReactionSite& CDPL::Chem::Reactor::getReactionSite |
( |
std::size_t |
idx | ) |
|
Returns a non-const 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 non-
const reference to the reaction-site data object at index idx.
- Exceptions
-
◆ getReactionSite() [2/2]
| const ReactionSite& CDPL::Chem::Reactor::getReactionSite |
( |
std::size_t |
idx | ) |
const |
Returns a const 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
const reference to the reaction-site data object at index idx.
- Exceptions
-
◆ getReactionSitesBegin() [1/2]
Returns a mutable iterator pointing to the beginning of the stored reaction-site data objects.
- Returns
- A mutable iterator pointing to the beginning of the stored reaction-site data objects.
◆ getReactionSitesBegin() [2/2]
Returns a constant iterator pointing to the beginning of the stored reaction-site data objects.
- Returns
- A constant iterator pointing to the beginning of the stored reaction-site data objects.
◆ getReactionSitesEnd() [1/2]
Returns a mutable iterator pointing to the end of the stored reaction-site data objects.
- Returns
- A mutable iterator pointing to the end of the stored reaction-site data objects.
◆ getReactionSitesEnd() [2/2]
Returns a constant iterator pointing to the end of the stored reaction-site data objects.
- Returns
- A constant iterator pointing to the end of the stored reaction-site data objects.
◆ begin() [1/2]
Returns a mutable iterator pointing to the beginning of the stored reaction-site data objects.
- Returns
- A mutable iterator pointing to the beginning of the stored reaction-site data objects.
◆ begin() [2/2]
Returns a constant iterator pointing to the beginning of the stored reaction-site data objects.
- Returns
- A constant iterator pointing to the beginning of the stored reaction-site data objects.
◆ end() [1/2]
Returns a mutable iterator pointing to the end of the stored reaction-site data objects.
- Returns
- A mutable iterator pointing to the end of the stored reaction-site data objects.
◆ end() [2/2]
Returns a constant iterator pointing to the end of the stored reaction-site data objects.
- Returns
- A constant iterator pointing to the end of the stored reaction-site data objects.
◆ performReaction()
| void CDPL::Chem::Reactor::performReaction |
( |
const ReactionSite & |
rxn_site | ) |
|
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()
The documentation for this class was generated from the following file: