normalizeAssay: Normalize a data sets (reduce technical sample effects)

View source: R/tab_values.R

normalizeAssayR Documentation

Normalize a data sets (reduce technical sample effects)

Description

The function normalizeAssay performs normalization by sum of the (count/intensity) values per sample (method = "sum"), quantile division per sample (method = "quantile division"), or by quantile normalization (adjusting the value distributions that they become identical in statistical properties, method = "quantile"). The value for quantile division (e.g., the 75 specified by the probs argument. Quantile normalization is performed by using the normalizeQuantiles function from limma.

For the methods "sum" and "quantile division", normalization will be done depending on the multiplyByNormalizationValue parameter. If set to TRUE, normalization values (e.g. sum or quantile) will be calculated per sample. In a next step, adjusted normalization values will be calculated for each sample in relation to the median normalization values across all samples. Finally, the values in a are multiplied by these adjusted normalization values. If multiplyByNormalizationValue is set to FALSE, normalization values (e.g. sum or quantile) will be calculated per sample. The values in a are sample-wise divided by the normalization values.

Usage

normalizeAssay(
  a,
  method = c("none", "sum", "quantile division", "quantile"),
  probs = 0.75,
  multiplyByNormalizationValue = FALSE
)

Arguments

a

matrix with samples in columns and features in rows

method

character, one of "none", "sum", "quantile division", "quantile"

probs

numeric, ranging between [0, 1). probs is used as the divisor for quantile division in method = "quantile division"

multiplyByNormalizationValue

logical, if TRUE, normalization values will be calculated and the values in a will be multiplied by the values The parameter is only relavant for method = "sum" and method = "quantile division"

Details

Internal usage in shinyQC. If method is set to "none", the object x is returned as is (pass-through).

If probs is NULL, probs is internally set to 0.75 if method = "quantile division".

Depending on the values in a, if multiplyByNormalizationValue is set to TRUE the returned normalized values will be in the same order of magnitude than the original values, while if FALSE, the returned values will be in a smaller order of magnitude.

Value

matrix

Examples

a <- matrix(seq_len(100), nrow = 10, ncol = 10, 
        dimnames = list(seq_len(10), paste("sample", seq_len(10))))
normalizeAssay(a, "sum")


tnaake/MatrixQCvis documentation built on June 20, 2024, 7:22 a.m.