Chemical Data Processing Library Python API - Version 1.2.0
Public Member Functions | Properties | List of all members
CDPL.Pharm.InteractionAnalyzer Class Reference

InteractionAnalyzer. 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)
 

Detailed Description

InteractionAnalyzer.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Pharm.InteractionAnalyzer.__init__ ( InteractionAnalyzer  analyzer)

Initializes a copy of the InteractionAnalyzer instance analyzer.

Parameters
analyzerThe InteractionAnalyzer instance to copy.

Member Function Documentation

◆ 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
type1An identifier for the type of the first feature.
type2An identifier for the type of the second feature.
funcThe 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
type1An identifier for the type of the first feature.
type2An 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
type1An identifier for the type of the first feature.
type2An identifier for the type of the second feature.
Returns
The registered constraint check function.

◆ assign()

InteractionAnalyzer CDPL.Pharm.InteractionAnalyzer.assign ( InteractionAnalyzer  analyzer)

Replaces the current state of self with a copy of the state of the InteractionAnalyzer instance analyzer.

Parameters
analyzerThe InteractionAnalyzer instance to copy.
Returns
self

◆ analyze()

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!).

Parameters
cntnr1The first feature container.
cntnr2The second feature container.
iactionsAn output map that contains features of cntnr1 as keys and interacting features of cntnr2 as values.
appendIf False, iactions gets cleared before adding any feature mappings.