phyloseq_add_max_tax_rank: Add the lowest level of taxonomic classification to the...

View source: R/phyloseq_add_max_tax_rank.R

phyloseq_add_max_tax_rankR Documentation

Add the lowest level of taxonomic classification to the taxonomy table of phyloseq-class object.

Description

Add the lowest level of taxonomic classification to the taxonomy table of phyloseq-class object.

Usage

phyloseq_add_max_tax_rank(physeq, abbreviate = F, ...)

Arguments

physeq

A phyloseq-class object

abbreviate

Logical; if TRUE, lowest taxon name will be abbreviated (useful for plotting). Default is FALSE

...

Additional arguments may be passed to abbreviate_taxa_names

Value

Phyloseq object with modified taxonomy table.

Examples

# Load data 
data("GlobalPatterns")

# Subset data to 5% of the most abundant taxa (just for the example)
GP <- phyloseq_filter_top_taxa(GlobalPatterns, perc = 5)

# Add the lowest level of taxonomic classification to the taxonomy table
GP <- phyloseq_add_max_tax_rank(GP, abbreviate = T)

# Replace taxa names with abbreviated lowest taxa ranks,
# e.g., this names could be placed on ordination plot
taxa_names(GP) <- as.data.frame(tax_table(GP))$LowestTaxon
tail(taxa_names(GP))


vmikk/metagMisc documentation built on Feb. 14, 2024, 2:29 a.m.