RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
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 <string_view>
43#include <vector>
44
45namespace RDKit {
46class ReactionPickler;
47
48//! used to indicate an error in the chemical reaction engine
50 : public std::exception {
51 public:
52 //! construct with an error message
53 explicit ChemicalReactionException(const char *msg) : _msg(msg) {}
54 //! construct with an error message
55 explicit ChemicalReactionException(const std::string msg) : _msg(msg) {}
56 //! get the error message
57 const char *what() const noexcept override { return _msg.c_str(); }
58 ~ChemicalReactionException() noexcept override = default;
59
60 private:
61 std::string _msg;
62};
63
64//! This is a class for storing and applying general chemical reactions.
65/*!
66 basic usage will be something like:
67
68 \verbatim
69 ChemicalReaction rxn;
70 rxn.addReactantTemplate(r1);
71 rxn.addReactantTemplate(r2);
72 rxn.addProductTemplate(p1);
73 rxn.initReactantMatchers();
74
75 MOL_SPTR_VECT prods;
76 for(MOL_SPTR_VECT::const_iterator r1It=reactantSet1.begin();
77 r1It!=reactantSet1.end();++r1It;){
78 for(MOL_SPTR_VECT::const_iterator r2It=reactantSet2.begin();
79 r2It!=reactantSet2.end();++r2It;){
80 MOL_SPTR_VECT rVect(2);
81 rVect[0] = *r1It;
82 rVect[1] = *r2It;
83
84 std::vector<MOL_SPTR_VECT> lprods;
85 lprods = rxn.runReactants(rVect);
86 for(std::vector<MOL_SPTR_VECT>::const_iterator lpIt=lprods.begin();
87 lpIt!=lprods.end();++lpIt){
88 // we know this is a single-product reaction:
89 prods.push_back((*lpIt)[0]);
90 }
91 }
92 }
93 \endverbatim
94
95 NOTES:
96 - to allow more control over the reaction, it is possible to flag reactant
97 atoms as being protected by setting the common_properties::_protected
98 property on those
99 atoms. Here's an example:
100 \verbatim
101 std::string smi="[O:1]>>[N:1]";
102 ChemicalReaction *rxn = RxnSmartsToChemicalReaction(smi);
103 rxn->initReactantMatchers();
104
105 MOL_SPTR_VECT reacts;
106 reacts.clear();
107 smi = "OCO";
108 ROMol *mol = SmilesToMol(smi);
109 reacts.push_back(ROMOL_SPTR(mol));
110 std::vector<MOL_SPTR_VECT> prods;
111 prods = rxn->runReactants(reacts);
112 // here prods has two entries, because there are two Os in the
113 // reactant.
114
115 reacts[0]->getAtomWithIdx(0)->setProp(common_properties::_protected,1);
116 prods = rxn->runReactants(reacts);
117 // here prods only has one entry, the reaction at atom 0
118 // has been blocked by the _protected property
119 \endverbatim
120
121*/
123 friend class ReactionPickler;
124
125 private:
126 void copy(const ChemicalReaction &other) {
127 RDProps::operator=(other);
128 df_needsInit = other.df_needsInit;
129 df_implicitProperties = other.df_implicitProperties;
130 m_reactantTemplates.clear();
131 m_reactantTemplates.reserve(other.m_reactantTemplates.size());
132 for (ROMOL_SPTR reactant_template : other.m_reactantTemplates) {
133 m_reactantTemplates.emplace_back(new RWMol(*reactant_template));
134 }
135 m_productTemplates.clear();
136 m_productTemplates.reserve(other.m_productTemplates.size());
137 for (ROMOL_SPTR product_template : other.m_productTemplates) {
138 m_productTemplates.emplace_back(new RWMol(*product_template));
139 }
140 m_agentTemplates.clear();
141 m_agentTemplates.reserve(other.m_agentTemplates.size());
142 for (ROMOL_SPTR agent_template : other.m_agentTemplates) {
143 m_agentTemplates.emplace_back(new RWMol(*agent_template));
144 }
145 d_substructParams = other.d_substructParams;
146 }
147
148 public:
150 //! construct a reaction from a pickle string
151 ChemicalReaction(const std::string &binStr);
152 ChemicalReaction(const ChemicalReaction &other) : RDProps() { copy(other); }
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 \param removeUnmatchedAtoms toggles whether or not atoms from the reactant
251 which do not match template atoms are removed.
252
253 \return whether or not the reactant was actually modified
254 */
255 bool runReactant(RWMol &reactant, bool removeUnmatchedAtoms = true) const;
256
258 return this->m_reactantTemplates;
259 }
260 const MOL_SPTR_VECT &getAgents() const { return this->m_agentTemplates; }
261 const MOL_SPTR_VECT &getProducts() const { return this->m_productTemplates; }
262
263 MOL_SPTR_VECT::const_iterator beginReactantTemplates() const {
264 return this->m_reactantTemplates.begin();
265 }
266 MOL_SPTR_VECT::const_iterator endReactantTemplates() const {
267 return this->m_reactantTemplates.end();
268 }
269
270 MOL_SPTR_VECT::const_iterator beginProductTemplates() const {
271 return this->m_productTemplates.begin();
272 }
273 MOL_SPTR_VECT::const_iterator endProductTemplates() const {
274 return this->m_productTemplates.end();
275 }
276
277 MOL_SPTR_VECT::const_iterator beginAgentTemplates() const {
278 return this->m_agentTemplates.begin();
279 }
280 MOL_SPTR_VECT::const_iterator endAgentTemplates() const {
281 return this->m_agentTemplates.end();
282 }
283
284 MOL_SPTR_VECT::iterator beginReactantTemplates() {
285 return this->m_reactantTemplates.begin();
286 }
287 MOL_SPTR_VECT::iterator endReactantTemplates() {
288 return this->m_reactantTemplates.end();
289 }
290
291 MOL_SPTR_VECT::iterator beginProductTemplates() {
292 return this->m_productTemplates.begin();
293 }
294 MOL_SPTR_VECT::iterator endProductTemplates() {
295 return this->m_productTemplates.end();
296 }
297
298 MOL_SPTR_VECT::iterator beginAgentTemplates() {
299 return this->m_agentTemplates.begin();
300 }
301 MOL_SPTR_VECT::iterator endAgentTemplates() {
302 return this->m_agentTemplates.end();
303 }
304 unsigned int getNumReactantTemplates() const {
305 return rdcast<unsigned int>(this->m_reactantTemplates.size());
306 }
307 unsigned int getNumProductTemplates() const {
308 return rdcast<unsigned int>(this->m_productTemplates.size());
309 }
310 unsigned int getNumAgentTemplates() const {
311 return rdcast<unsigned int>(this->m_agentTemplates.size());
312 }
313
314 //! initializes our internal reactant-matching datastructures.
315 /*!
316 This must be called after adding reactants and before calling
317 runReactants.
318
319 \param silent: If this bool is true, no messages will be logged during the
320 validation. By default, validation problems are reported to the warning
321 and error logs depending on their severity.
322 */
323 void initReactantMatchers(bool silent = false);
324
325 bool isInitialized() const { return !df_needsInit; }
326
327 //! validates the reactants and products to make sure the reaction seems
328 /// "reasonable"
329 /*!
330 \return true if the reaction validates without errors (warnings do not
331 stop validation)
332
333 \param numWarnings used to return the number of validation warnings
334 \param numErrors used to return the number of validation errors
335
336 \param silent: If this bool is true, no messages will be logged during the
337 validation. By default, validation problems are reported to the warning
338 and error logs depending on their severity.
339
340 */
341 bool validate(unsigned int &numWarnings, unsigned int &numErrors,
342 bool silent = false) const;
343
344 //! returns whether or not the reaction uses implicit
345 //! properties on the product atoms
346 /*!
347
348 This toggles whether or not unspecified atomic properties in the
349 products are considered to be implicit and should be copied from
350 the actual reactants. This is necessary due to a semantic difference
351 between the "reaction SMARTS" approach and the MDL RXN
352 approach:
353 In "reaction SMARTS", this reaction:
354 [C:1]-[Br:2].[O-:3]>>[C:1]-[O:3].[Br-:2]
355 applied to [CH4+]Br should yield [CH4+]O
356 Something similar drawn in an rxn file, and applied to
357 [CH4+]Br should yield [CH3]O.
358 In rxn there is no charge on the product C because nothing is
359 specified in the rxn file; in "SMARTS" the charge from the
360 actual reactants is not *removed* because no charge is
361 specified in the reaction.
362
363 */
364 bool getImplicitPropertiesFlag() const { return df_implicitProperties; }
365 //! sets the implicit properties flag. See the documentation for
366 //! getImplicitProertiesFlag() for a discussion of what this means.
367 void setImplicitPropertiesFlag(bool val) { df_implicitProperties = val; }
368
370 return d_substructParams;
371 }
372 SubstructMatchParameters &getSubstructParams() { return d_substructParams; }
373
374 private:
375 bool df_needsInit{true};
376 bool df_implicitProperties{false};
377 MOL_SPTR_VECT m_reactantTemplates, m_productTemplates, m_agentTemplates;
378 SubstructMatchParameters d_substructParams;
379};
380
381//! tests whether or not the molecule has a substructure match
382//! to the reaction's reactants
383//! the \c which argument is used to return which of the reactants
384//! the molecule matches.
386 const ChemicalReaction &rxn, const ROMol &mol,
387 std::vector<unsigned int> &which, bool stopAtFirstMatch = false);
388//! \overload
390 const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which);
391//! \overload
393 const ChemicalReaction &rxn, const ROMol &mol);
394
395//! tests whether or not the molecule has a substructure match
396//! to the reaction's products
397//! the \c which argument is used to return which of the products
398//! the molecule matches.
400 const ChemicalReaction &rxn, const ROMol &mol,
401 std::vector<unsigned int> &which, bool stopAtFirstMatch = false);
402//! \overload
404 const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which);
405//! \overload
407 const ChemicalReaction &rxn, const ROMol &mol);
408
409//! tests whether or not the molecule has a substructure match
410//! to any of the reaction's agents
411//! the \c which argument is used to return which of the agents
412//! the molecule matches. If there's no match, it is equal to the number
413//! of agents on return
415 const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which);
416//! \overload
418 const ChemicalReaction &rxn, const ROMol &mol);
419
420//! returns indices of the atoms in each reactant that are changed
421//! in the reaction
422/*!
423 \param rxn the reaction we are interested in
424
425 \param mappedAtomsOnly if set, atoms that are not mapped will not be included
426 in the list of changed atoms (otherwise they are automatically included)
427
428 How are changed atoms recognized?
429 1) Atoms whose degree changes
430 2) Atoms whose bonding pattern changes
431 3) unmapped atoms (unless the mappedAtomsOnly flag is set)
432 4) Atoms connected to unmapped atoms
433 5) Atoms whose atomic number changes (unless the
434 corresponding product atom is a dummy)
435 6) Atoms with more than one atomic number query (unless the
436 corresponding product atom is a dummy)
437
438 Note that the atomic number of a query atom depends on how it's constructed.
439 When coming from SMARTS: if the first query is an atomic label/number that
440 sets the atomic number, otherwise it's zero.
441 For example [O;$(OC)] is atomic number 8 while [$(OC);O] is atomic
442 number 0.
443 When coming from RXN: the atomic number of the atom in the rxn file sets
444 the value.
445 */
447getReactingAtoms(const ChemicalReaction &rxn, bool mappedAtomsOnly = false);
448
449//! add the recursive queries to the reactants of a reaction
450/*!
451 This does its work using RDKit::addRecursiveQueries()
452
453 \param rxn the reaction we are interested in
454 \param queries - the dictionary of named queries to add
455 \param propName - the atom property to use to get query names
456 optional:
457 \param reactantLabels - to store pairs of (atom index, query string)
458 per reactant
459
460 NOTES:
461 - existing query information, if present, will be supplemented (AND logic)
462 - non-query atoms will be replaced with query atoms using only the query
463 logic
464 - query names can be present as comma separated lists, they will then
465 be combined using OR logic.
466 - throws a KeyErrorException if a particular query name is not present
467 in \c queries
468
469 */
471 ChemicalReaction &rxn, const std::map<std::string, ROMOL_SPTR> &queries,
472 const std::string_view &propName,
473 std::vector<std::vector<std::pair<unsigned int, std::string>>>
474 *reactantLabels = nullptr);
475
476} // namespace RDKit
477
478namespace RDDepict {
479//! \brief Generate 2D coordinates (a depiction) for a reaction
480/*!
481
482 \param rxn the reaction we are interested in
483
484 \param spacing the spacing between components of the reaction
485
486 \param updateProps if set, properties such as conjugation and
487 hybridization will be calculated for the reactant and product
488 templates before generating coordinates. This should result in
489 better depictions, but can lead to errors in some cases.
490
491 \param canonOrient canonicalize the orientation so that the long
492 axes align with the x-axis etc.
493
494 \param nFlipsPerSample - the number of rotatable bonds that are
495 flipped at random for each sample
496
497 \param nSamples - the number of samples
498
499 \param sampleSeed - seed for the random sampling process
500
501 \param permuteDeg4Nodes - try permuting the drawing order of bonds around
502 atoms with four neighbors in order to improve the depiction
503
504 for the other parameters see the documentation for compute2DCoords()
505
506*/
508 RDKit::ChemicalReaction &rxn, double spacing = 1.0, bool updateProps = true,
509 bool canonOrient = false, unsigned int nFlipsPerSample = 0,
510 unsigned int nSamples = 0, int sampleSeed = 0,
511 bool permuteDeg4Nodes = false);
512
513} // namespace RDDepict
514
515#endif
#define rdcast
Definition Invariant.h:191
pulls in the core RDKit functionality
const char * what() const noexcept override
get the error message
Definition Reaction.h:57
ChemicalReactionException(const char *msg)
construct with an error message
Definition Reaction.h:53
ChemicalReactionException(const std::string msg)
construct with an error message
Definition Reaction.h:55
~ChemicalReactionException() noexcept override=default
This is a class for storing and applying general chemical reactions.
Definition Reaction.h:122
unsigned int addProductTemplate(ROMOL_SPTR mol)
Adds a new product template.
Definition Reaction.h:186
SubstructMatchParameters & getSubstructParams()
Definition Reaction.h:372
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:310
const SubstructMatchParameters & getSubstructParams() const
Definition Reaction.h:369
bool getImplicitPropertiesFlag() const
Definition Reaction.h:364
unsigned int getNumReactantTemplates() const
Definition Reaction.h:304
ChemicalReaction & operator=(const ChemicalReaction &other)
Definition Reaction.h:153
ChemicalReaction(const std::string &binStr)
construct a reaction from a pickle string
MOL_SPTR_VECT::iterator beginProductTemplates()
Definition Reaction.h:291
void removeUnmappedReactantTemplates(double thresholdUnmappedAtoms=0.2, bool moveToAgentTemplates=true, MOL_SPTR_VECT *targetVector=nullptr)
MOL_SPTR_VECT::const_iterator beginProductTemplates() const
Definition Reaction.h:270
void initReactantMatchers(bool silent=false)
initializes our internal reactant-matching datastructures.
std::vector< MOL_SPTR_VECT > runReactants(const MOL_SPTR_VECT reactants, unsigned int numProducts=1000) const
Runs the reaction on a set of reactants.
const MOL_SPTR_VECT & getReactants() const
Definition Reaction.h:257
MOL_SPTR_VECT::const_iterator endReactantTemplates() const
Definition Reaction.h:266
void setImplicitPropertiesFlag(bool val)
Definition Reaction.h:367
const MOL_SPTR_VECT & getAgents() const
Definition Reaction.h:260
MOL_SPTR_VECT::iterator endProductTemplates()
Definition Reaction.h:294
unsigned int getNumProductTemplates() const
Definition Reaction.h:307
MOL_SPTR_VECT::const_iterator endProductTemplates() const
Definition Reaction.h:273
bool isInitialized() const
Definition Reaction.h:325
ChemicalReaction(const ChemicalReaction &other)
Definition Reaction.h:152
MOL_SPTR_VECT::const_iterator beginAgentTemplates() const
Definition Reaction.h:277
void removeAgentTemplates(MOL_SPTR_VECT *targetVector=nullptr)
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 beginReactantTemplates() const
Definition Reaction.h:263
const MOL_SPTR_VECT & getProducts() const
Definition Reaction.h:261
bool runReactant(RWMol &reactant, bool removeUnmatchedAtoms=true) const
Runs a single reactant in place (the reactant is modified).
friend class ReactionPickler
Definition Reaction.h:123
MOL_SPTR_VECT::iterator beginReactantTemplates()
Definition Reaction.h:284
MOL_SPTR_VECT::iterator endAgentTemplates()
Definition Reaction.h:301
MOL_SPTR_VECT::iterator beginAgentTemplates()
Definition Reaction.h:298
MOL_SPTR_VECT::iterator endReactantTemplates()
Definition Reaction.h:287
void removeUnmappedProductTemplates(double thresholdUnmappedAtoms=0.2, bool moveToAgentTemplates=true, MOL_SPTR_VECT *targetVector=nullptr)
MOL_SPTR_VECT::const_iterator endAgentTemplates() const
Definition Reaction.h:280
bool validate(unsigned int &numWarnings, unsigned int &numErrors, bool silent=false) const
RDProps & operator=(const RDProps &rhs)
Definition RDProps.h:27
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:57
RDKIT_CHEMREACTIONS_EXPORT void compute2DCoordsForReaction(RDKit::ChemicalReaction &rxn, double spacing=1.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.
RDKIT_CHEMREACTIONS_EXPORT void addRecursiveQueriesToReaction(ChemicalReaction &rxn, const std::map< std::string, ROMOL_SPTR > &queries, const std::string_view &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< INT_VECT > VECT_INT_VECT
Definition types.h:240
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
std::vector< boost::shared_ptr< ROMol > > MOL_SPTR_VECT