Chemical Data Processing Library C++ API - Version 1.1.1
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
CDPL::Descr::CircularFingerprintGenerator Class Reference

CircularFingerprintGenerator. More...

#include <CircularFingerprintGenerator.hpp>

Classes

class  DefAtomIdentifierFunctor
 The functor for the generation of ECFP atom identifiers. More...
 
class  DefBondIdentifierFunctor
 The default functor for the generation of bond identifiers. More...
 

Public Types

typedef std::function< std::uint64_t(const Chem::Atom &, const Chem::MolecularGraph &)> AtomIdentifierFunction
 Type of the generic functor class used to store user-defined functions or function objects for the generation of atom identifiers. More...
 
typedef std::function< std::uint64_t(const Chem::Bond &)> BondIdentifierFunction
 Type of the generic functor class used to store user-defined functions or function objects for the generation of bond identifiers. More...
 

Public Member Functions

 CircularFingerprintGenerator ()
 Constructs the CircularFingerprintGenerator instance. More...
 
 CircularFingerprintGenerator (const Chem::MolecularGraph &molgraph)
 Constructs the CircularFingerprintGenerator instance and generates the atom-centered circular substructure fingerprint of the molecular graph molgraph. More...
 
void setAtomIdentifierFunction (const AtomIdentifierFunction &func)
 Allows to specify a customized function for the generation of initial atom identifiers. More...
 
void setBondIdentifierFunction (const BondIdentifierFunction &func)
 Allows to specify a customized function for the generation of initial bond identifiers. More...
 
void setNumIterations (std::size_t num_iter)
 Allows to specify the desired number of feature substructure growing iterations. More...
 
std::size_t getNumIterations () const
 Returns the number of feature substructure growing iterations. More...
 
void includeHydrogens (bool include)
 
bool hydrogensIncluded () const
 
void includeChirality (bool include)
 
bool chiralityIncluded () const
 
void generate (const Chem::MolecularGraph &molgraph)
 Generates the atom-centered circular substructure fingerprint of the molecular graph molgraph. More...
 
void setFeatureBits (Util::BitSet &bs, bool reset=true) const
 Maps previously generated feature identifiers to bit indices and sets the correponding bits of bs. More...
 
void setFeatureBits (std::size_t atom_idx, Util::BitSet &bs, bool reset=true) const
 Maps previously generated identifiers of structural features involving the atom specified by atom_idx to bit indices and sets the correponding bits of bs. More...
 
std::size_t getNumFeatures () const
 
std::uint64_t getFeatureIdentifier (std::size_t ftr_idx) const
 
const Util::BitSetgetFeatureSubstructure (std::size_t ftr_idx) const
 
void getFeatureSubstructure (std::size_t ftr_idx, Chem::Fragment &frag, bool clear=true) const
 
void getFeatureSubstructures (std::size_t bit_idx, std::size_t bs_size, Chem::FragmentList &frags, bool clear=true) const
 

Static Public Attributes

static constexpr unsigned int DEF_ATOM_PROPERTY_FLAGS
 Specifies the default set of atomic properties considered in the generation of atom identifiers by CircularFingerprintGenerator::DefAtomIdentifierFunction. More...
 
static constexpr unsigned int DEF_BOND_PROPERTY_FLAGS
 Specifies the default set of bond properties considered in the generation of bond identifiers by CircularFingerprintGenerator::DefBondIdentifierFunction. More...
 

Detailed Description

CircularFingerprintGenerator.

See also
[STECFP]

Member Typedef Documentation

◆ AtomIdentifierFunction

Type of the generic functor class used to store user-defined functions or function objects for the generation of atom identifiers.

Functions or function objects for the generation of atom identifiers are required to take the atom (as a const reference to Chem::Atom) and containing molecular graph (as a const reference to Chem::MolecularGraph) as argument and return the identifier as an integer of type std::uint64_t (see [FUNWRP]).

◆ BondIdentifierFunction

