pool_taxon_counts: Pool OTU counts at a particular taxonomic level

View source: R/shared.R

pool_taxon_countsR Documentation

Pool OTU counts at a particular taxonomic level

Description

Enables comparing analyses at different taxonomic resolutions, as seen in \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1128/mbio.03161-21")}. Implementation adapted from here.

Usage

pool_taxon_counts(otu_shared_dat, otu_tax_dat, taxon_level)

Arguments

otu_shared_dat

data frame created from a shared file at the OTU level.

otu_tax_dat

data frame created from a taxonomy file at the OTU level. Must be from the same dataset as the shared file.

taxon_level

taxonomic level to pool OTUs into. Options: "kingdom", "phylum", "class", "order", "family", "genus". This should be the name of a column in otu_tax_dat as a character string.

Value

a shared data frame with the OTUs at the specified taxon_level and a corresponding taxonomy dataframe with new OTU numbers.

Author(s)

Kelly Sovacool, sovacool@umich.edu

Pat Schloss pschloss@umich.edu

Examples

tax_dat <- read_tax(system.file("extdata", "test.taxonomy",
  package = "schtools"
))
shared_dat <- readr::read_tsv(system.file("extdata", "test.shared",
  package = "schtools"
))
pool_taxon_counts(shared_dat, tax_dat, "genus")
pool_taxon_counts(shared_dat, tax_dat, "family")
pool_taxon_counts(shared_dat, tax_dat, "phylum")

SchlossLab/mothuR documentation built on Aug. 29, 2023, 1:32 a.m.