eBay_comps: An empirical Bayes approach for transforming raw counts into...

View source: R/eBay_comps.R

eBay_compsR Documentation

An empirical Bayes approach for transforming raw counts into relative abundances

Description

An empirical Bayes approach for transforming raw counts into relative abundances

Usage

eBay_comps(otu_tab, prior, tree = NULL, model = "MIX")

Arguments

otu_tab

a data frame or matrix containing the count data. Rows of the matrix represent observations and columns are the taxa.

prior

Dirichlet, Dirichlet-tree, or zero-inflated Dirichlet-tree prior for the proportions.

tree

the phylogenetic tree.

model

smooth methods for zero-inflated Dirichlet-tree mulinomial, including 0.5, DM, ZIDM, or MIX.

Value

Returns the estimated microbial compositions by empirical Bayes.

References

Liu, T., Zhao, H., Wang, T.: An empirical Bayes approach to normalization and differential abundance testing for microbiome data. BMC Bioinformatics 21, 225 (2020).

Zhou, C., Zhao, H., and Wang, T.: Transformation and differential abundance analysis of microbiome data incorporating phylogeny. Bioinformatics btab543, https://doi.org/10.1093/bioinformatics/btab543 (2021).

Examples

library(phyloseq)
otu_tab <- t(combo.phyloseq.obj@otu_table@.Data)
tree <- phy_tree(combo.phyloseq.obj)
eBay.comps <- eBay_comps(otu_tab, prior = "Dirichlet", tree=NULL)
eBay.tree.comps <- eBay_comps(otu_tab, prior = "Dirichlet-tree", tree = tree)
eBay.zitree.comps <- eBay_comps(otu_tab, prior = "zero-inflated-Dirichlet-tree", tree = tree, model= "MIX")

liudoubletian/phyloMDA documentation built on April 28, 2022, 6:51 p.m.