32 #ifndef __RD_REACTION_H_17Aug2006__ 33 #define __RD_REACTION_H_17Aug2006__ 40 class ReactionPickler;
50 const char *
message ()
const {
return _msg.c_str(); };
119 df_needsInit=other.df_needsInit;
120 df_implicitProperties=other.df_implicitProperties;
121 m_reactantTemplates=other.m_reactantTemplates;
122 m_productTemplates=other.m_productTemplates;
123 m_agentTemplates=other.m_agentTemplates;
134 this->df_needsInit =
true;
135 this->m_reactantTemplates.push_back(mol);
136 return this->m_reactantTemplates.size();
145 this->m_agentTemplates.push_back(mol);
146 return this->m_agentTemplates.size();
155 this->m_productTemplates.push_back(mol);
156 return this->m_productTemplates.size();
163 void removeUnmappedReactantTemplates(
164 double thresholdUnmappedAtoms = 0.2,
165 bool moveToAgentTemplates =
true,
172 void removeUnmappedProductTemplates(
173 double thresholdUnmappedAtoms =0.2,
174 bool moveToAgentTemplates =
true,
190 std::vector<MOL_SPTR_VECT> runReactants(
const MOL_SPTR_VECT reactants)
const;
197 return this->m_reactantTemplates.begin();
200 return this->m_reactantTemplates.end();
204 return this->m_productTemplates.begin();
207 return this->m_productTemplates.end();
211 return this->m_agentTemplates.begin();
214 return this->m_agentTemplates.end();
218 return this->m_reactantTemplates.begin();
221 return this->m_reactantTemplates.end();
225 return this->m_productTemplates.begin();
228 return this->m_productTemplates.end();
232 return this->m_agentTemplates.begin();
235 return this->m_agentTemplates.end();
246 void initReactantMatchers();
263 bool validate(
unsigned int &numWarnings,
unsigned int &numErrors,
bool silent=
false)
const;
293 bool df_implicitProperties;
294 MOL_SPTR_VECT m_reactantTemplates,m_productTemplates,m_agentTemplates;
304 unsigned int &which);
314 unsigned int &which);
324 unsigned int &which);
378 const std::map<std::string,ROMOL_SPTR> &queries,
379 std::string propName,
380 std::vector<std::vector<std::pair<unsigned int,std::string> > > *reactantLabels=NULL);
415 bool updateProps=
true,
416 bool canonOrient=
false,
417 unsigned int nFlipsPerSample=0,
418 unsigned int nSamples=0,
420 bool permuteDeg4Nodes=
false);
MOL_SPTR_VECT::iterator beginProductTemplates()
MOL_SPTR_VECT::const_iterator endAgentTemplates() const
unsigned int getNumProductTemplates() const
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
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()
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
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.
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 addRecursiveQueriesToReaction(ChemicalReaction &rxn, const std::map< std::string, ROMOL_SPTR > &queries, 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
MOL_SPTR_VECT::iterator endAgentTemplates()
ChemicalReactionException(const char *msg)
construct with an error message
~ChemicalReactionException()