| OpenMS 2.5.0

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SimplePairFinder Class Reference
Analysis » FeatureGrouping

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

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

Inheritance diagram for SimplePairFinder:

## 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 DefaultParamHandler & | operator= (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 Param & | getParameters () const
| Non-mutable access to the parameters. More...
const Param & | getDefaults () const
| Non-mutable access to the default parameters. More...
const String & | getName () 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...
ProgressLogger & | operator= (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 BaseGroupFinder * | create ()
| 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< String > | subsections_
| 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_
ProgressLoggerImpl * | current_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 and be the absolute values of the RT and MZ differences in the data. Then the similarity value is

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 . 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:

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

Name | Type | Default | Restrictions | Description
--- | --- | --- | --- | ---
similarity:pair_min_quality | float | 0.01 |  | Minimum required pair quality.
similarity:diff_intercept:RT | float | 1.0 |  | This parameter controls the asymptotic decay rate for large differences (for more details see the similarity measurement).
similarity:diff_intercept:MZ | float | 0.1 |  | This parameter controls the asymptotic decay rate for large differences (for more details see the similarity measurement).
similarity:diff_exponent:RT | float | 2.0 |  | This parameter is important for small differences (for more details see the similarity measurement).
similarity:diff_exponent:MZ | float | 1.0 |  | This parameter is important for small differences (for more details see the similarity measurement).

Note:

- If a section name is documented, the documentation is displayed as tooltip.
- Advanced parameter names are italic.

## Member Typedef Documentation

## ◆ Base

typedef BaseGroupFinder Base

Base class.

## Constructor & Destructor Documentation

## ◆ SimplePairFinder()

SimplePairFinder | ( |  | ) |

Constructor.

## ◆ ~SimplePairFinder()

~SimplePairFinder | ( |  | ) |

inline override

Destructor.

## Member Function Documentation

## ◆ create()

static BaseGroupFinder* create | ( |  | ) |

inline static

returns an instance of this class

## ◆ getProductName()

static const String getProductName | ( |  | ) |

inline static

returns the name of this module

## ◆ run()

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

override virtual

Run the algorithm.

Note
  Exactly two input maps must be provided.
  All two input maps must be provided.

Exceptions

  Exception::IllegalArgument | is 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_ | ( |  | ) |

override protected virtual

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.