A variant of QT clustering for the detection of feature groups. More...
#include <OpenMS/ANALYSIS/MAPMATCHING/QTClusterFinder.h>
Public Member Functions | |
QTClusterFinder () | |
Constructor. More... | |
virtual | ~QTClusterFinder () |
Destructor. More... | |
void | run (const std::vector< ConsensusMap > &input_maps, ConsensusMap &result_map) |
Runs the algorithm on consensus maps. More... | |
void | run (const std::vector< FeatureMap > &input_maps, ConsensusMap &result_map) |
Runs the algorithm on feature maps. More... | |
![]() | |
BaseGroupFinder () | |
Default constructor. More... | |
virtual | ~BaseGroupFinder () |
Destructor. More... | |
![]() | |
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 ¶m) |
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... | |
![]() | |
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... | |
Static Public Member Functions | |
static const String | getProductName () |
Returns the name of the product. More... | |
static BaseGroupFinder * | create () |
Returns an instance of this class. More... | |
![]() | |
static void | registerChildren () |
Register all derived classes here. More... | |
Protected Types | |
enum | { RT = Peak2D::RT, MZ = Peak2D::MZ } |
Private Types | |
typedef OpenMSBoost::unordered_map< std::pair< GridFeature *, GridFeature * >, double > | PairDistances |
Distances between pairs of grid features. More... | |
typedef HashGrid< GridFeature * > | Grid |
Private Member Functions | |
double | getDistance_ (GridFeature *left, GridFeature *right) |
Calculates the distance between two grid features. More... | |
bool | compatibleIDs_ (QTCluster &cluster, const GridFeature *neighbor) |
Checks whether the peptide IDs of a cluster and a neighboring feature are compatible. More... | |
void | setParameters_ (double max_intensity, double max_mz) |
Sets algorithm parameters. More... | |
void | makeConsensusFeature_ (std::list< QTCluster > &clustering, ConsensusFeature &feature, OpenMSBoost::unordered_map< GridFeature *, std::vector< QTCluster * > > &element_mapping) |
Generates a consensus feature from the best cluster and updates the clustering. More... | |
void | computeClustering_ (Grid &grid, std::list< QTCluster > &clustering) |
Computes an initial QT clustering of the points in the hash grid. More... | |
template<typename MapType > | |
void | run_ (const std::vector< MapType > &input_maps, ConsensusMap &result_map) |
Runs the algorithm on feature maps or consensus maps. More... | |
Private Attributes | |
Size | num_maps_ |
Number of input maps. More... | |
bool | use_IDs_ |
Consider peptide identifications for grouping? More... | |
double | max_diff_rt_ |
Maximum RT difference. More... | |
double | max_diff_mz_ |
Maximum m/z difference. More... | |
FeatureDistance | feature_distance_ |
Feature distance functor. More... | |
PairDistances | distances_ |
Distance map. More... | |
Additional Inherited Members | |
![]() | |
enum | LogType { CMD, GUI, NONE } |
Possible log types. More... | |
![]() | |
void | checkIds_ (const std::vector< ConsensusMap > &maps) const |
Checks if all file descriptions have disjoint map identifiers. More... | |
![]() | |
virtual void | updateMembers_ () |
This method is used to update extra member variables at the end of the setParameters() method. More... | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
![]() | |
static String | logTypeToFactoryName_ (LogType type) |
Return the name of the factory product used for this log type. More... | |
![]() | |
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... | |
![]() | |
LogType | type_ |
time_t | last_invoke_ |
ProgressLoggerImpl * | current_logger_ |
![]() | |
static int | recursion_depth_ |
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 |
|
private |
|
private |
Distances between pairs of grid features.
QTClusterFinder | ( | ) |
Constructor.
|
virtual |
Destructor.
|
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.
|
inlinestatic |
Returns an instance of this class.
|
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.
|
inlinestatic |
Returns the name of the product.
|
private |
Generates a consensus feature from the best cluster and updates the clustering.
|
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< FeatureMap > & | input_maps, |
ConsensusMap & | result_map | ||
) |
Runs the algorithm on feature maps.
Exception::IllegalArgument | is thrown if the input data is not valid. |
|
private |
Runs the algorithm on feature maps or consensus maps.
|
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.
|
private |
Feature distance functor.
|
private |
Maximum m/z difference.
|
private |
Maximum RT difference.
|
private |
Number of input maps.
|
private |
Consider peptide identifications for grouping?
OpenMS / TOPP release 2.0.0 | Documentation generated on Sat May 16 2015 16:14:03 using doxygen 1.8.9.1 |