rla: Calculate relative log abundances

View source: R/functions-utils.R

rlaR Documentation

Calculate relative log abundances

Description

rla calculates the relative log abundances (RLA, see reference) on a numeric vector.

Usage

rla(x, group, log.transform = TRUE)

rowRla(x, group, log.transform = TRUE)

Arguments

x

numeric (for rla) or matrix (for rowRla) with the abundances (in natural scale) on which the RLA should be calculated.

group

factor, numeric or character with the same length than x that groups values in x. If omitted all values are considered to be from the same group.

log.transform

logical(1) whether x should be log2 transformed. Set to log.transform = FALSE if x is already in log scale.

Details

The RLA is defines as the (log) abundance of an analyte relative to the median across all abundances of the same group.

Value

numeric of the same length than x (for rla) or matrix with the same dimensions than x (for rowRla).

Author(s)

Johannes Rainer

References

De Livera AM, Dias DA, De Souza D, Rupasinghe T, Pyke J, Tull D, Roessner U, McConville M, Speed TP. Normalizing and integrating metabolomics data. Anal Chem 2012 Dec 18;84(24):10768-76.

Examples


x <- c(3, 4, 5, 1, 2, 3, 7, 8, 9)

grp <- c(1, 1, 1, 2, 2, 2, 3, 3, 3)

rla(x, grp)

sneumann/xcms documentation built on Nov. 23, 2024, 6:53 p.m.