![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
SMARTS-pattern-based implementation of a Chem::TautomerizationRule. More...
#include <PatternBasedTautomerizationRule.hpp>
Inheritance diagram for CDPL::Chem::PatternBasedTautomerizationRule:Classes | |
| struct | BondOrderChange |
| Encodes a single bond-order change between two pattern atoms applied when the parent transformation pattern matches. More... | |
Public Types | |
| typedef std::shared_ptr< PatternBasedTautomerizationRule > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated PatternBasedTautomerizationRule instances. More... | |
Public Types inherited from CDPL::Chem::TautomerizationRule | |
| typedef std::shared_ptr< TautomerizationRule > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated TautomerizationRule instances. More... | |
Public Member Functions | |
| PatternBasedTautomerizationRule (unsigned int rule_id) | |
Constructs the PatternBasedTautomerizationRule instance with the given rule identifier. More... | |
| PatternBasedTautomerizationRule (const PatternBasedTautomerizationRule &rule) | |
Constructs a copy of the PatternBasedTautomerizationRule instance rule. More... | |
| PatternBasedTautomerizationRule & | operator= (const PatternBasedTautomerizationRule &rule) |
| Replaces the state of this rule by a copy of the state of rule. More... | |
| template<typename Iter > | |
| void | addTransformationPattern (const MolecularGraph::SharedPointer &molgraph, Iter bond_chgs_beg, Iter bond_chgs_end) |
| Registers a new transformation pattern together with the associated bond-order changes. More... | |
| void | addExcludePattern (const MolecularGraph::SharedPointer &molgraph) |
| Registers an exclude pattern: when this substructure is present in the parent molecular graph, the matching transformation will not be applied. More... | |
| void | addExcludePatterns (const PatternBasedTautomerizationRule &rule) |
| Copies all exclude patterns of rule into this rule. More... | |
| void | clearExcludePatterns () |
| Removes all registered exclude patterns. More... | |
| bool | setup (MolecularGraph &parent_molgraph) |
| Prepares the rule for tautomer enumeration on parent_molgraph. More... | |
| unsigned int | getID () const |
| Returns the rule identifier supplied at construction. More... | |
| bool | generate (Molecule &tautomer) |
| Writes the next tautomer reachable from the parent molecular graph into tautomer. More... | |
| TautomerizationRule::SharedPointer | clone () const |
| Creates and returns a deep copy of this rule. More... | |
Public Member Functions inherited from CDPL::Chem::TautomerizationRule | |
| virtual | ~TautomerizationRule () |
| Virtual destructor. More... | |
SMARTS-pattern-based implementation of a Chem::TautomerizationRule.
The rule is configured with a set of transformation patterns (SMARTS queries describing the source substructure together with per-atom-pair bond-order changes that apply when the pattern matches) plus optional exclude patterns (substructures that, when present, suppress the application of the rule). The setup() / generate() pair from the base class then enumerates the tautomers reachable from the parent molecular graph by applying the configured transformations.
| typedef std::shared_ptr<PatternBasedTautomerizationRule> CDPL::Chem::PatternBasedTautomerizationRule::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated PatternBasedTautomerizationRule instances.
| CDPL::Chem::PatternBasedTautomerizationRule::PatternBasedTautomerizationRule | ( | unsigned int | rule_id | ) |
Constructs the PatternBasedTautomerizationRule instance with the given rule identifier.
| rule_id | The numeric rule identifier (returned by getID() and forwarded to the generated tautomers). |
| CDPL::Chem::PatternBasedTautomerizationRule::PatternBasedTautomerizationRule | ( | const PatternBasedTautomerizationRule & | rule | ) |
Constructs a copy of the PatternBasedTautomerizationRule instance rule.
| rule | The PatternBasedTautomerizationRule to copy. |
| PatternBasedTautomerizationRule& CDPL::Chem::PatternBasedTautomerizationRule::operator= | ( | const PatternBasedTautomerizationRule & | rule | ) |
Replaces the state of this rule by a copy of the state of rule.
| rule | The source PatternBasedTautomerizationRule. |
|
inline |
Registers a new transformation pattern together with the associated bond-order changes.
Bond-order changes are read from the iterator range [bond_chgs_beg, bond_chgs_end); each element must be a BondOrderChange value referring to atom IDs of molgraph.
| Iter | Input iterator type yielding BondOrderChange values. |
| molgraph | The SMARTS transformation pattern. |
| bond_chgs_beg | Iterator pointing to the first bond-order change. |
| bond_chgs_end | Iterator pointing one past the last bond-order change. |
| void CDPL::Chem::PatternBasedTautomerizationRule::addExcludePattern | ( | const MolecularGraph::SharedPointer & | molgraph | ) |
Registers an exclude pattern: when this substructure is present in the parent molecular graph, the matching transformation will not be applied.
| molgraph | The exclude SMARTS pattern. |
| void CDPL::Chem::PatternBasedTautomerizationRule::addExcludePatterns | ( | const PatternBasedTautomerizationRule & | rule | ) |
Copies all exclude patterns of rule into this rule.
| rule | The source rule whose exclude patterns are copied. |
| void CDPL::Chem::PatternBasedTautomerizationRule::clearExcludePatterns | ( | ) |
Removes all registered exclude patterns.
|
virtual |
Prepares the rule for tautomer enumeration on parent_molgraph.
| parent_molgraph | The parent molecular graph from which tautomers are generated. |
true if the rule could be set up (at least one transformation pattern matched), and false otherwise. Implements CDPL::Chem::TautomerizationRule.
|
virtual |
Returns the rule identifier supplied at construction.
Implements CDPL::Chem::TautomerizationRule.
Writes the next tautomer reachable from the parent molecular graph into tautomer.
| tautomer | The output molecule receiving the next tautomer. |
true if a new tautomer was generated, and false when the enumeration is exhausted. Implements CDPL::Chem::TautomerizationRule.
|
virtual |
Creates and returns a deep copy of this rule.
Implements CDPL::Chem::TautomerizationRule.