![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
High-level driver for the alignment of Gaussian shapes against a set of reference shapes. More...
#include <GaussianShapeAlignment.hpp>
Public Types | |
| typedef std::shared_ptr< GaussianShapeAlignment > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated GaussianShapeAlignment instances. More... | |
| typedef ResultList::const_iterator | ConstResultIterator |
| A constant iterator over the alignment results. More... | |
| typedef ResultList::iterator | ResultIterator |
| A mutable iterator over the alignment results. More... | |
| typedef boost::transform_iterator< GetShapeFunction, ShapeFunctionList::const_iterator > | ConstShapeIterator |
| A constant iterator over the reference shapes. More... | |
| typedef GaussianShapeFunctionAlignment::ColorFilterFunction | ColorFilterFunction |
| Type of the function used to filter color (pharmacophore) features by type. More... | |
| typedef GaussianShapeFunctionAlignment::ColorMatchFunction | ColorMatchFunction |
| Type of the function used to decide whether two color features match. More... | |
| typedef std::function< double(const AlignmentResult &)> | ScoringFunction |
| Type of the function used to score an alignment result. More... | |
| typedef std::function< bool(const AlignmentResult &, const AlignmentResult &)> | ResultCompareFunction |
| Type of the function used to compare two alignment results. More... | |
Public Member Functions | |
| GaussianShapeAlignment () | |
Constructs the GaussianShapeAlignment instance. More... | |
| GaussianShapeAlignment (const GaussianShape &ref_shape) | |
Constructs the GaussianShapeAlignment instance with ref_shape as the single reference shape. More... | |
| GaussianShapeAlignment (const GaussianShapeSet &ref_shapes) | |
Constructs the GaussianShapeAlignment instance with the shapes in ref_shapes as the reference set. More... | |
| GaussianShapeAlignment (const GaussianShapeAlignment &alignment)=delete | |
| ~GaussianShapeAlignment () | |
| Destructor. More... | |
| GaussianShapeAlignment & | operator= (const GaussianShapeAlignment &alignment)=delete |
| void | setOverlapFunction (GaussianShapeOverlapFunction &func) |
| Specifies the Gaussian-shape overlap function used during alignment. More... | |
| GaussianShapeOverlapFunction & | getOverlapFunction () const |
| Returns the currently configured overlap function. More... | |
| const FastGaussianShapeOverlapFunction & | getDefaultOverlapFunction () const |
| Returns the built-in default overlap function. More... | |
| FastGaussianShapeOverlapFunction & | getDefaultOverlapFunction () |
| Returns the built-in default overlap function. More... | |
| void | setStartGenerator (GaussianShapeAlignmentStartGenerator &gen) |
| Specifies the alignment-start generator used to seed the overlap optimization. More... | |
| GaussianShapeAlignmentStartGenerator & | getStartGenerator () const |
| Returns the currently configured alignment-start generator. More... | |
| const PrincipalAxesAlignmentStartGenerator & | getDefaultStartGenerator () const |
| Returns the built-in principal-axes alignment-start generator. More... | |
| PrincipalAxesAlignmentStartGenerator & | getDefaultStartGenerator () |
| Returns the built-in principal-axes alignment-start generator. More... | |
| void | setColorMatchFunction (const ColorMatchFunction &func) |
| Specifies the function used to decide whether two color features match. More... | |
| const ColorMatchFunction & | getColorMatchFunction () const |
| Returns the currently configured color-match function. More... | |
| void | setColorFilterFunction (const ColorFilterFunction &func) |
| Specifies the function used to filter color features by type. More... | |
| const ColorFilterFunction & | getColorFilterFunction () const |
| Returns the currently configured color-filter function. More... | |
| void | setResultCompareFunction (const ResultCompareFunction &func) |
| Specifies the function used to compare two alignment results for sorting and filtering. More... | |
| const ResultCompareFunction & | getResultCompareFunction () const |
| Returns the currently configured result-compare function. More... | |
| void | setScoringFunction (const ScoringFunction &func) |
| Specifies the function used to score an alignment result. More... | |
| const ScoringFunction & | getScoringFunction () const |
| Returns the currently configured scoring function. More... | |
| void | setResultSelectionMode (unsigned int mode) |
| Sets the alignment-result selection mode (see namespace Shape::AlignmentResultSelectionMode). More... | |
| unsigned int | getResultSelectionMode () const |
| Returns the currently configured alignment-result selection mode. More... | |
| void | calcSelfOverlaps (bool calc) |
| Specifies whether shape self-overlaps shall be computed for the involved shapes. More... | |
| bool | calcSelfOverlaps () const |
| Tells whether shape self-overlaps are computed for the involved shapes. More... | |
| void | calcColorSelfOverlaps (bool calc) |
| Specifies whether color self-overlaps shall be computed for the involved shapes. More... | |
| bool | calcColorSelfOverlaps () const |
| Tells whether color self-overlaps are computed for the involved shapes. More... | |
| void | calcColorOverlaps (bool calc) |
| Specifies whether color overlaps shall be computed in addition to shape overlaps. More... | |
| bool | calcColorOverlaps () const |
| Tells whether color overlaps are computed in addition to shape overlaps. More... | |
| void | performAlignment (bool perf_align) |
| Specifies whether the actual alignment shall be performed (vs. only computing overlaps in the initial pose). More... | |
| bool | performAlignment () const |
| Tells whether the actual alignment is performed. More... | |
| void | optimizeOverlap (bool optimize) |
| Specifies whether the overlap shall be optimized iteratively after the initial alignment. More... | |
| bool | optimizeOverlap () const |
| Tells whether the overlap is optimized iteratively. More... | |
| void | greedyOptimization (bool greedy) |
| Specifies whether the overlap optimization shall use a greedy strategy that stops at the first local maximum. More... | |
| bool | greedyOptimization () const |
| Tells whether the overlap optimization uses a greedy strategy. More... | |
| void | setMaxNumOptimizationIterations (std::size_t max_iter) |
| Sets the maximum number of overlap-optimization iterations. More... | |
| std::size_t | getMaxNumOptimizationIterations () const |
| Returns the currently configured maximum number of overlap-optimization iterations. More... | |
| void | setOptimizationStopGradient (double grad_norm) |
| Sets the gradient norm at which the overlap optimization is stopped. More... | |
| double | getOptimizationStopGradient () const |
| Returns the currently configured overlap-optimization stop gradient. More... | |
| void | setMaxOrder (std::size_t max_order) |
| Sets the maximum order of the Gaussian-product expansion used by the overlap function. More... | |
| std::size_t | getMaxOrder () const |
| Returns the currently configured maximum order of the Gaussian-product expansion. More... | |
| void | setDistanceCutoff (double cutoff) |
| Sets the distance cutoff for pruning negligible overlap contributions. More... | |
| double | getDistanceCutoff () const |
| Returns the currently configured distance cutoff. More... | |
| void | clearReferenceShapes () |
| Removes all reference shapes and reference shape sets. More... | |
| void | addReferenceShape (const GaussianShape &shape, bool new_set=true) |
| Adds shape to the reference shapes. More... | |
| void | addReferenceShapes (const GaussianShapeSet &shapes, bool new_set=true) |
| Adds the shapes in shapes to the reference shapes. More... | |
| std::size_t | getNumReferenceShapes () const |
| Returns the total number of reference shapes. More... | |
| const GaussianShape & | getReferenceShape (std::size_t idx) const |
| Returns the reference shape at index idx. More... | |
| ConstShapeIterator | getReferenceShapesBegin () const |
| Returns a constant iterator pointing to the first reference shape. More... | |
| ConstShapeIterator | getReferenceShapesEnd () const |
| Returns a constant iterator pointing one past the last reference shape. More... | |
| bool | align (const GaussianShape &shape) |
| Aligns shape against all reference shapes. More... | |
| bool | align (const GaussianShapeSet &shapes) |
| Aligns each shape in shapes against all reference shapes. More... | |
| std::size_t | getNumResults () const |
| Returns the number of stored alignment results. More... | |
| const AlignmentResult & | getResult (std::size_t idx) const |
| Returns the alignment result at index idx. More... | |
| AlignmentResult & | getResult (std::size_t idx) |
| Returns the alignment result at index idx. More... | |
| ConstResultIterator | getResultsBegin () const |
| Returns a constant iterator pointing to the first alignment result. More... | |
| ConstResultIterator | getResultsEnd () const |
| Returns a constant iterator pointing one past the last alignment result. More... | |
| ResultIterator | getResultsBegin () |
| Returns a mutable iterator pointing to the first alignment result. More... | |
| ResultIterator | getResultsEnd () |
| Returns a mutable iterator pointing one past the last alignment result. More... | |
Static Public Attributes | |
| static constexpr double | DEF_OPTIMIZATION_STOP_GRADIENT = 1.0 |
| Default gradient norm at which the overlap optimization is stopped. More... | |
| static constexpr std::size_t | DEF_MAX_OPTIMIZATION_ITERATIONS = 20 |
| Default maximum number of overlap-optimization iterations. More... | |
| static constexpr std::size_t | DEF_MAX_PRODUCT_ORDER = 1 |
| Default maximum order of the Gaussian-product expansion. More... | |
| static constexpr unsigned int | DEF_RESULT_SELECTION_MODE = AlignmentResultSelectionMode::BEST_PER_REFERENCE_SET |
| Default alignment-result selection mode. More... | |
| static constexpr double | DEF_DISTANCE_CUTOFF = 0.0 |
| Default distance cutoff for pruning negligible overlap contributions. More... | |
High-level driver for the alignment of Gaussian shapes against a set of reference shapes.
The class manages a list of reference Gaussian shapes (organised into reference sets), runs the underlying Shape::GaussianShapeFunctionAlignment for each (reference, aligned) pair, and collects the Shape::AlignmentResult instances filtered according to the configured selection mode and comparator/scoring functions.
| typedef std::shared_ptr<GaussianShapeAlignment> CDPL::Shape::GaussianShapeAlignment::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated GaussianShapeAlignment instances.
| typedef ResultList::const_iterator CDPL::Shape::GaussianShapeAlignment::ConstResultIterator |
A constant iterator over the alignment results.
| typedef ResultList::iterator CDPL::Shape::GaussianShapeAlignment::ResultIterator |
A mutable iterator over the alignment results.
| typedef boost::transform_iterator<GetShapeFunction, ShapeFunctionList::const_iterator> CDPL::Shape::GaussianShapeAlignment::ConstShapeIterator |
A constant iterator over the reference shapes.
| typedef GaussianShapeFunctionAlignment::ColorFilterFunction CDPL::Shape::GaussianShapeAlignment::ColorFilterFunction |
Type of the function used to filter color (pharmacophore) features by type.
| typedef GaussianShapeFunctionAlignment::ColorMatchFunction CDPL::Shape::GaussianShapeAlignment::ColorMatchFunction |
Type of the function used to decide whether two color features match.
| typedef std::function<double(const AlignmentResult&)> CDPL::Shape::GaussianShapeAlignment::ScoringFunction |
Type of the function used to score an alignment result.
| typedef std::function<bool(const AlignmentResult&, const AlignmentResult&)> CDPL::Shape::GaussianShapeAlignment::ResultCompareFunction |
Type of the function used to compare two alignment results.
| CDPL::Shape::GaussianShapeAlignment::GaussianShapeAlignment | ( | ) |
Constructs the GaussianShapeAlignment instance.
| CDPL::Shape::GaussianShapeAlignment::GaussianShapeAlignment | ( | const GaussianShape & | ref_shape | ) |
Constructs the GaussianShapeAlignment instance with ref_shape as the single reference shape.
| ref_shape | The reference shape. |
| CDPL::Shape::GaussianShapeAlignment::GaussianShapeAlignment | ( | const GaussianShapeSet & | ref_shapes | ) |
Constructs the GaussianShapeAlignment instance with the shapes in ref_shapes as the reference set.
| ref_shapes | The reference shapes. |
|
delete |
| CDPL::Shape::GaussianShapeAlignment::~GaussianShapeAlignment | ( | ) |
Destructor.
|
delete |
| void CDPL::Shape::GaussianShapeAlignment::setOverlapFunction | ( | GaussianShapeOverlapFunction & | func | ) |
Specifies the Gaussian-shape overlap function used during alignment.
| func | The overlap function. |
| GaussianShapeOverlapFunction& CDPL::Shape::GaussianShapeAlignment::getOverlapFunction | ( | ) | const |
Returns the currently configured overlap function.
| const FastGaussianShapeOverlapFunction& CDPL::Shape::GaussianShapeAlignment::getDefaultOverlapFunction | ( | ) | const |
Returns the built-in default overlap function.
const reference to the default overlap function. | FastGaussianShapeOverlapFunction& CDPL::Shape::GaussianShapeAlignment::getDefaultOverlapFunction | ( | ) |
Returns the built-in default overlap function.
| void CDPL::Shape::GaussianShapeAlignment::setStartGenerator | ( | GaussianShapeAlignmentStartGenerator & | gen | ) |
Specifies the alignment-start generator used to seed the overlap optimization.
| gen | The alignment-start generator. |
| GaussianShapeAlignmentStartGenerator& CDPL::Shape::GaussianShapeAlignment::getStartGenerator | ( | ) | const |
Returns the currently configured alignment-start generator.
| const PrincipalAxesAlignmentStartGenerator& CDPL::Shape::GaussianShapeAlignment::getDefaultStartGenerator | ( | ) | const |
Returns the built-in principal-axes alignment-start generator.
const reference to the default alignment-start generator. | PrincipalAxesAlignmentStartGenerator& CDPL::Shape::GaussianShapeAlignment::getDefaultStartGenerator | ( | ) |
Returns the built-in principal-axes alignment-start generator.
| void CDPL::Shape::GaussianShapeAlignment::setColorMatchFunction | ( | const ColorMatchFunction & | func | ) |
Specifies the function used to decide whether two color features match.
| func | The color-match function. |
| const ColorMatchFunction& CDPL::Shape::GaussianShapeAlignment::getColorMatchFunction | ( | ) | const |
Returns the currently configured color-match function.
const reference to the color-match function. | void CDPL::Shape::GaussianShapeAlignment::setColorFilterFunction | ( | const ColorFilterFunction & | func | ) |
Specifies the function used to filter color features by type.
| func | The color-filter function. |
| const ColorFilterFunction& CDPL::Shape::GaussianShapeAlignment::getColorFilterFunction | ( | ) | const |
Returns the currently configured color-filter function.
const reference to the color-filter function. | void CDPL::Shape::GaussianShapeAlignment::setResultCompareFunction | ( | const ResultCompareFunction & | func | ) |
Specifies the function used to compare two alignment results for sorting and filtering.
| func | The result-compare function. |
| const ResultCompareFunction& CDPL::Shape::GaussianShapeAlignment::getResultCompareFunction | ( | ) | const |
Returns the currently configured result-compare function.
const reference to the result-compare function. | void CDPL::Shape::GaussianShapeAlignment::setScoringFunction | ( | const ScoringFunction & | func | ) |
Specifies the function used to score an alignment result.
| func | The scoring function. |
| const ScoringFunction& CDPL::Shape::GaussianShapeAlignment::getScoringFunction | ( | ) | const |
Returns the currently configured scoring function.
const reference to the scoring function. | void CDPL::Shape::GaussianShapeAlignment::setResultSelectionMode | ( | unsigned int | mode | ) |
Sets the alignment-result selection mode (see namespace Shape::AlignmentResultSelectionMode).
| mode | The new result-selection mode. |
| unsigned int CDPL::Shape::GaussianShapeAlignment::getResultSelectionMode | ( | ) | const |
Returns the currently configured alignment-result selection mode.
| void CDPL::Shape::GaussianShapeAlignment::calcSelfOverlaps | ( | bool | calc | ) |
Specifies whether shape self-overlaps shall be computed for the involved shapes.
| calc | true to compute shape self-overlaps, and false to skip them. |
| bool CDPL::Shape::GaussianShapeAlignment::calcSelfOverlaps | ( | ) | const |
Tells whether shape self-overlaps are computed for the involved shapes.
true if shape self-overlaps are computed, and false otherwise. | void CDPL::Shape::GaussianShapeAlignment::calcColorSelfOverlaps | ( | bool | calc | ) |
Specifies whether color self-overlaps shall be computed for the involved shapes.
| calc | true to compute color self-overlaps, and false to skip them. |
| bool CDPL::Shape::GaussianShapeAlignment::calcColorSelfOverlaps | ( | ) | const |
Tells whether color self-overlaps are computed for the involved shapes.
true if color self-overlaps are computed, and false otherwise. | void CDPL::Shape::GaussianShapeAlignment::calcColorOverlaps | ( | bool | calc | ) |
Specifies whether color overlaps shall be computed in addition to shape overlaps.
| calc | true to compute color overlaps, and false to skip them. |
| bool CDPL::Shape::GaussianShapeAlignment::calcColorOverlaps | ( | ) | const |
Tells whether color overlaps are computed in addition to shape overlaps.
true if color overlaps are computed, and false otherwise. | void CDPL::Shape::GaussianShapeAlignment::performAlignment | ( | bool | perf_align | ) |
Specifies whether the actual alignment shall be performed (vs. only computing overlaps in the initial pose).
| perf_align | true to perform the alignment, and false to only evaluate the initial pose. |
| bool CDPL::Shape::GaussianShapeAlignment::performAlignment | ( | ) | const |
Tells whether the actual alignment is performed.
true if the alignment is performed, and false otherwise. | void CDPL::Shape::GaussianShapeAlignment::optimizeOverlap | ( | bool | optimize | ) |
Specifies whether the overlap shall be optimized iteratively after the initial alignment.
| optimize | true to optimize the overlap, and false to skip optimization. |
| bool CDPL::Shape::GaussianShapeAlignment::optimizeOverlap | ( | ) | const |
Tells whether the overlap is optimized iteratively.
true if the overlap is optimized, and false otherwise. | void CDPL::Shape::GaussianShapeAlignment::greedyOptimization | ( | bool | greedy | ) |
Specifies whether the overlap optimization shall use a greedy strategy that stops at the first local maximum.
| greedy | true to use the greedy strategy, and false to use the full optimization. |
| bool CDPL::Shape::GaussianShapeAlignment::greedyOptimization | ( | ) | const |
Tells whether the overlap optimization uses a greedy strategy.
true if the greedy strategy is used, and false otherwise. | void CDPL::Shape::GaussianShapeAlignment::setMaxNumOptimizationIterations | ( | std::size_t | max_iter | ) |
Sets the maximum number of overlap-optimization iterations.
| max_iter | The new maximum number of iterations. |
| std::size_t CDPL::Shape::GaussianShapeAlignment::getMaxNumOptimizationIterations | ( | ) | const |
Returns the currently configured maximum number of overlap-optimization iterations.
| void CDPL::Shape::GaussianShapeAlignment::setOptimizationStopGradient | ( | double | grad_norm | ) |
Sets the gradient norm at which the overlap optimization is stopped.
| grad_norm | The new stop gradient norm. |
| double CDPL::Shape::GaussianShapeAlignment::getOptimizationStopGradient | ( | ) | const |
Returns the currently configured overlap-optimization stop gradient.
| void CDPL::Shape::GaussianShapeAlignment::setMaxOrder | ( | std::size_t | max_order | ) |
Sets the maximum order of the Gaussian-product expansion used by the overlap function.
| max_order | The new maximum product order. |
| std::size_t CDPL::Shape::GaussianShapeAlignment::getMaxOrder | ( | ) | const |
Returns the currently configured maximum order of the Gaussian-product expansion.
| void CDPL::Shape::GaussianShapeAlignment::setDistanceCutoff | ( | double | cutoff | ) |
Sets the distance cutoff for pruning negligible overlap contributions.
| cutoff | The new distance cutoff. |
| double CDPL::Shape::GaussianShapeAlignment::getDistanceCutoff | ( | ) | const |
Returns the currently configured distance cutoff.
| void CDPL::Shape::GaussianShapeAlignment::clearReferenceShapes | ( | ) |
Removes all reference shapes and reference shape sets.
| void CDPL::Shape::GaussianShapeAlignment::addReferenceShape | ( | const GaussianShape & | shape, |
| bool | new_set = true |
||
| ) |
Adds shape to the reference shapes.
| shape | The reference shape. |
| new_set | If true, shape is added to a new reference set; otherwise it is appended to the most recent reference set. |
| void CDPL::Shape::GaussianShapeAlignment::addReferenceShapes | ( | const GaussianShapeSet & | shapes, |
| bool | new_set = true |
||
| ) |
Adds the shapes in shapes to the reference shapes.
| shapes | The reference shapes. |
| new_set | If true, the shapes are added to a new reference set; otherwise they are appended to the most recent reference set. |
| std::size_t CDPL::Shape::GaussianShapeAlignment::getNumReferenceShapes | ( | ) | const |
Returns the total number of reference shapes.
| const GaussianShape& CDPL::Shape::GaussianShapeAlignment::getReferenceShape | ( | std::size_t | idx | ) | const |
Returns the reference shape at index idx.
| idx | The zero-based index of the reference shape. |
const reference to the reference shape. | Base::IndexError | if the number of reference shapes is zero or idx is not in the range [0, getNumReferenceShapes() - 1]. |
| ConstShapeIterator CDPL::Shape::GaussianShapeAlignment::getReferenceShapesBegin | ( | ) | const |
Returns a constant iterator pointing to the first reference shape.
| ConstShapeIterator CDPL::Shape::GaussianShapeAlignment::getReferenceShapesEnd | ( | ) | const |
Returns a constant iterator pointing one past the last reference shape.
| bool CDPL::Shape::GaussianShapeAlignment::align | ( | const GaussianShape & | shape | ) |
Aligns shape against all reference shapes.
| shape | The shape to align. |
true if at least one alignment result was produced, and false otherwise. | bool CDPL::Shape::GaussianShapeAlignment::align | ( | const GaussianShapeSet & | shapes | ) |
Aligns each shape in shapes against all reference shapes.
| shapes | The shapes to align. |
true if at least one alignment result was produced, and false otherwise. | std::size_t CDPL::Shape::GaussianShapeAlignment::getNumResults | ( | ) | const |
Returns the number of stored alignment results.
| const AlignmentResult& CDPL::Shape::GaussianShapeAlignment::getResult | ( | std::size_t | idx | ) | const |
Returns the alignment result at index idx.
| idx | The zero-based result index. |
const reference to the result. | Base::IndexError | if the number of results is zero or idx is not in the range [0, getNumResults() - 1]. |
| AlignmentResult& CDPL::Shape::GaussianShapeAlignment::getResult | ( | std::size_t | idx | ) |
Returns the alignment result at index idx.
| idx | The zero-based result index. |
| Base::IndexError | if the number of results is zero or idx is not in the range [0, getNumResults() - 1]. |
| ConstResultIterator CDPL::Shape::GaussianShapeAlignment::getResultsBegin | ( | ) | const |
Returns a constant iterator pointing to the first alignment result.
| ConstResultIterator CDPL::Shape::GaussianShapeAlignment::getResultsEnd | ( | ) | const |
Returns a constant iterator pointing one past the last alignment result.
| ResultIterator CDPL::Shape::GaussianShapeAlignment::getResultsBegin | ( | ) |
Returns a mutable iterator pointing to the first alignment result.
| ResultIterator CDPL::Shape::GaussianShapeAlignment::getResultsEnd | ( | ) |
Returns a mutable iterator pointing one past the last alignment result.
|
staticconstexpr |
Default gradient norm at which the overlap optimization is stopped.
|
staticconstexpr |
Default maximum number of overlap-optimization iterations.
|
staticconstexpr |
Default maximum order of the Gaussian-product expansion.
|
staticconstexpr |
Default alignment-result selection mode.
|
staticconstexpr |
Default distance cutoff for pruning negligible overlap contributions.