phyloseq_coverage_raref: Coverage-based rarefaction

View source: R/phyloseq_coverage.R

phyloseq_coverage_rarefR Documentation

Coverage-based rarefaction

Description

This function performs coverage-based rarefaction (interpolation) based on the analytical approach proposed by Chao and Jost (2012).

Usage

phyloseq_coverage_raref(
  physeq,
  coverage = NULL,
  iter = 1,
  replace = F,
  correct_singletons = FALSE,
  seeds = NULL,
  multithread = F,
  drop_lowcoverage = F,
  ...
)

Arguments

physeq

A phyloseq-class object

coverage

Numeric value for a particular sample coverage (between 0 and 1)

iter

Number of rarefication iterations

replace

Logical, whether to sample with replacement (TRUE) or without replacement (FALSE, default)

correct_singletons

Logical; if TRUE, singleton counts will be corrected with modified Good–Turing frequency formula (Chiu, Chao 2016)

seeds

Integer vector used for the reproducible random subsampling (should be of the same length as the number of iterations)

multithread

Logical or integer; if TRUE, attempts to run the function on multiple cores; integer defines the number of cores to use (if it is set to TRUE, all cores will be used)

drop_lowcoverage

Logical; if TRUE, samples with coverage lower than selected value will be removed (default, FALSE)

...

Additional arguments will be passed to rarefy_even_depth

Details

Samples standardized by size will have different degrees of completness. When we compare samples with the same coverage, we are making sure that samples are equally complete and that the unsampled species constitute the same proportion of the total individuals in each community (Chao, Jost, 2012).

Value

List of rarefied phyloseq-objects (or a single phyloseq object if iter = 1)

Examples

# Load data
data("esophagus")

# Coverage-based rarefaction
eso_raref <- phyloseq_coverage_raref(physeq = esophagus, iter = 1, coverage = 0.8)

# Perform coverage-based rarefaction multiple times (iter = 5)
eso_raref2 <- phyloseq_coverage_raref(physeq = esophagus, iter = 5, coverage = 0.8)


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