Agglomerates by rank_names() and then merges them into a phyloseq object.

add_ranks(ps = ps, ranks = c(rank_names(ps)),
  replace_ASV_names = TRUE, verbose = TRUE)

Arguments

ps

A phyloseq object that contains a tax_table.

ranks

A vector of taxonomic rank names found in rank_names. Defaults to all available ranks (Phylum through Genus).

replace_ASV_names

Logical. If TRUE, ASVs will be named with a unique and the lowest taxonomic rank available.

verbose

Logical. If FALSE, messages will be supressed.

Value

This function returns the input phyloseq object with additional taxa that are the agglomerated taxa at the taxonomic levels provided.

Examples

ps <- add_ranks(ps, ranks = c("Genus", "Family"))
#> Error in add_ranks(ps, ranks = c("Genus", "Family")): object 'ps' not found