Chemical Data Processing Library C++ API - Version 1.2.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 
60  {
61 
62  public:
64  {
65 
68  ALL_MATCHING_CONFS
69  };
70 
72  {
73 
74  public:
75  SearchHit(const ScreeningProcessor& hit_prov, const FeatureContainer& qry_pharm,
76  const FeatureContainer& hit_pharm, const Chem::Molecule& mol,
77  const Math::Matrix4D& xform, std::size_t pharm_idx,
78  std::size_t mol_idx, std::size_t conf_idx);
79 
81 
83 
85 
87 
89 
90  std::size_t getHitPharmacophoreIndex() const;
91 
92  std::size_t getHitMoleculeIndex() const;
93 
94  std::size_t getHitConformationIndex() const;
95 
96  private:
97  const ScreeningProcessor* provider;
98  const FeatureContainer* qryPharm;
99  const FeatureContainer* hitPharm;
100  const Chem::Molecule* molecule;
101  const Math::Matrix4D* almntTransform;
102  std::size_t pharmIndex;
103  std::size_t molIndex;
104  std::size_t confIndex;
105  };
106 
107  typedef std::shared_ptr<ScreeningProcessor> SharedPointer;
108 
109  typedef std::function<bool(const SearchHit&, double)> HitCallbackFunction;
110  typedef std::function<double(const SearchHit&)> ScoringFunction;
111  typedef std::function<bool(std::size_t, std::size_t)> ProgressCallbackFunction;
112 
119 
120  ScreeningProcessor(const ScreeningProcessor& proc) = delete;
121 
126 
128 
130 
132 
134 
136 
137  void setMaxNumOmittedFeatures(std::size_t max_num);
138 
139  std::size_t getMaxNumOmittedFeatures() const;
140 
141  void checkXVolumeClashes(bool check);
142 
143  bool xVolumeClashesChecked() const;
144 
145  void seekBestAlignments(bool seek_best);
146 
147  bool bestAlignmentsSeeked() const;
148 
150 
152 
154 
156 
158 
160 
161  std::size_t searchDB(const FeatureContainer& query, std::size_t mol_start_idx = 0, std::size_t mol_end_idx = 0);
162 
163  private:
164  typedef std::unique_ptr<ScreeningProcessorImpl> ImplementationPointer;
165 
166  ImplementationPointer impl;
167  };
168  } // namespace Pharm
169 } // namespace CDPL
170 
171 #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.
Molecule.
Definition: Molecule.hpp:49
FeatureContainer.
Definition: FeatureContainer.hpp:53
A class for accessing the data stored in pharmacophore screening databases.
Definition: ScreeningDBAccessor.hpp:58
Definition: Pharm/ScreeningProcessor.hpp:72
const ScreeningProcessor & getHitProvider() const
const Math::Matrix4D & getHitAlignmentTransform() const
const FeatureContainer & getQueryPharmacophore() const
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)
const Chem::Molecule & getHitMolecule() const
const FeatureContainer & getHitPharmacophore() const
ScreeningProcessor.
Definition: Pharm/ScreeningProcessor.hpp:60
void setScoringFunction(const ScoringFunction &func)
ScreeningProcessor(const ScreeningProcessor &proc)=delete
std::function< double(const SearchHit &)> ScoringFunction
Definition: Pharm/ScreeningProcessor.hpp:110
void checkXVolumeClashes(bool check)
ScreeningProcessor & operator=(const ScreeningProcessor &proc)=delete
void setHitReportMode(HitReportMode mode)
void setHitCallback(const HitCallbackFunction &func)
const ProgressCallbackFunction & getProgressCallback() const
void setDBAccessor(ScreeningDBAccessor &db_acc)
void seekBestAlignments(bool seek_best)
std::function< bool(const SearchHit &, double)> HitCallbackFunction
Definition: Pharm/ScreeningProcessor.hpp:109
const ScoringFunction & getScoringFunction() const
std::size_t searchDB(const FeatureContainer &query, std::size_t mol_start_idx=0, std::size_t mol_end_idx=0)
ScreeningDBAccessor & getDBAccessor() const
std::shared_ptr< ScreeningProcessor > SharedPointer
Definition: Pharm/ScreeningProcessor.hpp:107
ScreeningProcessor(ScreeningDBAccessor &db_acc)
Constructs the ScreeningProcessor instance for the given screening database accessor db_acc.
HitReportMode getHitReportMode() const
void setProgressCallback(const ProgressCallbackFunction &func)
std::size_t getMaxNumOmittedFeatures() const
void setMaxNumOmittedFeatures(std::size_t max_num)
HitReportMode
Definition: Pharm/ScreeningProcessor.hpp:64
@ BEST_MATCHING_CONF
Definition: Pharm/ScreeningProcessor.hpp:67
@ FIRST_MATCHING_CONF
Definition: Pharm/ScreeningProcessor.hpp:66
std::function< bool(std::size_t, std::size_t)> ProgressCallbackFunction
Definition: Pharm/ScreeningProcessor.hpp:111
const HitCallbackFunction & getHitCallback() const
The namespace of the Chemical Data Processing Library.