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

Algorithms of ConsensusMapNormalizer. More...

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

Public Types

enum  NormalizationMethod { NM_SCALE , NM_SHIFT }
 The NormalizationMethod enum Whether to scale to same median using division/multiplication or shift using subtraction/addition. More...
 

Public Member Functions

 ConsensusMapNormalizerAlgorithmMedian ()
 default constructor is not implemented -> private
 
virtual ~ConsensusMapNormalizerAlgorithmMedian ()
 destructor is not implemented -> private
 

Static Public Member Functions

static void normalizeMaps (ConsensusMap &map, NormalizationMethod method, const std::string &acc_filter, const std::string &desc_filter)
 normalizes the maps of the consensusMap
 
static Size computeMedians (const ConsensusMap &map, std::vector< double > &medians, const std::string &acc_filter, const std::string &desc_filter)
 computes medians of all maps and returns index of map with most features
 
static bool passesFilters_ (ConsensusMap::ConstIterator cf_it, const ConsensusMap &map, const std::string &acc_filter, const std::string &desc_filter)
 returns whether consensus feature passes filters returns whether consensus feature cf_it in map passes accession regexp acc_filter and description regexp desc_filter
 
static std::map< UInt64, Size > mapPositions_ (const ConsensusMap &map)
 Position of every map index among the column headers of map (in map index order)
 
static Size mapPosition_ (const std::map< UInt64, Size > &positions, UInt64 map_index)
 Position of map_index in positions (from mapPositions_())
 

Private Member Functions

 ConsensusMapNormalizerAlgorithmMedian (const ConsensusMapNormalizerAlgorithmMedian &copyin)
 copy constructor is not implemented -> private
 
ConsensusMapNormalizerAlgorithmMedian & operator= (const ConsensusMapNormalizerAlgorithmMedian &rhs)
 assignment operator is not implemented -> private
 

Friends

class ConsensusMapNormalizerAlgorithmThreshold
 our friend can use our passesWhitelist_() method in order to avoid code duplication (without overdesigning this)
 

Detailed Description

Algorithms of ConsensusMapNormalizer.

Member Enumeration Documentation

◆ NormalizationMethod

The NormalizationMethod enum Whether to scale to same median using division/multiplication or shift using subtraction/addition.

Enumerator
NM_SCALE 
NM_SHIFT 

Constructor & Destructor Documentation

◆ ConsensusMapNormalizerAlgorithmMedian() [1/2]

copy constructor is not implemented -> private

◆ ConsensusMapNormalizerAlgorithmMedian() [2/2]

default constructor is not implemented -> private

◆ ~ConsensusMapNormalizerAlgorithmMedian()

destructor is not implemented -> private

Member Function Documentation

◆ computeMedians()

static Size computeMedians ( const ConsensusMap &  map,
std::vector< double > &  medians,
const std::string &  acc_filter,
const std::string &  desc_filter 
)
static

computes medians of all maps and returns index of map with most features

The maps are numbered by their position among the column headers (see mapPositions_()); for maps numbered 0 ... N-1 this is the map index.

Parameters
[in]mapConsensusMap
[out]mediansvector of medians to be filled, one per map (by position)
[in]acc_filterstring describing the regular expression for filtering accessions
[in]desc_filterstring describing the regular expression for filtering descriptions
Returns
position of the map with the largest number of features (ColumnHeader::size)
Exceptions
Exception::ElementNotFoundif a feature handle's map index has no column header

◆ mapPosition_()

static Size mapPosition_ ( const std::map< UInt64, Size > &  positions,
UInt64  map_index 
)
static

Position of map_index in positions (from mapPositions_())

Exceptions
Exception::ElementNotFoundif map_index has no column header

◆ mapPositions_()

static std::map< UInt64, Size > mapPositions_ ( const ConsensusMap &  map)
static

Position of every map index among the column headers of map (in map index order)

Map indices need not be consecutive: FileFilter keeps them when it extracts maps (-consensus:map). The per-map vectors of the normalization algorithms are therefore indexed by these positions. For maps numbered 0 ... N-1 the position is the map index.

Parameters
[in]mapconsensus map
Returns
map index -> position

◆ normalizeMaps()

static void normalizeMaps ( ConsensusMap &  map,
NormalizationMethod  method,
const std::string &  acc_filter,
const std::string &  desc_filter 
)
static

normalizes the maps of the consensusMap

Parameters
[in]mapConsensusMap
[in]methodwhether to use scaling or shifting to same median
[in]acc_filterstring describing the regular expression for filtering accessions
[in]desc_filterstring describing the regular expression for filtering descriptions

◆ operator=()

assignment operator is not implemented -> private

◆ passesFilters_()

static bool passesFilters_ ( ConsensusMap::ConstIterator  cf_it,
const ConsensusMap &  map,
const std::string &  acc_filter,
const std::string &  desc_filter 
)
static

returns whether consensus feature passes filters returns whether consensus feature cf_it in map passes accession regexp acc_filter and description regexp desc_filter

Parameters
[in]cf_itconsensus feature
[in]mapconsensus map
[in]acc_filterstring describing the regular expression for filtering accessions
[in]desc_filterstring describing the regular expression for filtering descriptions

Friends And Related Symbol Documentation

◆ ConsensusMapNormalizerAlgorithmThreshold

our friend can use our passesWhitelist_() method in order to avoid code duplication (without overdesigning this)