Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Static Public Attributes | Properties | 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...

+ Inheritance diagram for CDPL.GRAIL.GRAILDataSetGenerator:

Public Member Functions

None __init__ ()
 Constructs the GRAILDataSetGenerator instance.
 
None __init__ (GRAILDataSetGenerator gen)
 Initializes a copy of the GRAILDataSetGenerator instance gen. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
GRAILDataSetGenerator assign (GRAILDataSetGenerator gen)
 Replaces the current state of self with a copy of the state of the GRAILDataSetGenerator instance gen. More...
 
None setScoringFunction (int ftr_type, int tgt_ftr_type, DoubleVector3DFeatureFunctor func)
 Sets the scoring function for the given (ligand feature type, target feature type) pair. More...
 
None removeScoringFunction (int ftr_type, int tgt_ftr_type)
 Removes the scoring function configured for the given (ligand feature type, target feature type) pair. More...
 
DoubleVector3DFeatureFunctor getScoringFunction (int ftr_type, int tgt_ftr_type)
 Returns the scoring function configured for the given (ligand feature type, target feature type) pair. More...
 
None setGridName (int ftr_type, int tgt_ftr_type, str name)
 Sets the grid name associated with the given (ligand feature type, target feature type) pair. More...
 
None removeGridName (int ftr_type, int tgt_ftr_type)
 Removes the grid name associated with the given (ligand feature type, target feature type) pair. More...
 
str getGridName (int ftr_type, int tgt_ftr_type)
 Returns the grid name associated with the given (ligand feature type, target feature type) pair. More...
 
