rarefy_even_coverage: Perform coverage-based rarefaction for a phyloseq object

View source: R/coverage_based_rarefaction.R

rarefy_even_coverageR Documentation

Perform coverage-based rarefaction for a phyloseq object

Description

rarefy_even_coverage performs coverage-based rarefaction for a phyloseq object using iNEXT package

Usage

rarefy_even_coverage(
  ps_obj,
  coverage = 0.97,
  remove_not_rarefied = FALSE,
  include_iNEXT_results = FALSE,
  correct_singletons = FALSE,
  se = FALSE,
  nboot = 40,
  knots = 50,
  n_rarefy_iter = 1,
  rarefy_average_method = "round",
  sample_method = "phyloseq",
  ran_seed = 1234
)

Arguments

ps_obj

Phyloseq object.

coverage

Numeric. Coverage specified by a user (default = 0.97 = 97%).

remove_not_rarefied

Logical. If TRUE, samples of which coverage is lower than the specified coverage will be removed.

include_iNEXT_results

Logical. If TURE, iNEXT results will be included as a element of the output. The first object is a rarefied phyloseq object, and the second object is an iNEXT result. Also, if TRUE, computation time will increase. If FALSE, it returns a rarefied phyloseq object only.

correct_singletons

Logical. If TURE, singleton counts will be corrected according to the method of Chiu & Chao (2016). Corrected coverage and reads will be used for the rarefaction of the original data.

se

Logical. Specify whether SE of the rarefaction curve is calculated.

nboot

Numeric. Specify nboot of iNEXT function (valid only if include_iNEXT_results = TRUE).

knots

Numeric. Specify knots of iNEXT function (valid only if include_iNEXT_results = TRUE).

n_rarefy_iter

Numeric. The number of iterations of rarefactions (default = 1).

rarefy_average_method

Character. If n_rarefy_iter >= 2, this argument determines how the multiple rarefactions are summarized. rarefy_average_method = "round" uses round(). rarefy_average_method = "floor" uses floor(). rarefy_average_method = "ceiling" uses ceiling().

sample_method

Character. Specify which function is used for rarefaction. sample_method = "vegan" uses vegan::rrarefy(), while sample_method = "phyloseq" uses phyloseq:::rarefaction_subsample().

ran_seed

Numeric. Random seed.

Details

  • Hsieh et al. (2016) Methods in Ecology and Evolution https://doi.org/10.1111/2041-210X.12613

Value

Rarefied phyloseq object (ps_rare). If include_iNEXT_results = TRUE, iNEXT results are stored in the second element of the list.

Examples

# rarefy_even_coverage(ps_obj, coverage = 0.97)

ong8181/macam documentation built on Oct. 15, 2024, 7:04 a.m.