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

Generator that produces alignment starting transformations by aligning the principal axes of the aligned shape to those of the reference shape. More...

#include <PrincipalAxesAlignmentStartGenerator.hpp>

+ Inheritance diagram for CDPL::Shape::PrincipalAxesAlignmentStartGenerator:

Public Member Functions

 PrincipalAxesAlignmentStartGenerator ()
 Constructs the PrincipalAxesAlignmentStartGenerator instance. More...
 
unsigned int setupReference (GaussianShapeFunction &func, Math::Matrix4D &xform) const
 Prepares the reference shape function for use by the start generator. More...
 
unsigned int setupAligned (GaussianShapeFunction &func, Math::Matrix4D &xform) const
 Prepares the aligned shape function for use by the start generator. More...
 
void genShapeCenterStarts (bool generate)
 Enables or disables the generation of a starting transformation at the shape centroid. More...
 
bool genShapeCenterStarts () const
 Tells whether a starting transformation at the shape centroid is generated. More...
 
void genColorCenterStarts (bool generate)
 Enables or disables the generation of starting transformations at color (pharmacophore) feature centers. More...
 
bool genColorCenterStarts () const
 Tells whether starting transformations at color (pharmacophore) feature centers are generated. More...
 
void genNonColorCenterStarts (bool generate)
 Enables or disables the generation of starting transformations at non-color (shape) element centers. More...
 
bool genNonColorCenterStarts () const
 Tells whether starting transformations at non-color (shape) element centers are generated. More...
 
void genRandomStarts (bool generate)
 Enables or disables the generation of random starting transformations. More...
 
bool genRandomStarts () const
 Tells whether random starting transformations are generated. More...
 
void genForAlignedShapeCenters (bool generate)
 Specifies whether element-/color-center starts shall be generated for centers of the aligned shape. More...
 
bool genForAlignedShapeCenters () const
 Tells whether element-/color-center starts are generated for centers of the aligned shape. More...
 
void genForReferenceShapeCenters (bool generate)
 Specifies whether element-/color-center starts shall be generated for centers of the reference shape. More...
 
bool genForReferenceShapeCenters () const
 Tells whether element-/color-center starts are generated for centers of the reference shape. More...
 
void genForLargerShapeCenters (bool generate)
 Specifies whether element-/color-center starts shall be generated for centers of the shape with more elements (instead of both shapes). More...
 
bool genForLargerShapeCenters () const
 Tells whether element-/color-center starts are generated for centers of the shape with more elements (instead of both shapes). More...
 
void setSymmetryThreshold (double thresh)
 Sets the relative threshold for treating two principal moments as equal. More...
 
double getSymmetryThreshold ()
 Returns the currently configured symmetry threshold. More...
 
void setMaxRandomTranslation (double max_trans)
 Sets the maximum random translation magnitude applied to random starts. More...
 
double getMaxRandomTranslation () const
 Returns the currently configured maximum random translation. More...
 
void setNumRandomStarts (std::size_t num_starts)
 Sets the number of random starting transformations. More...
 
std::size_t getNumRandomStarts () const
 Returns the currently configured number of random starts. More...
 
void setRandomSeed (unsigned int seed)
 Sets the seed used by the random number generator that produces the random starts. More...
 
void setReference (const GaussianShapeFunction &func, unsigned int sym_class)
 Specifies the reference shape function and its symmetry class. More...
 
bool generate (const GaussianShapeFunction &func, unsigned int sym_class)
 Generates the starting transformations for the alignment of func against the previously configured reference shape. More...
 
std::size_t getNumStartTransforms () const
 Returns the total number of starting transformations produced by the last generate() call. More...
 
std::size_t getNumStartSubTransforms () const
 Returns the number of sub-transformations applied per generated starting transformation (e.g. axes-swap variants). More...
 
const QuaternionTransformationgetStartTransform (std::size_t idx) const
 Returns the starting transformation at index idx. More...
 
- Public Member Functions inherited from CDPL::Shape::GaussianShapeAlignmentStartGenerator
virtual ~GaussianShapeAlignmentStartGenerator ()
 Virtual destructor. More...
 

Static Public Attributes

static constexpr double DEF_SYMMETRY_THRESHOLD = 0.15
 Default relative threshold for treating two principal moments as equal. More...
 
static constexpr std::size_t DEF_NUM_RANDOM_STARTS = 4
 Default number of random starting transformations. More...
 
static constexpr double DEF_MAX_RANDOM_TRANSLATION = 2.0
 Default maximum random translation magnitude applied to random starts. More...
 

Detailed Description

Generator that produces alignment starting transformations by aligning the principal axes of the aligned shape to those of the reference shape.

