12#ifndef RD_MORGANGEN_H_2018_07
13#define RD_MORGANGEN_H_2018_07
29 bool df_includeRingMembership;
41 const ROMol &mol)
const override;
44 void toJSON(boost::property_tree::ptree &pt)
const override;
45 void fromJSON(
const boost::property_tree::ptree &)
override;
56 std::vector<const ROMol *> *dp_patterns;
70 const ROMol &mol)
const override;
73 void toJSON(boost::property_tree::ptree &pt)
const override;
74 void fromJSON(
const boost::property_tree::ptree &)
override;
97 const bool useChirality =
false);
100 const ROMol &mol)
const override;
103 void toJSON(boost::property_tree::ptree &pt)
const override;
104 void fromJSON(
const boost::property_tree::ptree &pt)
override;
121 void toJSON(boost::property_tree::ptree &pt)
const override;
122 void fromJSON(
const boost::property_tree::ptree &pt)
override;
143 bool includeChirality =
false,
144 bool onlyNonzeroInvariants =
false,
145 std::vector<std::uint32_t> countBounds = {1, 2, 4, 8},
146 std::uint32_t fpSize = 2048,
147 bool includeRedundantEnvironments =
false,
148 bool useBondTypes =
true)
151 df_onlyNonzeroInvariants(onlyNonzeroInvariants),
153 df_includeRedundantEnvironments(includeRedundantEnvironments),
154 df_useBondTypes(useBondTypes) {};
162template <
typename OutputType>
165 const OutputType d_code;
166 const unsigned int d_atomId;
167 const unsigned int d_layer;
168 const ROMol *d_mol =
nullptr;
173 const std::vector<std::uint32_t> *atomInvariants,
174 const std::vector<std::uint32_t> *bondInvariants,
176 const bool hashResults =
false,
177 const std::uint64_t fpSize = 0
180 size_t bitId)
const override;
190 const unsigned int layer,
const ROMol *mol)
191 : d_code(code), d_atomId(atomId), d_layer(layer), d_mol(mol) {}
198template <
typename OutputType>
204 const std::vector<std::uint32_t> *fromAtoms,
205 const std::vector<std::uint32_t> *ignoreAtoms,
const int confId,
207 const std::vector<std::uint32_t> *atomInvariants,
208 const std::vector<std::uint32_t> *bondInvariants,
209 const bool hashResults =
false)
const override;
212 void toJSON(boost::property_tree::ptree &pt)
const override;
213 void fromJSON(
const boost::property_tree::ptree &pt)
override;
265template <
typename OutputType>
267 unsigned int radius,
bool countSimulation,
bool includeChirality,
268 bool useBondTypes,
bool onlyNonzeroInvariants,
269 bool includeRedundantEnvironments,
272 std::uint32_t fpSize = 2048,
273 std::vector<std::uint32_t> countBounds = {1, 2, 4, 8},
274 bool ownsAtomInvGen =
false,
bool ownsBondInvGen =
false);
276template <
typename OutputType>
281 bool ownsAtomInvGen =
false,
bool ownsBondInvGen =
false);
328template <
typename OutputType>
330 unsigned int radius,
bool countSimulation =
false,
331 bool includeChirality =
false,
bool useBondTypes =
true,
332 bool onlyNonzeroInvariants =
false,
335 std::uint32_t fpSize = 2048,
336 std::vector<std::uint32_t> countBounds = {1, 2, 4, 8},
337 bool ownsAtomInvGen =
false,
bool ownsBondInvGen =
false) {
339 radius, countSimulation, includeChirality, useBondTypes,
340 onlyNonzeroInvariants,
false, atomInvariantsGenerator,
341 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(std::vector< const ROMol * > *patterns=nullptr)
Construct a new MorganFeatureAtomInvGenerator object.
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
#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.