Chemical Data Processing Library C++ API - Version 1.4.0
Namespaces | Classes | Typedefs | Functions
CDPL::Shape Namespace Reference

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

Namespaces

 AlignmentResultSelectionMode
 Provides constants for selecting which alignment results are kept by alignment routines.
 
 SymmetryClass
 Provides constants for the rotational symmetry class of a Gaussian shape.
 

Classes

class  AlignmentResult
 Result of a Gaussian-shape alignment between a reference and an aligned shape. More...
 
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  TotalOverlapTanimotoScore
 Functor wrapping Shape::calcTotalOverlapTanimotoScore(). More...
 
class  ShapeTanimotoScore
 Functor wrapping Shape::calcShapeTanimotoScore(). More...
 
class  ColorTanimotoScore
 Functor wrapping Shape::calcColorTanimotoScore(). More...
 
class  TanimotoComboScore
 Functor wrapping Shape::calcTanimotoComboScore(). More...
 
class  TotalOverlapTverskyScore
 Functor wrapping Shape::calcTotalOverlapTverskyScore(). More...
 
class  ShapeTverskyScore
 Functor wrapping Shape::calcShapeTverskyScore(). More...
 
class  ColorTverskyScore
 Functor wrapping Shape::calcColorTverskyScore(). More...
 
class  TverskyComboScore
 Functor wrapping Shape::calcTverskyComboScore(). More...
 
class  ReferenceTotalOverlapTverskyScore
 Functor wrapping Shape::calcReferenceTotalOverlapTverskyScore(). More...
 
class  ReferenceShapeTverskyScore
 Functor wrapping Shape::calcReferenceShapeTverskyScore(). More...
 
class  ReferenceColorTverskyScore
 Functor wrapping Shape::calcReferenceColorTverskyScore(). More...
 
class  ReferenceTverskyComboScore
 Functor wrapping Shape::calcReferenceTverskyComboScore(). More...
 
class  AlignedTotalOverlapTverskyScore
 Functor wrapping Shape::calcAlignedTotalOverlapTverskyScore(). More...
 
class  AlignedShapeTverskyScore
 Functor wrapping Shape::calcAlignedShapeTverskyScore(). More...
 
class  AlignedColorTverskyScore
 Functor wrapping Shape::calcAlignedColorTverskyScore(). More...
 
class  AlignedTverskyComboScore
 Functor wrapping Shape::calcAlignedTverskyComboScore(). 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...
 

Typedefs

typedef Math::Vector7D QuaternionTransformation
 Bounded 7 element vector specifying a quaternion-based rotation plus translation. More...
 

Functions

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

Detailed Description

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

Typedef Documentation

◆ QuaternionTransformation

Bounded 7 element vector specifying a quaternion-based rotation plus translation.

Function Documentation

◆ generateGaussianShape() [1/3]

CDPL_SHAPE_API void CDPL::Shape::generateGaussianShape ( const Chem::AtomContainer atoms,
GaussianShape shape,
bool  append = false,
double  radius = -1.0,
bool  inc_h = false,
double  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]

CDPL_SHAPE_API void CDPL::Shape::generateGaussianShape ( const Chem::AtomContainer atoms,
GaussianShape shape,
const Chem::Atom3DCoordinatesFunction coords_func,
bool  append = false,
double  radius = -1.0,
bool  inc_h = false,
double  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]

