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