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 
74 
79 
83  ALL_MATCHING_CONFS
84  };
85 
91  {
92 
93  public:
105  SearchHit(const ScreeningProcessor& hit_prov, const FeatureContainer& qry_pharm,
106  const FeatureContainer& hit_pharm, const Chem::Molecule& mol,
107  const Math::Matrix4D& xform, std::size_t pharm_idx,
108  std::size_t mol_idx, std::size_t conf_idx);
109 
115 
121 
127 
133 
139 
144  std::size_t getHitPharmacophoreIndex() const;
145 
150  std::size_t getHitMoleculeIndex() const;
151 
156  std::size_t getHitConformationIndex() const;
157 
158  private:
159  const ScreeningProcessor* provider;
160  const FeatureContainer* qryPharm;
161  const FeatureContainer* hitPharm;
162  const Chem::Molecule* molecule;
163  const Math::Matrix4D* almntTransform;
164  std::size_t pharmIndex;
165  std::size_t molIndex;
166  std::size_t confIndex;
167  };
168 
169 
173  typedef std::shared_ptr<ScreeningProcessor> SharedPointer;
174 
178  typedef std::function<bool(const SearchHit&, double)> HitCallbackFunction;
179 
183  typedef std::function<double(const SearchHit&)> ScoringFunction;
184 
188  typedef std::function<bool(std::size_t, std::size_t)> ProgressCallbackFunction;
189 
196 
197  ScreeningProcessor(const ScreeningProcessor& proc) = delete;
198 
203 
205 
211 
217 
223 
229 
234  void setMaxNumOmittedFeatures(std::size_t max_num);
235 
240  std::size_t getMaxNumOmittedFeatures() const;
241 
246  void checkXVolumeClashes(bool check);
247 
252  bool xVolumeClashesChecked() const;
253 
258  void seekBestAlignments(bool seek_best);
259 
264  bool bestAlignmentsSeeked() const;
265 
271 
277 
283 
289 
295 
301 
309  std::size_t searchDB(const FeatureContainer& query, std::size_t mol_start_idx = 0, std::size_t mol_end_idx = 0);
310 
311  private:
312  typedef std::unique_ptr<ScreeningProcessorImpl> ImplementationPointer;
313 
314  ImplementationPointer impl;
315  };
316  } // namespace Pharm
317 } // namespace CDPL
318 
319 #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:91
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:183
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:178
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:173
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:78
@ FIRST_MATCHING_CONF
Report the first conformer that matches the query.
Definition: Pharm/ScreeningProcessor.hpp:73
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:188
const HitCallbackFunction & getHitCallback() const
Returns the currently configured hit-callback function.
The namespace of the Chemical Data Processing Library.