![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
Analyzer that detects pairwise interactions between features of two Pharm.FeatureContainer instances based on user-registered per-feature-type-pair interaction constraint functions. More...
Inheritance diagram for CDPL.Pharm.InteractionAnalyzer:Public Member Functions | |
| None | __init__ () |
Constructs the InteractionAnalyzer instance. | |
| None | __init__ (InteractionAnalyzer analyzer) |
Initializes a copy of the InteractionAnalyzer instance analyzer. More... | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
| None | setConstraintFunction (int type1, int type2, BoolFeature2Functor func) |
| Specifies a function that gets used for checking whether all constraints are actually fulfilled for an interaction between a pair of features of the specified types. More... | |
| None | removeConstraintFunction (int type1, int type2) |
| Removes the constraint check function that was registered for the specified pair of feature types. More... | |
| BoolFeature2Functor | getConstraintFunction (int type1, int type2) |
| Returns the constraint check function that was registered for the specified pair of feature types. More... | |
| InteractionAnalyzer | assign (InteractionAnalyzer analyzer) |
Replaces the current state of self with a copy of the state of the InteractionAnalyzer instance analyzer. More... | |
| None | analyze (FeatureContainer cntnr1, FeatureContainer cntnr2, FeatureMapping iactions, bool append=False) |
| Analyzes possible interactions of the features in feature container cntnr1 and with features of cntnr2 according to the registered constraint functions. More... | |
Properties | |
| objectID = property(getObjectID) | |
Analyzer that detects pairwise interactions between features of two Pharm.FeatureContainer instances based on user-registered per-feature-type-pair interaction constraint functions.
A typical use case is the analysis of ligand ↔ target pharmacophore interactions: register one constraint function per (ligand feature type, target feature type) pair, then call analyze() to obtain a Pharm.FeatureMapping with the detected interactions.
| None CDPL.Pharm.InteractionAnalyzer.__init__ | ( | InteractionAnalyzer | analyzer | ) |
Initializes a copy of the InteractionAnalyzer instance analyzer.
| analyzer | The InteractionAnalyzer instance to copy. |
| int CDPL.Pharm.InteractionAnalyzer.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python InteractionAnalyzer 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 InteractionAnalyzer 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.Pharm.InteractionAnalyzer.setConstraintFunction | ( | int | type1, |
| int | type2, | ||
| BoolFeature2Functor | func | ||
| ) |
Specifies a function that gets used for checking whether all constraints are actually fulfilled for an interaction between a pair of features of the specified types.
| type1 | An identifier for the type of the first feature. |
| type2 | An identifier for the type of the second feature. |
| func | The constraint check function. |
| None CDPL.Pharm.InteractionAnalyzer.removeConstraintFunction | ( | int | type1, |
| int | type2 | ||
| ) |
Removes the constraint check function that was registered for the specified pair of feature types.
| type1 | An identifier for the type of the first feature. |
| type2 | An identifier for the type of the second feature. |
| BoolFeature2Functor CDPL.Pharm.InteractionAnalyzer.getConstraintFunction | ( | int | type1, |
| int | type2 | ||
| ) |
Returns the constraint check function that was registered for the specified pair of feature types.
| type1 | An identifier for the type of the first feature. |
| type2 | An identifier for the type of the second feature. |
| InteractionAnalyzer CDPL.Pharm.InteractionAnalyzer.assign | ( | InteractionAnalyzer | analyzer | ) |
Replaces the current state of self with a copy of the state of the InteractionAnalyzer instance analyzer.
| analyzer | The InteractionAnalyzer instance to copy. |
| None CDPL.Pharm.InteractionAnalyzer.analyze | ( | FeatureContainer | cntnr1, |
| FeatureContainer | cntnr2, | ||
| FeatureMapping | iactions, | ||
| bool | append = False |
||
| ) |
Analyzes possible interactions of the features in feature container cntnr1 and with features of cntnr2 according to the registered constraint functions.
For every pairwise combination of the features in the first feature container cntnr1 with the features in the second feature container cntnr1 a lookup for a registered interaction constraint function using the respective feature types is performed. If no function for the corresponding type pair was registered, the pair of features is assumed to be incompatible and that no interaction between them can ever occur. Note that a function that was registered for the type pair [typeA, typeB] does not automatically get called for the reverse pair [typeB, typeA]! If, however, a function was found, it gets called with the current feature instance of the first feature container as the first argument and the feature instance of the second feature container as the second argument. If the constraint function evaluates to True, a corresponding mapping of the first to the second feature object is inserted in the specified output map iactions (be aware that a mapping of the second to the first feature is not added automatically!).
| cntnr1 | The first feature container. |
| cntnr2 | The second feature container. |
| iactions | An output map that contains features of cntnr1 as keys and interacting features of cntnr2 as values. |
| append | If False, iactions gets cleared before adding any feature mappings. |