This class implements a pair finding algorithm for consensus features. More...
#include <OpenMS/ANALYSIS/MAPMATCHING/StablePairFinder.h>
Public Types | |
| typedef BaseGroupFinder | Base |
| Base class. | |
Public Member Functions | |
| StablePairFinder () | |
| Constructor. | |
| virtual | ~StablePairFinder () |
| Destructor. | |
| void | run (const std::vector< ConsensusMap > &input_maps, ConsensusMap &result_map) |
| Run the algorithm. | |
Static Public Member Functions | |
| static BaseGroupFinder * | create () |
| Returns an instance of this class. | |
| static const String | getProductName () |
| Returns the name of this module. | |
Protected Types | |
Internal helper classes and enums | |
| enum | { RT = Peak2D::RT, MZ = Peak2D::MZ } |
Protected Member Functions | |
| virtual void | updateMembers_ () |
| bool | compatibleIDs_ (const ConsensusFeature &feat1, const ConsensusFeature &feat2) const |
| Checks if the peptide IDs of two features are compatible. | |
| const AASequence & | getBestHitSequence_ (const PeptideIdentification &peptideIdentification) const |
| Returns the highest scoring peptide hit in the the given peptide identification. | |
Protected Attributes | |
| DoubleReal | second_nearest_gap_ |
| The distance to the second nearest neighbors must be by this factor larger than the distance to the matched element itself. | |
| bool | use_IDs_ |
| Only match if peptide IDs are compatible? | |
This class implements a pair finding algorithm for consensus features.
It offers a method to determine pairs across two consensus maps. The corresponding consensus features must be aligned, but may have small position deviations.
The distance measure is implemented in class FeatureDistance - see there for details.
Additional criteria for pairing
Depending on parameter use_identifications, peptide identifications annotated to the features may have to be compatible (i.e. no annotation or the same annotation) for a pairing to occur.
Stability criterion: The distance to the nearest neighbor must be smaller than the distance to the second-nearest neighbor by a certain factor, see parameter second_nearest_gap. There is a non-trivial relation between this parameter and the maximum allowed difference (in RT or m/z) of the distance measure: If second_nearest_gap is greater than one, lowering max_difference may in fact lead to more - rather than fewer - pairings, because it increases the distance difference between the nearest and the second-nearest neighbor, so that the constraint imposed by second_nearest_gap may be fulfilled more often.
Quality calculation
The quality of a pairing is computed from the distance between the paired elements (nearest neighbors) and the distances to the second-nearest neighbors of both elements, according to the formula:
is the quality of the pairing of elements i and j,
is the distance between the two,
and
are the distances to the second-nearest neighbors of i and j, respectively, and g is the factor defined by parameter second_nearest_gap.
Note that by the definition of the distance measure,
if i and j are to form a pair. The criteria for pairing further require that
and
. This ensures that the resulting quality is always between one (best) and zero (worst).
For the final quality q of the consensus feature produced by merging two paired elements (i and j), the existing quality values of the two elements are taken into account. The final quality is a weighted average of the existing qualities (
and
) and the quality of the pairing (
, see above):
The weighting factors
and
are the sizes (i.e. numbers of subelements) of the two consensus features i and j. That way, it is possible to link several feature maps to a growing consensus map in a stepwise fashion (as done by FeatureGroupingAlgorithmUnlabeled), and in the end obtain quality values that incorporate the qualities of all pairings that occurred during the generation of a consensus feature. Note that "missing" elements (if a consensus feature does not contain sub-features from all input maps) are not punished in this definition of quality.
| Name | Type | Default | Restrictions | Description |
|---|---|---|---|---|
| second_nearest_gap | float | 2 | min: 1 | The distance to the second nearest neighbors must be larger by this factor than the distance to the matching element itself. |
| 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 BaseGroupFinder Base |
Base class.
| StablePairFinder | ( | ) |
Constructor.
| virtual ~StablePairFinder | ( | ) | [inline, virtual] |
Destructor.
| bool compatibleIDs_ | ( | const ConsensusFeature & | feat1, | |
| const ConsensusFeature & | feat2 | |||
| ) | const [protected] |
Checks if the peptide IDs of two features are compatible.
A feature without identification is always compatible. Otherwise, two features are compatible if the best peptide hits of their identifications have the same sequences.
| static BaseGroupFinder* create | ( | ) | [inline, static] |
Returns an instance of this class.
| const AASequence& getBestHitSequence_ | ( | const PeptideIdentification & | peptideIdentification | ) | const [protected] |
Returns the highest scoring peptide hit in the the given peptide identification.
| peptideIdentification | The peptideIdentification to scan. |
| static const String getProductName | ( | ) | [inline, static] |
Returns the name of this module.
| void run | ( | const std::vector< ConsensusMap > & | input_maps, | |
| ConsensusMap & | result_map | |||
| ) | [virtual] |
Run the algorithm.
| Exception::IllegalArgument | is thrown if the input data is not valid. |
Implements BaseGroupFinder.
| virtual void updateMembers_ | ( | ) | [protected, virtual] |
DoubleReal second_nearest_gap_ [protected] |
The distance to the second nearest neighbors must be by this factor larger than the distance to the matched element itself.
bool use_IDs_ [protected] |
Only match if peptide IDs are compatible?
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:49 using doxygen 1.7.1 |