InteractionAnalyzer.
More...
◆ __init__()
Initializes a copy of the InteractionAnalyzer instance analyzer.
- Parameters
-
analyzer | The InteractionAnalyzer instance to copy. |
◆ getObjectID()
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()
.
- Returns
- The numeric ID of the internally referenced C++ class instance.
◆ setConstraintFunction()
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.
- Parameters
-
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. |
◆ removeConstraintFunction()
None CDPL.Pharm.InteractionAnalyzer.removeConstraintFunction |
( |
int |
type1, |
|
|
int |
type2 |
|
) |
| |
Removes the constraint check function that was registered for the specified pair of feature types.
- Parameters
-
type1 | An identifier for the type of the first feature. |
type2 | An identifier for the type of the second feature. |
◆ getConstraintFunction()
BoolFeature2Functor CDPL.Pharm.InteractionAnalyzer.getConstraintFunction |
( |
int |
type1, |
|
|
int |
type2 |
|
) |
| |
Returns the constraint check function that was registered for the specified pair of feature types.
- Parameters
-
type1 | An identifier for the type of the first feature. |
type2 | An identifier for the type of the second feature. |
- Returns
- The registered constraint check function.
◆ assign()
Replaces the current state of self with a copy of the state of the InteractionAnalyzer instance analyzer.
- Parameters
-
analyzer | The InteractionAnalyzer instance to copy. |
- Returns
- self
◆ analyze()
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!).
- Parameters
-
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. |