11 #ifndef RD_SUBSTRUCTMATCH_H
12 #define RD_SUBSTRUCTMATCH_H
17 #include <unordered_map>
26 class ResonanceMolSupplier;
34 bool useChirality =
false;
36 bool useEnhancedStereo =
false;
38 bool aromaticMatchesConjugated =
false;
40 bool useQueryQueryMatches =
false;
42 bool recursionPossible =
true;
44 unsigned int maxMatches = 1000;
50 std::function<bool(
const ROMol &mol,
51 const std::vector<unsigned int> &match)>
111 template <
typename T1,
typename T2>
113 bool recursionPossible =
true,
bool useChirality =
false,
114 bool useQueryQueryMatches =
false) {
120 std::vector<MatchVectType> matchVects =
SubstructMatch(mol, query, params);
121 if (matchVects.size()) {
122 matchVect = matchVects.front();
126 return matchVect.size() != 0;
151 template <
typename T1,
typename T2>
153 std::vector<MatchVectType> &matchVect,
154 bool uniquify =
true,
bool recursionPossible =
true,
155 bool useChirality =
false,
156 bool useQueryQueryMatches =
false,
157 unsigned int maxMatches = 1000,
158 int numThreads = 1) {
167 return matchVect.size();
177 bool recursionPossible,
bool useChirality,
178 bool useQueryQueryMatches) {
184 std::vector<MatchVectType> matchVects =
186 if (matchVects.size()) {
187 matchVect = matchVects.front();
191 return matchVect.size() != 0;
197 std::vector<MatchVectType> &matchVect,
198 bool uniquify,
bool recursionPossible,
199 bool useChirality,
bool useQueryQueryMatches,
200 unsigned int maxMatches,
int numThreads) {
209 return matchVect.size();
219 bool operator()(
const std::uint32_t q_c[],
const std::uint32_t m_c[])
const;
222 const ROMol &d_query;
225 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()