rarefy_even_coverage2: Perform coverage-based rarefaction for a phyloseq object...

View source: R/coverage_based_rarefaction2.R

rarefy_even_coverage2R Documentation

Perform coverage-based rarefaction for a phyloseq object using vegan

Description

rarefy_even_coverage2 performs coverage-based rarefaction for a phyloseq object using vegan package

Usage

rarefy_even_coverage2(
  ps_obj,
  coverage = 0.97,
  remove_not_rarefied = FALSE,
  include_rarecurve_results = FALSE,
  knots = 1000,
  n_rarefy_iter = 10,
  rareplot_step_size = 100,
  rarefy_average_method = "round",
  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_rarecurve_results

Logical. If TURE, rarecurve results will also be included for visualization. The first object is a rarefied phyloseq object, and the second object is rarecurve results. If FALSE, it returns a rarefied phyloseq object only.

knots

Numeric. Specify knots of rareslope function.

n_rarefy_iter

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

rareplot_step_size

Numeric. Step size for rarecurve function. Only affect the resolution of a rarefaction plot.

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().

ran_seed

Numeric. Random seed.

Value

Rarefied phyloseq object (ps_rare). If include_rarecurve_results = TRUE, rarecurve 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.