29 #ifndef CDPL_GRAIL_GRAILDATASETGENERATOR_HPP
30 #define CDPL_GRAIL_GRAILDATASETGENERATOR_HPP
95 static constexpr
double DEF_GRID_STEP_SIZE = 0.5;
157 void setGridName(
unsigned int ftr_type,
unsigned int tgt_ftr_type,
const std::string& name);
165 const std::string&
getGridName(
unsigned int ftr_type,
unsigned int tgt_ftr_type)
const;
245 template <
typename T>
248 gridTransform = xform;
350 const std::string& grid_name);
357 typedef std::pair<unsigned int, unsigned int> FeatureTypePair;
358 typedef std::map<FeatureTypePair, ScoringFunction> ScoringFuncMap;
359 typedef std::map<FeatureTypePair, std::string> GridNameMap;
360 typedef std::set<FeatureTypePair> EnabledInteractionsSet;
362 ScoringFuncMap ftrInteractionScoringFuncMap;
363 GridNameMap gridNameMap;
364 EnabledInteractionsSet enabledFtrInteractions;
371 std::size_t gridXSize;
372 std::size_t gridYSize;
373 std::size_t gridZSize;
375 bool diminishByAtomDensity;
376 bool storeEnvAtomDensityGrid;
377 std::string envAtomDensityGridName;
Type declaration of a generic wrapper class for storing user-defined Chem::Atom 3D-coordinates functi...
Definition of class CDPL::GRAIL::AtomDensityGridCalculator.
Definition of class CDPL::Pharm::BasicPharmacophore.
Definition of class CDPL::Pharm::DefaultPharmacophoreGenerator.
Definition of class CDPL::GRAIL::FeatureInteractionScoreGridCalculator.
Definition of the preprocessor macro CDPL_GRAIL_API.
#define CDPL_GRAIL_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of matrix data types.
Definition of class CDPL::Grid::RegularGridSet.
Definition of vector data types.
Common interface for data structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Calculator that fills a spatial grid with combined per-atom density contributions.
Definition: AtomDensityGridCalculator.hpp:73
Calculator that fills a spatial grid with per-cell feature-interaction scores against a set of target...
Definition: FeatureInteractionScoreGridCalculator.hpp:73
std::function< double(const Math::Vector3D &, const Pharm::Feature &)> ScoringFunction
Type of the generic functor that scores the interaction between a grid cell and a target feature.
Definition: FeatureInteractionScoreGridCalculator.hpp:94
std::function< double(const Math::DVector &)> ScoreCombinationFunction
Type of the generic functor that combines per-feature scores into a single grid cell value.
Definition: FeatureInteractionScoreGridCalculator.hpp:99
Generator that pre-computes the per-cell interaction-score grids and the atom-density grid used by GR...
Definition: GRAILDataSetGenerator.hpp:69
void setScoreCombinationFunction(const ScoreCombinationFunction &func)
Sets the function used to combine per-feature scores into a single grid cell value.
void setGridXSize(std::size_t size)
Sets the grid size in the x direction.
virtual ~GRAILDataSetGenerator()
Virtual destructor.
Definition: GRAILDataSetGenerator.hpp:105
std::shared_ptr< GRAILDataSetGenerator > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated GRAILDataSetGenerator instances.
Definition: GRAILDataSetGenerator.hpp:75
void clearEnabledInteractions()
Disables interaction-grid generation for all feature-type pairs.
GRAILDataSetGenerator()
Constructs the GRAILDataSetGenerator instance.
std::size_t getGridYSize() const
Returns the grid size in the y direction.
std::size_t getGridZSize() const
Returns the grid size in the z direction.
void setGridParamsForBoundingBox(const Math::Vector3D &bbox_min, const Math::Vector3D &bbox_max, double step_size=DEF_GRID_STEP_SIZE)
Convenience method that configures grid size, spacing and transformation so that the grid covers the ...
bool scoresNormalized() const
Tells whether the combined per-cell scores are normalized.
void setGridZSize(std::size_t size)
Sets the grid size in the z direction.
bool scoresDiminishedByAtomDensity() const
Tells whether the interaction scores are diminished by the atom density of the target environment.
void setGridStepSize(double size)
Sets the grid spacing (isotropic).
double getGridStepSize() const
Returns the currently configured grid spacing.
const ScoreCombinationFunction & getScoreCombinationFunction() const
Returns the currently configured score-combination function.
void normalizeScores(bool normalize)
Enables or disables normalization of the combined per-cell scores to the range [0,...
const Pharm::DefaultPharmacophoreGenerator & getPharmacophoreGenerator() const
Returns the internal pharmacophore generator used for the target environment.
std::function< void(CDPL::Pharm::Pharmacophore &)> PharmacophoreProcessingFunction
Type of the generic functor used to post-process a generated pharmacophore prior to grid calculation.
Definition: GRAILDataSetGenerator.hpp:90
FeatureInteractionScoreGridCalculator::ScoringFunction ScoringFunction
Re-export of the scoring-function type used by the underlying score-grid calculator.
Definition: GRAILDataSetGenerator.hpp:80
const ScoringFunction & getScoringFunction(unsigned int ftr_type, unsigned int tgt_ftr_type) const
Returns the scoring function configured for the given (ligand feature type, target feature type) pair...
void removeGridName(unsigned int ftr_type, unsigned int tgt_ftr_type)
Removes the grid name associated with the given (ligand feature type, target feature type) pair.
bool isInteractionEnabled(unsigned int ftr_type, unsigned int tgt_ftr_type) const
Tells whether interaction-grid generation is enabled for the given (ligand feature type,...
Grid::DRegularGrid::SharedPointer calcAtomDensityGrid(const Chem::AtomContainer &atoms, const Chem::Atom3DCoordinatesFunction &coords_func, const std::string &grid_name)
Calculates an atom-density grid for the given atoms.
FeatureInteractionScoreGridCalculator::ScoreCombinationFunction ScoreCombinationFunction
Re-export of the score-combination function type used by the underlying score-grid calculator.
Definition: GRAILDataSetGenerator.hpp:85
const std::string & getEnvironmentAtomDensityGridName() const
Returns the name assigned to the target environment atom-density grid.
const Math::Matrix4D & getGridTransform() const
Returns the affine transformation matrix that places the grids in the target coordinate frame.
void setGridName(unsigned int ftr_type, unsigned int tgt_ftr_type, const std::string &name)
Sets the grid name associated with the given (ligand feature type, target feature type) pair.
const std::string & getGridName(unsigned int ftr_type, unsigned int tgt_ftr_type) const
Returns the grid name associated with the given (ligand feature type, target feature type) pair.
void setEnvironmentAtomDensityGridName(const std::string &name)
Sets the name to assign to the target environment atom-density grid in the produced grid set.
std::size_t getGridXSize() const
Returns the grid size in the x direction.
const PharmacophoreProcessingFunction & getPharmacophoreProcessingFunction() const
Returns the currently configured pharmacophore processing function.
void calcInteractionGrids(const Chem::MolecularGraph &tgt_env, const Chem::Atom3DCoordinatesFunction &coords_func, Grid::DRegularGridSet &grid_set, bool append=false)
Calculates the interaction-score grids for all enabled feature-type pairs and stores them in grid_set...
bool environmentAtomDensityGridStored() const
Tells whether the target environment atom-density grid is stored in the produced grid set.
Pharm::DefaultPharmacophoreGenerator & getPharmacophoreGenerator()
Returns the internal pharmacophore generator used for the target environment.
void setGridYSize(std::size_t size)
Sets the grid size in the y direction.
void storeEnvironmentAtomDensityGrid(bool store)
Specifies whether the target environment atom-density grid shall be added to the produced grid set.
void enableInteraction(unsigned int ftr_type, unsigned int tgt_ftr_type, bool enable)
Enables or disables interaction-grid generation for the given (ligand feature type,...
void setGridTransform(const T &xform)
Sets the affine transformation matrix that places the grids in the target coordinate frame.
Definition: GRAILDataSetGenerator.hpp:246
void removeScoringFunction(unsigned int ftr_type, unsigned int tgt_ftr_type)
Removes the scoring function configured for the given (ligand feature type, target feature type) pair...
void setPharmacophoreProcessingFunction(const PharmacophoreProcessingFunction &func)
Sets the function applied to the generated target pharmacophore before grid calculation (e....
void setScoringFunction(unsigned int ftr_type, unsigned int tgt_ftr_type, const ScoringFunction &func)
Sets the scoring function for the given (ligand feature type, target feature type) pair.
void diminishScoresByAtomDensity(bool diminish)
Enables or disables multiplicative diminishing of interaction scores by the (normalized) atom density...
Indirected array of dynamically allocated Grid::RegularGrid instances.
Definition: RegularGridSet.hpp:49
std::shared_ptr< RegularGrid > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated RegularGrid instances.
Definition: RegularGrid.hpp:61
Concrete Pharm::Pharmacophore implementation that owns its features as Pharm::BasicFeature instances ...
Definition: BasicPharmacophore.hpp:53
Pharmacophore generator pre-configured with the built-in default set of feature generators.
Definition: DefaultPharmacophoreGenerator.hpp:53
Abstract base class for mutable containers of Pharm::Feature instances representing a pharmacophore m...
Definition: Pharmacophore.hpp:53
constexpr unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
std::function< const Math::Vector3D &(const Chem::Atom &)> Atom3DCoordinatesFunction
Generic wrapper class used to store a user-defined Chem::Atom 3D-coordinates function.
Definition: Atom3DCoordinatesFunction.hpp:43
CVector< double, 3 > Vector3D
Bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:2937
The namespace of the Chemical Data Processing Library.