pool_taxon_counts {schtools} | R Documentation |
Pool OTU counts at a particular taxonomic level
Description
Enables comparing analyses at different taxonomic resolutions, as seen in 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 |
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")
[Package schtools version 0.4.1 Index]