![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Substructure search pattern-based implementation of the Chem::TautomerizationRule interface. 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 PatternBasedTautomerizationRule instance that is copy of 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. More... | |
| void | addExcludePattern (const MolecularGraph::SharedPointer &molgraph) |
| Registers a rule exclude pattern. More... | |
| void | addExcludePatterns (const PatternBasedTautomerizationRule &rule) |
| Appends all registered search patterns of rule to the exclude pattern list of this rule. More... | |
| void | clearExcludePatterns () |
| Removes all registered exclude patterns. More... | |
| bool | setup (MolecularGraph &parent_molgraph) |
| Performs rule-specific setup work for the given molecular graph that shall be tautomerized. More... | |
| unsigned int | getID () const |
| Returns the rule identifier. More... | |
| bool | generate (Molecule &tautomer) |
| Generates the next tautomer of the parent molecular graph and stores it in molecule. More... | |
| TautomerizationRule::SharedPointer | clone () const |
| Returns a deep copy of this rule instance. More... | |
Public Member Functions inherited from CDPL::Chem::TautomerizationRule | |
| virtual | ~TautomerizationRule () |
| Virtual destructor. More... | |
Substructure search pattern-based implementation of the Chem::TautomerizationRule interface.
The rule is configured with a set of transformation patterns 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 rule identifier (returned by getID()). |
| CDPL::Chem::PatternBasedTautomerizationRule::PatternBasedTautomerizationRule | ( | const PatternBasedTautomerizationRule & | rule | ) |
Constructs a PatternBasedTautomerizationRule instance that is copy of rule.
| rule | The other rule 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 other rule to copy. |
|
inline |
Registers a new transformation pattern.
Bond order changes are read from the iterator range [bond_chgs_beg, bond_chgs_end). Each element must be a value of type BondOrderChange that specifies the bond to change via the mapping IDs of the match pattern atoms.
| Iter | Input iterator type yielding BondOrderChange values. |
| molgraph | The match pattern specifying the substructure to transform. |
| 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 a rule exclude pattern.
Any matching substructures present in the parent molecular graph will be excluded from structure transformations.
| molgraph | The exclude match pattern. |
| void CDPL::Chem::PatternBasedTautomerizationRule::addExcludePatterns | ( | const PatternBasedTautomerizationRule & | rule | ) |
Appends all registered search patterns of rule to the exclude pattern list of this rule.
| rule | The source rule whose search patterns shall be added. |
| void CDPL::Chem::PatternBasedTautomerizationRule::clearExcludePatterns | ( | ) |
Removes all registered exclude patterns.
|
virtual |
Performs rule-specific setup work for the given molecular graph that shall be tautomerized.
| parent_molgraph | The molecular graph to tautomerize. |
true if the rule can be applied to parent_molgraph and has been initialized, and false otherwise. Implements CDPL::Chem::TautomerizationRule.
|
virtual |
Returns the rule identifier.
Implements CDPL::Chem::TautomerizationRule.
Generates the next tautomer of the parent molecular graph and stores it in molecule.
| tautomer | The tautomer output molecule. |
true if a tautomer was generated, false if no more tautomers could be generated. Implements CDPL::Chem::TautomerizationRule.
|
virtual |
Returns a deep copy of this rule instance.
Implements CDPL::Chem::TautomerizationRule.