|
Chemical Data Processing Library C++ API - Version 1.0.0
|
Go to the documentation of this file.
29 #ifndef CDPL_CHEM_MAXCOMMONATOMSUBSTRUCTURESEARCH_HPP
30 #define CDPL_CHEM_MAXCOMMONATOMSUBSTRUCTURESEARCH_HPP
36 #include <boost/iterator/indirect_iterator.hpp>
62 typedef std::vector<AtomBondMapping*> ABMappingList;
68 typedef boost::indirect_iterator<ABMappingList::iterator, AtomBondMapping>
MappingIterator;
73 typedef boost::indirect_iterator<ABMappingList::const_iterator, const AtomBondMapping>
ConstMappingIterator;
285 void initMatchExpressions();
287 bool buildAssocGraph();
289 bool findAssocGraphCliques(std::size_t);
290 bool isLegal(
const AGNode*);
294 bool hasPostMappingMatchExprs()
const;
297 bool foundMappingUnique();
299 void clearMappings();
301 void freeAtomBondMapping();
302 void freeAtomBondMappings();
303 void freeAssocGraph();
309 AGNode* allocAGNode(
const Atom*,
const Atom*);
310 AGEdge* allocAGEdge(
const Bond*,
const Bond*);
312 typedef std::vector<const AGEdge*> AGraphEdgeList;
318 void setQueryAtom(
const Atom*);
319 const Atom* getQueryAtom()
const;
321 void setAssocAtom(
const Atom*);
322 const Atom* getAssocAtom()
const;
324 void addEdge(
const AGEdge*);
326 bool isConnected(
const AGNode*)
const;
327 const AGEdge* findEdge(
const AGNode*)
const;
331 void setIndex(std::size_t idx);
335 const Atom* queryAtom;
336 const Atom* assocAtom;
338 AGraphEdgeList bondEdges;
345 void setQueryBond(
const Bond*);
346 const Bond* getQueryBond()
const;
348 void setAssocBond(
const Bond*);
349 const Bond* getAssocBond()
const;
351 void setNode1(
const AGNode*);
352 void setNode2(
const AGNode*);
354 const AGNode* getNode1()
const;
355 const AGNode* getNode2()
const;
357 const AGNode* getOther(
const AGNode*)
const;
360 const Bond* queryBond;
361 const Bond* assocBond;
370 void initQueryAtomMask(std::size_t);
371 void initTargetAtomMask(std::size_t);
373 void initQueryBondMask(std::size_t);
374 void initTargetBondMask(std::size_t);
376 void setQueryAtomBit(std::size_t);
377 void setTargetAtomBit(std::size_t);
379 void setQueryBondBit(std::size_t);
380 void setTargetBondBit(std::size_t);
384 bool operator<(
const ABMappingMask&)
const;
385 bool operator>(
const ABMappingMask&)
const;
396 typedef std::vector<AGNode*> AGraphNodeList;
397 typedef std::vector<AGraphNodeList> AGraphNodeMatrix;
398 typedef std::set<ABMappingMask> UniqueMappingList;
399 typedef std::vector<const Atom*> AtomList;
400 typedef std::vector<const Bond*> BondList;
401 typedef std::vector<MatchExpression<Atom, MolecularGraph>::SharedPointer> AtomMatchExprTable;
402 typedef std::vector<MatchExpression<Bond, MolecularGraph>::SharedPointer> BondMatchExprTable;
403 typedef Util::ObjectStack<AGNode> NodeCache;
404 typedef Util::ObjectStack<AGEdge> EdgeCache;
405 typedef Util::ObjectStack<AtomBondMapping> MappingCache;
407 const MolecularGraph* query;
408 const MolecularGraph* target;
409 AGraphNodeMatrix nodeMatrix;
410 ABMappingList foundMappings;
411 UniqueMappingList uniqueMappings;
412 AGraphEdgeList cliqueEdges;
413 AGraphNodeList cliqueNodes;
414 ABMappingMask mappingMask;
415 AtomMatchExprTable atomMatchExprTable;
416 BondMatchExprTable bondMatchExprTable;
417 MolGraphMatchExprPtr molGraphMatchExpr;
418 AtomList postMappingMatchAtoms;
419 BondList postMappingMatchBonds;
422 MappingCache mappingCache;
427 bool maxBondMappingsOnly;
428 std::size_t numQueryAtoms;
429 std::size_t numQueryBonds;
430 std::size_t numTargetAtoms;
431 std::size_t numTargetBonds;
432 std::size_t maxAtomSubstructureSize;
433 std::size_t maxBondSubstructureSize;
434 std::size_t currNumNullNodes;
435 std::size_t minNumNullNodes;
436 std::size_t maxNumMappings;
437 std::size_t minSubstructureSize;
438 std::size_t currNodeIdx;
443 #endif // CDPL_CHEM_MAXCOMMONATOMSUBSTRUCTURESEARCH_HPP
MaxCommonAtomSubstructureSearch.
Definition: MaxCommonAtomSubstructureSearch.hpp:60
boost::indirect_iterator< ABMappingList::iterator, AtomBondMapping > MappingIterator
A mutable random access iterator used to iterate over the stored atom/bond mapping objects.
Definition: MaxCommonAtomSubstructureSearch.hpp:68
Definition of the class CDPL::Util::ObjectStack.
MappingIterator getMappingsBegin()
Returns a mutable iterator pointing to the beginning of the stored atom/bond mapping objects.
Definition of the preprocessor macro CDPL_CHEM_API.
ConstMappingIterator end() const
Returns a constant iterator pointing to the end of the stored atom/bond mapping objects.
std::size_t getMaxNumMappings() const
Returns the specified limit on the number of stored atom/bond mappings.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
MappingIterator getMappingsEnd()
Returns a mutable iterator pointing to the end of the stored atom/bond mapping objects.
Bond.
Definition: Bond.hpp:50
MappingIterator begin()
Returns a mutable iterator pointing to the beginning of the stored atom/bond mapping objects.
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
Atom.
Definition: Atom.hpp:52
bool mappingExists(const MolecularGraph &target)
Searches for a common substructure between the query and the specified target molecular graph.
ConstMappingIterator getMappingsEnd() const
Returns a constant iterator pointing to the end of the stored atom/bond mapping objects.
void setMinSubstructureSize(std::size_t min_size)
Allows to specify the minimum accepted common substructure size.
MolecularGraph.
Definition: MolecularGraph.hpp:52
Definition of the type CDPL::Util::BitSet.
ConstMappingIterator begin() const
Returns a constant iterator pointing to the beginning of the stored atom/bond mapping objects.
boost::indirect_iterator< ABMappingList::const_iterator, const AtomBondMapping > ConstMappingIterator
A constant random access iterator used to iterate over the stored atom/bond mapping objects.
Definition: MaxCommonAtomSubstructureSearch.hpp:73
std::size_t getNumMappings() const
Returns the number of atom/bond mappings that were recorded in the last search for common substructur...
bool operator<(const Array< ValueType > &array1, const Array< ValueType > &array2)
Less than comparison operator.
bool uniqueMappingsOnly() const
Tells whether duplicate atom/bond mappings are discarded.
std::shared_ptr< MatchExpression > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MatchExpression instances.
Definition: MatchExpression.hpp:81
void setMaxNumMappings(std::size_t max_num_mappings)
Allows to specify a limit on the number of stored atom/bond mappings.
MaxCommonAtomSubstructureSearch(const MolecularGraph &query)
Constructs and initializes a MaxCommonAtomSubstructureSearch instance for the specified query structu...
Definition of the class CDPL::Chem::AtomBondMapping.
bool findMaxBondMappings(const MolecularGraph &target)
Searches for all atom/bond mappings of query subgraphs to substructures of the specified target molec...
MappingIterator end()
Returns a mutable iterator pointing to the end of the stored atom/bond mapping objects.
MaxCommonAtomSubstructureSearch()
Constructs and initializes a MaxCommonAtomSubstructureSearch instance.
Definition of the class CDPL::Chem::MatchExpression.
The namespace of the Chemical Data Processing Library.
void setQuery(const MolecularGraph &query)
Allows to specify a new query structure.
bool findAllMappings(const MolecularGraph &target)
Searches for all atom/bond mappings of query subgraphs to substructures of the specified target molec...
void uniqueMappingsOnly(bool unique)
Allows to specify whether or not to store only unique atom/bond mappings.
AtomBondMapping & getMapping(std::size_t idx)
Returns a non-const reference to the stored atom/bond mapping object at index idx.
A data structure for the common storage of related atom to atom and bond to bond mappings.
Definition: AtomBondMapping.hpp:55
ConstMappingIterator getMappingsBegin() const
Returns a constant iterator pointing to the beginning of the stored atom/bond mapping objects.
std::size_t getMinSubstructureSize() const
Returns the minimum accepted common substructure size.
bool operator>(const Array< ValueType > &array1, const Array< ValueType > &array2)
Greater than comparison operator.
const AtomBondMapping & getMapping(std::size_t idx) const
Returns a const reference to the stored atom/bond mapping object at index idx.
~MaxCommonAtomSubstructureSearch()
Destructor.