Intensity normalisation of a ConsensusMap by averaging per-feature intensity ratios against a reference map.
A stateless utility class – computeCorrelation derives one scalar normalisation factor per map, and normalizeMaps applies those factors to every feature handle in the consensus map.
The reference map is the one with the most features (largest size in the column headers). For each other map, the ratio reference_intensity / map_intensity is computed per feature that is present in both maps, then averaged after dropping ratios that fall outside the configurable ratio_threshold window (see computeCorrelation).
Copy construction and assignment are deliberately suppressed.
| static std::vector< double > computeCorrelation |
( |
const ConsensusMap & |
map, |
|
|
const double & |
ratio_threshold, |
|
|
const std::string & |
acc_filter, |
|
|
const std::string & |
desc_filter |
|
) |
| |
|
static |
Compute one normalisation factor per map.
The reference map is the column-header entry with the largest size in map. For every other map j and every consensus feature that has a non-zero intensity in both the reference and j, the ratio reference_intensity / intensity_j is collected; ratios outside the window (ratio_threshold, 1/ratio_threshold) are discarded as outliers. The mean of the surviving ratios is returned as the factor for map j.
Features are first filtered by acc_filter (regex on protein accessions) and desc_filter (regex on protein descriptions); only features that pass both filters contribute to the ratios.
- Warning
- When no feature passes the filters for a given map (the surviving ratio list is empty), the function returns a vector of
1.0 of length number_of_maps and logs a warning – i.e. the result is "no normalisation".
- Parameters
-
| [in] | map | ConsensusMap providing the per-map feature handles. |
| [in] | ratio_threshold | Lower bound of the kept-ratio window. Use e.g. 0.5 to keep ratios in (0.5, 2.0). |
| [in] | acc_filter | Regex applied to accession strings; empty means "match anything". |
| [in] | desc_filter | Regex applied to description strings; empty means "match anything". |
- Returns
- One normalisation factor per map, in the order of the column headers (size equals
map.getColumnHeaders().size()). For maps numbered 0 ... N-1 entry j belongs to map index j; map indices need not be consecutive (e.g. after FileFilter -consensus:map).
- Exceptions
-