![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
High-level driver for the fast alignment of Gaussian shapes against a set of reference shapes. More...
Inheritance diagram for CDPL.Shape.FastGaussianShapeAlignment:Public Member Functions | |
| None | __init__ () |
Constructs the FastGaussianShapeAlignment instance. | |
| None | __init__ (GaussianShape ref_shape) |
Constructs the FastGaussianShapeAlignment instance with ref_shape as the single reference shape. More... | |
| None | __init__ (GaussianShapeSet ref_shapes) |
Constructs the FastGaussianShapeAlignment instance with the shapes in ref_shapes as the reference set. More... | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
| None | setResultCompareFunction (BoolAlignmentResult2Functor func) |
| Specifies the function used to compare two alignment results for sorting and filtering. More... | |
| BoolAlignmentResult2Functor | getResultCompareFunction () |
| Returns the currently configured result-compare function. More... | |
| None | setScoringFunction (DoubleAlignmentResultFunctor func) |
| Specifies the function used to score an alignment result. More... | |
| DoubleAlignmentResultFunctor | getScoringFunction () |
| Returns the currently configured scoring function. More... | |
| None | setResultSelectionMode (int mode) |
| Sets the alignment-result selection mode (see namespace Shape.AlignmentResultSelectionMode). More... | |
| int | getResultSelectionMode () |
| Returns the currently configured alignment-result selection mode. More... | |
| None | setMaxNumOptimizationIterations (int max_iter) |
| Sets the maximum number of overlap-optimization iterations. More... | |
| int | getMaxNumOptimizationIterations () |
| Returns the currently configured maximum number of overlap-optimization iterations. More... | |
| None | setOptimizationStopGradient (float grad_norm) |
| Sets the gradient norm at which the overlap optimization is stopped. More... | |
| float | getOptimizationStopGradient () |
| Returns the currently configured overlap-optimization stop gradient. More... | |
| None | performAlignment (bool perf_align) |
| Specifies whether the actual alignment shall be performed (vs. More... | |
| bool | performAlignment () |
| Tells whether the actual alignment is performed. More... | |
| None | optimizeOverlap (bool optimize) |
| Specifies whether the overlap shall be optimized iteratively after the initial alignment. More... | |
| bool | optimizeOverlap () |
| Tells whether the overlap is optimized iteratively. More... | |
| None | greedyOptimization (bool greedy) |
| Specifies whether the overlap optimization shall use a greedy strategy that stops at the first local maximum. More... | |
| bool | greedyOptimization () |
| Tells whether the overlap optimization uses a greedy strategy. More... | |
| None | setSymmetryThreshold (float thresh) |
| Sets the relative threshold for treating two principal moments as equal. More... | |
| float | getSymmetryThreshold () |
| Returns the currently configured symmetry threshold. More... | |
| None | genShapeCenterStarts (bool generate) |
| Enables or disables the generation of a starting transformation at the shape centroid. More... | |
| bool | genShapeCenterStarts () |
| Tells whether a starting transformation at the shape centroid is generated. More... | |
| None | genColorCenterStarts (bool generate) |
| Enables or disables the generation of starting transformations at color (pharmacophore) feature centers. More... | |
| bool | genColorCenterStarts () |
| Tells whether starting transformations at color (pharmacophore) feature centers are generated. More... | |
| None | genNonColorCenterStarts (bool generate) |
| Enables or disables the generation of starting transformations at non-color (shape) element centers. More... | |
| bool | genNonColorCenterStarts () |
| Tells whether starting transformations at non-color (shape) element centers are generated. More... | |
| None | genRandomStarts (bool generate) |
| Enables or disables the generation of random starting transformations. More... | |
| bool | genRandomStarts () |
| Tells whether random starting transformations are generated. More... | |
| None | genForAlignedShapeCenters (bool generate) |
| Specifies whether element-/color-center starts shall be generated for centers of the aligned shape. More... | |
| bool | genForAlignedShapeCenters () |
| Tells whether element-/color-center starts are generated for centers of the aligned shape. More... | |
| None | genForReferenceShapeCenters (bool generate) |
| Specifies whether element-/color-center starts shall be generated for centers of the reference shape. More... | |
| bool | genForReferenceShapeCenters () |
| Tells whether element-/color-center starts are generated for centers of the reference shape. More... | |
| None | 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 () |
| Tells whether element-/color-center starts are generated for centers of the shape with more elements (instead of both shapes). More... | |
| None | setMaxRandomTranslation (float max_trans) |
| Sets the maximum random translation magnitude applied to random starts. More... | |
| float | getMaxRandomTranslation () |
| Returns the currently configured maximum random translation. More... | |
| None | setNumRandomStarts (int num_starts) |
| Sets the number of random starting transformations. More... | |
| int | getNumRandomStarts () |
| Returns the currently configured number of random starts. More... | |
| None | setRandomSeed (int seed) |
| Sets the seed used by the random number generator that produces the random starts. More... | |
| None | clearReferenceShapes () |
| Removes all reference shapes and reference shape sets. | |
| None | addReferenceShape (GaussianShape shape, bool new_set=True) |
| Adds shape to the reference shapes. More... | |
| None | addReferenceShapes (GaussianShapeSet shapes, bool new_set=True) |
| Adds the shapes in shapes to the reference shapes. More... | |
| int | getNumReferenceShapes () |
| Returns the total number of reference shapes. More... | |
| bool | align (GaussianShape shape) |
| Aligns shape against all reference shapes. More... | |
| bool | align (GaussianShapeSet shapes) |
| Aligns each shape in shapes against all reference shapes. More... | |
| int | getNumResults () |
| Returns the number of stored alignment results. More... | |
| AlignmentResult | getResult (int idx) |
| Returns the alignment result at index idx. More... | |
| int | __len__ () |
| AlignmentResult | __getitem__ (int idx) |
Static Public Attributes | |
| float | DEF_OPTIMIZATION_STOP_GRADIENT = 1.0 |
| Default gradient norm at which the overlap optimization is stopped. | |
| int | DEF_MAX_OPTIMIZATION_ITERATIONS = 20 |
| Default maximum number of overlap-optimization iterations. | |
| int | DEF_RESULT_SELECTION_MODE = 3 |
| Default alignment-result selection mode. | |
| float | DEF_SYMMETRY_THRESHOLD = 0.15 |
| Default relative threshold for treating two principal moments as equal. | |
| int | DEF_NUM_RANDOM_STARTS = 4 |
| Default number of random starting transformations. | |
| float | DEF_MAX_RANDOM_TRANSLATION = 2.0 |
| Default maximum random translation magnitude applied to random starts. | |
High-level driver for the fast alignment of Gaussian shapes against a set of reference shapes.
Unlike Shape.GaussianShapeAlignment, which delegates the alignment to a separate Shape.GaussianShapeFunctionAlignment instance, FastGaussianShapeAlignment integrates the entire pipeline (start-transform generation, BFGS overlap optimization, result selection) into one class and operates on a self-contained Gaussian-product representation. The configuration combines settings exposed by Shape.PrincipalAxesAlignmentStartGenerator (start-transform options) and the iterative overlap optimization.
| None CDPL.Shape.FastGaussianShapeAlignment.__init__ | ( | GaussianShape | ref_shape | ) |
Constructs the FastGaussianShapeAlignment instance with ref_shape as the single reference shape.
| ref_shape | The reference shape. |
| None CDPL.Shape.FastGaussianShapeAlignment.__init__ | ( | GaussianShapeSet | ref_shapes | ) |
Constructs the FastGaussianShapeAlignment instance with the shapes in ref_shapes as the reference set.
| ref_shapes | The reference shapes. |
| int CDPL.Shape.FastGaussianShapeAlignment.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python FastGaussianShapeAlignment 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 FastGaussianShapeAlignment 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().
| None CDPL.Shape.FastGaussianShapeAlignment.setResultCompareFunction | ( | BoolAlignmentResult2Functor | func | ) |
Specifies the function used to compare two alignment results for sorting and filtering.
| func | The result-compare function. |
| BoolAlignmentResult2Functor CDPL.Shape.FastGaussianShapeAlignment.getResultCompareFunction | ( | ) |
Returns the currently configured result-compare function.
| None CDPL.Shape.FastGaussianShapeAlignment.setScoringFunction | ( | DoubleAlignmentResultFunctor | func | ) |
Specifies the function used to score an alignment result.
| func | The scoring function. |
| DoubleAlignmentResultFunctor CDPL.Shape.FastGaussianShapeAlignment.getScoringFunction | ( | ) |
Returns the currently configured scoring function.
| None CDPL.Shape.FastGaussianShapeAlignment.setResultSelectionMode | ( | int | mode | ) |
Sets the alignment-result selection mode (see namespace Shape.AlignmentResultSelectionMode).
| mode | The new result-selection mode. |
| int CDPL.Shape.FastGaussianShapeAlignment.getResultSelectionMode | ( | ) |
Returns the currently configured alignment-result selection mode.
| None CDPL.Shape.FastGaussianShapeAlignment.setMaxNumOptimizationIterations | ( | int | max_iter | ) |
Sets the maximum number of overlap-optimization iterations.
| max_iter | The new maximum number of iterations. |
| int CDPL.Shape.FastGaussianShapeAlignment.getMaxNumOptimizationIterations | ( | ) |
Returns the currently configured maximum number of overlap-optimization iterations.
| None CDPL.Shape.FastGaussianShapeAlignment.setOptimizationStopGradient | ( | float | grad_norm | ) |
Sets the gradient norm at which the overlap optimization is stopped.
| grad_norm | The new stop gradient norm. |
| float CDPL.Shape.FastGaussianShapeAlignment.getOptimizationStopGradient | ( | ) |
Returns the currently configured overlap-optimization stop gradient.
| None CDPL.Shape.FastGaussianShapeAlignment.performAlignment | ( | bool | perf_align | ) |
Specifies whether the actual alignment shall be performed (vs.
only evaluating overlaps in the initial pose).
| perf_align | True to perform the alignment, and False to only evaluate the initial pose. |
| bool CDPL.Shape.FastGaussianShapeAlignment.performAlignment | ( | ) |
Tells whether the actual alignment is performed.
True if the alignment is performed, and False otherwise. | None CDPL.Shape.FastGaussianShapeAlignment.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.FastGaussianShapeAlignment.optimizeOverlap | ( | ) |
Tells whether the overlap is optimized iteratively.
True if the overlap is optimized, and False otherwise. | None CDPL.Shape.FastGaussianShapeAlignment.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.FastGaussianShapeAlignment.greedyOptimization | ( | ) |
Tells whether the overlap optimization uses a greedy strategy.
True if the greedy strategy is used, and False otherwise. | None CDPL.Shape.FastGaussianShapeAlignment.setSymmetryThreshold | ( | float | thresh | ) |
Sets the relative threshold for treating two principal moments as equal.
| thresh | The new symmetry threshold. |
| float CDPL.Shape.FastGaussianShapeAlignment.getSymmetryThreshold | ( | ) |
Returns the currently configured symmetry threshold.
| None CDPL.Shape.FastGaussianShapeAlignment.genShapeCenterStarts | ( | bool | generate | ) |
Enables or disables the generation of a starting transformation at the shape centroid.
| generate | True to enable the shape-centroid start, and False to disable it. |
| bool CDPL.Shape.FastGaussianShapeAlignment.genShapeCenterStarts | ( | ) |
Tells whether a starting transformation at the shape centroid is generated.
True if a shape-centroid start is generated, and False otherwise. | None CDPL.Shape.FastGaussianShapeAlignment.genColorCenterStarts | ( | bool | generate | ) |
Enables or disables the generation of starting transformations at color (pharmacophore) feature centers.
| generate | True to enable the color-center starts, and False to disable them. |
| bool CDPL.Shape.FastGaussianShapeAlignment.genColorCenterStarts | ( | ) |
Tells whether starting transformations at color (pharmacophore) feature centers are generated.
True if color-center starts are generated, and False otherwise. | None CDPL.Shape.FastGaussianShapeAlignment.genNonColorCenterStarts | ( | bool | generate | ) |
Enables or disables the generation of starting transformations at non-color (shape) element centers.
| generate | True to enable the non-color-center starts, and False to disable them. |
| bool CDPL.Shape.FastGaussianShapeAlignment.genNonColorCenterStarts | ( | ) |
Tells whether starting transformations at non-color (shape) element centers are generated.
True if non-color-center starts are generated, and False otherwise. | None CDPL.Shape.FastGaussianShapeAlignment.genRandomStarts | ( | bool | generate | ) |
Enables or disables the generation of random starting transformations.
| generate | True to enable the random starts, and False to disable them. |
| bool CDPL.Shape.FastGaussianShapeAlignment.genRandomStarts | ( | ) |
Tells whether random starting transformations are generated.
True if random starts are generated, and False otherwise. | None CDPL.Shape.FastGaussianShapeAlignment.genForAlignedShapeCenters | ( | bool | generate | ) |
Specifies whether element-/color-center starts shall be generated for centers of the aligned shape.
| generate | True to consider aligned-shape centers, and False to ignore them. |
| bool CDPL.Shape.FastGaussianShapeAlignment.genForAlignedShapeCenters | ( | ) |
Tells whether element-/color-center starts are generated for centers of the aligned shape.
True if aligned-shape centers are considered, and False otherwise. | None CDPL.Shape.FastGaussianShapeAlignment.genForReferenceShapeCenters | ( | bool | generate | ) |
Specifies whether element-/color-center starts shall be generated for centers of the reference shape.
| generate | True to consider reference-shape centers, and False to ignore them. |
| bool CDPL.Shape.FastGaussianShapeAlignment.genForReferenceShapeCenters | ( | ) |
Tells whether element-/color-center starts are generated for centers of the reference shape.
True if reference-shape centers are considered, and False otherwise. | None CDPL.Shape.FastGaussianShapeAlignment.genForLargerShapeCenters | ( | bool | generate | ) |
Specifies whether element-/color-center starts shall be generated for centers of the shape with more elements (instead of both shapes).
| generate | True to use only the centers of the larger shape, and False to use the centers of all configured shapes. |
| bool CDPL.Shape.FastGaussianShapeAlignment.genForLargerShapeCenters | ( | ) |
Tells whether element-/color-center starts are generated for centers of the shape with more elements (instead of both shapes).
True if only the centers of the larger shape are used, and False otherwise. | None CDPL.Shape.FastGaussianShapeAlignment.setMaxRandomTranslation | ( | float | max_trans | ) |
Sets the maximum random translation magnitude applied to random starts.
| max_trans | The new maximum random translation magnitude. |
| float CDPL.Shape.FastGaussianShapeAlignment.getMaxRandomTranslation | ( | ) |
Returns the currently configured maximum random translation.
| None CDPL.Shape.FastGaussianShapeAlignment.setNumRandomStarts | ( | int | num_starts | ) |
Sets the number of random starting transformations.
| num_starts | The new number of random starts. |
| int CDPL.Shape.FastGaussianShapeAlignment.getNumRandomStarts | ( | ) |
Returns the currently configured number of random starts.
| None CDPL.Shape.FastGaussianShapeAlignment.setRandomSeed | ( | int | seed | ) |
Sets the seed used by the random number generator that produces the random starts.
| seed | The new random seed. |
| None CDPL.Shape.FastGaussianShapeAlignment.addReferenceShape | ( | 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. |
| None CDPL.Shape.FastGaussianShapeAlignment.addReferenceShapes | ( | 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. |
| int CDPL.Shape.FastGaussianShapeAlignment.getNumReferenceShapes | ( | ) |
Returns the total number of reference shapes.
| bool CDPL.Shape.FastGaussianShapeAlignment.align | ( | 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.FastGaussianShapeAlignment.align | ( | 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. | int CDPL.Shape.FastGaussianShapeAlignment.getNumResults | ( | ) |
Returns the number of stored alignment results.
| AlignmentResult CDPL.Shape.FastGaussianShapeAlignment.getResult | ( | int | 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]. |
| int CDPL.Shape.FastGaussianShapeAlignment.__len__ | ( | ) |
| AlignmentResult CDPL.Shape.FastGaussianShapeAlignment.__getitem__ | ( | int | idx | ) |
| idx |