29 #ifndef CDPL_CHEM_PATTERNBASEDTAUTOMERIZATIONRULE_HPP
30 #define CDPL_CHEM_PATTERNBASEDTAUTOMERIZATIONRULE_HPP
114 template <
typename Iter>
117 structPatterns.push_back(molgraph);
119 patternBondChangeLists.resize(patternBondChangeLists.size() + 1);
121 std::copy(bond_chgs_beg, bond_chgs_end, std::back_inserter(patternBondChangeLists.back()));
169 bool applyTransformation(
Molecule& tautomer);
177 typedef std::vector<BondOrderChange> BondOrderChangeList;
178 typedef std::vector<BondOrderChangeList> BondOrderChangeListArray;
179 typedef std::vector<MolecularGraph::SharedPointer> StructPatternList;
180 typedef std::vector<SubstructureSearch::SharedPointer> SubstructureSearchList;
181 typedef std::vector<Util::BitSet*> BitSetList;
185 StructPatternList structPatterns;
186 StructPatternList excludePatterns;
187 BondOrderChangeListArray patternBondChangeLists;
188 SubstructureSearchList patternSubSearchList;
189 SubstructureSearchList excludeSubSearchList;
191 std::size_t currPatternIdx;
192 std::size_t currMappingIdx;
194 BitSetList excludeMatches;
Declaration of type CDPL::Util::BitSet.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::Chem::MolecularGraph.
Definition of class CDPL::Util::ObjectStack.
Definition of class CDPL::Chem::SubstructureSearch.
Definition of class CDPL::Chem::TautomerizationRule.
Data type for the storage and lookup of arbitrary atom to atom mappings.
Definition: AtomMapping.hpp:54
Abstract base class representing a chemical atom and its bonded neighborhood.
Definition: Atom.hpp:57
Data type for the storage and lookup of arbitrary bond to bond mappings.
Definition: BondMapping.hpp:54
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
std::shared_ptr< MolecularGraph > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MolecularGraph instances.
Definition: MolecularGraph.hpp:63
Abstract base class representing a mutable molecular graph that owns its atoms and bonds.
Definition: Molecule.hpp:53
SMARTS-pattern-based implementation of a Chem::TautomerizationRule.
Definition: PatternBasedTautomerizationRule.hpp:63
PatternBasedTautomerizationRule(unsigned int rule_id)
Constructs the PatternBasedTautomerizationRule instance with the given rule identifier.
void addExcludePattern(const MolecularGraph::SharedPointer &molgraph)
Registers an exclude pattern: when this substructure is present in the parent molecular graph,...
void addExcludePatterns(const PatternBasedTautomerizationRule &rule)
Copies all exclude patterns of rule into this rule.
PatternBasedTautomerizationRule(const PatternBasedTautomerizationRule &rule)
Constructs a copy of the PatternBasedTautomerizationRule instance rule.
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.
Definition: PatternBasedTautomerizationRule.hpp:115
void clearExcludePatterns()
Removes all registered exclude patterns.
unsigned int getID() const
Returns the rule identifier supplied at construction.
bool setup(MolecularGraph &parent_molgraph)
Prepares the rule for tautomer enumeration on parent_molgraph.
std::shared_ptr< PatternBasedTautomerizationRule > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated PatternBasedTautomerizationRule i...
Definition: PatternBasedTautomerizationRule.hpp:67
TautomerizationRule::SharedPointer clone() const
Creates and returns a deep copy of this rule.
PatternBasedTautomerizationRule & operator=(const PatternBasedTautomerizationRule &rule)
Replaces the state of this rule by a copy of the state of rule.
bool generate(Molecule &tautomer)
Writes the next tautomer reachable from the parent molecular graph into tautomer.
Subgraph-isomorphism search of a query molecular graph against a target molecular graph,...
Definition: SubstructureSearch.hpp:74
std::shared_ptr< SubstructureSearch > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated SubstructureSearch instances.
Definition: SubstructureSearch.hpp:86
Abstract base class for all tautomerization rule implementations used by the Chem::TautomerGenerator.
Definition: TautomerizationRule.hpp:50
std::shared_ptr< TautomerizationRule > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated TautomerizationRule instances.
Definition: TautomerizationRule.hpp:54
boost::dynamic_bitset BitSet
Dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.
Encodes a single bond-order change between two pattern atoms applied when the parent transformation p...
Definition: PatternBasedTautomerizationRule.hpp:74
std::size_t atom1ID
Pattern-atom ID of the first atom of the bond whose order changes.
Definition: PatternBasedTautomerizationRule.hpp:77
std::size_t atom2ID
Pattern-atom ID of the second atom of the bond whose order changes.
Definition: PatternBasedTautomerizationRule.hpp:79
long orderChange
Signed bond-order delta applied to the matched bond (positive = increase, negative = decrease).
Definition: PatternBasedTautomerizationRule.hpp:81