![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Generation of Daylight-style path fingerprints of molecular graphs. More...
#include <PathFingerprintGenerator.hpp>
Classes | |
| class | DefAtomDescriptorFunctor |
| The default functor for the generation of atom descriptors. More... | |
| class | DefBondDescriptorFunctor |
| The default functor for the generation of bond descriptors. More... | |
Public Types | |
| typedef std::function< std::uint64_t(const Chem::Atom &)> | AtomDescriptorFunction |
| Type of the generic functor class used to store user-defined functions or function objects for the generation of atom descriptors. More... | |
| typedef std::function< std::uint64_t(const Chem::Bond &)> | BondDescriptorFunction |
| Type of the generic functor class used to store user-defined functions or function objects for the generation of bond descriptors. More... | |
Public Member Functions | |
| PathFingerprintGenerator () | |
Constructs the PathFingerprintGenerator instance. More... | |
| PathFingerprintGenerator (const Chem::MolecularGraph &molgraph, Util::BitSet &fp) | |
Constructs the PathFingerprintGenerator instance and generates the fingerprint of the molecular graph molgraph. More... | |
| void | setAtomDescriptorFunction (const AtomDescriptorFunction &func) |
| Allows to specify a custom function for the generation of atom descriptors. More... | |
| void | setBondDescriptorFunction (const BondDescriptorFunction &func) |
| Allows to specify a custom function for the generation of bond descriptors. More... | |
| void | setMinPathLength (std::size_t min_length) |
| Allows to specify the minimum length a path must have to contribute to the generated fingerprint. More... | |
| std::size_t | getMinPathLength () const |
| Returns the minimum length a path must have to contribute to the generated fingerprint. More... | |
| void | setMaxPathLength (std::size_t max_length) |
| Allows to specify the maximum considered path length. More... | |
| std::size_t | getMaxPathLength () const |
| Returns the maximum considered path length. More... | |
| void | includeHydrogens (bool include) |
| Specifies whether hydrogens shall be considered during path enumeration. More... | |
| bool | hydrogensIncluded () const |
| Tells whether hydrogens are considered during path enumeration. More... | |
| void | generate (const Chem::MolecularGraph &molgraph, Util::BitSet &fp) |
| Generates the fingerprint of the molecular graph molgraph. More... | |
Static Public Attributes | |
| static constexpr unsigned int | DEF_ATOM_PROPERTY_FLAGS |
| Specifies the default set of atomic properties considered in the generation of atom descriptors by PathFingerprintGenerator::DefAtomDescriptorFunction. More... | |
| static constexpr unsigned int | DEF_BOND_PROPERTY_FLAGS |
| Specifies the default set of bond properties considered in the generation of bond descriptors by PathFingerprintGenerator::DefBondDescriptorFunction. More... | |
Generation of Daylight-style path fingerprints of molecular graphs.
The generator enumerates atom-bond-atom paths up to a configurable maximum length, derives a hash for each path from per-atom and per-bond descriptors (provided by the DefAtomDescriptorFunctor / DefBondDescriptorFunctor or user-supplied alternatives), and folds the hashes into a bitset of any size.
| typedef std::function<std::uint64_t(const Chem::Atom&)> CDPL::Descr::PathFingerprintGenerator::AtomDescriptorFunction |
Type of the generic functor class used to store user-defined functions or function objects for the generation of atom descriptors.
Functions or function objects for the generation of atom descriptors are required to take the atom (as a const reference to Chem::Atom) as argument and return the descriptor as an integer of type std::uint64_t (see [FUNWRP]).
| typedef std::function<std::uint64_t(const Chem::Bond&)> CDPL::Descr::PathFingerprintGenerator::BondDescriptorFunction |
Type of the generic functor class used to store user-defined functions or function objects for the generation of bond descriptors.
Functions or function objects for the generation of bond descriptors are required to take the bond (as a const reference to Chem::Bond) as argument and return the descriptor as an integer of type std::uint64_t (see [FUNWRP]).
| CDPL::Descr::PathFingerprintGenerator::PathFingerprintGenerator | ( | ) |
Constructs the PathFingerprintGenerator instance.
| CDPL::Descr::PathFingerprintGenerator::PathFingerprintGenerator | ( | const Chem::MolecularGraph & | molgraph, |
| Util::BitSet & | fp | ||
| ) |
Constructs the PathFingerprintGenerator instance and generates the fingerprint of the molecular graph molgraph.
| molgraph | The molecular graph for which to generate the fingerprint. |
| fp | The generated fingerprint. |
| void CDPL::Descr::PathFingerprintGenerator::setAtomDescriptorFunction | ( | const AtomDescriptorFunction & | func | ) |
Allows to specify a custom function for the generation of atom descriptors.
| func | A PathFingerprintGenerator::AtomDescriptorFunction instance that wraps the target function. |
| void CDPL::Descr::PathFingerprintGenerator::setBondDescriptorFunction | ( | const BondDescriptorFunction & | func | ) |
Allows to specify a custom function for the generation of bond descriptors.
| func | A PathFingerprintGenerator::BondDescriptorFunction instance that wraps the target function. |
| void CDPL::Descr::PathFingerprintGenerator::setMinPathLength | ( | std::size_t | min_length | ) |
Allows to specify the minimum length a path must have to contribute to the generated fingerprint.
Any path whose length (in number of bonds) is lower than the specified minimum length will not be represented by a corresponding bit in the generated fingerprint.
| min_length | The minimum path length in number of bonds. |
| std::size_t CDPL::Descr::PathFingerprintGenerator::getMinPathLength | ( | ) | const |
Returns the minimum length a path must have to contribute to the generated fingerprint.
| void CDPL::Descr::PathFingerprintGenerator::setMaxPathLength | ( | std::size_t | max_length | ) |
Allows to specify the maximum considered path length.
Any path whose length (in number of bonds) is greater than the specified maximum length will not be represented by a corresponding bit in the generated fingerprint.
| max_length | The maximum path length in number of bonds. |
| std::size_t CDPL::Descr::PathFingerprintGenerator::getMaxPathLength | ( | ) | const |
Returns the maximum considered path length.
| void CDPL::Descr::PathFingerprintGenerator::includeHydrogens | ( | bool | include | ) |
Specifies whether hydrogens shall be considered during path enumeration.
| include | If true, hydrogens are considered as regular atoms during fingerprint generation. |
| bool CDPL::Descr::PathFingerprintGenerator::hydrogensIncluded | ( | ) | const |
Tells whether hydrogens are considered during path enumeration.
true if hydrogens are considered, and false otherwise. | void CDPL::Descr::PathFingerprintGenerator::generate | ( | const Chem::MolecularGraph & | molgraph, |
| Util::BitSet & | fp | ||
| ) |
Generates the fingerprint of the molecular graph molgraph.
| molgraph | The molecular graph for which to generate the fingerprint. |
| fp | The generated fingerprint. |
|
staticconstexpr |
Specifies the default set of atomic properties considered in the generation of atom descriptors by PathFingerprintGenerator::DefAtomDescriptorFunction.
|
staticconstexpr |
Specifies the default set of bond properties considered in the generation of bond descriptors by PathFingerprintGenerator::DefBondDescriptorFunction.