11 #ifndef RDKIT_RGROUPDECOMP_H
12 #define RDKIT_RGROUPDECOMP_H
14 #include "../RDKitBase.h"
63 unsigned int alignment =
MCS;
65 unsigned int chunkSize = 5;
66 bool onlyMatchAtRGroups =
false;
67 bool removeAllHydrogenRGroups =
true;
68 bool removeHydrogensPostMatch =
true;
69 double timeout = -1.0;
81 typedef std::map<std::string, boost::shared_ptr<ROMol>>
RGroupRow;
118 const std::vector<ROMOL_SPTR> &cores,
const std::vector<ROMOL_SPTR> &mols,
119 RGroupRows &rows, std::vector<unsigned int> *unmatched =
nullptr,
124 const std::vector<ROMOL_SPTR> &cores,
const std::vector<ROMOL_SPTR> &mols,
125 RGroupColumns &columns, std::vector<unsigned int> *unmatched =
nullptr,
130 double timeout,
bool throwOnTimeout =
true) {
131 if (timeout <= 0)
return false;
132 auto t1 = std::chrono::steady_clock::now();
133 std::chrono::duration<double> elapsed = t1 - t0;
134 if (elapsed.count() >= timeout) {
135 if (throwOnTimeout) {
136 throw std::runtime_error(
"operation timed out");
RGroupRows getRGroupsAsRows() const
return rgroups in row order group[row][attachment_point] = ROMol
RGroupDecomposition(const std::vector< ROMOL_SPTR > &cores, const RGroupDecompositionParameters ¶ms=RGroupDecompositionParameters())
RGroupColumns getRGroupsAsColumns() const
return rgroups in column order group[attachment_point][row] = ROMol
const RGroupDecompositionParameters & params() const
RGroupDecomposition(const ROMol &core, const RGroupDecompositionParameters ¶ms=RGroupDecompositionParameters())
int add(const ROMol &mol)
std::vector< std::string > getRGroupLabels() const
return the current group labels
RWMol is a molecule class that is intended to be edited.
#define RDKIT_RGROUPDECOMPOSITION_EXPORT
std::vector< boost::shared_ptr< ROMol > > RGroupColumn
std::map< std::string, RGroupColumn > RGroupColumns
bool checkForTimeout(const std::chrono::steady_clock::time_point &t0, double timeout, bool throwOnTimeout=true)
RDKIT_RGROUPDECOMPOSITION_EXPORT unsigned int RGroupDecompose(const std::vector< ROMOL_SPTR > &cores, const std::vector< ROMOL_SPTR > &mols, RGroupRows &rows, std::vector< unsigned int > *unmatched=nullptr, const RGroupDecompositionParameters &options=RGroupDecompositionParameters())
std::vector< RGroupRow > RGroupRows
std::map< std::string, boost::shared_ptr< ROMol > > RGroupRow
unsigned int autoGetLabels(const RWMol &)
bool prepareCore(RWMol &, const RWMol *alignCore)