| OpenMS 2.5.0

Classes | Public Member Functions | Static Public Member Functions | List of all members
ClusterFunctor Class Referenceabstract
Analysis » Clustering

Base class for cluster functors. More...

`#include <OpenMS/COMPARISON/CLUSTERING/ClusterFunctor.h>`

Inheritance diagram for ClusterFunctor:

## Classes

class | InsufficientInput
| Exception thrown if not enough data (<2) is used. More...

## Public Member Functions

| ClusterFunctor ()
| default constructor More...
| ClusterFunctor (const ClusterFunctor &source)
| copy constructor More...
virtual | ~ClusterFunctor ()
| destructor More...
ClusterFunctor & | operator= (const ClusterFunctor &source)
| assignment operator More...
virtual void | operator() (DistanceMatrix< float > &original_distance, std::vector< BinaryTreeNode > &cluster_tree, const float threshold=1) const =0
| abstract for clustering the indices according to their respective element distances More...

## Static Public Member Functions

static void | registerChildren ()
| registers all derived products More...

## Detailed Description

Base class for cluster functors.

Each cluster functor employs a different method for stepwise merging clusters up to a given threshold, starting from the most elementary partition of data. Elements are represented by indices of a given distance matrix, which also should represent the order of input.

## Constructor & Destructor Documentation

## ◆ ClusterFunctor() [1/2]

ClusterFunctor | ( |  | ) |

default constructor

## ◆ ClusterFunctor() [2/2]

ClusterFunctor | ( | const ClusterFunctor & | source | ) |

copy constructor

## ◆ ~ClusterFunctor()

virtual ~ClusterFunctor | ( |  | ) |

virtual

destructor

## Member Function Documentation

## ◆ operator()()

virtual void operator() | ( | DistanceMatrix< float > & | original_distance,
|  | std::vector< BinaryTreeNode > & | cluster_tree,
|  | const float | threshold = `1`
| ) |  | const

pure virtual

abstract for clustering the indices according to their respective element distances

Parameters

  original_distance | DistanceMatrix<float> containing the distances of the elements to be clustered, will be changed during clustering process, make sure to have a copy or be able to redo
  cluster_tree | vector< BinaryTreeNode >, represents the clustering, each node contains the next merged clusters (not element indices) and their distance, strict order is kept: left_child < right_child,
  threshold | float value, the minimal distance from which on cluster merging is considered unrealistic. By default set to 1, i.e. complete clustering until only one cluster remains

`original_distance` is considered mirrored at the main diagonal, so only entries up the main diagonal are used. The `threshold` can be taken from the maximal distance of two elements considered related and adapted in a way corresponding to the employed clustering method. The results are represented by `cluster_tree`, to get the actual clustering (with element indices) from a certain step of the clustering

See also
  BinaryTreeNode , ClusterAnalyzer::cut

Implemented in AverageLinkage, CompleteLinkage, and SingleLinkage.

## ◆ operator=()

ClusterFunctor& operator= | ( | const ClusterFunctor & | source | ) |

assignment operator

## ◆ registerChildren()

static void registerChildren | ( |  | ) |

static

registers all derived products