A variant of QT clustering for the detection of feature groups. More...
#include <OpenMS/ANALYSIS/MAPMATCHING/QTClusterFinder.h>
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 BaseGroupFinder * | create () |
| 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. | |
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:
distance_RT:max_difference and distance_MZ:max_difference), ignore_charge is set), use_identifications is set and both the feature and the cluster center are annotated with peptide identifications, the identifications have to match.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:
| Name | Type | Default | Restrictions | Description |
|---|---|---|---|---|
| use_identifications | string | false | true, false | Never link features that are annotated with different peptides (only the best hit per peptide identification is taken into account). |
| ignore_charge | string | false | true, false | Compare features normally even if their charge states are different |
| distance_RT:max_difference | float | 100 | min: 0 | Maximum allowed difference in RT in seconds |
| distance_RT:exponent | float | 1 | min: 0 | Normalized RT differences are raised to this power (using 1 or 2 will be fast, everything else is REALLY slow) |
| distance_RT:weight | float | 1 | min: 0 | RT distances are weighted by this factor |
| distance_MZ:max_difference | float | 0.3 | min: 0 | Maximum allowed difference in m/z (unit defined by 'unit') |
| distance_MZ:unit | string | Da | Da, ppm | Unit of the 'max_difference' parameter |
| distance_MZ:exponent | float | 2 | min: 0 | Normalized m/z differences are raised to this power (using 1 or 2 will be fast, everything else is REALLY slow) |
| distance_MZ:weight | float | 1 | min: 0 | m/z distances are weighted by this factor |
| distance_intensity:exponent | float | 1 | min: 0 | Differences in relative intensity are raised to this power (using 1 or 2 will be fast, everything else is REALLY slow) |
| distance_intensity:weight | float | 0 | min: 0 | Distances based on relative intensity are weighted by this factor |
typedef HashGrid<GridFeature *> Grid [private] |
typedef std::map<std::pair<GridFeature *, GridFeature *>, DoubleReal> PairDistances [private] |
Distances between pairs of grid features.
| QTClusterFinder | ( | ) |
Constructor.
| virtual ~QTClusterFinder | ( | ) | [virtual] |
Destructor.
| 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.
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.
| 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.
| 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.
PairDistances distances_ [private] |
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.
FeatureDistance feature_distance_ [private] |
Feature distance functor.
DoubleReal max_diff_mz_ [private] |
Maximum m/z difference.
DoubleReal max_diff_rt_ [private] |
Maximum RT difference.
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 |