OpenMS
Loading...
Searching...
No Matches
ConsensusMapNormalizerAlgorithmQuantile Class Reference

Quantile-normalisation of feature intensities across the maps of a ConsensusMap. More...

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

Public Member Functions

 ConsensusMapNormalizerAlgorithmQuantile ()
 Default constructor.
 
virtual ~ConsensusMapNormalizerAlgorithmQuantile ()
 Destructor.
 

Static Public Member Functions

static void normalizeMaps (ConsensusMap &map)
 Quantile-normalise the feature intensities of map in place.
 
static void resample (const std::vector< double > &data_in, std::vector< double > &data_out, UInt n_resampling_points)
 Linearly resample data_in to n_resampling_points evenly-spaced positions.
 
static void extractIntensityVectors (const ConsensusMap &map, std::vector< std::vector< double > > &out_intensities)
 Collect the feature-handle intensities of map into one vector per source map.
 
static void setNormalizedIntensityValues (const std::vector< std::vector< double > > &feature_ints, ConsensusMap &map)
 Push the per-map intensity vectors back into the corresponding feature handles.
 

Private Member Functions

 ConsensusMapNormalizerAlgorithmQuantile (const ConsensusMapNormalizerAlgorithmQuantile &copyin)
 Copy construction is deliberately suppressed.
 
ConsensusMapNormalizerAlgorithmQuantileoperator= (const ConsensusMapNormalizerAlgorithmQuantile &rhs)
 Assignment is deliberately suppressed.
 

Detailed Description

Quantile-normalisation of feature intensities across the maps of a ConsensusMap.

Stateless utility class. normalizeMaps rescales every map's sorted intensity distribution to a shared reference distribution derived from the average of the per-map quantiles, so that all maps end up sharing the same intensity distribution while their internal intensity ranks are preserved.

Copy construction and assignment are deliberately suppressed.

Constructor & Destructor Documentation

◆ ConsensusMapNormalizerAlgorithmQuantile() [1/2]

Copy construction is deliberately suppressed.

◆ ConsensusMapNormalizerAlgorithmQuantile() [2/2]

Default constructor.

◆ ~ConsensusMapNormalizerAlgorithmQuantile()

Destructor.

Member Function Documentation

◆ extractIntensityVectors()

static void extractIntensityVectors ( const ConsensusMap map,
std::vector< std::vector< double > > &  out_intensities 
)
static

Collect the feature-handle intensities of map into one vector per source map.

out_intensities is cleared and resized to the number of column-header entries; the per-map row receives the intensities of every feature handle whose map_index points at it (in the iteration order of the consensus features).

Parameters
[in]mapSource ConsensusMap.
[out]out_intensitiesPer-map intensity vectors; index j contains the intensities of all feature handles whose map-index is j.
Exceptions
Exception::ElementNotFoundwhen the column-header lookup for one of the expected map indices fails.

◆ normalizeMaps()

static void normalizeMaps ( ConsensusMap map)
static

Quantile-normalise the feature intensities of map in place.

Builds a reference intensity distribution by sorting each map's feature intensities, resampling each sorted distribution to a common length (the size of the largest map), and averaging the resampled distributions per quantile. The intensities are then written back to the consensus features rank-preservingly: the feature with the k -th smallest intensity in map j gets the k -th smallest value of the resampled reference distribution for map j (after a second resampling step that shrinks the reference back to map j 's original length).

Parameters
[in,out]mapConsensus map whose feature-handle intensities are rewritten in place. Per-map column-header indices 0 ... N-1 must each be present (extractIntensityVectors throws otherwise).
Exceptions
Exception::ElementNotFoundwhen a column-header index in 0 ... N-1 is missing from map (propagated from extractIntensityVectors).

◆ operator=()

Assignment is deliberately suppressed.

◆ resample()

static void resample ( const std::vector< double > &  data_in,
std::vector< double > &  data_out,
UInt  n_resampling_points 
)
static

Linearly resample data_in to n_resampling_points evenly-spaced positions.

The output is cleared, resized to n_resampling_points and filled by linear interpolation between consecutive data_in entries:

  • data_out.front() takes data_in.front() and data_out.back() takes data_in.back().
  • Intermediate positions are interpolated between the two neighbouring source entries.
  • When n_resampling_points is 0 the output is just cleared and the function returns.
Parameters
[in]data_inSource vector; assumed sorted by the caller (normalizeMaps sorts before calling).
[out]data_outDestination vector; cleared and resized.
[in]n_resampling_pointsNumber of points to produce.

◆ setNormalizedIntensityValues()

static void setNormalizedIntensityValues ( const std::vector< std::vector< double > > &  feature_ints,
ConsensusMap map 
)
static

Push the per-map intensity vectors back into the corresponding feature handles.

Iterates the consensus features of map in the same order as extractIntensityVectors and writes feature_ints[map_index][k] into the k -th feature handle of that map index. The caller is responsible for keeping feature_ints in lock-step with the iteration order used by extractIntensityVectorsnormalizeMaps does this by mutating the same per-map vector in place.

Parameters
[in]feature_intsPer-map intensity vectors (same shape as the output of extractIntensityVectors).
[in,out]mapConsensus map whose feature-handle intensities are updated in place.