RDKit: ReactionRunner.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
ReactionRunner.h
Go to the documentation of this file.
1//
2// Copyright (c) 2014-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_RUNNER_H
37#define RD_REACTION_RUNNER_H
38
39#include <GraphMol/ChemReactions/Reaction.h>
40#include <GraphMol/ROMol.h>
41
42namespace RDKit {
43//! Runs the reaction on a set of reactants
44/*!
45 \param rxn: the template reaction we are interested
46 \param reactants: the reactants to be used. The length of this must be equal
47 to
48 rxn->getNumReactantTemplates()
49 Caution: The order of the reactant templates determines the
50 order of the reactants!
51 \param maxProducts: if non zero, the maximum number of products to generate
52 before stopping. If hit a warning will be generated.
53 \return a vector of vectors of products. Each subvector will be
54 rxn->getNumProductTemplates() long.
55
56 We return a vector of vectors of products because each individual template may
57 map multiple times onto its reactant. This leads to multiple possible result
58 sets.
59*/
60 RDKIT_CHEMREACTIONS_EXPORT std::vector<MOL_SPTR_VECT> run_Reactants(
61 const ChemicalReaction &rxn, const MOL_SPTR_VECT &reactants,
62 unsigned int maxProducts = 1000);
63
64//! Runs a single reactant against a single reactant template
65/*!
66 \param reactant The single reactant to use
67
68 \param reactantTemplateIdx the reactant template to target in the reaction
69
70 \return a vector of vectors of products. Each subvector will be
71 rxn->getNumProductTemplates() long.
72
73 We return a vector of vectors of products because each individual template may
74 map multiple times onto its reactant. This leads to multiple possible result
75 sets.
76
77*/
78
79 RDKIT_CHEMREACTIONS_EXPORT std::vector<MOL_SPTR_VECT> run_Reactant(
80 const ChemicalReaction &rxn, const ROMOL_SPTR &reactant,
81 unsigned int reactantIdx);
82
83 RDKIT_CHEMREACTIONS_EXPORT bool run_Reactant(const ChemicalReaction &rxn,
84 RWMol &reactant,
85 bool removeUnmatchedAtoms = true);
86
87//! Reduce the product generated by run_Reactants or run_Reactant to
88/// the sidechains that come from the reagents
89//
90// n.b. molecules that might be a product of the given reaction
91// but were not generated by run_Reactant(s) currently
92// produce no sidechains.
93/*!
94 \param addDummyAtoms If true, add dummy atoms to the sidechains for the
95 non-reagent parts of the sidechain. Dummy atoms are annotated with
96 the atom maps from the reaction.
97 If False, then any sidechain atom where a bond was cleaved is annotated
98 with: _rgroupAtomMaps property which indicates the scaffold atommaps that
99 where bonded _rgroupBonds property which indicates the bondtype for each
100 atommap bonded
101*/
102
103 RDKIT_CHEMREACTIONS_EXPORT ROMol *reduceProductToSideChains(
104 const ROMOL_SPTR &product, bool addDummyAtoms = true);
105
106 namespace ReactionRunnerUtils {
107 RDKIT_CHEMREACTIONS_EXPORT MOL_SPTR_VECT generateOneProductSet(
108 const ChemicalReaction &rxn, const MOL_SPTR_VECT &reactants,
109 const std::vector<MatchVectType> &reactantsMatch);
110
111 RDKIT_CHEMREACTIONS_EXPORT RWMOL_SPTR
112convertTemplateToMol(const ROMOL_SPTR prodTemplateSptr);
113} // namespace ReactionRunnerUtils
114
115} // namespace RDKit
116
117#endif
ROMol.h
Defines the primary molecule class ROMol as well as associated typedefs.
Reaction.h
RDKit::ChemicalReaction
This is a class for storing and applying general chemical reactions.
Definition Reaction.h:121
RDKit::ROMol
Definition ROMol.h:199
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition RWMol.h:32
export.h
RDKIT_CHEMREACTIONS_EXPORT
#define RDKIT_CHEMREACTIONS_EXPORT
Definition export.h:57
RDKit::ReactionRunnerUtils
Definition ReactionRunner.h:106
RDKit::ReactionRunnerUtils::generateOneProductSet
RDKIT_CHEMREACTIONS_EXPORT MOL_SPTR_VECT generateOneProductSet(const ChemicalReaction &rxn, const MOL_SPTR_VECT &reactants, const std::vector< MatchVectType > &reactantsMatch)
RDKit::ReactionRunnerUtils::convertTemplateToMol
RDKIT_CHEMREACTIONS_EXPORT RWMOL_SPTR convertTemplateToMol(const ROMOL_SPTR prodTemplateSptr)
RDKit
Std stuff.
Definition Abbreviations.h:19
RDKit::run_Reactants
RDKIT_CHEMREACTIONS_EXPORT std::vector< MOL_SPTR_VECT > run_Reactants(const ChemicalReaction &rxn, const MOL_SPTR_VECT &reactants, unsigned int maxProducts=1000)
Runs the reaction on a set of reactants.
RDKit::ROMOL_SPTR
boost::shared_ptr< ROMol > ROMOL_SPTR
Definition ChemTransforms.h:22
RDKit::run_Reactant
RDKIT_CHEMREACTIONS_EXPORT std::vector< MOL_SPTR_VECT > run_Reactant(const ChemicalReaction &rxn, const ROMOL_SPTR &reactant, unsigned int reactantIdx)
Runs a single reactant against a single reactant template.
RDKit::reduceProductToSideChains
RDKIT_CHEMREACTIONS_EXPORT ROMol * reduceProductToSideChains(const ROMOL_SPTR &product, bool addDummyAtoms=true)
RDKit::MOL_SPTR_VECT
std::vector< boost::shared_ptr< ROMol > > MOL_SPTR_VECT
Definition FragCatParams.h:21
RDKit::RWMOL_SPTR
boost::shared_ptr< RWMol > RWMOL_SPTR
Definition RWMol.h:222