RDKit
Open-source cheminformatics and machine learning.
Reaction.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2007-2021, Novartis Institutes for BioMedical Research Inc.
3 // and other RDKit contributors
4 //
5 // All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are
9 // met:
10 //
11 // * Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 // * Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following
15 // disclaimer in the documentation and/or other materials provided
16 // with the distribution.
17 // * Neither the name of Novartis Institutes for BioMedical Research Inc.
18 // nor the names of its contributors may be used to endorse or promote
19 // products derived from this software without specific prior written
20 // permission.
21 //
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 //
34 
35 #include <RDGeneral/export.h>
36 #ifndef RD_REACTION_H_17Aug2006
37 #define RD_REACTION_H_17Aug2006
38 
39 #include <GraphMol/RDKitBase.h>
40 #include <RDGeneral/RDProps.h>
42 #include <vector>
43 
44 namespace RDKit {
45 class ReactionPickler;
46 
47 //! used to indicate an error in the chemical reaction engine
49  : public std::exception {
50  public:
51  //! construct with an error message
52  explicit ChemicalReactionException(const char *msg) : _msg(msg) {}
53  //! construct with an error message
54  explicit ChemicalReactionException(const std::string msg) : _msg(msg) {}
55  //! get the error message
56  const char *what() const noexcept override { return _msg.c_str(); }
57  ~ChemicalReactionException() noexcept override = default;
58 
59  private:
60  std::string _msg;
61 };
62 
63 //! This is a class for storing and applying general chemical reactions.
64 /*!
65  basic usage will be something like:
66 
67  \verbatim
68  ChemicalReaction rxn;
69  rxn.addReactantTemplate(r1);
70  rxn.addReactantTemplate(r2);
71  rxn.addProductTemplate(p1);
72  rxn.initReactantMatchers();
73 
74  MOL_SPTR_VECT prods;
75  for(MOL_SPTR_VECT::const_iterator r1It=reactantSet1.begin();
76  r1It!=reactantSet1.end();++r1It;){
77  for(MOL_SPTR_VECT::const_iterator r2It=reactantSet2.begin();
78  r2It!=reactantSet2.end();++r2It;){
79  MOL_SPTR_VECT rVect(2);
80  rVect[0] = *r1It;
81  rVect[1] = *r2It;
82 
83  std::vector<MOL_SPTR_VECT> lprods;
84  lprods = rxn.runReactants(rVect);
85  for(std::vector<MOL_SPTR_VECT>::const_iterator lpIt=lprods.begin();
86  lpIt!=lprods.end();++lpIt){
87  // we know this is a single-product reaction:
88  prods.push_back((*lpIt)[0]);
89  }
90  }
91  }
92  \endverbatim
93 
94  NOTES:
95  - to allow more control over the reaction, it is possible to flag reactant
96  atoms as being protected by setting the common_properties::_protected
97  property on those
98  atoms. Here's an example:
99  \verbatim
100  std::string smi="[O:1]>>[N:1]";
101  ChemicalReaction *rxn = RxnSmartsToChemicalReaction(smi);
102  rxn->initReactantMatchers();
103 
104  MOL_SPTR_VECT reacts;
105  reacts.clear();
106  smi = "OCO";
107  ROMol *mol = SmilesToMol(smi);
108  reacts.push_back(ROMOL_SPTR(mol));
109  std::vector<MOL_SPTR_VECT> prods;
110  prods = rxn->runReactants(reacts);
111  // here prods has two entries, because there are two Os in the
112  // reactant.
113 
114  reacts[0]->getAtomWithIdx(0)->setProp(common_properties::_protected,1);
115  prods = rxn->runReactants(reacts);
116  // here prods only has one entry, the reaction at atom 0
117  // has been blocked by the _protected property
118  \endverbatim
119 
120 */
122  friend class ReactionPickler;
123 
124  private:
125  void copy(const ChemicalReaction &other) {
126  RDProps::operator=(other);
127  df_needsInit = other.df_needsInit;
128  df_implicitProperties = other.df_implicitProperties;
129  m_reactantTemplates.clear();
130  m_reactantTemplates.reserve(other.m_reactantTemplates.size());
131  for (ROMOL_SPTR reactant_template : other.m_reactantTemplates) {
132  m_reactantTemplates.emplace_back(new RWMol(*reactant_template));
133  }
134  m_productTemplates.clear();
135  m_productTemplates.reserve(other.m_productTemplates.size());
136  for (ROMOL_SPTR product_template : other.m_productTemplates) {
137  m_productTemplates.emplace_back(new RWMol(*product_template));
138  }
139  m_agentTemplates.clear();
140  m_agentTemplates.reserve(other.m_agentTemplates.size());
141  for (ROMOL_SPTR agent_template : other.m_agentTemplates) {
142  m_agentTemplates.emplace_back(new RWMol(*agent_template));
143  }
144  }
145 
146  public:
148  //! construct a reaction from a pickle string
149  ChemicalReaction(const std::string &binStr);
151  copy(other);
152  }
154  if (this != &other) {
155  copy(other);
156  }
157  return *this;
158  }
159 
160  //! Adds a new reactant template
161  /*!
162  \return the number of reactants
163 
164  */
165  unsigned int addReactantTemplate(ROMOL_SPTR mol) {
166  this->df_needsInit = true;
167  this->m_reactantTemplates.push_back(mol);
168  return rdcast<unsigned int>(this->m_reactantTemplates.size());
169  }
170 
171  //! Adds a new agent template
172  /*!
173  \return the number of agent
174 
175  */
176  unsigned int addAgentTemplate(ROMOL_SPTR mol) {
177  this->m_agentTemplates.push_back(mol);
178  return rdcast<unsigned int>(this->m_agentTemplates.size());
179  }
180 
181  //! Adds a new product template
182  /*!
183  \return the number of products
184 
185  */
186  unsigned int addProductTemplate(ROMOL_SPTR mol) {
187  this->m_productTemplates.push_back(mol);
188  return rdcast<unsigned int>(this->m_productTemplates.size());
189  }
190 
191  //! Removes the reactant templates from a reaction if atom mapping ratio is
192  /// below a given threshold
193  /*! By default the removed reactant templates were attached to the agent
194  templates.
195  An alternative will be to provide a pointer to a molecule vector where
196  these reactants should be saved.
197  */
198  void removeUnmappedReactantTemplates(double thresholdUnmappedAtoms = 0.2,
199  bool moveToAgentTemplates = true,
200  MOL_SPTR_VECT *targetVector = nullptr);
201 
202  //! Removes the product templates from a reaction if its atom mapping ratio is
203  /// below a given threshold
204  /*! By default the removed products templates were attached to the agent
205  templates.
206  An alternative will be to provide a pointer to a molecule vector where
207  these products should be saved.
208  */
209  void removeUnmappedProductTemplates(double thresholdUnmappedAtoms = 0.2,
210  bool moveToAgentTemplates = true,
211  MOL_SPTR_VECT *targetVector = nullptr);
212 
213  /*! Removes the agent templates from a reaction if a pointer to a
214  molecule vector is provided the agents are stored therein.*/
215  void removeAgentTemplates(MOL_SPTR_VECT *targetVector = nullptr);
216 
217  //! Runs the reaction on a set of reactants
218  /*!
219 
220  \param reactants the reactants to be used. The length of this must be equal
221  to this->getNumReactantTemplates()
222  \param maxProducts: if non zero, the maximum number of products to generate
223  before stopping. If hit a warning will be generated.
224 
225  \return a vector of vectors of products. Each subvector will be
226  this->getNumProductTemplates() long.
227 
228  We return a vector of vectors of products because each individual template
229  may map multiple times onto its reactant. This leads to multiple possible
230  result sets.
231  */
232  std::vector<MOL_SPTR_VECT> runReactants(
233  const MOL_SPTR_VECT reactants, unsigned int numProducts = 1000) const;
234 
235  //! Runs a single reactant against a single reactant template
236  /*!
237  \param reactant The single reactant to use
238 
239  \param reactantTemplateIdx the reactant template to target in the reaction
240  */
241  std::vector<MOL_SPTR_VECT> runReactant(
242  ROMOL_SPTR reactant, unsigned int reactantTemplateIdx) const;
243 
244  //! Runs a single reactant in place (the reactant is modified)
245  /*!
246  This is only useable with reactions which have a single reactant and product
247  and where no atoms are added in the product.
248 
249  \param reactant The single reactant to use
250 
251  \return whether or not the reactant was actually modified
252  */
253  bool runReactant(RWMol &reactant) const;
254 
255  const MOL_SPTR_VECT &getReactants() const {
256  return this->m_reactantTemplates;
257  }
258  const MOL_SPTR_VECT &getAgents() const { return this->m_agentTemplates; }
259  const MOL_SPTR_VECT &getProducts() const { return this->m_productTemplates; }
260 
261  MOL_SPTR_VECT::const_iterator beginReactantTemplates() const {
262  return this->m_reactantTemplates.begin();
263  }
264  MOL_SPTR_VECT::const_iterator endReactantTemplates() const {
265  return this->m_reactantTemplates.end();
266  }
267 
268  MOL_SPTR_VECT::const_iterator beginProductTemplates() const {
269  return this->m_productTemplates.begin();
270  }
271  MOL_SPTR_VECT::const_iterator endProductTemplates() const {
272  return this->m_productTemplates.end();
273  }
274 
275  MOL_SPTR_VECT::const_iterator beginAgentTemplates() const {
276  return this->m_agentTemplates.begin();
277  }
278  MOL_SPTR_VECT::const_iterator endAgentTemplates() const {
279  return this->m_agentTemplates.end();
280  }
281 
282  MOL_SPTR_VECT::iterator beginReactantTemplates() {
283  return this->m_reactantTemplates.begin();
284  }
285  MOL_SPTR_VECT::iterator endReactantTemplates() {
286  return this->m_reactantTemplates.end();
287  }
288 
289  MOL_SPTR_VECT::iterator beginProductTemplates() {
290  return this->m_productTemplates.begin();
291  }
292  MOL_SPTR_VECT::iterator endProductTemplates() {
293  return this->m_productTemplates.end();
294  }
295 
296  MOL_SPTR_VECT::iterator beginAgentTemplates() {
297  return this->m_agentTemplates.begin();
298  }
299  MOL_SPTR_VECT::iterator endAgentTemplates() {
300  return this->m_agentTemplates.end();
301  }
302  unsigned int getNumReactantTemplates() const {
303  return rdcast<unsigned int>(this->m_reactantTemplates.size());
304  }
305  unsigned int getNumProductTemplates() const {
306  return rdcast<unsigned int>(this->m_productTemplates.size());
307  }
308  unsigned int getNumAgentTemplates() const {
309  return rdcast<unsigned int>(this->m_agentTemplates.size());
310  }
311 
312  //! initializes our internal reactant-matching datastructures.
313  /*!
314  This must be called after adding reactants and before calling
315  runReactants.
316 
317  \param silent: If this bool is true, no messages will be logged during the
318  validation. By default, validation problems are reported to the warning
319  and error logs depending on their severity.
320  */
321  void initReactantMatchers(bool silent = false);
322 
323  bool isInitialized() const { return !df_needsInit; }
324 
325  //! validates the reactants and products to make sure the reaction seems
326  /// "reasonable"
327  /*!
328  \return true if the reaction validates without errors (warnings do not
329  stop validation)
330 
331  \param numWarnings used to return the number of validation warnings
332  \param numErrors used to return the number of validation errors
333 
334  \param silent: If this bool is true, no messages will be logged during the
335  validation. By default, validation problems are reported to the warning
336  and error logs depending on their severity.
337 
338  */
339  bool validate(unsigned int &numWarnings, unsigned int &numErrors,
340  bool silent = false) const;
341 
342  //! returns whether or not the reaction uses implicit
343  //! properties on the product atoms
344  /*!
345 
346  This toggles whether or not unspecified atomic properties in the
347  products are considered to be implicit and should be copied from
348  the actual reactants. This is necessary due to a semantic difference
349  between the "reaction SMARTS" approach and the MDL RXN
350  approach:
351  In "reaction SMARTS", this reaction:
352  [C:1]-[Br:2].[O-:3]>>[C:1]-[O:3].[Br-:2]
353  applied to [CH4+]Br should yield [CH4+]O
354  Something similar drawn in an rxn file, and applied to
355  [CH4+]Br should yield [CH3]O.
356  In rxn there is no charge on the product C because nothing is
357  specified in the rxn file; in "SMARTS" the charge from the
358  actual reactants is not *removed* because no charge is
359  specified in the reaction.
360 
361  */
362  bool getImplicitPropertiesFlag() const { return df_implicitProperties; }
363  //! sets the implicit properties flag. See the documentation for
364  //! getImplicitProertiesFlag() for a discussion of what this means.
365  void setImplicitPropertiesFlag(bool val) { df_implicitProperties = val; }
366 
367  private:
368  bool df_needsInit{true};
369  bool df_implicitProperties{false};
370  MOL_SPTR_VECT m_reactantTemplates, m_productTemplates, m_agentTemplates;
371 };
372 
373 //! tests whether or not the molecule has a substructure match
374 //! to the reaction's reactants
375 //! the \c which argument is used to return which of the reactants
376 //! the molecule matches.
378  const ChemicalReaction &rxn, const ROMol &mol,
379  std::vector<unsigned int> &which, bool stopAtFirstMatch = false);
380 //! \overload
382  const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which);
383 //! \overload
385  const ChemicalReaction &rxn, const ROMol &mol);
386 
387 //! tests whether or not the molecule has a substructure match
388 //! to the reaction's products
389 //! the \c which argument is used to return which of the products
390 //! the molecule matches.
392  const ChemicalReaction &rxn, const ROMol &mol,
393  std::vector<unsigned int> &which, bool stopAtFirstMatch = false);
394 //! \overload
396  const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which);
397 //! \overload
399  const ChemicalReaction &rxn, const ROMol &mol);
400 
401 //! tests whether or not the molecule has a substructure match
402 //! to any of the reaction's agents
403 //! the \c which argument is used to return which of the agents
404 //! the molecule matches. If there's no match, it is equal to the number
405 //! of agents on return
407  const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which);
408 //! \overload
410  const ChemicalReaction &rxn, const ROMol &mol);
411 
412 //! returns indices of the atoms in each reactant that are changed
413 //! in the reaction
414 /*!
415  \param rxn the reaction we are interested in
416 
417  \param mappedAtomsOnly if set, atoms that are not mapped will not be included
418  in the list of changed atoms (otherwise they are automatically included)
419 
420  How are changed atoms recognized?
421  1) Atoms whose degree changes
422  2) Atoms whose bonding pattern changes
423  3) unmapped atoms (unless the mappedAtomsOnly flag is set)
424  4) Atoms connected to unmapped atoms
425  5) Atoms whose atomic number changes (unless the
426  corresponding product atom is a dummy)
427  6) Atoms with more than one atomic number query (unless the
428  corresponding product atom is a dummy)
429 
430  Note that the atomic number of a query atom depends on how it's constructed.
431  When coming from SMARTS: if the first query is an atomic label/number that
432  sets the atomic number, otherwise it's zero.
433  For example [O;$(OC)] is atomic number 8 while [$(OC);O] is atomic
434  number 0.
435  When coming from RXN: the atomic number of the atom in the rxn file sets
436  the value.
437  */
439 getReactingAtoms(const ChemicalReaction &rxn, bool mappedAtomsOnly = false);
440 
441 //! add the recursive queries to the reactants of a reaction
442 /*!
443  This does its work using RDKit::addRecursiveQueries()
444 
445  \param rxn the reaction we are interested in
446  \param queries - the dictionary of named queries to add
447  \param propName - the atom property to use to get query names
448  optional:
449  \param reactantLabels - to store pairs of (atom index, query string)
450  per reactant
451 
452  NOTES:
453  - existing query information, if present, will be supplemented (AND logic)
454  - non-query atoms will be replaced with query atoms using only the query
455  logic
456  - query names can be present as comma separated lists, they will then
457  be combined using OR logic.
458  - throws a KeyErrorException if a particular query name is not present
459  in \c queries
460 
461  */
463  ChemicalReaction &rxn, const std::map<std::string, ROMOL_SPTR> &queries,
464  const std::string &propName,
465  std::vector<std::vector<std::pair<unsigned int, std::string>>>
466  *reactantLabels = nullptr);
467 
468 } // namespace RDKit
469 
470 namespace RDDepict {
471 //! \brief Generate 2D coordinates (a depiction) for a reaction
472 /*!
473 
474  \param rxn the reaction we are interested in
475 
476  \param spacing the spacing between components of the reaction
477 
478  \param updateProps if set, properties such as conjugation and
479  hybridization will be calculated for the reactant and product
480  templates before generating coordinates. This should result in
481  better depictions, but can lead to errors in some cases.
482 
483  \param canonOrient canonicalize the orientation so that the long
484  axes align with the x-axis etc.
485 
486  \param nFlipsPerSample - the number of rotatable bonds that are
487  flipped at random for each sample
488 
489  \param nSamples - the number of samples
490 
491  \param sampleSeed - seed for the random sampling process
492 
493  \param permuteDeg4Nodes - try permuting the drawing order of bonds around
494  atoms with four neighbors in order to improve the depiction
495 
496  for the other parameters see the documentation for compute2DCoords()
497 
498 */
500  RDKit::ChemicalReaction &rxn, double spacing = 2.0, bool updateProps = true,
501  bool canonOrient = false, unsigned int nFlipsPerSample = 0,
502  unsigned int nSamples = 0, int sampleSeed = 0,
503  bool permuteDeg4Nodes = false);
504 
505 } // namespace RDDepict
506 
507 #endif
pulls in the core RDKit functionality
used to indicate an error in the chemical reaction engine
Definition: Reaction.h:49
ChemicalReactionException(const char *msg)
construct with an error message
Definition: Reaction.h:52
ChemicalReactionException(const std::string msg)
construct with an error message
Definition: Reaction.h:54
const char * what() const noexcept override
get the error message
Definition: Reaction.h:56
~ChemicalReactionException() noexcept override=default
This is a class for storing and applying general chemical reactions.
Definition: Reaction.h:121
unsigned int addProductTemplate(ROMOL_SPTR mol)
Adds a new product template.
Definition: Reaction.h:186
unsigned int addAgentTemplate(ROMOL_SPTR mol)
Adds a new agent template.
Definition: Reaction.h:176
unsigned int addReactantTemplate(ROMOL_SPTR mol)
Adds a new reactant template.
Definition: Reaction.h:165
unsigned int getNumAgentTemplates() const
Definition: Reaction.h:308
bool getImplicitPropertiesFlag() const
Definition: Reaction.h:362
std::vector< MOL_SPTR_VECT > runReactants(const MOL_SPTR_VECT reactants, unsigned int numProducts=1000) const
Runs the reaction on a set of reactants.
unsigned int getNumReactantTemplates() const
Definition: Reaction.h:302
ChemicalReaction(const std::string &binStr)
construct a reaction from a pickle string
MOL_SPTR_VECT::iterator beginProductTemplates()
Definition: Reaction.h:289
void removeUnmappedReactantTemplates(double thresholdUnmappedAtoms=0.2, bool moveToAgentTemplates=true, MOL_SPTR_VECT *targetVector=nullptr)
const MOL_SPTR_VECT & getProducts() const
Definition: Reaction.h:259
std::vector< MOL_SPTR_VECT > runReactant(ROMOL_SPTR reactant, unsigned int reactantTemplateIdx) const
Runs a single reactant against a single reactant template.
MOL_SPTR_VECT::const_iterator beginProductTemplates() const
Definition: Reaction.h:268
void initReactantMatchers(bool silent=false)
initializes our internal reactant-matching datastructures.
MOL_SPTR_VECT::const_iterator endReactantTemplates() const
Definition: Reaction.h:264
void setImplicitPropertiesFlag(bool val)
Definition: Reaction.h:365
MOL_SPTR_VECT::iterator endProductTemplates()
Definition: Reaction.h:292
bool runReactant(RWMol &reactant) const
Runs a single reactant in place (the reactant is modified)
unsigned int getNumProductTemplates() const
Definition: Reaction.h:305
const MOL_SPTR_VECT & getAgents() const
Definition: Reaction.h:258
const MOL_SPTR_VECT & getReactants() const
Definition: Reaction.h:255
MOL_SPTR_VECT::const_iterator endProductTemplates() const
Definition: Reaction.h:271
bool isInitialized() const
Definition: Reaction.h:323
ChemicalReaction & operator=(const ChemicalReaction &other)
Definition: Reaction.h:153
ChemicalReaction(const ChemicalReaction &other)
Definition: Reaction.h:150
MOL_SPTR_VECT::const_iterator beginAgentTemplates() const
Definition: Reaction.h:275
void removeAgentTemplates(MOL_SPTR_VECT *targetVector=nullptr)
MOL_SPTR_VECT::const_iterator beginReactantTemplates() const
Definition: Reaction.h:261
MOL_SPTR_VECT::iterator beginReactantTemplates()
Definition: Reaction.h:282
MOL_SPTR_VECT::iterator endAgentTemplates()
Definition: Reaction.h:299
MOL_SPTR_VECT::iterator beginAgentTemplates()
Definition: Reaction.h:296
MOL_SPTR_VECT::iterator endReactantTemplates()
Definition: Reaction.h:285
void removeUnmappedProductTemplates(double thresholdUnmappedAtoms=0.2, bool moveToAgentTemplates=true, MOL_SPTR_VECT *targetVector=nullptr)
MOL_SPTR_VECT::const_iterator endAgentTemplates() const
Definition: Reaction.h:278
bool validate(unsigned int &numWarnings, unsigned int &numErrors, bool silent=false) const
RDProps & operator=(const RDProps &rhs)
Definition: RDProps.h:24
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:32
handles pickling (serializing) reactions
#define RDKIT_CHEMREACTIONS_EXPORT
Definition: export.h:49
RDKIT_CHEMREACTIONS_EXPORT void compute2DCoordsForReaction(RDKit::ChemicalReaction &rxn, double spacing=2.0, bool updateProps=true, bool canonOrient=false, unsigned int nFlipsPerSample=0, unsigned int nSamples=0, int sampleSeed=0, bool permuteDeg4Nodes=false)
Generate 2D coordinates (a depiction) for a reaction.
Std stuff.
Definition: Abbreviations.h:19
std::vector< INT_VECT > VECT_INT_VECT
Definition: types.h:292
RDKIT_CHEMREACTIONS_EXPORT bool isMoleculeAgentOfReaction(const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which)
RDKIT_CHEMREACTIONS_EXPORT bool isMoleculeReactantOfReaction(const ChemicalReaction &rxn, const ROMol &mol, std::vector< unsigned int > &which, bool stopAtFirstMatch=false)
RDKIT_CHEMREACTIONS_EXPORT VECT_INT_VECT getReactingAtoms(const ChemicalReaction &rxn, bool mappedAtomsOnly=false)
RDKIT_CHEMREACTIONS_EXPORT bool isMoleculeProductOfReaction(const ChemicalReaction &rxn, const ROMol &mol, std::vector< unsigned int > &which, bool stopAtFirstMatch=false)
boost::shared_ptr< ROMol > ROMOL_SPTR
RDKIT_CHEMREACTIONS_EXPORT void addRecursiveQueriesToReaction(ChemicalReaction &rxn, const std::map< std::string, ROMOL_SPTR > &queries, const std::string &propName, std::vector< std::vector< std::pair< unsigned int, std::string >>> *reactantLabels=nullptr)
add the recursive queries to the reactants of a reaction
std::vector< boost::shared_ptr< ROMol > > MOL_SPTR_VECT
Definition: FragCatParams.h:20