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

Normalizes the maps of a consensus map by a per-map offset that may vary with retention time. More...

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

Classes

struct  Settings
 Settings of the normalization (all of them at least 1) More...
 

Static Public Member Functions

static std::vector< std::vector< double > > computeOffsets (const ConsensusMap &map, const Settings &settings, const std::string &acc_filter, const std::string &desc_filter)
 Computes the log2 offset of every feature handle.
 
static void normalizeMaps (ConsensusMap &map, const Settings &settings, const std::string &acc_filter, const std::string &desc_filter)
 Normalizes the maps of the consensus map: divides every feature handle's intensity by 2^offset.
 

Detailed Description

Normalizes the maps of a consensus map by a per-map offset that may vary with retention time.

Runs of one experiment differ in their overall loading, and their ion signal can also drift along the gradient (spray stability, source contamination). A single factor per map removes the first, not the second. This algorithm removes both: every map gets a log2 offset o(t) that is estimated locally in retention time from features quantified across the maps, and each intensity is divided by 2^o(t). The recipe follows the run normalisation of andes (bigbio/andes, quant::normalize).

  • Reference features are the consensus features with an intensity in at least min_maps maps that pass the accession and description filters. Their intensities in all maps are reference cells.
  • Backfitting. All offsets start at 0. Each of rounds rounds
    1. sets the level of every reference feature to the mean over its maps of log2(intensity) - o,
    2. computes the residual z = log2(intensity) - level of every reference cell, and
    3. sets the offset of every reference cell to the median residual of the neighbors reference cells of the same map before it and the neighbors after it in retention time; the cell's own residual is left out.
  • Other features (fewer maps, filtered out) take the median residual of the neighbors reference cells of the map on each side of their retention time.
  • A map with fewer than min_reference reference cells is not normalized. When fewer than two maps qualify, nothing is normalized.

The level of a feature is its mean over all of its maps, its own map included, so a map that drifts does not pull the offsets of the other maps. Because the level is the mean over the maps, the offsets of one feature average to roughly zero and the overall intensity scale is kept.

The retention time of a cell is the retention time of its feature handle. For maps that were aligned before linking, this is the aligned retention time; any retention time scale that is monotonic within a map gives the same result. The intensity of the consensus feature itself is left unchanged, as in ConsensusMapNormalizerAlgorithmMedian.


Class Documentation

◆ OpenMS::ConsensusMapNormalizerAlgorithmRTLocal::Settings

struct OpenMS::ConsensusMapNormalizerAlgorithmRTLocal::Settings

Settings of the normalization (all of them at least 1)

Class Members
Size min_maps = 3 a consensus feature is a reference feature with intensities in at least this many maps
Size min_reference = 20 maps with fewer reference cells are not normalized
Size neighbors = 50 reference cells on each side (in retention time) that estimate a cell's offset
Size rounds = 5 backfitting rounds

Member Function Documentation

◆ computeOffsets()

static std::vector< std::vector< double > > computeOffsets ( const ConsensusMap &  map,
const Settings &  settings,
const std::string &  acc_filter,
const std::string &  desc_filter 
)
static

Computes the log2 offset of every feature handle.

Parameters
[in]mapThe consensus map
[in]settingsSettings of the normalization
[in]acc_filterRegular expression the protein accessions of a reference feature must (partially) match; empty: no filter
[in]desc_filterRegular expression the protein descriptions of a reference feature must (partially) match; empty: no filter
Returns
One vector per consensus feature (in map order) with one offset per feature handle (in the order of ConsensusFeature::getFeatures()). Handles without a positive intensity get 0.

The map indices of the feature handles need not be consecutive (FileFilter keeps them when it extracts maps).

Exceptions
Exception::InvalidParameterif a setting is 0
Exception::ElementNotFoundif the map index of a feature handle with a positive intensity has no column header

◆ normalizeMaps()

static void normalizeMaps ( ConsensusMap &  map,
const Settings &  settings,
const std::string &  acc_filter,
const std::string &  desc_filter 
)
static

Normalizes the maps of the consensus map: divides every feature handle's intensity by 2^offset.

Parameters
[in,out]mapThe consensus map
[in]settingsSettings of the normalization
[in]acc_filterRegular expression the protein accessions of a reference feature must (partially) match; empty: no filter
[in]desc_filterRegular expression the protein descriptions of a reference feature must (partially) match; empty: no filter
Exceptions
Exception::InvalidParameterif a setting is 0
Exception::ElementNotFoundif the map index of a feature handle with a positive intensity has no column header