Starting transformations can be derived from any combination of (a) the shape centroid, (b) shape element (atom) centers, (c) color (pharmacophore) feature centers, and (d) random rotations applied to translated centers. The exact combination of starts is configured via the various gen* setter methods.

Constructor & Destructor Documentation

◆ PrincipalAxesAlignmentStartGenerator()

CDPL::Shape::PrincipalAxesAlignmentStartGenerator::PrincipalAxesAlignmentStartGenerator ( )

Constructs the PrincipalAxesAlignmentStartGenerator instance.

Member Function Documentation

◆ setupReference()

unsigned int CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setupReference ( GaussianShapeFunction func,
Math::Matrix4D xform 
) const
virtual

Prepares the reference shape function for use by the start generator.

Parameters
funcThe reference shape function (may be modified, e.g. centered).
xformThe output transformation that maps the reference shape from its prepared frame back to its original frame.
Returns
The perceived symmetry class of the reference shape (see namespace Shape::SymmetryClass).

Reimplemented from CDPL::Shape::GaussianShapeAlignmentStartGenerator.

◆ setupAligned()

unsigned int CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setupAligned ( GaussianShapeFunction func,
Math::Matrix4D xform 
) const
virtual

Prepares the aligned shape function for use by the start generator.

Parameters
funcThe aligned shape function (may be modified, e.g. centered).
xformThe output transformation that maps the aligned shape from its prepared frame back to its original frame.
Returns
The perceived symmetry class of the aligned shape (see namespace Shape::SymmetryClass).

Reimplemented from CDPL::Shape::GaussianShapeAlignmentStartGenerator.

◆ genShapeCenterStarts() [1/2]

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genShapeCenterStarts ( bool  generate)

Enables or disables the generation of a starting transformation at the shape centroid.

Parameters
generatetrue to enable the shape-centroid start, and false to disable it.

◆ genShapeCenterStarts() [2/2]

bool CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genShapeCenterStarts ( ) const

Tells whether a starting transformation at the shape centroid is generated.

Returns
true if a shape-centroid start is generated, and false otherwise.

◆ genColorCenterStarts() [1/2]

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genColorCenterStarts ( bool  generate)

Enables or disables the generation of starting transformations at color (pharmacophore) feature centers.

Parameters
generatetrue to enable the color-center starts, and false to disable them.

◆ genColorCenterStarts() [2/2]

bool CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genColorCenterStarts ( ) const

Tells whether starting transformations at color (pharmacophore) feature centers are generated.

Returns
true if color-center starts are generated, and false otherwise.

◆ genNonColorCenterStarts() [1/2]

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genNonColorCenterStarts ( bool  generate)

Enables or disables the generation of starting transformations at non-color (shape) element centers.

Parameters
generatetrue to enable the non-color-center starts, and false to disable them.

◆ genNonColorCenterStarts() [2/2]

bool CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genNonColorCenterStarts ( ) const

Tells whether starting transformations at non-color (shape) element centers are generated.

Returns
true if non-color-center starts are generated, and false otherwise.

◆ genRandomStarts() [1/2]

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genRandomStarts ( bool  generate)

Enables or disables the generation of random starting transformations.

Parameters
generatetrue to enable the random starts, and false to disable them.

◆ genRandomStarts() [2/2]

bool CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genRandomStarts ( ) const

Tells whether random starting transformations are generated.

Returns
true if random starts are generated, and false otherwise.

◆ genForAlignedShapeCenters() [1/2]

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForAlignedShapeCenters ( bool  generate)

Specifies whether element-/color-center starts shall be generated for centers of the aligned shape.

Parameters
generatetrue to consider aligned-shape centers, and false to ignore them.

◆ genForAlignedShapeCenters() [2/2]

bool CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForAlignedShapeCenters ( ) const

Tells whether element-/color-center starts are generated for centers of the aligned shape.

Returns
true if aligned-shape centers are considered, and false otherwise.

◆ genForReferenceShapeCenters() [1/2]

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForReferenceShapeCenters ( bool  generate)

Specifies whether element-/color-center starts shall be generated for centers of the reference shape.

Parameters
generatetrue to consider reference-shape centers, and false to ignore them.

◆ genForReferenceShapeCenters() [2/2]

bool CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForReferenceShapeCenters ( ) const

Tells whether element-/color-center starts are generated for centers of the reference shape.

Returns
true if reference-shape centers are considered, and false otherwise.

◆ genForLargerShapeCenters() [1/2]

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForLargerShapeCenters ( bool  generate)

Specifies whether element-/color-center starts shall be generated for centers of the shape with more elements (instead of both shapes).

