10#ifndef RDKIT_MOLENUMERATOR_H
11#define RDKIT_MOLENUMERATOR_H
24class ChemicalReaction;
25namespace MolEnumerator {
45 const std::vector<size_t> &which)
const = 0;
49 virtual std::unique_ptr<MolEnumeratorOp>
copy()
const = 0;
68 : dp_mol(other.dp_mol), d_variationPoints(other.d_variationPoints) {}
73 dp_mol = other.dp_mol;
74 d_variationPoints = other.d_variationPoints;
82 const std::vector<size_t> &which)
const override;
88 std::unique_ptr<MolEnumeratorOp>
copy()
const override {
93 std::shared_ptr<ROMol> dp_mol{
nullptr};
94 std::vector<std::pair<unsigned int, std::vector<unsigned int>>>
96 std::vector<size_t> d_dummiesAtEachPoint{};
112 : dp_mol(other.dp_mol),
113 dp_frame(other.dp_frame),
114 d_countAtEachPoint(other.d_countAtEachPoint),
115 d_variations(other.d_variations),
116 d_pointRanges(other.d_pointRanges),
117 d_isotopeMap(other.d_isotopeMap),
118 d_atomMap(other.d_atomMap) {}
120 if (&other ==
this) {
123 dp_mol = other.dp_mol;
124 dp_frame = other.dp_frame;
125 d_countAtEachPoint = other.d_countAtEachPoint;
126 d_variations = other.d_variations;
127 d_pointRanges = other.d_pointRanges;
128 d_isotopeMap = other.d_isotopeMap;
129 d_atomMap = other.d_atomMap;
137 const std::vector<size_t> &which)
const override;
143 std::unique_ptr<MolEnumeratorOp>
copy()
const override {
144 return std::unique_ptr<MolEnumeratorOp>(
new LinkNodeOp(*
this));
148 std::shared_ptr<ROMol> dp_mol{
nullptr};
149 std::shared_ptr<RWMol> dp_frame{
nullptr};
150 std::vector<size_t> d_countAtEachPoint{};
151 std::vector<std::tuple<unsigned, unsigned, unsigned>> d_variations;
152 std::vector<std::pair<unsigned, unsigned>> d_pointRanges;
153 std::map<unsigned, unsigned> d_isotopeMap;
154 std::map<unsigned, Atom *> d_atomMap;
180 : d_maxNumRounds(other.d_maxNumRounds),
181 dp_mol(other.dp_mol),
182 dp_frame(other.dp_frame),
183 d_repeats(other.d_repeats),
184 d_countAtEachPoint(other.d_countAtEachPoint),
185 d_variations(other.d_variations),
186 d_pointRanges(other.d_pointRanges),
187 d_isotopeMap(other.d_isotopeMap),
188 d_atomMap(other.d_atomMap),
189 d_minRepeatCounts(other.d_minRepeatCounts) {};
191 if (&other ==
this) {
194 dp_mol = other.dp_mol;
195 dp_frame = other.dp_frame;
196 d_repeats = other.d_repeats;
197 d_countAtEachPoint = other.d_countAtEachPoint;
198 d_variations = other.d_variations;
199 d_pointRanges = other.d_pointRanges;
200 d_isotopeMap = other.d_isotopeMap;
201 d_atomMap = other.d_atomMap;
203 d_minRepeatCounts = other.d_minRepeatCounts;
211 const std::vector<size_t> &which)
const override;
217 std::unique_ptr<MolEnumeratorOp>
copy()
const override {
218 return std::unique_ptr<MolEnumeratorOp>(
new RepeatUnitOp(*
this));
222 size_t d_maxNumRounds = std::numeric_limits<size_t>::max();
225 std::shared_ptr<ROMol> dp_mol{
nullptr};
226 std::shared_ptr<RWMol> dp_frame{
nullptr};
227 std::vector<std::shared_ptr<RWMol>> d_repeats;
228 std::vector<RWMol> dp_repeatUnits{};
229 std::vector<size_t> d_countAtEachPoint{};
230 std::vector<unsigned> d_sruOrder{};
231 std::vector<std::tuple<unsigned, unsigned, unsigned>> d_variations;
232 std::vector<std::pair<unsigned, unsigned>> d_pointRanges;
233 std::map<unsigned, unsigned> d_isotopeMap;
234 std::map<unsigned, Atom *> d_atomMap;
235 std::vector<size_t> d_minRepeatCounts;
242 bool sanitize =
false;
243 size_t maxToEnumerate = 1000;
244 bool doRandom =
false;
277 std::vector<MolEnumeratorParams> v = {params};
#define PRECONDITION(expr, mess)
Defines a class for managing bundles of molecules.
pulls in the core RDKit functionality
MolBundle contains a collection of related ROMols.
Molecule enumeration operation corresponding to LINKNODES.
LinkNodeOp(const LinkNodeOp &other)
void initFromMol(const ROMol &mol) override
\override
LinkNodeOp(const std::shared_ptr< ROMol > mol)
std::vector< size_t > getVariationCounts() const override
\override
LinkNodeOp(const ROMol &mol)
std::unique_ptr< ROMol > operator()(const std::vector< size_t > &which) const override
\override
LinkNodeOp & operator=(const LinkNodeOp &other)
std::unique_ptr< MolEnumeratorOp > copy() const override
\override
abstract base class for the a molecule enumeration operation
virtual std::vector< size_t > getVariationCounts() const =0
virtual std::unique_ptr< MolEnumeratorOp > copy() const =0
polymorphic copy
virtual std::unique_ptr< ROMol > operator()(const std::vector< size_t > &which) const =0
returns a the molecule corresponding to a particular variation
virtual void initFromMol(const ROMol &mol)=0
initializes this operation to work on a particular molecule
virtual ~MolEnumeratorOp()
Molecule enumeration operation corresponding to position variation bonds.
PositionVariationOp & operator=(const PositionVariationOp &other)
std::unique_ptr< ROMol > operator()(const std::vector< size_t > &which) const override
\override
std::vector< size_t > getVariationCounts() const override
\override
void initFromMol(const ROMol &mol) override
\override
PositionVariationOp(const PositionVariationOp &other)
PositionVariationOp(const std::shared_ptr< ROMol > mol)
std::unique_ptr< MolEnumeratorOp > copy() const override
\override
PositionVariationOp(const ROMol &mol)
Molecule enumeration operation corresponding to SRUs.
static const size_t DEFAULT_REPEAT_COUNT
void initFromMol(const ROMol &mol) override
\override
RepeatUnitOp(const RepeatUnitOp &other)
RepeatUnitOp & operator=(const RepeatUnitOp &other)
RepeatUnitOp(const ROMol &mol)
std::unique_ptr< ROMol > operator()(const std::vector< size_t > &which) const override
\override
std::vector< size_t > getVariationCounts() const override
\override
RepeatUnitOp(const std::shared_ptr< ROMol > mol)
std::unique_ptr< MolEnumeratorOp > copy() const override
\override
#define RDKIT_MOLENUMERATOR_EXPORT
const std::string idxPropName
void removeOrigIndices(ROMol &mol)
void preserveOrigIndices(ROMol &mol)
RDKIT_MOLENUMERATOR_EXPORT MolBundle enumerate(const ROMol &mol, const std::vector< MolEnumeratorParams > ¶msList)
bool rdvalue_is(const RDValue_cast_t)
Parameters used to control the molecule enumeration.
std::shared_ptr< MolEnumeratorOp > dp_operation