11#ifndef RD_SUBSTRUCTMATCH_H
12#define RD_SUBSTRUCTMATCH_H
17#include <unordered_set>
19#include <unordered_map>
23#include <boost/dynamic_bitset.hpp>
24#if BOOST_VERSION >= 107100
25#define RDK_INTERNAL_BITSET_HAS_HASH
34class ResonanceMolSupplier;
42 bool useChirality =
false;
44 bool useEnhancedStereo =
false;
46 bool aromaticMatchesConjugated =
false;
48 bool useQueryQueryMatches =
false;
50 bool useGenericMatchers =
false;
52 bool recursionPossible =
true;
54 unsigned int maxMatches = 1000;
64 std::function<bool(
const ROMol &mol,
65 const std::vector<unsigned int> &match)>
68 unsigned int maxRecursiveMatches =
129template <
typename T1,
typename T2>
131 bool recursionPossible =
true,
bool useChirality =
false,
132 bool useQueryQueryMatches =
false) {
169template <
typename T1,
typename T2>
172 bool uniquify =
true,
bool recursionPossible =
true,
173 bool useChirality =
false,
174 bool useQueryQueryMatches =
false,
175 unsigned int maxMatches = 1000,
176 int numThreads = 1) {
185 return static_cast<unsigned int>(
matchVect.size());
195 bool recursionPossible,
bool useChirality,
196 bool useQueryQueryMatches) {
216 bool uniquify,
bool recursionPossible,
217 bool useChirality,
bool useQueryQueryMatches,
218 unsigned int maxMatches,
int numThreads) {
227 return static_cast<unsigned int>(
matchVect.size());
237 bool operator()(
const std::uint32_t q_c[],
const std::uint32_t m_c[]);
240 const ROMol &d_query;
243 std::unordered_map<unsigned int, StereoGroup const *> d_molStereoGroups;
244#ifdef RDK_INTERNAL_BITSET_HAS_HASH
246 using HashedStorageType = boost::dynamic_bitset<>;
249 using HashedStorageType = std::string;
251 std::unordered_set<HashedStorageType> matchesSeen;
Defines the class StereoGroup which stores relationships between the absolute configurations of atoms...
MolBundle contains a collection of related ROMols.
MolMatchFinalCheckFunctor(const ROMol &query, const ROMol &mol, const SubstructMatchParameters &ps)
bool operator()(const std::uint32_t q_c[], const std::uint32_t m_c[])
#define RDKIT_SUBSTRUCTMATCH_EXPORT
std::vector< std::pair< int, int > > MatchVectType
used to return matches from substructure searching, The format is (queryAtomIdx, molAtomIdx)
bool rdvalue_is(const RDValue_cast_t)
RDKIT_SUBSTRUCTMATCH_EXPORT std::vector< MatchVectType > SubstructMatch(const ROMol &mol, const ROMol &query, const SubstructMatchParameters ¶ms=SubstructMatchParameters())
Find a substructure match for a query in a molecule.
RDKIT_SUBSTRUCTMATCH_EXPORT void updateSubstructMatchParamsFromJSON(SubstructMatchParameters ¶ms, const std::string &json)
RDKIT_SUBSTRUCTMATCH_EXPORT std::string substructMatchParamsToJSON(const SubstructMatchParameters ¶ms)
unsigned int maxMatches
maximum number of matches to return
bool uniquify
uniquify (by atom index) match results
std::vector< std::string > atomProperties
std::vector< std::string > bondProperties
bool recursionPossible
Allow recursive queries.
bool useQueryQueryMatches
std::function< bool(const ROMol &mol, const std::vector< unsigned int > &match)> extraFinalCheck
SubstructMatchParameters()