Chemical Data Processing Library C++ API - Version 1.2.1
PharmacophoreFitScore.hpp
Go to the documentation of this file.
1 /*
2  * PharmacophoreFitScore.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_PHARM_PHARMACOPHOREFITSCORE_HPP
30 #define CDPL_PHARM_PHARMACOPHOREFITSCORE_HPP
31 
32 #include <vector>
33 #include <unordered_set>
34 #include <cstddef>
35 
36 #include "CDPL/Pharm/APIPrefix.hpp"
39 #include "CDPL/Util/BitSet.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Pharm
46  {
47 
48  class FeatureContainer;
49 
54  {
55 
56  public:
57  static constexpr double DEF_FTR_MATCH_COUNT_WEIGHT = 1.0;
58  static constexpr double DEF_FTR_POS_MATCH_WEIGHT = 0.5;
59  static constexpr double DEF_FTR_GEOM_MATCH_WEIGHT = 0.4;
60 
61  PharmacophoreFitScore(double match_cnt_weight = DEF_FTR_MATCH_COUNT_WEIGHT,
62  double pos_match_weight = DEF_FTR_POS_MATCH_WEIGHT,
63  double geom_match_weight = DEF_FTR_GEOM_MATCH_WEIGHT);
64 
66 
67  void setFeatureMatchCountWeight(double weight);
68 
70 
71  void setFeaturePositionMatchWeight(double weight);
72 
74 
75  void setFeatureGeometryMatchWeight(double weight);
76 
80  void groupReferenceFeatures(bool group);
81 
86 
87  double operator()(const FeatureContainer& ref_ftrs, const FeatureContainer& algnd_ftrs,
88  const Math::Matrix4D& xform);
89 
90  double operator()(const FeatureContainer& ref_ftrs, const SpatialFeatureMapping& mapping);
91 
92  private:
93  typedef std::vector<const Feature*> FeatureList;
94  typedef std::vector<std::size_t> IndexList;
95  typedef std::unordered_set<const Feature*> FeatureSet;
96 
97  void calcScore(std::size_t idx, const SpatialFeatureMapping& mapping,
98  std::size_t mat_ftr_cnt, std::size_t mat_mand_ftr_cnt, double tot_fit_score);
99 
100  SpatialFeatureMapping spatFtrMapping;
101  double ftrMatchCntWeight;
102  double ftrPosMatchWeight;
103  double ftrGeomMatchWeight;
104  bool grpRefFtrs;
105  FeatureList grpdRefFtrs;
106  IndexList refFtrGrpBounds;
107  Util::BitSet mandRefFtrGrps;
108  FeatureSet assignedAlgdFtrs;
109  double maxScore;
110  std::size_t maxMpdMandFtrCount;
111  std::size_t maxMpdFtrCount;
112  };
113  } // namespace Pharm
114 } // namespace CDPL
115 
116 #endif // CDPL_PHARM_PHARMACOPHOREFITSCORE_HPP
Definition of the type CDPL::Util::BitSet.
Definition of the type CDPL::Pharm::FeatureMapping.
Definition of the preprocessor macro CDPL_PHARM_API.
#define CDPL_PHARM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of the class CDPL::Pharm::SpatialFeatureMapping.
FeatureContainer.
Definition: FeatureContainer.hpp:53
PharmacophoreFitScore.
Definition: PharmacophoreFitScore.hpp:54
void setFeatureGeometryMatchWeight(double weight)
PharmacophoreFitScore(double match_cnt_weight=DEF_FTR_MATCH_COUNT_WEIGHT, double pos_match_weight=DEF_FTR_POS_MATCH_WEIGHT, double geom_match_weight=DEF_FTR_GEOM_MATCH_WEIGHT)
void setFeaturePositionMatchWeight(double weight)
void groupReferenceFeatures(bool group)
double operator()(const FeatureContainer &ref_ftrs, const FeatureContainer &algnd_ftrs, const Math::Matrix4D &xform)
double operator()(const FeatureContainer &ref_ftrs, const SpatialFeatureMapping &mapping)
double getFeatureGeometryMatchWeight() const
void setFeatureMatchCountWeight(double weight)
double getFeaturePositionMatchWeight() const
SpatialFeatureMapping.
Definition: SpatialFeatureMapping.hpp:55
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.