phyloseq_standardize_otu_abundance: Standardize OTU abundance table

View source: R/phyloseq_standardize_otu_abundance.R

phyloseq_standardize_otu_abundanceR Documentation

Standardize OTU abundance table

Description

Standardize phyloseq OTU table with with methods from decostand from vegan package.

Usage

phyloseq_standardize_otu_abundance(
  physeq,
  method = "total",
  rhea_depth = NULL,
  rhea_round = TRUE,
  rhea_threshold = NULL,
  ...
)

Arguments

physeq

A phyloseq-class object

method

Standardization method

...

Additional parameters may be passed to vegan decostand function

Details

Supported methods:

  • "total" - convert data to relative abundances (divide by sample total);

  • "pa" - convert OTU abundances to presence/absence scale (0/1);

  • "log" - logarithmic transformation as suggested by Anderson et al. (2006): log (x) + 1 for x > 0, zeros are left as zeros, logarithm base = 2. Please note this is not log(x+1);

  • "hellinger" - square root of method = "total" (Legendre & Gallagher 2001);

  • "max" - divide by sample maximum;

  • "frequency" - divide by sample total and multiply by the number of non-zero items, so that the average of non-zero entries is one;

  • "normalize" - make sample sum of squares equal to one;

  • "range" - standardize values into range 0 ... 1. If all values are constant, they will be transformed to 0;

  • "rank" - replace abundance values by their increasing ranks leaving zeros unchanged. Average ranks are used for tied values;

  • "rrank" - replace abundance values by relative ranks with maximum 1. Average ranks are used for tied values;

  • "standardize" - scale OTU abundances within sample to zero mean and unit variance;

  • "wisconsin" - Wisconsin double standardization where species are first standardized by maxima and then sites by site totals;

  • "chi.square" - divide by sample sums and square root of OTU sums, and adjust for square root of matrix total (Legendre & Gallagher 2001). When used with the Euclidean distance, the distances should be similar to the Chi-square distance used in correspondence analysis.

For the implementation of "total", "max", "frequency", "normalize", "range", "rank", "standardize", "pa", "chi.square", "hellinger", "log" methods see decostand.

Value

phyloseq object with standardized OTU table.

See Also

decostand, phyloseq_transform_css, phyloseq_transform_vst_blind, phyloseq_transform_rlog_blind, physeq_transform_anderson_log

Examples

# Load data
data("esophagus")

# Total-sum scaling (TSS) normalization
phyloseq_standardize_otu_abundance(esophagus, method = "total")
# the same as
transform_sample_counts(esophagus, function(OTU) OTU/sum(OTU) )
identical(
  phyloseq_standardize_otu_abundance(esophagus, method = "total"),
  transform_sample_counts(esophagus, function(OTU) OTU/sum(OTU)) )

# Presence-absence scaling (0/1)
phyloseq_standardize_otu_abundance(esophagus, method = "pa")

# Logarithmic transformation as in Anderson et al., 2006
phyloseq_standardize_otu_abundance(esophagus, method = "log")

# Hellinger standardization
phyloseq_standardize_otu_abundance(esophagus, method = "hellinger")


vmikk/metagMisc documentation built on Feb. 14, 2024, 2:29 a.m.