Chemical Data Processing Library Python API - Version 1.4.0
Classes | Functions
CDPL.Shape Package Reference

Contains classes and functions related to molecular shape representation and processing. More...

Classes

class  AlignedColorTverskyScore
 Functor wrapping Shape.calcAlignedColorTverskyScore(). More...
 
class  AlignedShapeTverskyScore
 Functor wrapping Shape.calcAlignedShapeTverskyScore(). More...
 
class  AlignedTotalOverlapTverskyScore
 Functor wrapping Shape.calcAlignedTotalOverlapTverskyScore(). More...
 
class  AlignedTverskyComboScore
 Functor wrapping Shape.calcAlignedTverskyComboScore(). More...
 
class  AlignmentResult
 Result of a Gaussian-shape alignment between a reference and an aligned shape. More...
 
class  AlignmentResultSelectionMode
 Provides constants for selecting which alignment results are kept by alignment routines. More...
 
class  BoolAlignmentResult2Functor
 
class  BoolSizeType2Functor
 
class  BoolSizeTypeFunctor
 
class  ColorTanimotoScore
 Functor wrapping Shape.calcColorTanimotoScore(). More...
 
class  ColorTverskyScore
 Functor wrapping Shape.calcColorTverskyScore(). More...
 
class  DoubleAlignmentResultFunctor
 
class  ExactGaussianShapeOverlapFunction
 Shape.GaussianShapeOverlapFunction implementation that evaluates the overlap analytically using the full Gaussian-product expansion (no approximations). More...
 
class  FastGaussianShapeAlignment
 High-level driver for the fast alignment of Gaussian shapes against a set of reference shapes. More...
 
class  FastGaussianShapeOverlapFunction
 Shape.GaussianShapeOverlapFunction implementation that uses two approximation techniques to trade some accuracy for a substantial speedup compared to Shape.ExactGaussianShapeOverlapFunction. More...
 
class  GaussianShape
 Data type for the descripton of arbitrary shapes composed of spheres approximated by gaussian functions. More...
 
class  GaussianShapeAlignment
 High-level driver for the alignment of Gaussian shapes against a set of reference shapes. More...
 
class  GaussianShapeAlignmentStartGenerator
 Abstract base class for generators of starting transformations used to seed Gaussian-shape overlap optimization. More...
 
class  GaussianShapeFunction
 Function representation of a Gaussian shape, used to evaluate the shape's density, volume, surface area and related quantities at arbitrary 3D positions. More...
 
class  GaussianShapeFunctionAlignment
 Driver for the alignment of one Shape.GaussianShapeFunction (the aligned shape) against a fixed reference Shape.GaussianShapeFunction. More...
 
class  GaussianShapeGenerator
 Generates Shape.GaussianShape instances from molecular graphs. More...
 
class  GaussianShapeOverlapFunction
 Abstract base class for functions evaluating the overlap between two Gaussian shape functions. More...
 
class  GaussianShapeSet
 Data structure storing a set of (shared) Gaussian shapes. More...
 
class  PrincipalAxesAlignmentStartGenerator
 Generator that produces alignment starting transformations by aligning the principal axes of the aligned shape to those of the reference shape. More...
 
class  ReferenceColorTverskyScore
 Functor wrapping Shape.calcReferenceColorTverskyScore(). More...
 
class  ReferenceShapeTverskyScore
 Functor wrapping Shape.calcReferenceShapeTverskyScore(). More...
 
class  ReferenceTotalOverlapTverskyScore
 Functor wrapping Shape.calcReferenceTotalOverlapTverskyScore(). More...
 
class  ReferenceTverskyComboScore
 Functor wrapping Shape.calcReferenceTverskyComboScore(). More...
 
class  ScreeningProcessor
 High-level driver for shape-based virtual screening of molecular databases. More...
 
class  ScreeningSettings
 Bundle of configuration parameters for Shape.ScreeningProcessor. More...
 
class  ShapeTanimotoScore
 Functor wrapping Shape.calcShapeTanimotoScore(). More...
 
class  ShapeTverskyScore
 Functor wrapping Shape.calcShapeTverskyScore(). More...
 
class  SymmetryClass
 Provides constants for the rotational symmetry class of a Gaussian shape. More...
 
class  TanimotoComboScore
 Functor wrapping Shape.calcTanimotoComboScore(). More...
 
class  TotalOverlapTanimotoScore
 Functor wrapping Shape.calcTotalOverlapTanimotoScore(). More...
 
class  TotalOverlapTverskyScore
 Functor wrapping Shape.calcTotalOverlapTverskyScore(). More...
 
