Chemical Data Processing Library C++ API - Version 1.3.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 #include <functional>
36 
37 #include "CDPL/Descr/APIPrefix.hpp"
41 #include "CDPL/Math/Matrix.hpp"
42 #include "CDPL/Util/BitSet.hpp"
43 
44 
45 namespace CDPL
46 {
47 
48  namespace Descr
49  {
50 
56  {
57 
58  public:
59  static constexpr std::size_t DEF_MIN_FEATURE_TUPLE_SIZE = 1;
60  static constexpr std::size_t DEF_MAX_FEATURE_TUPLE_SIZE = 3;
61 
62  typedef std::function<bool(const Pharm::Feature&)> FeatureFilterFunction;
63 
65 
66  void setMinFeatureTupleSize(std::size_t min_size);
67 
68  std::size_t getMinFeatureTupleSize() const;
69 
70  void setMaxFeatureTupleSize(std::size_t max_size);
71 
72  std::size_t getMaxFeatureTupleSize() const;
73 
74  void setBinSize(double bin_size);
75 
76  double getBinSize() const;
77 
79 
81 
86 
91 
92  protected:
93  static constexpr double DEF_BIN_SIZE = 2.0;
94 
96 
98 
99  void generate(const Chem::MolecularGraph& molgraph, Util::BitSet& fp);
101 
102  private:
103  void init(const Pharm::FeatureContainer& cntnr);
104 
105  void enumFeatureTuples(std::size_t curr_ftr_idx, Util::BitSet& fp);
106 
107  void emitFeatureTupleBit(Util::BitSet& fp);
108 
109  void canonFeatureTupleData(std::size_t curr_ftr_idx);
110 
111  unsigned long getDistanceBinNumber(double dist) const;
112 
113  virtual double getDistance(const Pharm::Feature& ftr1, const Pharm::Feature& ftr2) const = 0;
114 
115  typedef std::pair<unsigned int, std::size_t> FeatureID;
116  typedef std::vector<FeatureID> FeatureList;
117  typedef std::vector<unsigned long> FeatureTupleData;
118 
119  std::size_t minFtrTupleSize;
120  std::size_t maxFtrTupleSize;
121  double binSize;
122  FeatureFilterFunction ftrFilterFunc;
125  Pharm::FeatureSet ftrSubset;
126  FeatureList ftrList;
127  Math::ULMatrix ftrDistMatrix;
128  FeatureList ftrTuple;
129  FeatureTupleData ftrTupleData;
130  FeatureTupleData tmpFtrTupleData;
131  };
132  } // namespace Descr
133 } // namespace CDPL
134 
135 #endif // CDPL_DESCR_NPOINTPHARMACOPHOREFINGERPRINTGENERATOR_HPP
Definition of class CDPL::Pharm::BasicPharmacophore.
Declaration of type CDPL::Util::BitSet.
Definition of 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 class CDPL::Pharm::FeatureSet.
Definition of matrix data types.
MolecularGraph.
Definition: MolecularGraph.hpp:52
NPointPharmacophoreFingerprintGenerator.
Definition: NPointPharmacophoreFingerprintGenerator.hpp:56
const Pharm::PharmacophoreGenerator & getPharmacophoreGenerator() const
std::function< bool(const Pharm::Feature &)> FeatureFilterFunction
Definition: NPointPharmacophoreFingerprintGenerator.hpp:62
NPointPharmacophoreFingerprintGenerator(const NPointPharmacophoreFingerprintGenerator &gen)=default
void generate(const Chem::MolecularGraph &molgraph, Util::BitSet &fp)
void setFeatureFilterFunction(const FeatureFilterFunction &func)
Pharm::PharmacophoreGenerator & getPharmacophoreGenerator()
void generate(const Pharm::FeatureContainer &cntnr, Util::BitSet &fp)
const FeatureFilterFunction & getFeatureFilterFunction() const
virtual ~NPointPharmacophoreFingerprintGenerator()
Definition: NPointPharmacophoreFingerprintGenerator.hpp:64
BasicPharmacophore.
Definition: BasicPharmacophore.hpp:52
DefaultPharmacophoreGenerator.
Definition: DefaultPharmacophoreGenerator.hpp:48
FeatureContainer.
Definition: FeatureContainer.hpp:53
FeatureSet.
Definition: FeatureSet.hpp:52
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.