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;
124 m_reactantTemplates = other.m_reactantTemplates;
125 m_productTemplates = other.m_productTemplates;
126 m_agentTemplates = other.m_agentTemplates;
137 this->df_needsInit =
true;
138 this->m_reactantTemplates.push_back(mol);
139 return this->m_reactantTemplates.size();
148 this->m_agentTemplates.push_back(mol);
149 return this->m_agentTemplates.size();
158 this->m_productTemplates.push_back(mol);
159 return this->m_productTemplates.size();
170 bool moveToAgentTemplates =
true,
181 bool moveToAgentTemplates =
true,
212 ROMOL_SPTR reactant,
unsigned int reactantTemplateIdx)
const;
215 return this->m_reactantTemplates;
221 return this->m_reactantTemplates.begin();
224 return this->m_reactantTemplates.end();
228 return this->m_productTemplates.begin();
231 return this->m_productTemplates.end();
235 return this->m_agentTemplates.begin();
238 return this->m_agentTemplates.end();
242 return this->m_reactantTemplates.begin();
245 return this->m_reactantTemplates.end();
249 return this->m_productTemplates.begin();
252 return this->m_productTemplates.end();
256 return this->m_agentTemplates.begin();
259 return this->m_agentTemplates.end();
262 return this->m_reactantTemplates.size();
265 return this->m_productTemplates.size();
268 return this->m_agentTemplates.size();
297 bool validate(
unsigned int &numWarnings,
unsigned int &numErrors,
298 bool silent =
false)
const;
327 bool df_implicitProperties;
328 MOL_SPTR_VECT m_reactantTemplates, m_productTemplates, m_agentTemplates;
338 unsigned int &which);
349 unsigned int &which);
359 unsigned int &which);
391 bool mappedAtomsOnly =
false);
415 ChemicalReaction &rxn,
const std::map<std::string, ROMOL_SPTR> &queries,
416 const std::string &propName,
417 std::vector<std::vector<std::pair<unsigned int, std::string> > > *
418 reactantLabels = NULL);
452 double spacing = 2.0,
bool updateProps =
true,
453 bool canonOrient =
false,
454 unsigned int nFlipsPerSample = 0,
455 unsigned int nSamples = 0,
int sampleSeed = 0,
456 bool permuteDeg4Nodes =
false);
MOL_SPTR_VECT::iterator beginProductTemplates()
MOL_SPTR_VECT::const_iterator endAgentTemplates() const
void initReactantMatchers()
initializes our internal reactant-matching datastructures.
unsigned int getNumProductTemplates() const
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.
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.
unsigned int getNumReactantTemplates() const
bool getImplicitPropertiesFlag() const
bool isMoleculeReactantOfReaction(const ChemicalReaction &rxn, const ROMol &mol, unsigned int &which)
const MOL_SPTR_VECT & getProducts() const
const char * message() const
get the error message
unsigned int getNumAgentTemplates() const
VECT_INT_VECT getReactingAtoms(const ChemicalReaction &rxn, bool mappedAtomsOnly=false)
ChemicalReaction(const ChemicalReaction &other)
void setImplicitPropertiesFlag(bool val)
bool isInitialized() const
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
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 endReactantTemplates() const
MOL_SPTR_VECT::const_iterator endProductTemplates() const
boost::shared_ptr< ROMol > ROMOL_SPTR
MOL_SPTR_VECT::const_iterator beginAgentTemplates() const
Includes a bunch of functionality for handling Atom and Bond queries.
used to indicate an error in the chemical reaction engine
const MOL_SPTR_VECT & getAgents() const
std::vector< MOL_SPTR_VECT > runReactant(ROMOL_SPTR reactant, unsigned int reactantTemplateIdx) const
Runs a single reactant against a single reactant template.
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.
std::vector< MOL_SPTR_VECT > runReactants(const MOL_SPTR_VECT reactants) const
Runs the reaction on a set of reactants.
bool validate(unsigned int &numWarnings, unsigned int &numErrors, bool silent=false) const
validates the reactants and products to make sure the reaction seems
MOL_SPTR_VECT::const_iterator beginReactantTemplates() const
MOL_SPTR_VECT::const_iterator beginProductTemplates() 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
const MOL_SPTR_VECT & getReactants() const
MOL_SPTR_VECT::iterator endReactantTemplates()
handles pickling (serializing) reactions
MOL_SPTR_VECT::iterator beginAgentTemplates()
void removeAgentTemplates(MOL_SPTR_VECT *targetVector=NULL)
MOL_SPTR_VECT::iterator endAgentTemplates()
ChemicalReactionException(const char *msg)
construct with an error message
~ChemicalReactionException()