Chemical Data Processing Library C++ API - Version 1.1.1
GRAILDataSetGenerator.hpp
Go to the documentation of this file.
1 /*
2  * GRAILDataSetGenerator.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_GRAIL_GRAILDATASETGENERATOR_HPP
30 #define CDPL_GRAIL_GRAILDATASETGENERATOR_HPP
31 
32 #include <map>
33 #include <set>
34 #include <utility>
35 #include <string>
36 #include <memory>
37 #include <functional>
38 
39 #include "CDPL/GRAIL/APIPrefix.hpp"
46 #include "CDPL/Math/Matrix.hpp"
47 #include "CDPL/Math/Vector.hpp"
48 
49 
50 namespace CDPL
51 {
52 
53  namespace GRAIL
54  {
55 
61  {
62 
63  public:
64  typedef std::shared_ptr<GRAILDataSetGenerator> SharedPointer;
65 
68 
70 
71  static constexpr double DEF_GRID_STEP_SIZE = 0.5;
72 
74 
76 
77  void enableInteraction(unsigned int ftr_type, unsigned int tgt_ftr_type, bool enable);
78 
79  bool isInteractionEnabled(unsigned int ftr_type, unsigned int tgt_ftr_type) const;
80 
82 
83  void setScoringFunction(unsigned int ftr_type, unsigned int tgt_ftr_type, const ScoringFunction& func);
84 
85  const ScoringFunction& getScoringFunction(unsigned int ftr_type, unsigned int tgt_ftr_type) const;
86 
87  void removeScoringFunction(unsigned int ftr_type, unsigned int tgt_ftr_type);
88 
89  void setGridName(unsigned int ftr_type, unsigned int tgt_ftr_type, const std::string& name);
90 
91  const std::string& getGridName(unsigned int ftr_type, unsigned int tgt_ftr_type) const;
92 
93  void removeGridName(unsigned int ftr_type, unsigned int tgt_ftr_type);
94 
96 
98 
99  void normalizeScores(bool normalize);
100 
101  bool scoresNormalized() const;
102 
103  void diminishScoresByAtomDensity(bool diminish);
104 
106 
108 
110 
111  void setEnvironmentAtomDensityGridName(const std::string& name);
112 
113  const std::string& getEnvironmentAtomDensityGridName() const;
114 
116 
117  template <typename T>
118  void setGridTransform(const T& xform)
119  {
120  gridTransform = xform;
121  }
122 
123  double getGridStepSize() const;
124 
125  void setGridStepSize(double size);
126 
127  std::size_t getGridXSize() const;
128 
129  void setGridXSize(std::size_t size);
130 
131  std::size_t getGridYSize() const;
132 
133  void setGridYSize(std::size_t size);
134 
135  std::size_t getGridZSize() const;
136 
137  void setGridZSize(std::size_t size);
138 
139  void setGridParamsForBoundingBox(const Math::Vector3D& bbox_min, const Math::Vector3D& bbox_max, double step_size = DEF_GRID_STEP_SIZE);
140 
142 
144 
146 
148 
150  Grid::DRegularGridSet& grid_set, bool append = false);
151 
154  const std::string& grid_name);
155 
156  private:
157  Grid::DRegularGrid::SharedPointer createGrid() const;
158 
159  void init();
160 
161  typedef std::pair<unsigned int, unsigned int> FeatureTypePair;
162  typedef std::map<FeatureTypePair, ScoringFunction> ScoringFuncMap;
163  typedef std::map<FeatureTypePair, std::string> GridNameMap;
164  typedef std::set<FeatureTypePair> EnabledInteractionsSet;
165 
166  ScoringFuncMap ftrInteractionScoringFuncMap;
167  GridNameMap gridNameMap;
168  EnabledInteractionsSet enabledFtrInteractions;
169  FeatureInteractionScoreGridCalculator ftrInteractionGridCalc;
170  AtomDensityGridCalculator atomDensityGridCalc;
172  PharmacophoreProcessingFunction pharmProcessingFunc;
173  Pharm::BasicPharmacophore pharmacophore;
174  double gridStepSize;
175  std::size_t gridXSize;
176  std::size_t gridYSize;
177  std::size_t gridZSize;
178  Math::Matrix4D gridTransform;
179  bool diminishByAtomDensity;
180  bool storeEnvAtomDensityGrid;
181  std::string envAtomDensityGridName;
182  };
183  } // namespace GRAIL
184 } // namespace CDPL
185 
186 #endif // CDPL_GRAIL_GRAILDATASETGENERATOR_HPP
CDPL::GRAIL::GRAILDataSetGenerator::setGridName
void setGridName(unsigned int ftr_type, unsigned int tgt_ftr_type, const std::string &name)
CDPL::GRAIL::GRAILDataSetGenerator::getScoringFunction
const ScoringFunction & getScoringFunction(unsigned int ftr_type, unsigned int tgt_ftr_type) const
CDPL::GRAIL::GRAILDataSetGenerator::setPharmacophoreProcessingFunction
void setPharmacophoreProcessingFunction(const PharmacophoreProcessingFunction &func)
CDPL::GRAIL::GRAILDataSetGenerator::getScoreCombinationFunction
const ScoreCombinationFunction & getScoreCombinationFunction() const
CDPL::GRAIL::GRAILDataSetGenerator::~GRAILDataSetGenerator
virtual ~GRAILDataSetGenerator()
Definition: GRAILDataSetGenerator.hpp:75
CDPL::GRAIL::GRAILDataSetGenerator::getGridTransform
const Math::Matrix4D & getGridTransform() const
CDPL::GRAIL::GRAILDataSetGenerator::calcAtomDensityGrid
Grid::DRegularGrid::SharedPointer calcAtomDensityGrid(const Chem::AtomContainer &atoms, const Chem::Atom3DCoordinatesFunction &coords_func, const std::string &grid_name)
CMatrix< double, 4, 4 >
CDPL::GRAIL::GRAILDataSetGenerator::getGridYSize
std::size_t getGridYSize() const
CDPL::GRAIL::GRAILDataSetGenerator::enableInteraction
void enableInteraction(unsigned int ftr_type, unsigned int tgt_ftr_type, bool enable)
CDPL::GRAIL::GRAILDataSetGenerator::getGridName
const std::string & getGridName(unsigned int ftr_type, unsigned int tgt_ftr_type) const
CDPL::Math::Vector3D
CVector< double, 3 > Vector3D
A bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:1637
FeatureInteractionScoreGridCalculator.hpp
Definition of the class CDPL::GRAIL::FeatureInteractionScoreGridCalculator.
CDPL::GRAIL::GRAILDataSetGenerator::calcInteractionGrids
void calcInteractionGrids(const Chem::MolecularGraph &tgt_env, const Chem::Atom3DCoordinatesFunction &coords_func, Grid::DRegularGridSet &grid_set, bool append=false)
CDPL::GRAIL::GRAILDataSetGenerator::isInteractionEnabled
bool isInteractionEnabled(unsigned int ftr_type, unsigned int tgt_ftr_type) const
CDPL::GRAIL::GRAILDataSetGenerator::setGridParamsForBoundingBox
void setGridParamsForBoundingBox(const Math::Vector3D &bbox_min, const Math::Vector3D &bbox_max, double step_size=DEF_GRID_STEP_SIZE)
CDPL::GRAIL::GRAILDataSetGenerator::scoresNormalized
bool scoresNormalized() const
CDPL::GRAIL::GRAILDataSetGenerator::clearEnabledInteractions
void clearEnabledInteractions()
CDPL::GRAIL::GRAILDataSetGenerator::getGridStepSize
double getGridStepSize() const
CDPL::GRAIL::GRAILDataSetGenerator::setGridXSize
void setGridXSize(std::size_t size)
CDPL::GRAIL::AtomDensityGridCalculator
AtomDensityGridCalculator.
Definition: AtomDensityGridCalculator.hpp:69
BasicPharmacophore.hpp
Definition of the class CDPL::Pharm::BasicPharmacophore.
CDPL::GRAIL::GRAILDataSetGenerator::removeScoringFunction
void removeScoringFunction(unsigned int ftr_type, unsigned int tgt_ftr_type)
CDPL::GRAIL::GRAILDataSetGenerator::getGridZSize
std::size_t getGridZSize() const
CDPL::GRAIL::FeatureInteractionScoreGridCalculator::ScoringFunction
std::function< double(const Math::Vector3D &, const Pharm::Feature &)> ScoringFunction
Definition: FeatureInteractionScoreGridCalculator.hpp:75
CDPL::GRAIL::GRAILDataSetGenerator::getEnvironmentAtomDensityGridName
const std::string & getEnvironmentAtomDensityGridName() const
RegularGridSet.hpp
Definition of the class CDPL::Grid::RegularGridSet.
CDPL::GRAIL::GRAILDataSetGenerator::ScoreCombinationFunction
FeatureInteractionScoreGridCalculator::ScoreCombinationFunction ScoreCombinationFunction
Definition: GRAILDataSetGenerator.hpp:67
CDPL::GRAIL::GRAILDataSetGenerator::setScoreCombinationFunction
void setScoreCombinationFunction(const ScoreCombinationFunction &func)
CDPL::Chem::MolecularGraph
MolecularGraph.
Definition: MolecularGraph.hpp:52
Atom3DCoordinatesFunction.hpp
Type definition of a generic wrapper class for storing user-defined Chem::Atom 3D-coordinates functio...
CDPL::Chem::AtomContainer
A common interface for data-structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
CDPL::GRAIL::GRAILDataSetGenerator::scoresDiminishedByAtomDensity
bool scoresDiminishedByAtomDensity() const
CDPL::GRAIL::GRAILDataSetGenerator::normalizeScores
void normalizeScores(bool normalize)
CDPL::GRAIL::GRAILDataSetGenerator::setGridYSize
void setGridYSize(std::size_t size)
CDPL::GRAIL::GRAILDataSetGenerator
GRAILDataSetGenerator.
Definition: GRAILDataSetGenerator.hpp:61
CDPL::GRAIL::GRAILDataSetGenerator::setScoringFunction
void setScoringFunction(unsigned int ftr_type, unsigned int tgt_ftr_type, const ScoringFunction &func)
CDPL::GRAIL::GRAILDataSetGenerator::ScoringFunction
FeatureInteractionScoreGridCalculator::ScoringFunction ScoringFunction
Definition: GRAILDataSetGenerator.hpp:66
CDPL::Pharm::Pharmacophore
Pharmacophore.
Definition: Pharmacophore.hpp:48
CDPL::GRAIL::GRAILDataSetGenerator::setGridZSize
void setGridZSize(std::size_t size)
APIPrefix.hpp
Definition of the preprocessor macro CDPL_GRAIL_API.
AtomDensityGridCalculator.hpp
Definition of the class CDPL::GRAIL::AtomDensityGridCalculator.
CDPL::Chem::AtomType::T
const unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
CDPL::GRAIL::GRAILDataSetGenerator::getPharmacophoreGenerator
const Pharm::DefaultPharmacophoreGenerator & getPharmacophoreGenerator() const
CDPL::Chem::Atom3DCoordinatesFunction
std::function< const Math::Vector3D &(const Chem::Atom &)> Atom3DCoordinatesFunction
A generic wrapper class used to store a user-defined Chem::Atom 3D-coordinates function.
Definition: Atom3DCoordinatesFunction.hpp:43
CDPL::Pharm::BasicPharmacophore
BasicPharmacophore.
Definition: BasicPharmacophore.hpp:52
CDPL::GRAIL::GRAILDataSetGenerator::PharmacophoreProcessingFunction
std::function< void(CDPL::Pharm::Pharmacophore &)> PharmacophoreProcessingFunction
Definition: GRAILDataSetGenerator.hpp:69
CDPL::GRAIL::GRAILDataSetGenerator::setGridStepSize
void setGridStepSize(double size)
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::GRAIL::GRAILDataSetGenerator::getGridXSize
std::size_t getGridXSize() const
DefaultPharmacophoreGenerator.hpp
Definition of the class CDPL::Pharm::DefaultPharmacophoreGenerator.
CDPL::GRAIL::GRAILDataSetGenerator::setGridTransform
void setGridTransform(const T &xform)
Definition: GRAILDataSetGenerator.hpp:118
CDPL::Grid::RegularGrid::SharedPointer
std::shared_ptr< RegularGrid > SharedPointer
Definition: RegularGrid.hpp:51
CDPL::GRAIL::GRAILDataSetGenerator::getPharmacophoreGenerator
Pharm::DefaultPharmacophoreGenerator & getPharmacophoreGenerator()
CDPL::GRAIL::GRAILDataSetGenerator::SharedPointer
std::shared_ptr< GRAILDataSetGenerator > SharedPointer
Definition: GRAILDataSetGenerator.hpp:64
CDPL::GRAIL::GRAILDataSetGenerator::environmentAtomDensityGridStored
bool environmentAtomDensityGridStored() const
CDPL::Pharm::DefaultPharmacophoreGenerator
DefaultPharmacophoreGenerator.
Definition: DefaultPharmacophoreGenerator.hpp:48
CDPL::GRAIL::GRAILDataSetGenerator::setEnvironmentAtomDensityGridName
void setEnvironmentAtomDensityGridName(const std::string &name)
CDPL::GRAIL::GRAILDataSetGenerator::removeGridName
void removeGridName(unsigned int ftr_type, unsigned int tgt_ftr_type)
Matrix.hpp
Definition of matrix data types.
CDPL::GRAIL::GRAILDataSetGenerator::diminishScoresByAtomDensity
void diminishScoresByAtomDensity(bool diminish)
CDPL::GRAIL::FeatureInteractionScoreGridCalculator
FeatureInteractionScoreGridCalculator.
Definition: FeatureInteractionScoreGridCalculator.hpp:67
CDPL_GRAIL_API
#define CDPL_GRAIL_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::GRAIL::FeatureInteractionScoreGridCalculator::ScoreCombinationFunction
std::function< double(const Math::DVector &)> ScoreCombinationFunction
Definition: FeatureInteractionScoreGridCalculator.hpp:76
CDPL::GRAIL::GRAILDataSetGenerator::getPharmacophoreProcessingFunction
const PharmacophoreProcessingFunction & getPharmacophoreProcessingFunction() const
CDPL::Grid::RegularGridSet
RegularGridSet.
Definition: RegularGridSet.hpp:47
CDPL::GRAIL::GRAILDataSetGenerator::storeEnvironmentAtomDensityGrid
void storeEnvironmentAtomDensityGrid(bool store)
Vector.hpp
Definition of vector data types.
CDPL::GRAIL::GRAILDataSetGenerator::GRAILDataSetGenerator
GRAILDataSetGenerator()