calculateTaxaFoldDifference: Calculate Fold Difference in Taxa Abundance

View source: R/calculateTaxaFoldDifference.R

calculateTaxaFoldDifferenceR Documentation

Calculate Fold Difference in Taxa Abundance

Description

Calculate Fold Difference in Taxa Abundance

Usage

calculateTaxaFoldDifference(x, group, sort = FALSE, paired = FALSE)

Arguments

x

A phyloseq object

group

Vector with specifying the groups to compare. Only two-group comparisons are supported.

sort

Sort the results by descending order of fold difference

paired

Paired comparison (Default: FALSE)

Details

Calculate Log10 fold difference in abundance of taxa between two- groups. This code is modified from original code https://github.com/microbiome/microbiome/blob/fa2c0de2fbe000da87be3c185972ed7f0f626591/inst/extdata/check_foldchange.R Get the prevalence of taxa in phyloseq objects along with taxonomic classification and prevalence.

Value

A tibble with taxa ids, taxonomic information, two-group prevalence and fold change values.

Author(s)

Original Author: Leo Lahti. Adapted by Sudarshan A. Shetty

References

Shetty SA (2021). Utilities for microbiome analytics. https://github.com/RIVM-IIV-Microbiome/biomeUtils

Examples

library(biomeUtils)
data("FuentesIliGutData")
# reduce size for example
ps1 <- filterSampleData(FuentesIliGutData, ILI != "L2")

taxa_fd <- calculateTaxaFoldDifference(ps1, group = "ILI")
# check
taxa_fd

RIVM-IIV-Microbiome/biomeUtils documentation built on July 20, 2023, 10:29 a.m.