Parameters
generatetrue to use only the centers of the larger shape, and false to use the centers of all configured shapes.

◆ genForLargerShapeCenters() [2/2]

bool CDPL::Shape::PrincipalAxesAlignmentStartGenerator::genForLargerShapeCenters ( ) const

Tells whether element-/color-center starts are generated for centers of the shape with more elements (instead of both shapes).

Returns
true if only the centers of the larger shape are used, and false otherwise.

◆ setSymmetryThreshold()

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setSymmetryThreshold ( double  thresh)

Sets the relative threshold for treating two principal moments as equal.

Parameters
threshThe new symmetry threshold.

◆ getSymmetryThreshold()

double CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getSymmetryThreshold ( )

Returns the currently configured symmetry threshold.

Returns
The symmetry threshold.

◆ setMaxRandomTranslation()

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setMaxRandomTranslation ( double  max_trans)

Sets the maximum random translation magnitude applied to random starts.

Parameters
max_transThe new maximum random translation magnitude.

◆ getMaxRandomTranslation()

double CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getMaxRandomTranslation ( ) const

Returns the currently configured maximum random translation.

Returns
The maximum random translation magnitude.

◆ setNumRandomStarts()

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setNumRandomStarts ( std::size_t  num_starts)

Sets the number of random starting transformations.

Parameters
num_startsThe new number of random starts.

◆ getNumRandomStarts()

std::size_t CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getNumRandomStarts ( ) const

Returns the currently configured number of random starts.

Returns
The number of random starts.

◆ setRandomSeed()

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setRandomSeed ( unsigned int  seed)

Sets the seed used by the random number generator that produces the random starts.

Parameters
seedThe new random seed.

◆ setReference()

void CDPL::Shape::PrincipalAxesAlignmentStartGenerator::setReference ( const GaussianShapeFunction func,
unsigned int  sym_class 
)
virtual

Specifies the reference shape function and its symmetry class.

Parameters
funcThe reference shape function.
sym_classThe symmetry class of the reference shape (see namespace Shape::SymmetryClass).

Implements CDPL::Shape::GaussianShapeAlignmentStartGenerator.

◆ generate()

bool CDPL::Shape::PrincipalAxesAlignmentStartGenerator::generate ( const GaussianShapeFunction func,
unsigned int  sym_class 
)
virtual

Generates the starting transformations for the alignment of func against the previously configured reference shape.

Parameters
funcThe aligned shape function.
sym_classThe symmetry class of the aligned shape (see namespace Shape::SymmetryClass).
Returns
true if at least one starting transformation has been generated, and false otherwise.

Implements CDPL::Shape::GaussianShapeAlignmentStartGenerator.

◆ getNumStartTransforms()

std::size_t CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getNumStartTransforms ( ) const
virtual

Returns the total number of starting transformations produced by the last generate() call.

Returns
The number of starting transformations.

Implements CDPL::Shape::GaussianShapeAlignmentStartGenerator.

◆ getNumStartSubTransforms()

std::size_t CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getNumStartSubTransforms ( ) const
virtual

Returns the number of sub-transformations applied per generated starting transformation (e.g. axes-swap variants).

Returns
The number of sub-transformations.

Implements CDPL::Shape::GaussianShapeAlignmentStartGenerator.

◆ getStartTransform()

const QuaternionTransformation& CDPL::Shape::PrincipalAxesAlignmentStartGenerator::getStartTransform ( std::size_t  idx) const
virtual

Returns the starting transformation at index idx.

Parameters
idxThe zero-based index of the starting transformation.
Returns
A const reference to the starting transformation.
Exceptions
Base::IndexErrorif the number of starting transformations is zero or idx is not in the range [0, getNumStartTransforms() - 1].

Implements CDPL::Shape::GaussianShapeAlignmentStartGenerator.

Member Data Documentation

◆ DEF_SYMMETRY_THRESHOLD

constexpr double CDPL::Shape::PrincipalAxesAlignmentStartGenerator::DEF_SYMMETRY_THRESHOLD = 0.15
staticconstexpr

Default relative threshold for treating two principal moments as equal.

◆ DEF_NUM_RANDOM_STARTS

constexpr std::size_t CDPL::Shape::PrincipalAxesAlignmentStartGenerator::DEF_NUM_RANDOM_STARTS = 4
staticconstexpr

Default number of random starting transformations.

◆ DEF_MAX_RANDOM_TRANSLATION

constexpr double CDPL::Shape::PrincipalAxesAlignmentStartGenerator::DEF_MAX_RANDOM_TRANSLATION = 2.0
staticconstexpr

Default maximum random translation magnitude applied to random starts.


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