taxa_name_bundle: Bundle taxa names in a phyloseq object

View source: R/phyloseq_obj_handling.R

taxa_name_bundleR Documentation

Bundle taxa names in a phyloseq object

Description

taxa_name_bundle bundle taxa names in a phylosq object for a visualization purpose. Minor taxa names will be summarized as "Others". Also, if the taxa name is empty, the function assigns "Undetermined" for the taxa.

Usage

taxa_name_bundle(
  ps_obj,
  taxa_rank_bundled,
  top_taxa_n = 10,
  new_taxa_rank = "bundled_tax",
  taxa_rank_list = c("superkingdom", "kingdom", "phylum", "order", "family", "genus",
    "species"),
  add_undet = TRUE
)

Arguments

ps_obj

Phyloseq object.

taxa_rank_bundled

Character. The name of phylogenetic rank that will be bundled.

top_taxa_n

Numeric. The number of taxa names that will be retained.

new_taxa_rank

Character. The name of the bundled taxa rank. Default is bundled_tax.

taxa_rank_list

Character vector. The specified taxa ranks are used to determine whether a tax is "Undetermined" or not.

add_undet

Logical. If TRUE, "Undetermined" is assigned to undetermined taxa. If FALSE, "Others" is assigned.

Value

Phyloseq object. Bundled taxa names are in the new_taxa_rank column.

Examples

# taxa_name_bundle(ps_obj, "phylum", top_taxa_n = 10)

ong8181/macam documentation built on April 11, 2024, 12:58 p.m.