class  TverskyComboScore
 Functor wrapping Shape.calcTverskyComboScore(). More...
 
class  Vector7D
 
class  VoidMolecularGraph2AlignmentResultFunctor
 

Functions

float calcAlignedColorTverskyScore (AlignmentResult res, float beta=0.95)
 Returns the color (pharmacophore) aligned-normalized Tversky similarity score of res. More...
 
float calcAlignedShapeTverskyScore (AlignmentResult res, float beta=0.95)
 Returns the shape-only aligned-normalized Tversky similarity score of res. More...
 
float calcAlignedTotalOverlapTverskyScore (AlignmentResult res, float beta=0.95)
 Returns the (shape + color) total-overlap aligned-normalized Tversky similarity score of res. More...
 
float calcAlignedTverskyComboScore (AlignmentResult res, float beta=0.95)
 Returns the combined shape + color aligned-normalized Tversky score of res. More...
 
int calcCenterAlignmentTransforms (GaussianShapeFunction func, Math.Matrix4D to_ctr_xform, Math.Matrix4D from_ctr_xform, float mom_eq_thresh=0.15)
 Calculates the affine transformations that align a Gaussian shape to its center of mass and back. More...
 
float calcColorTanimotoScore (AlignmentResult res)
 Returns the color (pharmacophore) Tanimoto similarity score of res. More...
 
float calcColorTverskyScore (AlignmentResult res, float alpha=0.95, float beta=0.05)
 Returns the color (pharmacophore) symmetric Tversky similarity score of res. More...
 
None calcPrincipalAxes (Math.Matrix3D quad_tensor, Math.Vector3D x_axis, Math.Vector3D y_axis, Math.Vector3D z_axis, Math.Vector3D moments)
 Calculates the principal axes and principal moments of a quadrupole tensor. More...
 
None calcQuadrupoleTensorEigenDecomposition (Math.Matrix3D quad_tensor, Math.Matrix3D eigen_vecs, Math.Vector3D eigen_vals)
 Calculates the eigen-decomposition of a 3x3 quadrupole tensor. More...
 
float calcReferenceColorTverskyScore (AlignmentResult res, float alpha=0.95)
 Returns the color (pharmacophore) reference-normalized Tversky similarity score of res. More...
 
float calcReferenceShapeTverskyScore (AlignmentResult res, float alpha=0.95)
 Returns the shape-only reference-normalized Tversky similarity score of res. More...
 
float calcReferenceTotalOverlapTverskyScore (AlignmentResult res, float alpha=0.95)
 Returns the (shape + color) total-overlap reference-normalized Tversky similarity score of res. More...
 
float calcReferenceTverskyComboScore (AlignmentResult res, float alpha=0.95)
 Returns the combined shape + color reference-normalized Tversky score of res. More...
 
float calcShapeTanimotoScore (AlignmentResult res)
 Returns the shape-only Tanimoto similarity score of res. More...
 
float calcShapeTverskyScore (AlignmentResult res, float alpha=0.95, float beta=0.05)
 Returns the shape-only symmetric Tversky similarity score of res. More...
 
float calcTanimotoComboScore (AlignmentResult res)
 Returns the combined shape + color Tanimoto score of res. More...
 
float calcTotalOverlapTanimotoScore (AlignmentResult res)
 Returns the (shape + color) total-overlap Tanimoto similarity score of res. More...
 
float calcTotalOverlapTverskyScore (AlignmentResult res, float alpha=0.95, float beta=0.05)
 Returns the (shape + color) total-overlap symmetric Tversky similarity score of res. More...
 
float calcTverskyComboScore (AlignmentResult res, float alpha=0.95, float beta=0.05)
 Returns the combined shape + color symmetric Tversky score of res. More...
 
int centerAndAlignPrincipalAxes (GaussianShape shape, GaussianShapeFunction func, Math.Matrix4D back_xform, float mom_eq_thresh=0.15)
 Centers shape at its centroid and aligns its principal axes with the coordinate axes. More...
 
None generateGaussianShape (Chem.AtomContainer atoms, GaussianShape shape, bool append=False, float radius=-1.0, bool inc_h=False, float p=2.7)
 Builds a Gaussian shape from the atoms of atoms (using the default atom 3D coordinates accessor). More...
 
None generateGaussianShape (Chem.AtomContainer atoms, GaussianShape shape, Chem.Atom3DCoordinatesFunction coords_func, bool append=False, float radius=-1.0, bool inc_h=False, float p=2.7)
 Builds a Gaussian shape from the atoms of atoms using coords_func to retrieve atom positions. More...
 
