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

QTClusterFinder Class Reference
[FeatureGrouping]

A variant of QT clustering for the detection of feature groups. More...

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

Inheritance diagram for QTClusterFinder:
BaseGroupFinder DefaultParamHandler ProgressLogger

List of all members.

Public Member Functions

 QTClusterFinder ()
 Constructor.
virtual ~QTClusterFinder ()
 Destructor.
void run (const std::vector< ConsensusMap > &input_maps, ConsensusMap &result_map)
 Runs the algorithm on consensus maps.
void run (const std::vector< FeatureMap<> > &input_maps, ConsensusMap &result_map)
 Runs the algorithm on feature maps.

Static Public Member Functions

static const String getProductName ()
 Returns the name of the product.
static BaseGroupFindercreate ()
 Returns an instance of this class.

Protected Types

enum  { RT = Peak2D::RT, MZ = Peak2D::MZ }

Private Types

typedef std::map< std::pair
< GridFeature *, GridFeature * >
, DoubleReal
PairDistances
 Distances between pairs of grid features.
typedef HashGrid< GridFeature * > Grid

Private Member Functions

DoubleReal getDistance_ (GridFeature *left, GridFeature *right)
 Calculates the distance between two grid features.
bool compatibleIDs_ (QTCluster &cluster, const GridFeature *neighbor)
 Checks whether the peptide IDs of a cluster and a neighboring feature are compatible.
void setParameters_ (DoubleReal max_intensity, DoubleReal max_mz)
 Sets algorithm parameters.
void makeConsensusFeature_ (std::list< QTCluster > &clustering, ConsensusFeature &feature)
 Generates a consensus feature from the best cluster and updates the clustering.
void computeClustering_ (Grid &grid, std::list< QTCluster > &clustering)
 Computes an initial QT clustering of the points in the hash grid.
template<typename MapType >
void run_ (const std::vector< MapType > &input_maps, ConsensusMap &result_map)
 Runs the algorithm on feature maps or consensus maps.

Private Attributes

Size num_maps_
 Number of input maps.
bool use_IDs_
 Consider peptide identifications for grouping?
DoubleReal max_diff_rt_
 Maximum RT difference.
DoubleReal max_diff_mz_
 Maximum m/z difference.
FeatureDistance feature_distance_
 Feature distance functor.
PairDistances distances_
 Distance map.

Detailed Description

A variant of QT clustering for the detection of feature groups.

The algorithm accumulates all features from all input maps, then applies a variant of QT clustering to find groups of corresponding features. In more detail, every feature from every input map is considered as a potential cluster center. For every center, its nearest neighbors from the other input maps are detected and added to the potential cluster. Iteratively, the cluster with the highest quality is extracted and the clustering is updated.

Properties affecting the grouping

To be included in a particular cluster, a feature has to fulfill the following conditions:

Every cluster contains at most one feature from each input map - namely the feature closest to the cluster center that meets the criteria and does not belong to a better cluster.

The notion of "closeness" for features is defined by the distance function implemented in FeatureDistance, the parameters of which can be set by the user.

The quality of a cluster is computed from the number of elements in it and their distances to the cluster center. For more details see QTCluster.

Optimization

This algorithm includes a number of optimizations to reduce run-time:

See also:
FeatureGroupingAlgorithmQT
Parameters of this class are:

NameTypeDefaultRestrictionsDescription
use_identifications stringfalse true, falseNever link features that are annotated with different peptides (only the best hit per peptide identification is taken into account).
ignore_charge stringfalse true, falseCompare features normally even if their charge states are different
distance_RT:max_difference float100 min: 0Maximum allowed difference in RT in seconds
distance_RT:exponent float1 min: 0Normalized RT differences are raised to this power (using 1 or 2 will be fast, everything else is REALLY slow)
distance_RT:weight float1 min: 0RT distances are weighted by this factor
distance_MZ:max_difference float0.3 min: 0Maximum allowed difference in m/z (unit defined by 'unit')
distance_MZ:unit stringDa Da, ppmUnit of the 'max_difference' parameter
distance_MZ:exponent float2 min: 0Normalized m/z differences are raised to this power (using 1 or 2 will be fast, everything else is REALLY slow)
distance_MZ:weight float1 min: 0m/z distances are weighted by this factor
distance_intensity:exponent float1 min: 0Differences in relative intensity are raised to this power (using 1 or 2 will be fast, everything else is REALLY slow)
distance_intensity:weight float0 min: 0Distances based on relative intensity are weighted by this factor

Note:

Member Typedef Documentation

typedef HashGrid<GridFeature *> Grid [private]
typedef std::map<std::pair<GridFeature *, GridFeature *>, DoubleReal> PairDistances [private]

Distances between pairs of grid features.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
RT 
MZ 

Constructor & Destructor Documentation

QTClusterFinder (  ) 

Constructor.

virtual ~QTClusterFinder (  )  [virtual]

Destructor.


Member Function Documentation

bool compatibleIDs_ ( QTCluster cluster,
const GridFeature neighbor 
) [private]

Checks whether the peptide IDs of a cluster and a neighboring feature are compatible.

A neighboring feature without identification is always compatible. Otherwise, the cluster and feature are compatible if the best peptide hits of each of their identifications have the same sequences.

void computeClustering_ ( Grid grid,
std::list< QTCluster > &  clustering 
) [private]

Computes an initial QT clustering of the points in the hash grid.

static BaseGroupFinder* create (  )  [inline, static]

Returns an instance of this class.

DoubleReal getDistance_ ( GridFeature left,
GridFeature right 
) [private]

Calculates the distance between two grid features.

The distance is looked up in the distance map and only computed (and stored) if it's not already available.

static const String getProductName (  )  [inline, static]

Returns the name of the product.

void makeConsensusFeature_ ( std::list< QTCluster > &  clustering,
ConsensusFeature feature 
) [private]

Generates a consensus feature from the best cluster and updates the clustering.

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

Runs the algorithm on feature maps.

Exceptions:
Exception::IllegalArgument is thrown if the input data is not valid.
void run ( const std::vector< ConsensusMap > &  input_maps,
ConsensusMap result_map 
) [virtual]

Runs the algorithm on consensus maps.

Exceptions:
Exception::IllegalArgument is thrown if the input data is not valid.

Implements BaseGroupFinder.

void run_ ( const std::vector< MapType > &  input_maps,
ConsensusMap result_map 
) [private]

Runs the algorithm on feature maps or consensus maps.

void setParameters_ ( DoubleReal  max_intensity,
DoubleReal  max_mz 
) [private]

Sets algorithm parameters.


Member Data Documentation

Distance map.

To compute it only once, the distance between two features is accessible by searching for a pair where the first position is the smaller pointer value.

Feature distance functor.

Maximum m/z difference.

Maximum RT difference.

Size num_maps_ [private]

Number of input maps.

bool use_IDs_ [private]

Consider peptide identifications for grouping?


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