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 =
71 bool specifiedStereoQueryMatchesUnspecified =
132template <
typename T1,
typename T2>
134 bool recursionPossible =
true,
bool useChirality =
false,
135 bool useQueryQueryMatches =
false) {
172template <
typename T1,
typename T2>
175 bool uniquify =
true,
bool recursionPossible =
true,
176 bool useChirality =
false,
177 bool useQueryQueryMatches =
false,
178 unsigned int maxMatches = 1000,
179 int numThreads = 1) {
188 return static_cast<unsigned int>(
matchVect.size());
198 bool recursionPossible,
bool useChirality,
199 bool useQueryQueryMatches) {
219 bool uniquify,
bool recursionPossible,
220 bool useChirality,
bool useQueryQueryMatches,
221 unsigned int maxMatches,
int numThreads) {
230 return static_cast<unsigned int>(
matchVect.size());
240 bool operator()(
const std::uint32_t q_c[],
const std::uint32_t m_c[]);
243 const ROMol &d_query;
246 std::unordered_map<unsigned int, StereoGroup const *> d_molStereoGroups;
247#ifdef RDK_INTERNAL_BITSET_HAS_HASH
249 using HashedStorageType = boost::dynamic_bitset<>;
252 using HashedStorageType = std::string;
254 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()