Chemical Data Processing Library C++ API - Version 1.4.0
ScreeningSettings.hpp
Go to the documentation of this file.
1 /*
2  * ScreeningSettings.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_SHAPE_SCREENINGSETTINGS_HPP
30 #define CDPL_SHAPE_SCREENINGSETTINGS_HPP
31 
32 #include <cstddef>
33 #include <limits>
34 #include <functional>
35 
36 #include "CDPL/Shape/APIPrefix.hpp"
37 
38 
39 namespace CDPL
40 {
41 
42  namespace Shape
43  {
44 
45  class AlignmentResult;
46 
55  {
56 
57  public:
61  static const ScreeningSettings DEFAULT;
62 
66  static constexpr double NO_CUTOFF = std::numeric_limits<double>::quiet_NaN();
67 
71  typedef std::function<double(const AlignmentResult&)> ScoringFunction;
72 
77  {
78 
83 
88 
92  BEST_MATCH_PER_QUERY_CONF
93  };
94 
99  {
100 
105 
110 
114  PHARMACOPHORE_IMP_CHARGES
115  };
116 
121  {
122 
126  NO_ALIGNMENT = 0x0,
127 
131  SHAPE_CENTROID = 0x1,
132 
136  ATOM_CENTERS = 0x2,
137 
141  COLOR_FEATURE_CENTERS = 0x4,
142 
146  RANDOM = 0x8
147  };
148 
153 
159 
165 
171 
177 
183 
189 
195 
201 
206  void setNumRandomStarts(std::size_t num_starts);
207 
212  std::size_t getNumRandomStarts() const;
213 
218  void allCarbonMode(bool all_c);
219 
224  bool allCarbonMode() const;
225 
230  void singleConformerSearch(bool single_conf);
231 
236  bool singleConformerSearch() const;
237 
242  void optimizeOverlap(bool optimize);
243 
248  bool optimizeOverlap() const;
249 
254  void greedyOptimization(bool greedy);
255 
260  bool greedyOptimization() const;
261 
266  void setMaxNumOptimizationIterations(std::size_t max_iter);
267 
272  std::size_t getMaxNumOptimizationIterations() const;
273 
278  void setOptimizationStopGradient(double grad_norm);
279 
285 
290  void setScoreCutoff(double cutoff);
291 
296  double getScoreCutoff() const;
297 
298  private:
299  ScoringFunction scoringFunc;
300  ColorFeatureType colorFtrType;
301  ScreeningMode screeningMode;
302  AlignmentMode almntMode;
303  std::size_t numRandomStarts;
304  bool allCarbon;
305  bool singleConfSearch;
306  bool optOverlap;
307  bool greedyOpt;
308  std::size_t numOptIter;
309  double optStopGrad;
310  double scoreCutoff;
311  };
312  } // namespace Shape
313 } // namespace CDPL
314 
315 #endif // CDPL_SHAPE_SCREENINGSETTINGS_HPP
Definition of the preprocessor macro CDPL_SHAPE_API.
#define CDPL_SHAPE_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Result of a Gaussian-shape alignment between a reference and an aligned shape.
Definition: AlignmentResult.hpp:52
Bundle of configuration parameters for Shape::ScreeningProcessor.
Definition: ScreeningSettings.hpp:55
void setScreeningMode(ScreeningMode mode)
Sets the screening mode.
std::size_t getMaxNumOptimizationIterations() const
Returns the currently configured maximum number of overlap-optimization iterations.
static const ScreeningSettings DEFAULT
A static instance with default-initialized values.
Definition: ScreeningSettings.hpp:61
AlignmentMode getAlignmentMode() const
Returns the currently configured alignment-mode bitmask.
void setMaxNumOptimizationIterations(std::size_t max_iter)
Sets the maximum number of overlap-optimization iterations.
ScreeningSettings()
Constructs a ScreeningSettings instance with default values.
ScreeningMode getScreeningMode() const
Returns the currently configured screening mode.
void greedyOptimization(bool greedy)
Specifies whether the overlap optimization shall use a greedy strategy that stops at the first local ...
ScreeningMode
Specifies which alignment hits are reported by the screening processor.
Definition: ScreeningSettings.hpp:77
@ BEST_MATCH_PER_QUERY
Report the best-scoring alignment hit per query molecule.
Definition: ScreeningSettings.hpp:87
@ BEST_OVERALL_MATCH
Report only the single best-scoring alignment hit across all queries.
Definition: ScreeningSettings.hpp:82
bool greedyOptimization() const
Tells whether the overlap optimization uses a greedy strategy.
void setColorFeatureType(ColorFeatureType type)
Sets the color feature type to use during alignment.
std::size_t getNumRandomStarts() const
Returns the currently configured number of random starts.
void setScoreCutoff(double cutoff)
Sets the minimum score below which alignment hits are discarded (or NO_CUTOFF).
void optimizeOverlap(bool optimize)
Specifies whether the overlap shall be optimized iteratively after the initial alignment.
ColorFeatureType getColorFeatureType() const
Returns the currently configured color feature type.
void setNumRandomStarts(std::size_t num_starts)
Sets the number of random starting transformations when AlignmentMode::RANDOM is enabled.
void setAlignmentMode(AlignmentMode mode)
Sets the alignment-mode bitmask (see AlignmentMode).
void singleConformerSearch(bool single_conf)
Specifies whether only a single conformer of each molecule is considered.
bool singleConformerSearch() const
Tells whether only a single conformer of each molecule is considered.
void setScoringFunction(const ScoringFunction &func)
Sets the scoring function used to rank alignment results.
const ScoringFunction & getScoringFunction() const
Returns the currently configured scoring function.
bool allCarbonMode() const
Tells whether the all-carbon mode is enabled.
ColorFeatureType
Specifies which kind of color (pharmacophore) features are used during shape alignment.
Definition: ScreeningSettings.hpp:99
@ NO_FEATURES
Disable color features (shape-only alignment).
Definition: ScreeningSettings.hpp:104
@ PHARMACOPHORE_EXP_CHARGES
Use pharmacophore features derived from explicit charges.
Definition: ScreeningSettings.hpp:109
void setOptimizationStopGradient(double grad_norm)
Sets the gradient norm at which the overlap optimization is stopped.
std::function< double(const AlignmentResult &)> ScoringFunction
Type of the function used to score an alignment result.
Definition: ScreeningSettings.hpp:71
void allCarbonMode(bool all_c)
Enables or disables the all-carbon mode (treats every heavy atom as carbon for shape generation).
bool optimizeOverlap() const
Tells whether the overlap is optimized iteratively.
double getScoreCutoff() const
Returns the currently configured score cutoff (or NO_CUTOFF).
double getOptimizationStopGradient() const
Returns the currently configured overlap-optimization stop gradient.
AlignmentMode
Bitmask flags specifying the strategies used to seed alignment starting transformations.
Definition: ScreeningSettings.hpp:121
The namespace of the Chemical Data Processing Library.