mbqnNRI: Selective mean/median-balanced quantile normalization

View source: R/mbqnNRI.R

mbqnNRIR Documentation

Selective mean/median-balanced quantile normalization

Description

Quantile normalization of a data matrix where rank invariant (RI)/nearly rank invariant (NRI) rows/features or other user-selected rows are normalized by the mean/median-balanced quantile normalization.

Usage

mbqnNRI(
  x,
  FUN = "mean",
  na.rm = TRUE,
  method = NULL,
  low_thr = 0.5,
  index = NULL,
  offsetmatrix = FALSE,
  verbose = TRUE
)

Arguments

x

a data matrix, where rows represent features, e.g. of protein abundance, and columns represent groups or samples, e.g. replicates, treatments, or conditions.

FUN

a function like mean, median (default), a user defined function, or a numeric vector of weights with length nrow(x) to balance each feature across samples. Functions can be parsed also as characters. If FUN = NULL, features are not balanced, i.e. normal QN is used.

na.rm

logical indicating to omit NAs in the computation of feature mean.

method

character specifying function for computation of quantile normalization; "limma" (default) for normalizeQuantiles() from the limma package or "preprocessCore" for normalize.quantiles() from the preprocessCore package.

low_thr

a value between [0 1]. Features with RI frequency >=low_thr are considered as NRI/RI; default 0.5.

index

an integer or a vector integers specifying the indices of selected rows.

offsetmatrix

logical indicating if offset matrix should be used instead of offset vector specifying offset for each row

verbose

logical indicating to print messages.

Details

Selected rows and/or rows with rank invariance frequency >=threshold are normalized with the mean/median-balanced quantile normalization. Remaining rows are quantile normalized without mean balancing.

Value

Normalized matrix.

Author(s)

Ariane Schad

References

Brombacher, E., Schad, A., Kreutz, C. (2020). Tail-Robust Quantile Normalization. BioRxiv.

See Also

mbqn(), mbqnGetNRIfeatures().

Examples

## Quantile normalize a data matrix where
## nearly rank invariant (NRI) features are balanced
X <- matrix(c(5,2,3,NA,4,1,4,2,3,4,6,NA,1,3,1),ncol=3)
mbqnNRI(X, median,low_thr = 0.5) # Balance NRI features selected by threshold
mbqnNRI(X, median, index = c(1,2)) # Balance selected features

arianeschad/mbqn documentation built on March 29, 2022, 6:56 p.m.