abundant_tax_physeq: Return top n most abundand taxonomic terms at a given level

Description Usage Arguments Value Author(s) Examples

View source: R/abundant_tax_physeq.R

Description

This function extracts the top n most abundant taxonomic terms at a given level. It uses dplyr to calculate the most abundant elements. Output_format will take "ps" or "tops" and either return the phyloseq object or a character vector of the n most common terms. Ignores NA's by default but can show them (see parameters).

Usage

1
2
3
4
5
6
7
8
abundant_tax_physeq(
  physeq = ps,
  lvl = "Class",
  top = 10,
  output_format = "ps",
  ignore_na = FALSE,
  silent = TRUE
)

Arguments

physeq

a phyloseq object to rank

lvl

a character vector defining the taxonomic level to rank

top

an integer n defining the number of returned elements (e.g. 'top=5')

output_format

"tops" or "ps" (default), depending on this value, function returns either a character vector or a pruned phyloseq object.

ignore_na

TRUE/FALSE, default FALSE. If TRUE, excludes ASVs without assigned taxonomic term in the output.

silent

TRUE/FALSE, default TRUE. If FALSE, prints the top n taxonomix terms as a message.

Value

a phyloseq object or character vector, depending on value of "output_format"

Author(s)

Simeon Rossmann

Examples

1
2
ps_top10genera <- abundant_tax_physeq(physeq = ps, lvl="Genus", top=10)
top5species <- abundant_tax_physeq(physeq = ps, lvl="Species", top=5, output_format="tops", ignore_na = FALSE)

simeross/CuPhyR documentation built on April 1, 2020, 10:28 a.m.