Type of the generic functor class used to store user-defined functions or function objects for the generation of bond identifiers.

Functions or function objects for the generation of bond identifiers are required to take the bond (as a const reference to Chem::Bond) as argument and return the identifier as an integer of type std::uint64_t (see [FUNWRP]).

Constructor & Destructor Documentation

◆ CircularFingerprintGenerator() [1/2]

CDPL::Descr::CircularFingerprintGenerator::CircularFingerprintGenerator ( )

Constructs the CircularFingerprintGenerator instance.

◆ CircularFingerprintGenerator() [2/2]

CDPL::Descr::CircularFingerprintGenerator::CircularFingerprintGenerator ( const Chem::MolecularGraph molgraph)

Constructs the CircularFingerprintGenerator instance and generates the atom-centered circular substructure fingerprint of the molecular graph molgraph.

Parameters
molgraphThe molecular graph to process.

Member Function Documentation

◆ setAtomIdentifierFunction()

void CDPL::Descr::CircularFingerprintGenerator::setAtomIdentifierFunction ( const AtomIdentifierFunction func)

Allows to specify a customized function for the generation of initial atom identifiers.

Parameters
funcA CircularFingerprintGenerator::AtomIdentifierFunction instance that wraps the target function.
Note
By default, atom identifiers are generated by a CircularFingerprintGenerator::DefAtomIdentifierFunctor instance. If the generated initial identifier for an atom is 0, the atom is regarded as not being present in the processed molecular graph.

◆ setBondIdentifierFunction()

void CDPL::Descr::CircularFingerprintGenerator::setBondIdentifierFunction ( const BondIdentifierFunction func)

Allows to specify a customized function for the generation of initial bond identifiers.

Parameters
funcA CircularFingerprintGenerator::BondIdentifierFunction instance that wraps the target function.
Note
By default, bond identifiers are generated by a CircularFingerprintGenerator::DefBondIdentifierFunctor instance. If the generated initial identifier for a bond is 0, the bond is regarded as not being present in the processed molecular graph.

◆ setNumIterations()

void CDPL::Descr::CircularFingerprintGenerator::setNumIterations ( std::size_t  num_iter)

Allows to specify the desired number of feature substructure growing iterations.

Parameters
num_iterThe number of iterations.
Note
The default number of iterations is 2.

◆ getNumIterations()

std::size_t CDPL::Descr::CircularFingerprintGenerator::getNumIterations ( ) const

Returns the number of feature substructure growing iterations.

Returns
The number of iterations.

◆ includeHydrogens()

void CDPL::Descr::CircularFingerprintGenerator::includeHydrogens ( bool  include)

◆ hydrogensIncluded()

bool CDPL::Descr::CircularFingerprintGenerator::hydrogensIncluded ( ) const

◆ includeChirality()

void CDPL::Descr::CircularFingerprintGenerator::includeChirality ( bool  include)

◆ chiralityIncluded()

bool CDPL::Descr::CircularFingerprintGenerator::chiralityIncluded ( ) const

◆ generate()

void CDPL::Descr::CircularFingerprintGenerator::generate ( const Chem::MolecularGraph molgraph)

Generates the atom-centered circular substructure fingerprint of the molecular graph molgraph.

Parameters
molgraphThe molecular graph to process.

◆ setFeatureBits() [1/2]

void CDPL::Descr::CircularFingerprintGenerator::setFeatureBits ( Util::BitSet bs,
bool  reset = true 
) const

Maps previously generated feature identifiers to bit indices and sets the correponding bits of bs.

Parameters
bsThe target bitset.
resetIf true, bs will be cleared before any feature bits are set.
Note
The binary fingerprint size is specified implicitly via the size of bs.
See also
generate()

◆ setFeatureBits() [2/2]

void CDPL::Descr::CircularFingerprintGenerator::setFeatureBits ( std::size_t  atom_idx,
Util::BitSet bs,
bool  reset = true 
) const

Maps previously generated identifiers of structural features involving the atom specified by atom_idx to bit indices and sets the correponding bits of bs.

