prepare_breakaway: Prepare frequency counts for breakaway package

View source: R/prepare_breakaway.R

prepare_breakawayR Documentation

Prepare frequency counts for breakaway package

Description

This function prepares input data for breakaway package (Willis, Bunge, 2015).

Usage

prepare_breakaway(OTUs, remove_singletons = FALSE)

Arguments

OTUs

Data frame with OTU abundances (rows = species, cols = samples) or phyloseq/otu_table object

remove_singletons

Logical; if TRUE, singleton counts will be removed

Details

In case of sequencing errors singletons can be excluded from the data ('remove_singletons = TRUE') and species richness estimation can be performed with breakaway_nof1 function.

Value

List of the sample frequency count tables for each sample.

References

Willis A., Bunge J. (2015) Estimating diversity via frequency ratios // Biometrics 71(4), P. 1042–1049. DOI: 10.1111/biom.12332

Examples

data("esophagus")
eso <- prepare_breakaway(esophagus)
eso_nof1 <- prepare_breakaway(esophagus, remove_singletons = TRUE)

# Estimate species richness (observed + unobserved) for the second sample in esophagus data
library(breakaway)
breakaway(eso[[2]], plot = T)
breakaway_nof1(eso_nof1[[2]], plot = T)


vmikk/metagMisc documentation built on June 20, 2024, 7:20 a.m.