prep.physeq: Prepare a phyloseq with raw counts for analysis

View source: R/prep_physeq.R

prep.physeqR Documentation

Prepare a phyloseq with raw counts for analysis

Description

Perform common, important pre-analysis steps such as renaming NA taxa, removing eukaryotic taxa, rarefaction, and estimation of alpha- and beta-diversities

Usage

prep.physeq(
  physeq,
  min.rarefaction = 10000,
  min.prevalence = 1,
  alpha.metrics = c("Chao1", "Shannon", "Simpson", "Phylogenetic", "Richness"),
  beta.metrics = c("taxonomic", "phylogenetic"),
  sample.col.name = "Sample",
  taxon.col.name = "Taxon",
  n.cores = 1,
  user.seed = 42,
  ...
)

Arguments

physeq

a phyloseq object.

min.rarefaction

numeric; the minimum acceptable depth to rarefy to (actual number we be the smallest sample sum equal to or greater than this number). Set to 0 for no rarefaction. Default is 10000.

min.prevalence

numeric; the minimum acceptable number of samples a taxon must be present in to be included in subsequent analyses. Default is 1 (no prevalence filtering).

alpha.metrics

character; a vector of alpha-diveristy metrics to estimate. Must match arguments for phyloseq::estimate_richness, or be "Phylogenetic" or "Richness" (both assessed with picante::pd). Set to NULL to skip alpha-diversity estimation. Default is c("Chao1", "Shannon", "Simpson", "Phylogenetic", "Richness").

sample.col.name

character; name to use for sample column in extracted tables. Default is "Sample".

taxon.col.name

character; name to use for taxon column in extracted tables. Default is "Taxon".

n.cores

numeric; number of cores to use for beta-diversity estimation. Default is 1.

user.seed

numeric; random seed for reproducibility. Default is 42.

...

additional arguments to pass to certain functions (like 'clr_ps' to gen.dist.matrices)

remove.euks

logical; whether to remove taxa assigned to eukaryotic taxonomies with phyloseqCompanion::remove.euks. Default is TRUE.

beta.metrics;

character; a vector of beta-diversity metrics (or groups of metrics) that match arugments for phyloseqCompanion::gen.dist.matrices. Set to NULL to skip beta-diversity estimation. Default is c("taxonomic", "phylogenetic").

See Also

phyloseq, subset_taxa


kstagaman/phyloseqCompanion documentation built on Aug. 26, 2022, 5:07 a.m.