12#ifndef RD_MORGANGEN_H_2018_07
13#define RD_MORGANGEN_H_2018_07
28 bool df_includeRingMembership;
40 const ROMol &mol)
const override;
43 void toJSON(boost::property_tree::ptree &pt)
const override;
44 void fromJSON(
const boost::property_tree::ptree &)
override;
55 void cleanUpPatterns();
56 std::vector<const ROMol *> *dp_patterns =
nullptr;
68 const std::vector<const ROMol *> *patterns =
nullptr);
72 const ROMol &mol)
const override;
75 void toJSON(boost::property_tree::ptree &pt)
const override;
76 void fromJSON(
const boost::property_tree::ptree &)
override;
99 const bool useChirality =
false);
102 const ROMol &mol)
const override;
105 void toJSON(boost::property_tree::ptree &pt)
const override;
106 void fromJSON(
const boost::property_tree::ptree &pt)
override;
123 void toJSON(boost::property_tree::ptree &pt)
const override;
124 void fromJSON(
const boost::property_tree::ptree &pt)
override;
145 bool includeChirality =
false,
146 bool onlyNonzeroInvariants =
false,
147 std::vector<std::uint32_t> countBounds = {1, 2, 4, 8},
148 std::uint32_t fpSize = 2048,
149 bool includeRedundantEnvironments =
false,
150 bool useBondTypes =
true)
153 df_onlyNonzeroInvariants(onlyNonzeroInvariants),
155 df_includeRedundantEnvironments(includeRedundantEnvironments),
156 df_useBondTypes(useBondTypes) {};
164template <
typename OutputType>
167 const OutputType d_code;
168 const unsigned int d_atomId;
169 const unsigned int d_layer;
170 const ROMol *d_mol =
nullptr;
175 const std::vector<std::uint32_t> *atomInvariants,
176 const std::vector<std::uint32_t> *bondInvariants,
178 const bool hashResults =
false,
179 const std::uint64_t fpSize = 0
182 size_t bitId)
const override;
192 const unsigned int layer,
const ROMol *mol)
193 : d_code(code), d_atomId(atomId), d_layer(layer), d_mol(mol) {}
200template <
typename OutputType>
206 const std::vector<std::uint32_t> *fromAtoms,
207 const std::vector<std::uint32_t> *ignoreAtoms,
const int confId,
209 const std::vector<std::uint32_t> *atomInvariants,
210 const std::vector<std::uint32_t> *bondInvariants,
211 const bool hashResults =
false)
const override;
214 void toJSON(boost::property_tree::ptree &pt)
const override;
215 void fromJSON(
const boost::property_tree::ptree &pt)
override;
267template <
typename OutputType>
269 unsigned int radius,
bool countSimulation,
bool includeChirality,
270 bool useBondTypes,
bool onlyNonzeroInvariants,
271 bool includeRedundantEnvironments,
274 std::uint32_t fpSize = 2048,
275 std::vector<std::uint32_t> countBounds = {1, 2, 4, 8},
276 bool ownsAtomInvGen =
false,
bool ownsBondInvGen =
false);
278template <
typename OutputType>
283 bool ownsAtomInvGen =
false,
bool ownsBondInvGen =
false);
330template <
typename OutputType>
332 unsigned int radius,
bool countSimulation =
false,
333 bool includeChirality =
false,
bool useBondTypes =
true,
334 bool onlyNonzeroInvariants =
false,
337 std::uint32_t fpSize = 2048,
338 std::vector<std::uint32_t> countBounds = {1, 2, 4, 8},
339 bool ownsAtomInvGen =
false,
bool ownsBondInvGen =
false) {
341 radius, countSimulation, includeChirality, useBondTypes,
342 onlyNonzeroInvariants,
false, atomInvariantsGenerator,
343 bondInvariantsGenerator, fpSize, countBounds, ownsAtomInvGen,
abstract base class that generates atom-environments from a molecule
abstract base class that holds atom-environments that will be hashed to generate the fingerprint
abstract base class for atom invariants generators
abstract base class for bond invariants generators
Abstract base class that holds molecule independent arguments that are common amongst all fingerprint...
FingerprintArguments(bool countSimulation, const std::vector< std::uint32_t > countBounds, std::uint32_t fpSize, std::uint32_t numBitsPerFeature=1, bool includeChirality=false)
class that generates same fingerprint style for different output formats
Class for holding Morgan fingerprint specific arguments.
void toJSON(boost::property_tree::ptree &pt) const override
void fromJSON(const boost::property_tree::ptree &pt) override
bool df_includeRedundantEnvironments
bool df_onlyNonzeroInvariants
MorganArguments(unsigned int radius=3, bool countSimulation=false, bool includeChirality=false, bool onlyNonzeroInvariants=false, std::vector< std::uint32_t > countBounds={1, 2, 4, 8}, std::uint32_t fpSize=2048, bool includeRedundantEnvironments=false, bool useBondTypes=true)
Construct a new MorganArguments object.
std::string infoString() const override
method that returns information string about the fingerprint specific argument set and the arguments ...
void updateAdditionalOutput(AdditionalOutput *output, size_t bitId) const override
MorganAtomEnv(const std::uint32_t code, const unsigned int atomId, const unsigned int layer, const ROMol *mol)
Construct a new MorganAtomEnv object.
OutputType getBitId(FingerprintArguments *arguments, const std::vector< std::uint32_t > *atomInvariants, const std::vector< std::uint32_t > *bondInvariants, AdditionalOutput *additionalOutput, const bool hashResults=false, const std::uint64_t fpSize=0) const override
calculates and returns the bit id to be set for this atom-environment
MorganAtomInvGenerator(const bool includeRingMembership=true)
Construct a new MorganAtomInvGenerator object.
void fromJSON(const boost::property_tree::ptree &) override
MorganAtomInvGenerator * clone() const override
void toJSON(boost::property_tree::ptree &pt) const override
std::string infoString() const override
method that returns information about this /c AtomInvariantsGenerator and its arguments
std::vector< std::uint32_t > * getAtomInvariants(const ROMol &mol) const override
get atom invariants from a molecule
std::string infoString() const override
method that returns information about this /c BondInvariantsGenerator and its arguments
MorganBondInvGenerator * clone() const override
MorganBondInvGenerator(const bool useBondTypes=true, const bool useChirality=false)
Construct a new MorganBondInvGenerator object.
~MorganBondInvGenerator() override=default
void toJSON(boost::property_tree::ptree &pt) const override
std::vector< std::uint32_t > * getBondInvariants(const ROMol &mol) const override
get bond invariants from a molecule
void fromJSON(const boost::property_tree::ptree &pt) override
Class that generates atom environments for Morgan fingerprint.
void toJSON(boost::property_tree::ptree &pt) const override
std::string infoString() const override
method that returns information about this /c AtomEnvironmentGenerator and its arguments if any
OutputType getResultSize() const override
Returns the size of the fingerprint based on arguments.
std::vector< AtomEnvironment< OutputType > * > getEnvironments(const ROMol &mol, FingerprintArguments *arguments, const std::vector< std::uint32_t > *fromAtoms, const std::vector< std::uint32_t > *ignoreAtoms, const int confId, const AdditionalOutput *additionalOutput, const std::vector< std::uint32_t > *atomInvariants, const std::vector< std::uint32_t > *bondInvariants, const bool hashResults=false) const override
generate and return all atom-envorinments from a molecule
void fromJSON(const boost::property_tree::ptree &pt) override
~MorganFeatureAtomInvGenerator()
void fromJSON(const boost::property_tree::ptree &) override
std::vector< std::uint32_t > * getAtomInvariants(const ROMol &mol) const override
get atom invariants from a molecule
MorganFeatureAtomInvGenerator * clone() const override
void toJSON(boost::property_tree::ptree &pt) const override
std::string infoString() const override
method that returns information about this /c AtomInvariantsGenerator and its arguments
MorganFeatureAtomInvGenerator(const std::vector< const ROMol * > *patterns=nullptr)
Construct a new MorganFeatureAtomInvGenerator object.
#define RDKIT_FINGERPRINTS_EXPORT
RDKIT_FINGERPRINTS_EXPORT FingerprintGenerator< OutputType > * getMorganGenerator(unsigned int radius, bool countSimulation, bool includeChirality, bool useBondTypes, bool onlyNonzeroInvariants, bool includeRedundantEnvironments, AtomInvariantsGenerator *atomInvariantsGenerator=nullptr, BondInvariantsGenerator *bondInvariantsGenerator=nullptr, std::uint32_t fpSize=2048, std::vector< std::uint32_t > countBounds={1, 2, 4, 8}, bool ownsAtomInvGen=false, bool ownsBondInvGen=false)
Get a fingerprint generator for Morgan fingerprint.