CDPL_SHAPE_API void CDPL::Shape::generateGaussianShape ( const Pharm::FeatureContainer features,
GaussianShape shape,
bool  append = false,
double  radius = -1.0,
bool  inc_xv = false,
double  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.

◆ transform()

CDPL_SHAPE_API void CDPL::Shape::transform ( GaussianShape shape,
const 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.

◆ centerAndAlignPrincipalAxes()

CDPL_SHAPE_API unsigned int CDPL::Shape::centerAndAlignPrincipalAxes ( GaussianShape shape,
const GaussianShapeFunction func,
Math::Matrix4D back_xform,
double  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).

◆ calcTotalOverlapTanimotoScore()

CDPL_SHAPE_API double CDPL::Shape::calcTotalOverlapTanimotoScore ( const AlignmentResult res)

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

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

◆ calcShapeTanimotoScore()

CDPL_SHAPE_API double CDPL::Shape::calcShapeTanimotoScore ( const AlignmentResult res)

Returns the shape-only Tanimoto similarity score of res.

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

◆ calcColorTanimotoScore()

CDPL_SHAPE_API double CDPL::Shape::calcColorTanimotoScore ( const AlignmentResult res)

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

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

◆ calcTanimotoComboScore()

CDPL_SHAPE_API double CDPL::Shape::calcTanimotoComboScore ( const 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).

◆ calcTotalOverlapTverskyScore()

CDPL_SHAPE_API double CDPL::Shape::calcTotalOverlapTverskyScore ( const AlignmentResult res,
double  alpha = 0.95,
double  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.

◆ calcShapeTverskyScore()

CDPL_SHAPE_API double CDPL::Shape::calcShapeTverskyScore ( const AlignmentResult res,
double  alpha = 0.95,
double  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.

◆ calcColorTverskyScore()

CDPL_SHAPE_API double CDPL::Shape::calcColorTverskyScore ( const AlignmentResult res,
double  alpha = 0.95,
double  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.

◆ calcTverskyComboScore()

CDPL_SHAPE_API double CDPL::Shape::calcTverskyComboScore ( const AlignmentResult res,
double  alpha = 0.95,
double  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).

◆ calcReferenceTotalOverlapTverskyScore()

CDPL_SHAPE_API double CDPL::Shape::calcReferenceTotalOverlapTverskyScore ( const AlignmentResult res,
double  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.

◆ calcReferenceShapeTverskyScore()

CDPL_SHAPE_API double CDPL::Shape::calcReferenceShapeTverskyScore ( const AlignmentResult res,
double  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.

◆ calcReferenceColorTverskyScore()

CDPL_SHAPE_API double CDPL::Shape::calcReferenceColorTverskyScore ( const AlignmentResult res,
double  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.

◆ calcReferenceTverskyComboScore()

CDPL_SHAPE_API double CDPL::Shape::calcReferenceTverskyComboScore ( const AlignmentResult res,
double  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).

◆ calcAlignedTotalOverlapTverskyScore()

CDPL_SHAPE_API double CDPL::Shape::calcAlignedTotalOverlapTverskyScore ( const AlignmentResult res,
double  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.

◆ calcAlignedShapeTverskyScore()

CDPL_SHAPE_API double CDPL::Shape::calcAlignedShapeTverskyScore ( const AlignmentResult res,
double  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.

◆ calcAlignedColorTverskyScore()

CDPL_SHAPE_API double CDPL::Shape::calcAlignedColorTverskyScore ( const AlignmentResult res,
double  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.

◆ calcAlignedTverskyComboScore()

CDPL_SHAPE_API double CDPL::Shape::calcAlignedTverskyComboScore ( const AlignmentResult res,
double  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).

◆ calcQuadrupoleTensorEigenDecomposition()

CDPL_SHAPE_API void CDPL::Shape::calcQuadrupoleTensorEigenDecomposition ( const 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.

◆ calcPrincipalAxes()

CDPL_SHAPE_API void CDPL::Shape::calcPrincipalAxes ( const 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.

◆ perceiveSymmetryClass()

CDPL_SHAPE_API unsigned int CDPL::Shape::perceiveSymmetryClass ( const Math::Vector3D moments,
double  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.

◆ calcCenterAlignmentTransforms()

CDPL_SHAPE_API unsigned int CDPL::Shape::calcCenterAlignmentTransforms ( const Shape::GaussianShapeFunction func,
Math::Matrix4D to_ctr_xform,
Math::Matrix4D from_ctr_xform,
double  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).

◆ matrixToQuaternion()

CDPL_SHAPE_API void CDPL::Shape::matrixToQuaternion ( const Math::Matrix4D mtx,
QuaternionTransformation 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).

◆ quaternionToMatrix()

CDPL_SHAPE_API void CDPL::Shape::quaternionToMatrix ( const QuaternionTransformation 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.