None generateGaussianShape (Pharm.FeatureContainer features, GaussianShape shape, bool append=False, float radius=-1.0, bool inc_xv=False, float p=5.0)
 Builds a Gaussian shape from the pharmacophore features of features. More...
 
None matrixToQuaternion (Math.Matrix4D mtx, Math.Vector7D quat)
 Converts an affine 4x4 transformation matrix to a quaternion-plus-translation representation. More...
 
int perceiveSymmetryClass (Math.Vector3D moments, float eq_thresh=0.15)
 Classifies the rotational symmetry of a shape from its principal moments (see namespace Shape.SymmetryClass). More...
 
None quaternionToMatrix (Math.Vector7D quat, Math.Matrix4D mtx)
 Converts a quaternion-plus-translation representation back to an affine 4x4 transformation matrix. More...
 
None transform (GaussianShape shape, Math.Matrix4D xform)
 Applies an affine transformation to the element positions of shape. More...
 

Detailed Description

Contains classes and functions related to molecular shape representation and processing.

Function Documentation

◆ calcAlignedColorTverskyScore()

float CDPL.Shape.calcAlignedColorTverskyScore ( AlignmentResult  res,
float   beta = 0.95 
)

Returns the color (pharmacophore) aligned-normalized Tversky similarity score of res.

Parameters
resThe alignment result.
betaThe aligned-side Tversky weighting factor.
Returns
The color aligned-normalized Tversky similarity score.

◆ calcAlignedShapeTverskyScore()

float CDPL.Shape.calcAlignedShapeTverskyScore ( AlignmentResult  res,
float   beta = 0.95 
)

Returns the shape-only aligned-normalized Tversky similarity score of res.

Parameters
resThe alignment result.
betaThe aligned-side Tversky weighting factor.
Returns
The shape-only aligned-normalized Tversky similarity score.

◆ calcAlignedTotalOverlapTverskyScore()

float CDPL.Shape.calcAlignedTotalOverlapTverskyScore ( AlignmentResult  res,
float   beta = 0.95 
)

Returns the (shape + color) total-overlap aligned-normalized Tversky similarity score of res.

Parameters
resThe alignment result.
betaThe aligned-side Tversky weighting factor.
Returns
The total-overlap aligned-normalized Tversky similarity score.

◆ calcAlignedTverskyComboScore()

float CDPL.Shape.calcAlignedTverskyComboScore ( AlignmentResult  res,
float   beta = 0.95 
)

Returns the combined shape + color aligned-normalized Tversky score of res.

Parameters
resThe alignment result.
betaThe aligned-side Tversky weighting factor.
Returns
The aligned-normalized Tversky combo score (sum of shape and color aligned-Tversky scores).

◆ calcCenterAlignmentTransforms()

int CDPL.Shape.calcCenterAlignmentTransforms ( GaussianShapeFunction  func,
Math.Matrix4D  to_ctr_xform,
Math.Matrix4D  from_ctr_xform,
float   mom_eq_thresh = 0.15 
)

Calculates the affine transformations that align a Gaussian shape to its center of mass and back.

Parameters
funcThe Gaussian shape function.
to_ctr_xformThe output transformation that places the shape at its center of mass with principal axes aligned to the coordinate axes.
from_ctr_xformThe output inverse transformation.
mom_eq_threshThe relative threshold below which two principal moments are considered equal.
Returns
The perceived symmetry class of the shape (see namespace Shape.SymmetryClass).

◆ calcColorTanimotoScore()

float CDPL.Shape.calcColorTanimotoScore ( AlignmentResult  res)

Returns the color (pharmacophore) Tanimoto similarity score of res.

Parameters
resThe alignment result.
Returns
The color Tanimoto similarity score.

◆ calcColorTverskyScore()

float CDPL.Shape.calcColorTverskyScore ( AlignmentResult  res,
float   alpha = 0.95,
float   beta = 0.05 
)

Returns the color (pharmacophore) symmetric Tversky similarity score of res.

Parameters
resThe alignment result.
alphaThe weight of the reference self-overlap contribution.
betaThe weight of the aligned self-overlap contribution.
Returns
The color symmetric Tversky similarity score.

◆ calcPrincipalAxes()

None CDPL.Shape.calcPrincipalAxes ( Math.Matrix3D  quad_tensor,
Math.Vector3D  x_axis,
Math.Vector3D  y_axis,
Math.Vector3D  z_axis,
Math.Vector3D  moments 
)

Calculates the principal axes and principal moments of a quadrupole tensor.