Parameters
atom_idxThe index of the atom that has to be involved in the structural features.
bsThe target bitset.
resetIf true, bs will be cleared before any feature bits are set.
Note
The binary fingerprint size is specified implicitly via the size of bs.
See also
generate()

◆ getNumFeatures()

std::size_t CDPL::Descr::CircularFingerprintGenerator::getNumFeatures ( ) const

◆ getFeatureIdentifier()

std::uint64_t CDPL::Descr::CircularFingerprintGenerator::getFeatureIdentifier ( std::size_t  ftr_idx) const

◆ getFeatureSubstructure() [1/2]

const Util::BitSet& CDPL::Descr::CircularFingerprintGenerator::getFeatureSubstructure ( std::size_t  ftr_idx) const

◆ getFeatureSubstructure() [2/2]

void CDPL::Descr::CircularFingerprintGenerator::getFeatureSubstructure ( std::size_t  ftr_idx,
Chem::Fragment frag,
bool  clear = true 
) const

◆ getFeatureSubstructures()

void CDPL::Descr::CircularFingerprintGenerator::getFeatureSubstructures ( std::size_t  bit_idx,
std::size_t  bs_size,
Chem::FragmentList frags,
bool  clear = true 
) const

Member Data Documentation

◆ DEF_ATOM_PROPERTY_FLAGS

constexpr unsigned int CDPL::Descr::CircularFingerprintGenerator::DEF_ATOM_PROPERTY_FLAGS
staticconstexpr
Initial value:

Specifies the default set of atomic properties considered in the generation of atom identifiers by CircularFingerprintGenerator::DefAtomIdentifierFunction.

◆ DEF_BOND_PROPERTY_FLAGS

constexpr unsigned int CDPL::Descr::CircularFingerprintGenerator::DEF_BOND_PROPERTY_FLAGS
staticconstexpr
Initial value:

Specifies the default set of bond properties considered in the generation of bond identifiers by CircularFingerprintGenerator::DefBondIdentifierFunction.


The documentation for this class was generated from the following file:
CDPL::Chem::AtomPropertyFlag::FORMAL_CHARGE
const unsigned int FORMAL_CHARGE
Specifies the formal charge of an atom.
Definition: Chem/AtomPropertyFlag.hpp:73
CDPL::Chem::BondPropertyFlag::AROMATICITY
const unsigned int AROMATICITY
Specifies the membership of a bond in aromatic rings.
Definition: BondPropertyFlag.hpp:73
CDPL::Chem::AtomPropertyFlag::VALENCE
const unsigned int VALENCE
Specifies the valence of an atom.
Definition: Chem/AtomPropertyFlag.hpp:113
CDPL::Chem::BondPropertyFlag::ORDER
const unsigned int ORDER
Specifies the order of a bond.
Definition: BondPropertyFlag.hpp:63
CDPL::Chem::AtomPropertyFlag::TYPE
const unsigned int TYPE
Specifies the generic type or element of an atom.
Definition: Chem/AtomPropertyFlag.hpp:63
CDPL::Chem::AtomPropertyFlag::ISOTOPE
const unsigned int ISOTOPE
Specifies the isotopic mass of an atom.
Definition: Chem/AtomPropertyFlag.hpp:68
CDPL::Chem::AtomPropertyFlag::TOPOLOGY
const unsigned int TOPOLOGY
Specifies the ring/chain topology of an atom.
Definition: Chem/AtomPropertyFlag.hpp:88
CDPL::Chem::AtomPropertyFlag::HEAVY_BOND_COUNT
const unsigned int HEAVY_BOND_COUNT
Specifies the heavy bond count of an atom.
Definition: Chem/AtomPropertyFlag.hpp:108
CDPL::Chem::AtomPropertyFlag::H_COUNT
const unsigned int H_COUNT
Specifies the hydrogen count of an atom.
Definition: Chem/AtomPropertyFlag.hpp:78