Chemical Data Processing Library C++ API - Version 1.2.0
NPointPharmacophoreFingerprintGenerator.hpp
Go to the documentation of this file.
1 /*
2  * NPointPharmacophoreFingerprintGenerator.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_NPOINTPHARMACOPHOREFINGERPRINTGENERATOR_HPP
30 #define CDPL_DESCR_NPOINTPHARMACOPHOREFINGERPRINTGENERATOR_HPP
31 
32 #include <cstddef>
33 #include <vector>
34 #include <utility>
35 
36 #include "CDPL/Descr/APIPrefix.hpp"
39 #include "CDPL/Math/Matrix.hpp"
40 #include "CDPL/Util/BitSet.hpp"
41 
42 
43 namespace CDPL
44 {
45 
46  namespace Descr
47  {
48 
54  {
55 
56  public:
57  static constexpr std::size_t DEF_MIN_FEATURE_TUPLE_SIZE = 1;
58  static constexpr std::size_t DEF_MAX_FEATURE_TUPLE_SIZE = 3;
59 
60  static constexpr double DEF_BIN_SIZE = 0.5;
61 
63 
64  void setMinFeatureTupleSize(std::size_t min_size);
65 
66  std::size_t getMinFeatureTupleSize() const;
67 
68  void setMaxFeatureTupleSize(std::size_t max_size);
69 
70  std::size_t getMaxFeatureTupleSize() const;
71 
72  void setBinSize(double bin_size);
73 
74  double getBinSize() const;
75 
77 
79 
80  protected:
82 
84 
85  void generate(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
87 
88  private:
89  void init(const Pharm::FeatureContainer& cntnr);
90 
91  void enumFeatureTuples(std::size_t curr_ftr_idx, Util::BitSet& fp);
92 
93  void emitFeatureTupleBit(Util::BitSet& fp);
94 
95  void canonFeatureTupleData(std::size_t curr_ftr_idx);
96 
97  unsigned long getDistanceBinNumber(double dist) const;
98 
99  virtual double getDistance(const Pharm::Feature& ftr1, const Pharm::Feature& ftr2) const = 0;
100 
101  typedef std::pair<unsigned int, std::size_t> FeatureID;
102  typedef std::vector<FeatureID> FeatureList;
103  typedef std::vector<unsigned long> FeatureTupleData;
104 
105  std::size_t minFtrTupleSize;
106  std::size_t maxFtrTupleSize;
107  double binSize;
110  FeatureList ftrList;
111  Math::ULMatrix ftrDistMatrix;
112  FeatureList ftrTuple;
113  FeatureTupleData ftrTupleData;
114  FeatureTupleData tmpFtrTupleData;
115  };
116  } // namespace Descr
117 } // namespace CDPL
118 
119 #endif // CDPL_DESCR_NPOINTPHARMACOPHOREFINGERPRINTGENERATOR_HPP
Definition of the class CDPL::Pharm::BasicPharmacophore.
Definition of the type CDPL::Util::BitSet.
Definition of the class CDPL::Pharm::DefaultPharmacophoreGenerator.
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 matrix data types.
MolecularGraph.
Definition: MolecularGraph.hpp:52
NPointPharmacophoreFingerprintGenerator.
Definition: NPointPharmacophoreFingerprintGenerator.hpp:54
const Pharm::PharmacophoreGenerator & getPharmacophoreGenerator() const
NPointPharmacophoreFingerprintGenerator(const NPointPharmacophoreFingerprintGenerator &gen)=default
void generate(const Chem::MolecularGraph &molgraph, Util::BitSet &fp)
Pharm::PharmacophoreGenerator & getPharmacophoreGenerator()
void generate(const Pharm::FeatureContainer &cntnr, Util::BitSet &fp)
virtual ~NPointPharmacophoreFingerprintGenerator()
Definition: NPointPharmacophoreFingerprintGenerator.hpp:62
BasicPharmacophore.
Definition: BasicPharmacophore.hpp:52
DefaultPharmacophoreGenerator.
Definition: DefaultPharmacophoreGenerator.hpp:48
FeatureContainer.
Definition: FeatureContainer.hpp:53
Feature.
Definition: Feature.hpp:48
PharmacophoreGenerator.
Definition: PharmacophoreGenerator.hpp:49
Matrix< unsigned long > ULMatrix
An unbounded dense matrix holding unsigned integers of type unsigned long.
Definition: Matrix.hpp:1824
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.