Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | Static Public Attributes | List of all members
CDPL::GRAIL::GRAILDataSetGenerator Class Reference

Generator that pre-computes the per-cell interaction-score grids and the atom-density grid used by GRAIL scoring of ligand poses against a target environment. More...

#include <GRAILDataSetGenerator.hpp>

Public Types

typedef std::shared_ptr< GRAILDataSetGeneratorSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated GRAILDataSetGenerator instances. More...
 
typedef FeatureInteractionScoreGridCalculator::ScoringFunction ScoringFunction
 Re-export of the scoring-function type used by the underlying score-grid calculator. More...
 
typedef FeatureInteractionScoreGridCalculator::ScoreCombinationFunction ScoreCombinationFunction
 Re-export of the score-combination function type used by the underlying score-grid calculator. More...
 
typedef std::function< void(CDPL::Pharm::Pharmacophore &)> PharmacophoreProcessingFunction
 Type of the generic functor used to post-process a generated pharmacophore prior to grid calculation. More...
 

Public Member Functions

 GRAILDataSetGenerator ()
 Constructs the GRAILDataSetGenerator instance. More...
 
virtual ~GRAILDataSetGenerator ()
 Virtual destructor. More...
 
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, target feature type) pair. More...
 
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, target feature type) pair. More...
 
void clearEnabledInteractions ()
 Disables interaction-grid generation for all feature-type pairs. More...
 
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. More...
 
