33 #ifndef __RD_REACTION_H_17Aug2006__ 34 #define __RD_REACTION_H_17Aug2006__ 41 class ReactionPickler;
51 const char *
message()
const {
return _msg.c_str(); };
122 df_needsInit = other.df_needsInit;
123 df_implicitProperties = other.df_implicitProperties;
127 m_reactantTemplates.push_back(
ROMOL_SPTR(reactant));
132 m_productTemplates.push_back(
ROMOL_SPTR(product));
137 m_agentTemplates.push_back(
ROMOL_SPTR(agent));
149 this->df_needsInit =
true;
150 this->m_reactantTemplates.push_back(mol);
151 return this->m_reactantTemplates.size();
160 this->m_agentTemplates.push_back(mol);
161 return this->m_agentTemplates.size();
170 this->m_productTemplates.push_back(mol);
171 return this->m_productTemplates.size();
181 void removeUnmappedReactantTemplates(
double thresholdUnmappedAtoms = 0.2,
182 bool moveToAgentTemplates =
true,
192 void removeUnmappedProductTemplates(
double thresholdUnmappedAtoms = 0.2,
193 bool moveToAgentTemplates =
true,
198 void removeAgentTemplates(
MOL_SPTR_VECT *targetVector = NULL);
215 std::vector<MOL_SPTR_VECT> runReactants(
const MOL_SPTR_VECT reactants)
const;
223 std::vector<MOL_SPTR_VECT> runReactant(
224 ROMOL_SPTR reactant,
unsigned int reactantTemplateIdx)
const;
227 return this->m_reactantTemplates;
233 return this->m_reactantTemplates.begin();
236 return this->m_reactantTemplates.end();
240 return this->m_productTemplates.begin();
243 return this->m_productTemplates.end();
247 return this->m_agentTemplates.begin();
250 return this->m_agentTemplates.end();
254 return this->m_reactantTemplates.begin();
257 return this->m_reactantTemplates.end();
261 return this->m_productTemplates.begin();
264 return this->m_productTemplates.end();
268 return this->m_agentTemplates.begin();
271 return this->m_agentTemplates.end();
274 return this->m_reactantTemplates.size();
277 return this->m_productTemplates.size();
280 return this->m_agentTemplates.size();
288 void initReactantMatchers();
309 bool validate(
unsigned int &numWarnings,
unsigned int &numErrors,
310 bool silent =
false)
const;
339 bool df_implicitProperties;
340 MOL_SPTR_VECT m_reactantTemplates, m_productTemplates, m_agentTemplates;
350 unsigned int &which);
361 unsigned int &which);
371 unsigned int &which);
403 bool mappedAtomsOnly =
false);
428 const std::string &propName,
429 std::vector<std::vector<std::pair<unsigned int, std::string> > > *
430 reactantLabels = NULL);
464 double spacing = 2.0,
bool updateProps =
true,
465 bool canonOrient =
false,
466 unsigned int nFlipsPerSample = 0,
467 unsigned int nSamples = 0,
int sampleSeed = 0,
468 bool permuteDeg4Nodes =
false);
MOL_SPTR_VECT::iterator beginProductTemplates()
const MOL_SPTR_VECT & getAgents() const
MOL_SPTR_VECT::const_iterator endReactantTemplates() const
bool isMoleculeReactantOfReaction(const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which)
bool getImplicitPropertiesFlag() const
const MOL_SPTR_VECT & getReactants() const
VECT_INT_VECT getReactingAtoms(const ChemicalReaction &rxn, bool mappedAtomsOnly=false)
ChemicalReaction(const ChemicalReaction &other)
void setImplicitPropertiesFlag(bool val)
unsigned int addAgentTemplate(ROMOL_SPTR mol)
Adds a new agent template.
This is a class for storing and applying general chemical reactions.
pulls in the core RDKit functionality
ROMol is a molecule class that is intended to have a fixed topology.
std::vector< boost::shared_ptr< ROMol > > MOL_SPTR_VECT
MOL_SPTR_VECT::iterator endProductTemplates()
std::vector< INT_VECT > VECT_INT_VECT
MOL_SPTR_VECT::iterator beginReactantTemplates()
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
bool isMoleculeAgentOfReaction(const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which)
MOL_SPTR_VECT::const_iterator endProductTemplates() const
MOL_SPTR_VECT::const_iterator beginProductTemplates() const
const char * message() const
get the error message
unsigned int getNumProductTemplates() const
const MOL_SPTR_VECT & getProducts() const
boost::shared_ptr< ROMol > ROMOL_SPTR
Includes a bunch of functionality for handling Atom and Bond queries.
used to indicate an error in the chemical reaction engine
MOL_SPTR_VECT::const_iterator beginReactantTemplates() const
unsigned int addProductTemplate(ROMOL_SPTR mol)
Adds a new product template.
bool isMoleculeProductOfReaction(const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which)
unsigned int addReactantTemplate(ROMOL_SPTR mol)
Adds a new reactant template.
bool isInitialized() const
MOL_SPTR_VECT::const_iterator beginAgentTemplates() const
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.
ChemicalReactionException(const std::string msg)
construct with an error message
MOL_SPTR_VECT::iterator endReactantTemplates()
handles pickling (serializing) reactions
MOL_SPTR_VECT::iterator beginAgentTemplates()
unsigned int getNumAgentTemplates() const
MOL_SPTR_VECT::iterator endAgentTemplates()
ChemicalReactionException(const char *msg)
construct with an error message
~ChemicalReactionException()
MOL_SPTR_VECT::const_iterator endAgentTemplates() const
unsigned int getNumReactantTemplates() const