Chemical Data Processing Library C++ API - Version 1.4.0
Pharm/ScreeningProcessor.hpp
Go to the documentation of this file.
1 /*
2  * ScreeningProcessor.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_SCREENINGPROCESSOR_HPP
30 #define CDPL_PHARM_SCREENINGPROCESSOR_HPP
31 
32 #include <memory>
33 #include <cstddef>
34 #include <functional>
35 
36 #include "CDPL/Pharm/APIPrefix.hpp"
37 #include "CDPL/Math/Matrix.hpp"
38 
39 
40 namespace CDPL
41 {
42 
43  namespace Chem
44  {
45 
46  class Molecule;
47  }
48 
49  namespace Pharm
50  {
51 
52  class FeatureContainer;
53  class ScreeningDBAccessor;
54  class ScreeningProcessorImpl;
55 
61  {
62 
63  public:
68  {
69 
75  ALL_MATCHING_CONFS
76  };
77 
83  {
84 
85  public:
97  SearchHit(const ScreeningProcessor& hit_prov, const FeatureContainer& qry_pharm,
98  const FeatureContainer& hit_pharm, const Chem::Molecule& mol,
99  const Math::Matrix4D& xform, std::size_t pharm_idx,
100  std::size_t mol_idx, std::size_t conf_idx);
101 
107 
113 
119 
125 
131 
136  std::size_t getHitPharmacophoreIndex() const;
137 
142  std::size_t getHitMoleculeIndex() const;
143 
148  std::size_t getHitConformationIndex() const;
149 
150  private:
151  const ScreeningProcessor* provider;
152  const FeatureContainer* qryPharm;
153  const FeatureContainer* hitPharm;
154  const Chem::Molecule* molecule;
155  const Math::Matrix4D* almntTransform;
156  std::size_t pharmIndex;
157  std::size_t molIndex;
158  std::size_t confIndex;
159  };
160 
162  typedef std::shared_ptr<ScreeningProcessor> SharedPointer;
163 
165  typedef std::function<bool(const SearchHit&, double)> HitCallbackFunction;
167  typedef std::function<double(const SearchHit&)> ScoringFunction;
169  typedef std::function<bool(std::size_t, std::size_t)> ProgressCallbackFunction;
170 
177 
178  ScreeningProcessor(const ScreeningProcessor& proc) = delete;
179 
184 
186 
192 
198 
204 
210 
215  void setMaxNumOmittedFeatures(std::size_t max_num);
216 
221  std::size_t getMaxNumOmittedFeatures() const;
222 
227  void checkXVolumeClashes(bool check);
228 
233  bool xVolumeClashesChecked() const;
234 
239  void seekBestAlignments(bool seek_best);
240 
245  bool bestAlignmentsSeeked() const;
246 
252 
258 
264 
270 
276 
282 
290  std::size_t searchDB(const FeatureContainer& query, std::size_t mol_start_idx = 0, std::size_t mol_end_idx = 0);
291 
292  private:
293  typedef std::unique_ptr<ScreeningProcessorImpl> ImplementationPointer;
294 
295  ImplementationPointer impl;
296  };
297  } // namespace Pharm
298 } // namespace CDPL
299 
300 #endif // CDPL_PHARM_SCREENINGPROCESSOR_HPP
Definition of matrix data types.
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.
Abstract base class representing a mutable molecular graph that owns its atoms and bonds.
Definition: Molecule.hpp:53
Abstract base class for containers holding a sequence of Pharm::Feature objects with associated prope...
Definition: FeatureContainer.hpp:55
Abstract base class for accessors that read the data stored in pharmacophore screening databases.
Definition: ScreeningDBAccessor.hpp:58
Data structure representing a single alignment hit produced by the screening processor,...
Definition: Pharm/ScreeningProcessor.hpp:83
const ScreeningProcessor & getHitProvider() const
Returns the screening processor that produced the hit.
const Math::Matrix4D & getHitAlignmentTransform() const
Returns the rigid-body transformation that aligns the hit onto the query pharmacophore.
std::size_t getHitPharmacophoreIndex() const
Returns the source-database pharmacophore index of the hit.
const FeatureContainer & getQueryPharmacophore() const
Returns the query pharmacophore.
std::size_t getHitConformationIndex() const
Returns the conformer index within the source molecule.
SearchHit(const ScreeningProcessor &hit_prov, const FeatureContainer &qry_pharm, const FeatureContainer &hit_pharm, const Chem::Molecule &mol, const Math::Matrix4D &xform, std::size_t pharm_idx, std::size_t mol_idx, std::size_t conf_idx)
Constructs the SearchHit instance with the given references.
std::size_t getHitMoleculeIndex() const
Returns the source-database molecule index of the hit.
const Chem::Molecule & getHitMolecule() const
Returns the hit molecule.
const FeatureContainer & getHitPharmacophore() const
Returns the hit pharmacophore.
High-level driver for pharmacophore-based screening of a Pharm::ScreeningDBAccessor-backed database a...
Definition: Pharm/ScreeningProcessor.hpp:61
void setScoringFunction(const ScoringFunction &func)
Specifies the function used to score a search hit.
ScreeningProcessor(const ScreeningProcessor &proc)=delete
std::function< double(const SearchHit &)> ScoringFunction
Type of the function used to score a search hit.
Definition: Pharm/ScreeningProcessor.hpp:167
void checkXVolumeClashes(bool check)
Specifies whether the alignment shall check exclusion-volume clashes between the query and the hit mo...
ScreeningProcessor & operator=(const ScreeningProcessor &proc)=delete
void setHitReportMode(HitReportMode mode)
Sets the hit-report mode.
void setHitCallback(const HitCallbackFunction &func)
Specifies the hit-callback function.
const ProgressCallbackFunction & getProgressCallback() const
Returns the currently configured progress-reporting callback.
void setDBAccessor(ScreeningDBAccessor &db_acc)
Specifies the screening database accessor.
bool bestAlignmentsSeeked() const
Tells whether the alignment seeks the best-scoring rather than the first valid alignment.
void seekBestAlignments(bool seek_best)
Specifies whether the alignment shall search for the best-scoring rather than the first valid alignme...
std::function< bool(const SearchHit &, double)> HitCallbackFunction
Type of the callback invoked for every alignment hit (return: true to continue, false to abort the se...
Definition: Pharm/ScreeningProcessor.hpp:165
const ScoringFunction & getScoringFunction() const
Returns the currently configured scoring function.
std::size_t searchDB(const FeatureContainer &query, std::size_t mol_start_idx=0, std::size_t mol_end_idx=0)
Screens the database with the supplied query pharmacophore.
ScreeningDBAccessor & getDBAccessor() const
Returns the currently configured screening database accessor.
std::shared_ptr< ScreeningProcessor > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ScreeningProcessor instances.
Definition: Pharm/ScreeningProcessor.hpp:162
ScreeningProcessor(ScreeningDBAccessor &db_acc)
Constructs the ScreeningProcessor instance for the given screening database accessor db_acc.
HitReportMode getHitReportMode() const
Returns the currently configured hit-report mode.
void setProgressCallback(const ProgressCallbackFunction &func)
Specifies the progress-reporting callback.
std::size_t getMaxNumOmittedFeatures() const
Returns the currently configured maximum number of omitted features.
void setMaxNumOmittedFeatures(std::size_t max_num)
Sets the maximum number of query features that may remain unmatched in a valid hit.
HitReportMode
Specifies which conformer-level hits are reported per molecule.
Definition: Pharm/ScreeningProcessor.hpp:68
@ BEST_MATCHING_CONF
Report only the best-scoring matching conformer.
Definition: Pharm/ScreeningProcessor.hpp:73
@ FIRST_MATCHING_CONF
Report the first conformer that matches the query.
Definition: Pharm/ScreeningProcessor.hpp:71
bool xVolumeClashesChecked() const
Tells whether exclusion-volume clashes are checked during alignment.
std::function< bool(std::size_t, std::size_t)> ProgressCallbackFunction
Type of the progress-reporting callback (arguments: current molecule index, total molecule count; ret...
Definition: Pharm/ScreeningProcessor.hpp:169
const HitCallbackFunction & getHitCallback() const
Returns the currently configured hit-callback function.
The namespace of the Chemical Data Processing Library.