Parameters
quad_tensorThe input symmetric quadrupole tensor.
x_axisThe output principal x-axis.
y_axisThe output principal y-axis.
z_axisThe output principal z-axis.
momentsThe output principal moments.

◆ calcQuadrupoleTensorEigenDecomposition()

None CDPL.Shape.calcQuadrupoleTensorEigenDecomposition ( Math.Matrix3D  quad_tensor,
Math.Matrix3D  eigen_vecs,
Math.Vector3D  eigen_vals 
)

Calculates the eigen-decomposition of a 3x3 quadrupole tensor.

Parameters
quad_tensorThe input symmetric quadrupole tensor.
eigen_vecsThe output eigenvector matrix (columns are eigenvectors).
eigen_valsThe output eigenvalues.

◆ calcReferenceColorTverskyScore()

float CDPL.Shape.calcReferenceColorTverskyScore ( AlignmentResult  res,
float   alpha = 0.95 
)

Returns the color (pharmacophore) reference-normalized Tversky similarity score of res.

Parameters
resThe alignment result.
alphaThe reference-side Tversky weighting factor.
Returns
The color reference-normalized Tversky similarity score.

◆ calcReferenceShapeTverskyScore()

float CDPL.Shape.calcReferenceShapeTverskyScore ( AlignmentResult  res,
float   alpha = 0.95 
)

Returns the shape-only reference-normalized Tversky similarity score of res.

Parameters
resThe alignment result.
alphaThe reference-side Tversky weighting factor.
Returns
The shape-only reference-normalized Tversky similarity score.

◆ calcReferenceTotalOverlapTverskyScore()

float CDPL.Shape.calcReferenceTotalOverlapTverskyScore ( AlignmentResult  res,
float   alpha = 0.95 
)

Returns the (shape + color) total-overlap reference-normalized Tversky similarity score of res.

Parameters
resThe alignment result.
alphaThe reference-side Tversky weighting factor.
Returns
The total-overlap reference-normalized Tversky similarity score.

◆ calcReferenceTverskyComboScore()

float CDPL.Shape.calcReferenceTverskyComboScore ( AlignmentResult  res,
float   alpha = 0.95 
)

Returns the combined shape + color reference-normalized Tversky score of res.

Parameters
resThe alignment result.
alphaThe reference-side Tversky weighting factor.
Returns
The reference-normalized Tversky combo score (sum of shape and color reference-Tversky scores).

◆ calcShapeTanimotoScore()

float CDPL.Shape.calcShapeTanimotoScore ( AlignmentResult  res)

Returns the shape-only Tanimoto similarity score of res.

Parameters
resThe alignment result.
Returns
The shape-only Tanimoto similarity score.

◆ calcShapeTverskyScore()

float CDPL.Shape.calcShapeTverskyScore ( AlignmentResult  res,
float   alpha = 0.95,
float   beta = 0.05 
)

Returns the shape-only symmetric Tversky similarity score of res.

Parameters
resThe alignment result.
alphaThe weight of the reference self-overlap contribution.
betaThe weight of the aligned self-overlap contribution.
Returns
The shape-only symmetric Tversky similarity score.

◆ calcTanimotoComboScore()

float CDPL.Shape.calcTanimotoComboScore ( AlignmentResult  res)

Returns the combined shape + color Tanimoto score of res.

Parameters
resThe alignment result.
Returns
The Tanimoto combo score (sum of shape and color Tanimoto scores).

◆ calcTotalOverlapTanimotoScore()

float CDPL.Shape.calcTotalOverlapTanimotoScore ( AlignmentResult  res)

Returns the (shape + color) total-overlap Tanimoto similarity score of res.

Parameters
resThe alignment result.
Returns
The total-overlap Tanimoto similarity score.

◆ calcTotalOverlapTverskyScore()

float CDPL.Shape.calcTotalOverlapTverskyScore ( AlignmentResult  res,
float   alpha = 0.95,
float   beta = 0.05 
)

Returns the (shape + color) total-overlap symmetric Tversky similarity score of res.

Parameters
resThe alignment result.
alphaThe weight of the reference self-overlap contribution.
betaThe weight of the aligned self-overlap contribution.
Returns
The total-overlap symmetric Tversky similarity score.

◆ calcTverskyComboScore()

float CDPL.Shape.calcTverskyComboScore ( AlignmentResult  res,
float   alpha = 0.95,
float   beta = 0.05 
)

Returns the combined shape + color symmetric Tversky score of res.

Parameters
resThe alignment result.
alphaThe weight of the reference self-overlap contribution.
betaThe weight of the aligned self-overlap contribution.
Returns
The symmetric Tversky combo score (sum of shape and color Tversky scores).

