Chemical Data Processing Library C++ API - Version 1.4.0
Shape/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_SHAPE_SCREENINGPROCESSOR_HPP
30 #define CDPL_SHAPE_SCREENINGPROCESSOR_HPP
31 
32 #include <cstddef>
33 #include <vector>
34 #include <memory>
35 #include <functional>
36 
37 #include <boost/iterator/indirect_iterator.hpp>
38 
39 #include "CDPL/Shape/APIPrefix.hpp"
44 
45 
46 namespace CDPL
47 {
48 
49  namespace Chem
50  {
51 
52  class MolecularGraph;
53  }
54 
55  namespace Shape
56  {
57 
58  class AlignmentResult;
59 
69  {
70 
71  typedef std::vector<const Chem::MolecularGraph*> MolecularGraphList;
72 
73  public:
75  typedef std::shared_ptr<ScreeningProcessor> SharedPointer;
77  typedef boost::indirect_iterator<MolecularGraphList::const_iterator, const Chem::MolecularGraph> ConstMolecularGraphIterator;
79  typedef std::function<void(const Chem::MolecularGraph&, const Chem::MolecularGraph&, const AlignmentResult&)> HitCallbackFunction;
80 
85 
91 
92  ScreeningProcessor(const ScreeningProcessor& proc) = delete;
93 
98 
100 
106 
112 
118 
124 
129 
134  void addQuery(const Chem::MolecularGraph& molgraph);
135 
140  std::size_t getQuerySetSize() const;
141 
148  const Chem::MolecularGraph& getQuery(std::size_t idx) const;
149 
155 
161 
167  bool process(const Chem::MolecularGraph& molgraph);
168 
169  private:
170  void init();
171  void applyShapeGenSettings(bool query);
172  void applyAlignmentSettings();
173  void resetQuery();
174 
175  ScreeningSettings settings;
177  bool allCarbon;
179  FastGaussianShapeAlignment alignment;
180  GaussianShapeGenerator shapeGen;
181  MolecularGraphList queryList;
182  HitCallbackFunction hitCallback;
183  };
184  } // namespace Shape
185 } // namespace CDPL
186 
187 #endif // CDPL_SHAPE_SCREENINGPROCESSOR_HPP
Definition of class CDPL::Pharm::DefaultPharmacophoreGenerator.
Definition of class CDPL::Shape::FastGaussianShapeAlignment.
Definition of class CDPL::Shape::GaussianShapeGenerator.
Definition of class CDPL::Shape::ScreeningSettings.
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.
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Pharmacophore generator pre-configured with the built-in default set of feature generators.
Definition: DefaultPharmacophoreGenerator.hpp:53
Result of a Gaussian-shape alignment between a reference and an aligned shape.
Definition: AlignmentResult.hpp:52
High-level driver for the fast alignment of Gaussian shapes against a set of reference shapes.
Definition: FastGaussianShapeAlignment.hpp:70
Generates Shape::GaussianShape instances from molecular graphs.
Definition: GaussianShapeGenerator.hpp:61
High-level driver for shape-based virtual screening of molecular databases.
Definition: Shape/ScreeningProcessor.hpp:69
void clearQuerySet()
Removes all query molecules.
void addQuery(const Chem::MolecularGraph &molgraph)
Adds molgraph to the query set.
const HitCallbackFunction & getHitCallback() const
Returns the currently configured hit callback.
ScreeningProcessor()
Constructs an empty ScreeningProcessor instance.
std::function< void(const Chem::MolecularGraph &, const Chem::MolecularGraph &, const AlignmentResult &)> HitCallbackFunction
Type of the callback invoked for each alignment hit (arguments: query, hit, alignment result).
Definition: Shape/ScreeningProcessor.hpp:79
const Chem::MolecularGraph & getQuery(std::size_t idx) const
Returns the query molecule at index idx.
std::size_t getQuerySetSize() const
Returns the number of query molecules.
ConstMolecularGraphIterator getQuerySetEnd() const
Returns a constant iterator pointing one past the last query molecule.
bool process(const Chem::MolecularGraph &molgraph)
Processes the database molecule molgraph, aligning it against all query molecules.
ScreeningProcessor(const Chem::MolecularGraph &query)
Constructs a ScreeningProcessor instance with query as the single query molecule.
std::shared_ptr< ScreeningProcessor > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ScreeningProcessor instances.
Definition: Shape/ScreeningProcessor.hpp:75
ScreeningSettings & getSettings()
Returns the current screening settings (mutable).
ConstMolecularGraphIterator getQuerySetBegin() const
Returns a constant iterator pointing to the first query molecule.
const ScreeningSettings & getSettings() const
Returns the current screening settings.
boost::indirect_iterator< MolecularGraphList::const_iterator, const Chem::MolecularGraph > ConstMolecularGraphIterator
A constant iterator over the query molecules.
Definition: Shape/ScreeningProcessor.hpp:77
ScreeningProcessor(const ScreeningProcessor &proc)=delete
void setHitCallback(const HitCallbackFunction &func)
Sets the callback that is invoked for every alignment hit produced by process().
ScreeningProcessor & operator=(const ScreeningProcessor &proc)=delete
Bundle of configuration parameters for Shape::ScreeningProcessor.
Definition: ScreeningSettings.hpp:55
ColorFeatureType
Specifies which kind of color (pharmacophore) features are used during shape alignment.
Definition: ScreeningSettings.hpp:85
The namespace of the Chemical Data Processing Library.