const ScoringFunctiongetScoringFunction (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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void setScoreCombinationFunction (const ScoreCombinationFunction &func)
 Sets the function used to combine per-feature scores into a single grid cell value. More...
 
const ScoreCombinationFunctiongetScoreCombinationFunction () const
 Returns the currently configured score-combination function. More...
 
void normalizeScores (bool normalize)
 Enables or disables normalization of the combined per-cell scores to the range [0, 1]. More...
 
bool scoresNormalized () const
 Tells whether the combined per-cell scores are normalized. More...
 
void diminishScoresByAtomDensity (bool diminish)
 Enables or disables multiplicative diminishing of interaction scores by the (normalized) atom density of the target environment. More...
 
bool scoresDiminishedByAtomDensity () const
 Tells whether the interaction scores are diminished by the atom density of the target environment. More...
 
void storeEnvironmentAtomDensityGrid (bool store)
 Specifies whether the target environment atom-density grid shall be added to the produced grid set. More...
 
bool environmentAtomDensityGridStored () const
 Tells whether the target environment atom-density grid is stored in the produced grid set. More...
 
void setEnvironmentAtomDensityGridName (const std::string &name)
 Sets the name to assign to the target environment atom-density grid in the produced grid set. More...
 
const std::string & getEnvironmentAtomDensityGridName () const
 Returns the name assigned to the target environment atom-density grid. More...
 
const Math::Matrix4DgetGridTransform () const
 Returns the affine transformation matrix that places the grids in the target coordinate frame. More...
 
template<typename T >
void setGridTransform (const T &xform)
 Sets the affine transformation matrix that places the grids in the target coordinate frame. More...
 
double getGridStepSize () const
 Returns the currently configured grid spacing. More...
 
void setGridStepSize (double size)
 Sets the grid spacing (isotropic). More...
 
std::size_t getGridXSize () const
 Returns the grid size in the x direction. More...
 
void setGridXSize (std::size_t size)
 Sets the grid size in the x direction. More...
 
std::size_t getGridYSize () const
 Returns the grid size in the y direction. More...
 
void setGridYSize (std::size_t size)
 Sets the grid size in the y direction. More...
 
std::size_t getGridZSize () const
 Returns the grid size in the z direction. More...
 
void setGridZSize (std::size_t size)
 Sets the grid size in the z direction. More...
 
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 given axis-aligned bounding box. More...
 
const Pharm::DefaultPharmacophoreGeneratorgetPharmacophoreGenerator () const
 Returns the internal pharmacophore generator used for the target environment. More...
 
Pharm::DefaultPharmacophoreGeneratorgetPharmacophoreGenerator ()
 Returns the internal pharmacophore generator used for the target environment. More...
 
void setPharmacophoreProcessingFunction (const PharmacophoreProcessingFunction &func)
 Sets the function applied to the generated target pharmacophore before grid calculation (e.g. for filtering or modification). More...
 
const PharmacophoreProcessingFunctiongetPharmacophoreProcessingFunction () const
 Returns the currently configured pharmacophore processing function. More...
 
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. More...
 
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. More...
 

Static Public Attributes

static constexpr double DEF_GRID_STEP_SIZE = 0.5
 Default grid spacing (isotropic). More...
 

Detailed Description

Generator that pre-computes the per-cell interaction-score grids and the atom-density grid used by GRAIL scoring of ligand poses against a target environment.

For every enabled (ligand feature type, target feature type) pair the generator runs a GRAIL::FeatureInteractionScoreGridCalculator and stores the resulting grid in a Grid::DRegularGridSet. Optionally the generator also produces an atom-density grid of the target environment (e.g. for use as a buriedness or accessibility weight).

See also
[GRAIL]
Since
1.1

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated GRAILDataSetGenerator instances.

◆ ScoringFunction

Re-export of the scoring-function type used by the underlying score-grid calculator.

◆ ScoreCombinationFunction

Re-export of the score-combination function type used by the underlying score-grid calculator.

◆ PharmacophoreProcessingFunction

Type of the generic functor used to post-process a generated pharmacophore prior to grid calculation.

Constructor & Destructor Documentation

◆ GRAILDataSetGenerator()

CDPL::GRAIL::GRAILDataSetGenerator::GRAILDataSetGenerator ( )

Constructs the GRAILDataSetGenerator instance.

◆ ~GRAILDataSetGenerator()

virtual CDPL::GRAIL::GRAILDataSetGenerator::~GRAILDataSetGenerator ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ enableInteraction()

void CDPL::GRAIL::GRAILDataSetGenerator::enableInteraction ( unsigned int  ftr_type,
unsigned int  tgt_ftr_type,
bool  enable 
)

Enables or disables interaction-grid generation for the given (ligand feature type, target feature type) pair.

Parameters
ftr_typeThe ligand feature type.
tgt_ftr_typeThe target feature type.
enableIf true, the interaction is enabled.

◆ isInteractionEnabled()

bool CDPL::GRAIL::GRAILDataSetGenerator::isInteractionEnabled ( unsigned int  ftr_type,
unsigned int  tgt_ftr_type 
) const

Tells whether interaction-grid generation is enabled for the given (ligand feature type, target feature type) pair.

Parameters
ftr_typeThe ligand feature type.
tgt_ftr_typeThe target feature type.
Returns
true if the interaction is enabled, and false otherwise.

◆ clearEnabledInteractions()

void CDPL::GRAIL::GRAILDataSetGenerator::clearEnabledInteractions ( )

Disables interaction-grid generation for all feature-type pairs.

◆ setScoringFunction()

void CDPL::GRAIL::GRAILDataSetGenerator::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.

Parameters
ftr_typeThe ligand feature type.
tgt_ftr_typeThe target feature type.
funcThe scoring function.

◆ getScoringFunction()

const ScoringFunction& CDPL::GRAIL::GRAILDataSetGenerator::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.

Parameters
ftr_typeThe ligand feature type.
tgt_ftr_typeThe target feature type.
Returns
The configured scoring function (or an empty function if no entry is registered).

◆ removeScoringFunction()

void CDPL::GRAIL::GRAILDataSetGenerator::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.

Parameters
ftr_typeThe ligand feature type.
tgt_ftr_typeThe target feature type.

◆ setGridName()

void CDPL::GRAIL::GRAILDataSetGenerator::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.

Parameters
ftr_typeThe ligand feature type.
tgt_ftr_typeThe target feature type.
nameThe grid name.

◆ getGridName()

const std::string& CDPL::GRAIL::GRAILDataSetGenerator::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.

Parameters
ftr_typeThe ligand feature type.
tgt_ftr_typeThe target feature type.
Returns
The grid name.

◆ removeGridName()

void CDPL::GRAIL::GRAILDataSetGenerator::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.

Parameters
ftr_typeThe ligand feature type.
tgt_ftr_typeThe target feature type.

◆ setScoreCombinationFunction()

void CDPL::GRAIL::GRAILDataSetGenerator::setScoreCombinationFunction ( const ScoreCombinationFunction func)

Sets the function used to combine per-feature scores into a single grid cell value.

Parameters
funcThe score-combination function.

◆ getScoreCombinationFunction()

const ScoreCombinationFunction& CDPL::GRAIL::GRAILDataSetGenerator::getScoreCombinationFunction ( ) const

Returns the currently configured score-combination function.

Returns
The configured score-combination function.

◆ normalizeScores()

void CDPL::GRAIL::GRAILDataSetGenerator::normalizeScores ( bool  normalize)

Enables or disables normalization of the combined per-cell scores to the range [0, 1].

Parameters
normalizeIf true, the combined scores are normalized.

◆ scoresNormalized()

bool CDPL::GRAIL::GRAILDataSetGenerator::scoresNormalized ( ) const

Tells whether the combined per-cell scores are normalized.

Returns
true if the combined scores are normalized, and false otherwise.

◆ diminishScoresByAtomDensity()

void CDPL::GRAIL::GRAILDataSetGenerator::diminishScoresByAtomDensity ( bool  diminish)

Enables or disables multiplicative diminishing of interaction scores by the (normalized) atom density of the target environment.

Parameters
diminishIf true, scores are diminished by atom density.

◆ scoresDiminishedByAtomDensity()

bool CDPL::GRAIL::GRAILDataSetGenerator::scoresDiminishedByAtomDensity ( ) const

Tells whether the interaction scores are diminished by the atom density of the target environment.

Returns
true if scores are diminished by atom density, and false otherwise.

◆ storeEnvironmentAtomDensityGrid()

void CDPL::GRAIL::GRAILDataSetGenerator::storeEnvironmentAtomDensityGrid ( bool  store)

Specifies whether the target environment atom-density grid shall be added to the produced grid set.

Parameters
storeIf true, the atom-density grid is stored.

◆ environmentAtomDensityGridStored()

bool CDPL::GRAIL::GRAILDataSetGenerator::environmentAtomDensityGridStored ( ) const

Tells whether the target environment atom-density grid is stored in the produced grid set.

Returns
true if the atom-density grid is stored, and false otherwise.

◆ setEnvironmentAtomDensityGridName()

void CDPL::GRAIL::GRAILDataSetGenerator::setEnvironmentAtomDensityGridName ( const std::string &  name)

Sets the name to assign to the target environment atom-density grid in the produced grid set.

Parameters
nameThe grid name.

◆ getEnvironmentAtomDensityGridName()

const std::string& CDPL::GRAIL::GRAILDataSetGenerator::getEnvironmentAtomDensityGridName ( ) const

Returns the name assigned to the target environment atom-density grid.

Returns
The grid name.

◆ getGridTransform()

const Math::Matrix4D& CDPL::GRAIL::GRAILDataSetGenerator::getGridTransform ( ) const

Returns the affine transformation matrix that places the grids in the target coordinate frame.

Returns
The grid transformation matrix.

◆ setGridTransform()

template<typename T >
void CDPL::GRAIL::GRAILDataSetGenerator::setGridTransform ( const T &  xform)
inline

Sets the affine transformation matrix that places the grids in the target coordinate frame.

Template Parameters
TThe transformation matrix expression type.
Parameters
xformThe transformation matrix.

◆ getGridStepSize()

double CDPL::GRAIL::GRAILDataSetGenerator::getGridStepSize ( ) const

Returns the currently configured grid spacing.

Returns
The configured grid spacing.

◆ setGridStepSize()

void CDPL::GRAIL::GRAILDataSetGenerator::setGridStepSize ( double  size)

Sets the grid spacing (isotropic).

Parameters
sizeThe grid spacing.

◆ getGridXSize()

std::size_t CDPL::GRAIL::GRAILDataSetGenerator::getGridXSize ( ) const

Returns the grid size in the x direction.

Returns
The grid size in the x direction.

◆ setGridXSize()

void CDPL::GRAIL::GRAILDataSetGenerator::setGridXSize ( std::size_t  size)

Sets the grid size in the x direction.

Parameters
sizeThe grid size.

◆ getGridYSize()

std::size_t CDPL::GRAIL::GRAILDataSetGenerator::getGridYSize ( ) const

Returns the grid size in the y direction.

Returns
The grid size in the y direction.

◆ setGridYSize()

void CDPL::GRAIL::GRAILDataSetGenerator::setGridYSize ( std::size_t  size)

Sets the grid size in the y direction.

Parameters
sizeThe grid size.

◆ getGridZSize()

std::size_t CDPL::GRAIL::GRAILDataSetGenerator::getGridZSize ( ) const

Returns the grid size in the z direction.

Returns
The grid size in the z direction.

◆ setGridZSize()

void CDPL::GRAIL::GRAILDataSetGenerator::setGridZSize ( std::size_t  size)

Sets the grid size in the z direction.

Parameters
sizeThe grid size.

◆ setGridParamsForBoundingBox()

void CDPL::GRAIL::GRAILDataSetGenerator::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 given axis-aligned bounding box.

Parameters
bbox_minThe bounding box minimum-corner coordinates.
bbox_maxThe bounding box maximum-corner coordinates.
step_sizeThe grid spacing.

◆ getPharmacophoreGenerator() [1/2]

const Pharm::DefaultPharmacophoreGenerator& CDPL::GRAIL::GRAILDataSetGenerator::getPharmacophoreGenerator ( ) const

Returns the internal pharmacophore generator used for the target environment.

Returns
A const reference to the pharmacophore generator.

◆ getPharmacophoreGenerator() [2/2]

Pharm::DefaultPharmacophoreGenerator& CDPL::GRAIL::GRAILDataSetGenerator::getPharmacophoreGenerator ( )

Returns the internal pharmacophore generator used for the target environment.

Returns
A reference to the pharmacophore generator.

◆ setPharmacophoreProcessingFunction()

void CDPL::GRAIL::GRAILDataSetGenerator::setPharmacophoreProcessingFunction ( const PharmacophoreProcessingFunction func)

Sets the function applied to the generated target pharmacophore before grid calculation (e.g. for filtering or modification).

Parameters
funcThe pharmacophore processing function.

◆ getPharmacophoreProcessingFunction()

const PharmacophoreProcessingFunction& CDPL::GRAIL::GRAILDataSetGenerator::getPharmacophoreProcessingFunction ( ) const

Returns the currently configured pharmacophore processing function.

Returns
The configured pharmacophore processing function.

◆ calcInteractionGrids()

void CDPL::GRAIL::GRAILDataSetGenerator::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.

Parameters
tgt_envThe target environment.
coords_funcThe function used to retrieve atom 3D-coordinates from tgt_env.
grid_setThe output grid set.
appendIf true, the new grids are appended to grid_set; otherwise grid_set is cleared first.

◆ calcAtomDensityGrid()

Grid::DRegularGrid::SharedPointer CDPL::GRAIL::GRAILDataSetGenerator::calcAtomDensityGrid ( const Chem::AtomContainer atoms,
const Chem::Atom3DCoordinatesFunction coords_func,
const std::string &  grid_name 
)

Calculates an atom-density grid for the given atoms.

Parameters
atomsThe atoms contributing to the density.
coords_funcThe function used to retrieve atom 3D-coordinates.
grid_nameThe name to assign to the resulting grid.
Returns
A smart pointer to the calculated atom-density grid.

Member Data Documentation

◆ DEF_GRID_STEP_SIZE

constexpr double CDPL::GRAIL::GRAILDataSetGenerator::DEF_GRID_STEP_SIZE = 0.5
staticconstexpr

Default grid spacing (isotropic).


The documentation for this class was generated from the following file: