11#ifndef RD_SUBSTRUCTMATCH_H
12#define RD_SUBSTRUCTMATCH_H
17#include <unordered_set>
19#include <unordered_map>
24#include <boost/dynamic_bitset.hpp>
25#if BOOST_VERSION >= 107100
26#define RDK_INTERNAL_BITSET_HAS_HASH
35class ResonanceMolSupplier;
43 bool useChirality =
false;
45 bool useEnhancedStereo =
false;
47 bool aromaticMatchesConjugated =
false;
49 bool useQueryQueryMatches =
false;
51 bool useGenericMatchers =
false;
53 bool recursionPossible =
true;
55 unsigned int maxMatches = 1000;
65 std::function<bool(
const ROMol &mol,
66 std::span<const unsigned int> match)>
69 unsigned int maxRecursiveMatches =
72 bool specifiedStereoQueryMatchesUnspecified =
75 bool aromaticMatchesSingleOrDouble =
false;
135template <
typename T1,
typename T2>
137 bool recursionPossible =
true,
bool useChirality =
false,
138 bool useQueryQueryMatches =
false) {
175template <
typename T1,
typename T2>
178 bool uniquify =
true,
bool recursionPossible =
true,
179 bool useChirality =
false,
180 bool useQueryQueryMatches =
false,
181 unsigned int maxMatches = 1000,
182 int numThreads = 1) {
191 return static_cast<unsigned int>(
matchVect.size());
201 bool recursionPossible,
bool useChirality,
202 bool useQueryQueryMatches) {
222 bool uniquify,
bool recursionPossible,
223 bool useChirality,
bool useQueryQueryMatches,
224 unsigned int maxMatches,
int numThreads) {
233 return static_cast<unsigned int>(
matchVect.size());
243 bool operator()(
const std::uint32_t q_c[],
const std::uint32_t m_c[]);
246 const ROMol &d_query;
249 std::unordered_map<unsigned int, StereoGroup const *> d_molStereoGroups;
250#ifdef RDK_INTERNAL_BITSET_HAS_HASH
252 using HashedStorageType = boost::dynamic_bitset<>;
255 using HashedStorageType = std::string;
257 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)
std::function< bool(const ROMol &mol, std::span< const unsigned int > match)> extraFinalCheck
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
SubstructMatchParameters()