None enableInteraction (int ftr_type, 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 (int ftr_type, int tgt_ftr_type)
 Tells whether interaction-grid generation is enabled for the given (ligand feature type, target feature type) pair. More...
 
bool clearEnabledInteractions (int arg2, int self)
 
None setScoreCombinationFunction (Math.DoubleDVectorFunctor func)
 Sets the function used to combine per-feature scores into a single grid cell value. More...
 
Math.DoubleDVectorFunctor getScoreCombinationFunction ()
 Returns the currently configured score-combination function. More...
 
None normalizeScores (bool normalize)
 Enables or disables normalization of the combined per-cell scores to the range [0, 1]. More...
 
bool scoresNormalized ()
 Tells whether the combined per-cell scores are normalized. More...
 
None diminishScoresByAtomDensity (bool diminish)
 Enables or disables multiplicative diminishing of interaction scores by the (normalized) atom density of the target environment. More...
 
bool scoresDiminishedByAtomDensity ()
 Tells whether the interaction scores are diminished by the atom density of the target environment. More...
 
None storeEnvironmentAtomDensityGrid (bool store)
 Specifies whether the target environment atom-density grid shall be added to the produced grid set. More...
 
bool environmentAtomDensityGridStored ()
 Tells whether the target environment atom-density grid is stored in the produced grid set. More...
 
None setEnvironmentAtomDensityGridName ()
 
str getEnvironmentAtomDensityGridName ()
 Returns the name assigned to the target environment atom-density grid. More...
 
float getGridStepSize ()
 Returns the currently configured grid spacing. More...
 
None setGridStepSize (float size)
 Sets the grid spacing (isotropic). More...
 
int getGridXSize ()
 Returns the grid size in the x direction. More...
 
None setGridXSize (int size)
 Sets the grid size in the x direction. More...
 
int getGridYSize ()
 Returns the grid size in the y direction. More...
 
None setGridYSize (int size)
 Sets the grid size in the y direction. More...
 
int getGridZSize ()
 Returns the grid size in the z direction. More...
 
None setGridZSize (int size)
 Sets the grid size in the z direction. More...
 
Math.Matrix4D getGridTransform ()
 Returns the affine transformation matrix that places the grids in the target coordinate frame. More...
 
None setGridTransform (Math.Matrix4D xform)
 Sets the affine transformation matrix that places the grids in the target coordinate frame. More...
 
None setGridParamsForBoundingBox (Math.Vector3D bbox_min, Math.Vector3D bbox_max, float step_size=0.5)
 Convenience method that configures grid size, spacing and transformation so that the grid covers the given axis-aligned bounding box. More...
 
Pharm.DefaultPharmacophoreGenerator getPharmacophoreGenerator ()
 Returns the internal pharmacophore generator used for the target environment. More...
 
None setPharmacophoreProcessingFunction (VoidPharmacophoreFunctor func)
 Sets the function applied to the generated target pharmacophore before grid calculation (e.g. More...
 
VoidPharmacophoreFunctor getPharmacophoreProcessingFunction ()
 Returns the currently configured pharmacophore processing function. More...
 
None calcInteractionGrids (Chem.MolecularGraph tgt_env, 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 calcAtomDensityGrid (Chem.AtomContainer atoms, Chem.Atom3DCoordinatesFunction coords_func, str grid_name)
 Calculates an atom-density grid for the given atoms. More...
 

Static Public Attributes

float DEF_GRID_STEP_SIZE = 0.5
 Default grid spacing (isotropic).
 

Properties

 objectID = property(getObjectID)
 
 normalizedScores = property(scoresNormalized, normalizeScores)
 
 scoreCombinationFunction = property(getScoreCombinationFunction, setScoreCombinationFunction)
 
 pharmProcessingFunction = property(getPharmacophoreProcessingFunction, setPharmacophoreProcessingFunction)
 
 gridStepSize = property(getGridStepSize, setGridStepSize)
 
 gridXSize = property(getGridXSize, setGridXSize)
 
 gridYSize = property(getGridYSize, setGridYSize)
 
 gridZSize = property(getGridZSize, setGridZSize)
 
 gridTransform = property(getGridTransform, setGridTransform)
 
 pharmGenerator = property(getPharmacophoreGenerator)
 
 dimScoresByAtomDensity = property(scoresDiminishedByAtomDensity, diminishScoresByAtomDensity)
 
 storeEnvAtomDensityGrid = property(environmentAtomDensityGridStored, storeEnvironmentAtomDensityGrid)
 
 envAtomDensityGridName = property(getEnvironmentAtomDensityGridName, setEnvironmentAtomDensityGridName)
 

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

Constructor & Destructor Documentation

◆ __init__()

None CDPL.GRAIL.GRAILDataSetGenerator.__init__ ( GRAILDataSetGenerator  gen)

Initializes a copy of the GRAILDataSetGenerator instance gen.

Parameters
genThe GRAILDataSetGenerator instance to copy.

Member Function Documentation

◆ getObjectID()

int CDPL.GRAIL.GRAILDataSetGenerator.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python GRAILDataSetGenerator instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two GRAILDataSetGenerator instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign()

GRAILDataSetGenerator CDPL.GRAIL.GRAILDataSetGenerator.assign ( GRAILDataSetGenerator  gen)

Replaces the current state of self with a copy of the state of the GRAILDataSetGenerator instance gen.

Parameters
genThe GRAILDataSetGenerator instance to copy.
Returns
self

◆ setScoringFunction()

None CDPL.GRAIL.GRAILDataSetGenerator.setScoringFunction ( int  ftr_type,
int  tgt_ftr_type,
DoubleVector3DFeatureFunctor  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.

◆ removeScoringFunction()

None CDPL.GRAIL.GRAILDataSetGenerator.removeScoringFunction ( int  ftr_type,
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.

◆ getScoringFunction()

DoubleVector3DFeatureFunctor CDPL.GRAIL.GRAILDataSetGenerator.getScoringFunction ( int  ftr_type,
int  tgt_ftr_type 
)

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).

◆ setGridName()

None CDPL.GRAIL.GRAILDataSetGenerator.setGridName ( int  ftr_type,
int  tgt_ftr_type,
str  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.

◆ removeGridName()

None CDPL.GRAIL.GRAILDataSetGenerator.removeGridName ( int  ftr_type,
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.

◆ getGridName()

str CDPL.GRAIL.GRAILDataSetGenerator.getGridName ( int  ftr_type,
int  tgt_ftr_type 
)

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.

◆ enableInteraction()

None CDPL.GRAIL.GRAILDataSetGenerator.enableInteraction ( int  ftr_type,
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 ( int  ftr_type,
int  tgt_ftr_type 
)

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()

bool CDPL.GRAIL.GRAILDataSetGenerator.clearEnabledInteractions ( int  arg2,
int  self 
)
Parameters
arg1
arg2
Returns

◆ setScoreCombinationFunction()

None CDPL.GRAIL.GRAILDataSetGenerator.setScoreCombinationFunction ( Math.DoubleDVectorFunctor  func)

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

Parameters
funcThe score-combination function.

◆ getScoreCombinationFunction()

Math.DoubleDVectorFunctor CDPL.GRAIL.GRAILDataSetGenerator.getScoreCombinationFunction ( )

Returns the currently configured score-combination function.

Returns
The configured score-combination function.

◆ normalizeScores()

None 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 ( )

Tells whether the combined per-cell scores are normalized.

Returns
True if the combined scores are normalized, and False otherwise.

◆ diminishScoresByAtomDensity()

None 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 ( )

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()

None 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 ( )

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()

None CDPL.GRAIL.GRAILDataSetGenerator.setEnvironmentAtomDensityGridName ( )
Parameters
<br>

◆ getEnvironmentAtomDensityGridName()

str CDPL.GRAIL.GRAILDataSetGenerator.getEnvironmentAtomDensityGridName ( )

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

Returns
The grid name.

◆ getGridStepSize()

float CDPL.GRAIL.GRAILDataSetGenerator.getGridStepSize ( )

Returns the currently configured grid spacing.

Returns
The configured grid spacing.

◆ setGridStepSize()

None CDPL.GRAIL.GRAILDataSetGenerator.setGridStepSize ( float  size)

Sets the grid spacing (isotropic).

Parameters
sizeThe grid spacing.

◆ getGridXSize()

int CDPL.GRAIL.GRAILDataSetGenerator.getGridXSize ( )

Returns the grid size in the x direction.

Returns
The grid size in the x direction.

◆ setGridXSize()

None CDPL.GRAIL.GRAILDataSetGenerator.setGridXSize ( int  size)

Sets the grid size in the x direction.

Parameters
sizeThe grid size.

◆ getGridYSize()

int CDPL.GRAIL.GRAILDataSetGenerator.getGridYSize ( )

Returns the grid size in the y direction.

Returns
The grid size in the y direction.

◆ setGridYSize()

None CDPL.GRAIL.GRAILDataSetGenerator.setGridYSize ( int  size)

Sets the grid size in the y direction.

Parameters
sizeThe grid size.

◆ getGridZSize()

int CDPL.GRAIL.GRAILDataSetGenerator.getGridZSize ( )

Returns the grid size in the z direction.

Returns
The grid size in the z direction.

◆ setGridZSize()

None CDPL.GRAIL.GRAILDataSetGenerator.setGridZSize ( int  size)

Sets the grid size in the z direction.

Parameters
sizeThe grid size.

◆ getGridTransform()

Math.Matrix4D CDPL.GRAIL.GRAILDataSetGenerator.getGridTransform ( )

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

Returns
The grid transformation matrix.

◆ setGridTransform()

None CDPL.GRAIL.GRAILDataSetGenerator.setGridTransform ( Math.Matrix4D  xform)

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

Parameters
xformThe transformation matrix.

◆ setGridParamsForBoundingBox()

None CDPL.GRAIL.GRAILDataSetGenerator.setGridParamsForBoundingBox ( Math.Vector3D  bbox_min,
Math.Vector3D  bbox_max,
float   step_size = 0.5 
)

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()

Pharm.DefaultPharmacophoreGenerator CDPL.GRAIL.GRAILDataSetGenerator.getPharmacophoreGenerator ( )

Returns the internal pharmacophore generator used for the target environment.

Returns
A reference to the pharmacophore generator.

◆ setPharmacophoreProcessingFunction()

None CDPL.GRAIL.GRAILDataSetGenerator.setPharmacophoreProcessingFunction ( VoidPharmacophoreFunctor  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()

VoidPharmacophoreFunctor CDPL.GRAIL.GRAILDataSetGenerator.getPharmacophoreProcessingFunction ( )

Returns the currently configured pharmacophore processing function.

Returns
The configured pharmacophore processing function.

◆ calcInteractionGrids()

None CDPL.GRAIL.GRAILDataSetGenerator.calcInteractionGrids ( Chem.MolecularGraph  tgt_env,
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 CDPL.GRAIL.GRAILDataSetGenerator.calcAtomDensityGrid ( Chem.AtomContainer  atoms,
Chem.Atom3DCoordinatesFunction  coords_func,
str  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 reference to the calculated atom-density grid.