Chemical Data Processing Library C++ API - Version 1.2.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:
57  static constexpr std::size_t NUM_BITS = 881;
58 
63 
65 
73 
79  void generate(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
80 
82  {
83  return *this;
84  }
85 
86  private:
87  void setElementCountBits(const Chem::MolecularGraph& molgraph, Util::BitSet& fp) const;
88  void setRingCountBits(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
89  void setAtomPairBits(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
90  void setAtomEnvPatternBits(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
91  void setSubstructPatternBits(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
92 
93  typedef std::unordered_set<std::size_t> AtomTypePairSet;
94 
95  Chem::SubstructureSearch subSearch;
96  Chem::ExtendedSSSR esssr;
97  Util::BitSet aromBondMask;
98  AtomTypePairSet foundAtomPairs;
99  Chem::Fragment atomEnv;
100  };
101  } // namespace Descr
102 } // namespace CDPL
103 
104 #endif // CDPL_DESCR_PUBCHEMFINGERPRINTGENERATOR_HPP
Definition of the 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 the class CDPL::Chem::ExtendedSSSR.
Definition of the class CDPL::Chem::Fragment.
Definition of the class CDPL::Chem::SubstructureSearch.
Implements the perception of the Extended Smallest Set of Smallest Rings (ESSSR) of a molecular graph...
Definition: ExtendedSSSR.hpp:51
Fragment.
Definition: Fragment.hpp:52
MolecularGraph.
Definition: MolecularGraph.hpp:52
SubstructureSearch.
Definition: SubstructureSearch.hpp:64
Generation of 881 bit PubChem fingerprints.
Definition: PubChemFingerprintGenerator.hpp:54
PubChemFingerprintGenerator(const PubChemFingerprintGenerator &gen)
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)
Definition: PubChemFingerprintGenerator.hpp:81
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.