clr_lite: Impute zeroes and perform a centered log-ratio (CLR)...

View source: R/clr_lite.R

clr_liteR Documentation

Impute zeroes and perform a centered log-ratio (CLR) transformation

Description

Microbiome data is compositional. When compositional data is examined using non-compositional methods, many problems arise. Performing a centered log-ratio transformation is a reasonable way to address these problems reasonably well.

A major problem with this approach is that microbiome data typically contains lots of zeroes and the logarithm of zero is undefined. Here, we implemented a few methods discussed by Lubbe et al. 2021 to replace zeroes with non-zero values in such a way that the structure of the data remains reasonably well preserved.

Some of these methods (namely 'logunif' and 'runif') involve imputing small values between 0 and the lowest non-zero value in the dataset. For these methods, we have implemented a resampling approach in order to stabilize the inter-run variability. See method for more information.

Usage

clr_lite(counts, samples_are = "cols", method = "logunif", replicates = 1000)

clr_c(counts, samples_are = "cols")

clr_unif(counts, samples_are = "cols", replicates = 1000)

clr_logunif(counts, samples_are = "cols", replicates = 1000)

Arguments

counts

A compositional count table.

samples_are

Either "cols" or "rows". Default is "cols". Denotes whether the columns or rows depict individual samples.

method

The method for zero imputation. One of "logunif", "unif" or "const". 'logunif' samples small numbers from a log-uniform distribution, whereas 'unif' samples from a uniform one. On the other hand, "const" simply replaces zeroes with 0.65 * [the lowest value].

replicates

An integer. For the two random sampling methods, if this is larger than 1, every zero will be imputed that many times. The median of the CLR of all those replicates will be returned. If method is set to "const", replicates will be automatically set to 1 as no random numbers are generated.

Value

A CLR-transformed count table.

Functions

clr_c: A wrapper for clr_lite(counts, method = "const", replicates = 1).

clr_unif: A wrapper for clr_lite(counts, method = "unif").

clr_logunif: A wrapper for clr_lite(counts, method = "logunif").

References

Sugnet Lubbe, Peter Filzmoser, Matthias Templ (2021) Comparison of zero replacement strategies for compositional data with large numbers of zeros. doi:https://doi.org/10.1016/j.chemolab.2021.104248


thomazbastiaanssen/Volatility documentation built on July 13, 2024, 9:09 a.m.