Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes

QTCluster Class Reference
[Datastructures]

A representation of a QT cluster used for feature grouping. More...

#include <OpenMS/DATASTRUCTURES/QTCluster.h>

List of all members.

Public Member Functions

 QTCluster (GridFeature *center_point, Size num_maps, DoubleReal max_distance, bool use_IDs)
 Detailed constructor.
virtual ~QTCluster ()
 Destructor.
DoubleReal getCenterRT () const
 Returns the RT value of the cluster.
DoubleReal getCenterMZ () const
 Returns the m/z value of the cluster center.
Size size () const
 Returns the size of the cluster (number of elements, incl. center).
bool operator< (QTCluster &cluster)
 Compare by quality.
void add (GridFeature *element, DoubleReal distance)
 Adds a new element/neighbor to the cluster.
void getElements (std::map< Size, GridFeature * > &elements)
 Gets the clustered elements.
bool update (const std::map< Size, GridFeature * > &removed)
 Updates the cluster after data points were removed.
DoubleReal getQuality ()
 Returns the cluster quality.
const std::set< AASequence > & getAnnotations ()
 Return the set of peptide sequences annotated to the cluster center.

Private Types

typedef std::map< Size,
std::multimap< DoubleReal,
GridFeature * > > 
NeighborMap
 Mapping: input map -> distance to center -> neighboring point.

Private Member Functions

 QTCluster ()
 Base constructor (not accessible).
void computeQuality_ ()
 Computes the quality of the cluster.
DoubleReal optimizeAnnotations_ ()
 Finds the optimal annotation (peptide sequences) for the cluster.

Private Attributes

GridFeaturecenter_point_
 Pointer to the cluster center.
NeighborMap neighbors_
 Neighbors of the cluster center, sorted by distance, for different input maps.
DoubleReal max_distance_
 Maximum distance of a point that can still belong to the cluster.
Size num_maps_
 Number of input maps.
DoubleReal quality_
 Quality of the cluster.
bool changed_
 Has the cluster changed (if yes, quality needs to be recomputed)?
bool use_IDs_
 Keep track of peptide IDs and use them for matching?
std::set< AASequenceannotations_
 Set of annotations of the cluster.

Detailed Description

A representation of a QT cluster used for feature grouping.

Ultimately, a cluster represents a group of corresponding features (or consensus features) from different input maps (feature maps or consensus maps).

Clusters are defined by their center points (one feature each). A cluster also stores a number of potential cluster elements (other features) from different input maps, together with their distances to the cluster center. Every feature that satisfies certain constraints with respect to the cluster center is a potential cluster element. However, since a feature group can only contain one feature from each input map, only the "best" (i.e. closest to the cluster center) such feature is considered a true cluster element.

The QT clustering algorithm has the characteristic of initially producing all possible, overlapping clusters. Iteratively, the best cluster is then extracted and the clustering is recomputed for the remaining points.

In our implementation, multiple rounds of clustering are not necessary. Instead, the clustering is updated in each iteration. This is the reason for storing all potential cluster elements: When a certain cluster is finalized, its elements have to be removed from the remaining clusters, and affected clusters change their composition. (Note that clusters can also be invalidated by this, if the cluster center is being removed.)

The quality of a cluster is the normalized average distance to the cluster center for present and missing cluster elements. The distance value for missing elements (if the cluster contains no feature from a certain input map) is the user-defined threshold that marks the maximum allowed radius of a cluster.

See also:
QTClusterFinder

Member Typedef Documentation

typedef std::map<Size, std::multimap<DoubleReal, GridFeature *> > NeighborMap [private]

Mapping: input map -> distance to center -> neighboring point.

Note:
There should never be an empty sub-map! (When a sub-map becomes empty, it should be removed from the overall map.)

Constructor & Destructor Documentation

QTCluster (  )  [private]

Base constructor (not accessible).

QTCluster ( GridFeature center_point,
Size  num_maps,
DoubleReal  max_distance,
bool  use_IDs 
)

Detailed constructor.

Parameters:
center_point Pointer to the center point
num_maps Number of input maps
max_distance Maximum allowed distance of two points
use_IDs Use peptide annotations?
virtual ~QTCluster (  )  [virtual]

Destructor.


Member Function Documentation

void add ( GridFeature element,
DoubleReal  distance 
)

Adds a new element/neighbor to the cluster.

Note:
There is no check whether the element/neighbor already exists in the cluster!
Parameters:
element The element to be added
distance Distance of the element to the center point
void computeQuality_ (  )  [private]

Computes the quality of the cluster.

const std::set<AASequence>& getAnnotations (  ) 

Return the set of peptide sequences annotated to the cluster center.

DoubleReal getCenterMZ (  )  const

Returns the m/z value of the cluster center.

DoubleReal getCenterRT (  )  const

Returns the RT value of the cluster.

void getElements ( std::map< Size, GridFeature * > &  elements  ) 

Gets the clustered elements.

DoubleReal getQuality (  ) 

Returns the cluster quality.

bool operator< ( QTCluster cluster  ) 

Compare by quality.

DoubleReal optimizeAnnotations_ (  )  [private]

Finds the optimal annotation (peptide sequences) for the cluster.

The optimal annotation is the one that results in the best quality. It is stored in annotations_;

Returns:
The total distance between cluster elements and the center.
Size size (  )  const

Returns the size of the cluster (number of elements, incl. center).

bool update ( const std::map< Size, GridFeature * > &  removed  ) 

Updates the cluster after data points were removed.

Returns:
Whether the cluster is still valid (it's not if the cluster center is among the removed points).

Member Data Documentation

std::set<AASequence> annotations_ [private]

Set of annotations of the cluster.

The set of peptide sequences that is compatible to the cluster center and results in the best cluster quality.

Pointer to the cluster center.

bool changed_ [private]

Has the cluster changed (if yes, quality needs to be recomputed)?

Maximum distance of a point that can still belong to the cluster.

Neighbors of the cluster center, sorted by distance, for different input maps.

The first (best) point in each sub-map is considered a cluster element.

Size num_maps_ [private]

Number of input maps.

DoubleReal quality_ [private]

Quality of the cluster.

bool use_IDs_ [private]

Keep track of peptide IDs and use them for matching?


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:53 using doxygen 1.7.1