Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | List of all members
CDPL::Pharm::InteractionAnalyzer Class Reference

InteractionAnalyzer. More...

#include <InteractionAnalyzer.hpp>

+ Inheritance diagram for CDPL::Pharm::InteractionAnalyzer:

Public Types

typedef std::function< bool(const Feature &, const Feature &)> ConstraintFunction
 A generic wrapper class used to store feature interaction constraint test functions. More...
 

Public Member Functions

 InteractionAnalyzer ()
 Constructs the InteractionAnalyzer instance. More...
 
virtual ~InteractionAnalyzer ()
 Virtual destructor. More...
 
void setConstraintFunction (unsigned int type1, unsigned type2, const ConstraintFunction &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...
 
void removeConstraintFunction (unsigned int type1, unsigned type2)
 Removes the constraint check function that was registered for the specified pair of feature types. More...
 
const ConstraintFunctiongetConstraintFunction (unsigned int type1, unsigned type2) const
 Returns the constraint check function that was registered for the specified pair of feature types. More...
 
void analyze (const FeatureContainer &cntnr1, const FeatureContainer &cntnr2, FeatureMapping &iactions, bool append=false) const
 Analyzes possible interactions of the features in feature container cntnr1 and with features of cntnr2 according to the registered constraint functions. More...
 

Detailed Description

InteractionAnalyzer.

Member Typedef Documentation

◆ ConstraintFunction

A generic wrapper class used to store feature interaction constraint test functions.

Constructor & Destructor Documentation

◆ InteractionAnalyzer()

CDPL::Pharm::InteractionAnalyzer::InteractionAnalyzer ( )
inline

Constructs the InteractionAnalyzer instance.

◆ ~InteractionAnalyzer()

virtual CDPL::Pharm::InteractionAnalyzer::~InteractionAnalyzer ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ setConstraintFunction()

void CDPL::Pharm::InteractionAnalyzer::setConstraintFunction ( unsigned int  type1,
unsigned  type2,
const ConstraintFunction 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()

void CDPL::Pharm::InteractionAnalyzer::removeConstraintFunction ( unsigned int  type1,
unsigned  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()

const ConstraintFunction& CDPL::Pharm::InteractionAnalyzer::getConstraintFunction ( unsigned int  type1,
unsigned  type2 
) const

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.

◆ analyze()

void CDPL::Pharm::InteractionAnalyzer::analyze ( const FeatureContainer cntnr1,
const FeatureContainer cntnr2,
FeatureMapping iactions,
bool  append = false 
) const

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.

The documentation for this class was generated from the following file: