OpenMS  2.4.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SimplePairFinder Class Reference

This class implements a simple point pair finding algorithm. More...

#include <OpenMS/ANALYSIS/MAPMATCHING/SimplePairFinder.h>

Inheritance diagram for SimplePairFinder:
BaseGroupFinder DefaultParamHandler ProgressLogger

Public Types

typedef BaseGroupFinder Base
 Base class. More...
 
- Public Types inherited from ProgressLogger
enum  LogType { CMD, GUI, NONE }
 Possible log types. More...
 

Public Member Functions

 SimplePairFinder ()
 Constructor. More...
 
 ~SimplePairFinder () override
 Destructor. More...
 
void run (const std::vector< ConsensusMap > &input_maps, ConsensusMap &result_map) override
 Run the algorithm. More...
 
- Public Member Functions inherited from BaseGroupFinder
 BaseGroupFinder ()
 Default constructor. More...
 
 ~BaseGroupFinder () override
 Destructor. More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
virtual DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
 ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress () const
 Ends the progress display. More...
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Static Public Member Functions

static BaseGroupFindercreate ()
 returns an instance of this class More...
 
static const String getProductName ()
 returns the name of this module More...
 
- Static Public Member Functions inherited from BaseGroupFinder
static void registerChildren ()
 Register all derived classes here. More...
 

Protected Member Functions

void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
double similarity_ (ConsensusFeature const &left, ConsensusFeature const &right) const
 Compute the similarity for a pair of elements. More...
 
- Protected Member Functions inherited from BaseGroupFinder
void checkIds_ (const std::vector< ConsensusMap > &maps) const
 Checks if all file descriptions have disjoint map identifiers. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

double diff_exponent_ [2]
 A parameter for similarity_(). More...
 
double diff_intercept_ [2]
 A parameter for similarity_(). More...
 
double pair_min_quality_
 Minimal pair quality. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 

Additional Inherited Members

- Static Protected Member Functions inherited from ProgressLogger
static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. More...
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

This class implements a simple point pair finding algorithm.

It offers a method to find element pairs across two element maps.

The similarity value should express our confidence that one element might possibly be matched to the other. Larger quality values are better, the maximal similarity is one. Let $\Delta_\textit{RT}$ and $\Delta_\textit{MZ}$ be the absolute values of the RT and MZ differences in the data. Then the similarity value is

\[ \frac{1}{ \big( 1 + \Delta_\textit{RT} \cdot \textit{diff\_intercept\_RT} \big)^\textit{diff\_exponent\_RT} \cdot \big( 1 + \Delta_\textit{MZ} \cdot \textit{diff\_intercept\_MZ} \big)^\textit{diff\_exponent\_MZ} } \]

Choosing diff_exponent: This parameter controls the growth rate of the penalty for differences. It is for example possible to search for pairs using the absolute distance in RT (which should not be very susceptible to outliers) and the squared distance in MZ (where small difference occur frequently, but large differences indicate a mismatch).

Choosing diff_intercept: Since we are taking the reciprocal value ("1/..."), we include an offset to avoid division by zero in case $\Delta=0$. To set this parameter, ask yourself: How much worse is a difference of 1 compared to no difference?

The following image illustrates the influence of these parameters:

SimplePairFinder.png
Influence of the parameters intercept and exponent
Parameters of this class are:

NameTypeDefaultRestrictionsDescription
similarity:pair_min_quality float0.01  Minimum required pair quality.
similarity:diff_intercept:RT float1  This parameter controls the asymptotic decay rate for large differences (for more details see the similarity measurement).
similarity:diff_intercept:MZ float0.1  This parameter controls the asymptotic decay rate for large differences (for more details see the similarity measurement).
similarity:diff_exponent:RT float2  This parameter is important for small differences (for more details see the similarity measurement).
similarity:diff_exponent:MZ float1  This parameter is important for small differences (for more details see the similarity measurement).

Note:

Member Typedef Documentation

◆ Base

Base class.

Constructor & Destructor Documentation

◆ SimplePairFinder()

Constructor.

◆ ~SimplePairFinder()

~SimplePairFinder ( )
inlineoverride

Destructor.

Member Function Documentation

◆ create()

static BaseGroupFinder* create ( )
inlinestatic

returns an instance of this class

◆ getProductName()

static const String getProductName ( )
inlinestatic

returns the name of this module

◆ run()

void run ( const std::vector< ConsensusMap > &  input_maps,
ConsensusMap result_map 
)
overridevirtual

Run the algorithm.

Note
Exactly two input maps must be provided.
All two input maps must be provided.
Exceptions
Exception::IllegalArgumentis thrown if the input data is not valid.

Implements BaseGroupFinder.

◆ similarity_()

double similarity_ ( ConsensusFeature const &  left,
ConsensusFeature const &  right 
) const
protected

Compute the similarity for a pair of elements.

◆ updateMembers_()

void updateMembers_ ( )
overrideprotectedvirtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ diff_exponent_

double diff_exponent_[2]
protected

A parameter for similarity_().

◆ diff_intercept_

double diff_intercept_[2]
protected

A parameter for similarity_().

◆ pair_min_quality_

double pair_min_quality_
protected

Minimal pair quality.