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:
59  static const ScreeningSettings DEFAULT;
60 
62  static constexpr double NO_CUTOFF = std::numeric_limits<double>::quiet_NaN();
63 
65  typedef std::function<double(const AlignmentResult&)> ScoringFunction;
66 
71  {
72 
78  BEST_MATCH_PER_QUERY_CONF
79  };
80 
85  {
86 
92  PHARMACOPHORE_IMP_CHARGES
93  };
94 
99  {
100 
102  NO_ALIGNMENT = 0x0,
104  SHAPE_CENTROID = 0x1,
106  ATOM_CENTERS = 0x2,
108  COLOR_FEATURE_CENTERS = 0x4,
110  RANDOM = 0x8
111  };
112 
117 
123 
129 
135 
141 
147 
153 
159 
165 
170  void setNumRandomStarts(std::size_t num_starts);
171 
176  std::size_t getNumRandomStarts() const;
177 
182  void allCarbonMode(bool all_c);
183 
188  bool allCarbonMode() const;
189 
194  void singleConformerSearch(bool single_conf);
195 
200  bool singleConformerSearch() const;
201 
206  void optimizeOverlap(bool optimize);
207 
212  bool optimizeOverlap() const;
213 
218  void greedyOptimization(bool greedy);
219 
224  bool greedyOptimization() const;
225 
230  void setMaxNumOptimizationIterations(std::size_t max_iter);
231 
236  std::size_t getMaxNumOptimizationIterations() const;
237 
242  void setOptimizationStopGradient(double grad_norm);
243 
249 
254  void setScoreCutoff(double cutoff);
255 
260  double getScoreCutoff() const;
261 
262  private:
263  ScoringFunction scoringFunc;
264  ColorFeatureType colorFtrType;
265  ScreeningMode screeningMode;
266  AlignmentMode almntMode;
267  std::size_t numRandomStarts;
268  bool allCarbon;
269  bool singleConfSearch;
270  bool optOverlap;
271  bool greedyOpt;
272  std::size_t numOptIter;
273  double optStopGrad;
274  double scoreCutoff;
275  };
276  } // namespace Shape
277 } // namespace CDPL
278 
279 #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:59
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:71
@ BEST_MATCH_PER_QUERY
Report the best-scoring alignment hit per query molecule.
Definition: ScreeningSettings.hpp:76
@ BEST_OVERALL_MATCH
Report only the single best-scoring alignment hit across all queries.
Definition: ScreeningSettings.hpp:74
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:85
@ NO_FEATURES
Disable color features (shape-only alignment).
Definition: ScreeningSettings.hpp:88
@ PHARMACOPHORE_EXP_CHARGES
Use pharmacophore features derived from explicit charges.
Definition: ScreeningSettings.hpp:90
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:65
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:99
The namespace of the Chemical Data Processing Library.