11#ifndef RD_SUBSTRUCTMATCH_H
12#define RD_SUBSTRUCTMATCH_H
17#include <unordered_map>
26class ResonanceMolSupplier;
34 bool useChirality =
false;
36 bool useEnhancedStereo =
false;
38 bool aromaticMatchesConjugated =
false;
40 bool useQueryQueryMatches =
false;
42 bool useGenericMatchers =
false;
44 bool recursionPossible =
true;
46 unsigned int maxMatches = 1000;
52 std::function<bool(
const ROMol &mol,
53 const std::vector<unsigned int> &match)>
113template <
typename T1,
typename T2>
115 bool recursionPossible =
true,
bool useChirality =
false,
116 bool useQueryQueryMatches =
false) {
122 std::vector<MatchVectType> matchVects =
SubstructMatch(mol, query, params);
123 if (matchVects.size()) {
124 matchVect = matchVects.front();
128 return matchVect.size() != 0;
153template <
typename T1,
typename T2>
155 std::vector<MatchVectType> &matchVect,
156 bool uniquify =
true,
bool recursionPossible =
true,
157 bool useChirality =
false,
158 bool useQueryQueryMatches =
false,
159 unsigned int maxMatches = 1000,
160 int numThreads = 1) {
169 return static_cast<unsigned int>(matchVect.size());
179 bool recursionPossible,
bool useChirality,
180 bool useQueryQueryMatches) {
186 std::vector<MatchVectType> matchVects =
188 if (matchVects.size()) {
189 matchVect = matchVects.front();
193 return matchVect.size() != 0;
199 std::vector<MatchVectType> &matchVect,
200 bool uniquify,
bool recursionPossible,
201 bool useChirality,
bool useQueryQueryMatches,
202 unsigned int maxMatches,
int numThreads) {
211 return static_cast<unsigned int>(matchVect.size());
221 bool operator()(
const std::uint32_t q_c[],
const std::uint32_t m_c[])
const;
224 const ROMol &d_query;
227 std::unordered_map<unsigned int, StereoGroup const *> d_molStereoGroups;
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[]) const
#define RDKIT_SUBSTRUCTMATCH_EXPORT
std::vector< std::pair< int, int > > MatchVectType
used to return matches from substructure searching, The format is (queryAtomIdx, molAtomIdx)
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)
unsigned int maxMatches
maximum number of matches to return
bool uniquify
uniquify (by atom index) match results
bool recursionPossible
Allow recursive queries.
bool useQueryQueryMatches
std::function< bool(const ROMol &mol, const std::vector< unsigned int > &match)> extraFinalCheck
SubstructMatchParameters()