34 #ifndef RD_REACTION_H_17Aug2006
35 #define RD_REACTION_H_17Aug2006
43 class ReactionPickler;
47 :
public std::exception {
54 const char *
message()
const {
return _msg.c_str(); };
124 :
RDProps(), df_needsInit(true), df_implicitProperties(false){};
126 df_needsInit = other.df_needsInit;
127 df_implicitProperties = other.df_implicitProperties;
131 m_reactantTemplates.push_back(
ROMOL_SPTR(reactant));
136 m_productTemplates.push_back(
ROMOL_SPTR(product));
141 m_agentTemplates.push_back(
ROMOL_SPTR(agent));
154 this->df_needsInit =
true;
155 this->m_reactantTemplates.push_back(mol);
156 return rdcast<unsigned int>(this->m_reactantTemplates.size());
165 this->m_agentTemplates.push_back(mol);
166 return rdcast<unsigned int>(this->m_agentTemplates.size());
175 this->m_productTemplates.push_back(mol);
176 return rdcast<unsigned int>(this->m_productTemplates.size());
186 void removeUnmappedReactantTemplates(
double thresholdUnmappedAtoms = 0.2,
187 bool moveToAgentTemplates =
true,
197 void removeUnmappedProductTemplates(
double thresholdUnmappedAtoms = 0.2,
198 bool moveToAgentTemplates =
true,
203 void removeAgentTemplates(
MOL_SPTR_VECT *targetVector = NULL);
222 std::vector<MOL_SPTR_VECT> runReactants(
223 const MOL_SPTR_VECT reactants,
unsigned int numProducts = 1000)
const;
231 std::vector<MOL_SPTR_VECT> runReactant(
232 ROMOL_SPTR reactant,
unsigned int reactantTemplateIdx)
const;
235 return this->m_reactantTemplates;
241 return this->m_reactantTemplates.begin();
244 return this->m_reactantTemplates.end();
248 return this->m_productTemplates.begin();
251 return this->m_productTemplates.end();
255 return this->m_agentTemplates.begin();
258 return this->m_agentTemplates.end();
262 return this->m_reactantTemplates.begin();
265 return this->m_reactantTemplates.end();
269 return this->m_productTemplates.begin();
272 return this->m_productTemplates.end();
276 return this->m_agentTemplates.begin();
279 return this->m_agentTemplates.end();
282 return rdcast<unsigned int>(this->m_reactantTemplates.size());
285 return rdcast<unsigned int>(this->m_productTemplates.size());
288 return rdcast<unsigned int>(this->m_agentTemplates.size());
296 void initReactantMatchers();
317 bool validate(
unsigned int &numWarnings,
unsigned int &numErrors,
318 bool silent =
false)
const;
347 bool df_implicitProperties;
348 MOL_SPTR_VECT m_reactantTemplates, m_productTemplates, m_agentTemplates;
358 const ChemicalReaction &rxn,
const ROMol &mol,
unsigned int &which);
361 const ChemicalReaction &rxn,
const ROMol &mol);
369 const ChemicalReaction &rxn,
const ROMol &mol,
unsigned int &which);
372 const ChemicalReaction &rxn,
const ROMol &mol);
380 const ChemicalReaction &rxn,
const ROMol &mol,
unsigned int &which);
383 const ChemicalReaction &rxn,
const ROMol &mol);
413 getReactingAtoms(
const ChemicalReaction &rxn,
bool mappedAtomsOnly =
false);
437 ChemicalReaction &rxn,
const std::map<std::string, ROMOL_SPTR> &queries,
438 const std::string &propName,
439 std::vector<std::vector<std::pair<unsigned int, std::string>>>
440 *reactantLabels = NULL);
475 bool canonOrient =
false,
unsigned int nFlipsPerSample = 0,
476 unsigned int nSamples = 0,
int sampleSeed = 0,
477 bool permuteDeg4Nodes =
false);