Chemical Data Processing Library C++ API - Version 1.4.0
PubChemFingerprintGenerator.hpp
Go to the documentation of this file.
1 /*
2  * PubChemFingerprintGenerator.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_DESCR_PUBCHEMFINGERPRINTGENERATOR_HPP
30 #define CDPL_DESCR_PUBCHEMFINGERPRINTGENERATOR_HPP
31 
32 #include <cstddef>
33 #include <unordered_set>
34 
35 #include "CDPL/Descr/APIPrefix.hpp"
37 #include "CDPL/Chem/Fragment.hpp"
39 #include "CDPL/Util/BitSet.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Descr
46  {
47 
54  {
55 
56  public:
60  static constexpr std::size_t NUM_BITS = 881;
61 
66 
73 
81 
87  void generate(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
88 
96  {
97  return *this;
98  }
99 
100  private:
101  void setElementCountBits(const Chem::MolecularGraph& molgraph, Util::BitSet& fp) const;
102  void setRingCountBits(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
103  void setAtomPairBits(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
104  void setAtomEnvPatternBits(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
105  void setSubstructPatternBits(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
106 
107  typedef std::unordered_set<std::size_t> AtomTypePairSet;
108 
109  Chem::SubstructureSearch subSearch;
110  Chem::ExtendedSSSR esssr;
111  Util::BitSet aromBondMask;
112  AtomTypePairSet foundAtomPairs;
113  Chem::Fragment atomEnv;
114  };
115  } // namespace Descr
116 } // namespace CDPL
117 
118 #endif // CDPL_DESCR_PUBCHEMFINGERPRINTGENERATOR_HPP
Declaration of type CDPL::Util::BitSet.
Definition of the preprocessor macro CDPL_DESCR_API.
#define CDPL_DESCR_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::Chem::ExtendedSSSR.
Definition of class CDPL::Chem::Fragment.
Definition of class CDPL::Chem::SubstructureSearch.
Implements the perception of the Extended Smallest Set of Smallest Rings (ESSSR) of a molecular graph...
Definition: ExtendedSSSR.hpp:51
Concrete Chem::MolecularGraph implementation that stores references to a selectable subset of atoms a...
Definition: Fragment.hpp:57
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Subgraph-isomorphism search of a query molecular graph against a target molecular graph,...
Definition: SubstructureSearch.hpp:74
Generation of 881 bit PubChem fingerprints.
Definition: PubChemFingerprintGenerator.hpp:54
PubChemFingerprintGenerator(const PubChemFingerprintGenerator &gen)
Copy constructor.
PubChemFingerprintGenerator(const Chem::MolecularGraph &molgraph, Util::BitSet &fp)
Constructs the PubChemFingerprintGenerator instance and generates the fingerprint of the molecular gr...
PubChemFingerprintGenerator()
Constructs the PubChemFingerprintGenerator instance.
void generate(const Chem::MolecularGraph &molgraph, Util::BitSet &fp)
Generates the fingerprint of the molecular graph molgraph.
PubChemFingerprintGenerator & operator=(const PubChemFingerprintGenerator &gen)
Assignment operator.
Definition: PubChemFingerprintGenerator.hpp:95
boost::dynamic_bitset BitSet
Dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.