◆ centerAndAlignPrincipalAxes()

int CDPL.Shape.centerAndAlignPrincipalAxes ( GaussianShape  shape,
GaussianShapeFunction  func,
Math.Matrix4D  back_xform,
float   mom_eq_thresh = 0.15 
)

Centers shape at its centroid and aligns its principal axes with the coordinate axes.

Parameters
shapeThe Gaussian shape to align (modified in place).
funcThe associated Shape.GaussianShapeFunction used to compute the principal axes.
back_xformThe output transformation that maps the aligned shape back to its original frame.
mom_eq_threshThe relative threshold below which two principal moments are considered equal.
Returns
The perceived symmetry class of the shape (see namespace Shape.SymmetryClass).

◆ generateGaussianShape() [1/3]

None CDPL.Shape.generateGaussianShape ( Chem.AtomContainer  atoms,
GaussianShape  shape,
bool   append = False,
float   radius = -1.0,
bool   inc_h = False,
float   p = 2.7 
)

Builds a Gaussian shape from the atoms of atoms (using the default atom 3D coordinates accessor).

Parameters
atomsThe atom container.
shapeThe output Gaussian shape.
appendIf True, the new elements are appended to shape. Otherwise, shape is cleared first.
radiusThe sphere radius to use for all atoms, or a negative value to use atom-specific Van der Waals radii.
inc_hIf True, hydrogen atoms are also included in the shape.
pThe Gaussian hardness used for all generated spheres.

◆ generateGaussianShape() [2/3]

None CDPL.Shape.generateGaussianShape ( Chem.AtomContainer  atoms,
GaussianShape  shape,
Chem.Atom3DCoordinatesFunction  coords_func,
bool   append = False,
float   radius = -1.0,
bool   inc_h = False,
float   p = 2.7 
)

Builds a Gaussian shape from the atoms of atoms using coords_func to retrieve atom positions.

Parameters
atomsThe atom container.
shapeThe output Gaussian shape.
coords_funcThe function used to retrieve atom 3D-coordinates.
appendIf True, the new elements are appended to shape. Otherwise, shape is cleared first.
radiusThe sphere radius to use for all atoms, or a negative value to use atom-specific Van der Waals radii.
inc_hIf True, hydrogen atoms are also included in the shape.
pThe Gaussian hardness used for all generated spheres.

◆ generateGaussianShape() [3/3]

None CDPL.Shape.generateGaussianShape ( Pharm.FeatureContainer  features,
GaussianShape  shape,
bool   append = False,
float   radius = -1.0,
bool   inc_xv = False,
float   p = 5.0 
)

Builds a Gaussian shape from the pharmacophore features of features.

Parameters
featuresThe feature container.
shapeThe output Gaussian shape.
appendIf True, the new elements are appended to shape. Otherwise, shape is cleared first.
radiusThe sphere radius to use for all features, or a negative value to use feature-specific tolerances.
inc_xvIf True, exclusion-volume features are also included in the shape.
pThe Gaussian hardness used for all generated spheres.

◆ matrixToQuaternion()

None CDPL.Shape.matrixToQuaternion ( Math.Matrix4D  mtx,
Math.Vector7D  quat 
)

Converts an affine 4x4 transformation matrix to a quaternion-plus-translation representation.

Parameters
mtxThe input transformation matrix.
quatThe output Shape.QuaternionTransformation (4 quaternion + 3 translation components).

◆ perceiveSymmetryClass()

int CDPL.Shape.perceiveSymmetryClass ( Math.Vector3D  moments,
float   eq_thresh = 0.15 
)

Classifies the rotational symmetry of a shape from its principal moments (see namespace Shape.SymmetryClass).

Parameters
momentsThe principal moments.
eq_threshThe relative threshold below which two moments are considered equal.
Returns
The perceived symmetry class.

◆ quaternionToMatrix()

None CDPL.Shape.quaternionToMatrix ( Math.Vector7D  quat,
Math.Matrix4D  mtx 
)

Converts a quaternion-plus-translation representation back to an affine 4x4 transformation matrix.

Parameters
quatThe input Shape.QuaternionTransformation (4 quaternion + 3 translation components).
mtxThe output transformation matrix.

◆ transform()

None CDPL.Shape.transform ( GaussianShape  shape,
Math.Matrix4D  xform 
)

Applies an affine transformation to the element positions of shape.

Parameters
shapeThe Gaussian shape to transform (modified in place).
xformThe 4x4 transformation matrix.