phyloseq_rename_with_tax: Rename phyloseq OTUs or species with taxonomy ranks.

View source: R/phyloseq_rename_with_tax.R

phyloseq_rename_with_taxR Documentation

Rename phyloseq OTUs or species with taxonomy ranks.

Description

Rename phyloseq OTUs or species with taxonomy ranks.

Usage

phyloseq_rename_with_tax(physeq, taxrank = "Family")

Arguments

physeq

A phyloseq-class object

taxrank

Character, which taxonomy rank to use for renaming

Value

A phyloseq-class object with renamed OTUs.

Examples

# Load data
data("GlobalPatterns")

# Agglomerate taxa of the same phylum
GP <- tax_glom(GlobalPatterns, taxrank="Phylum")
taxa_names(GP)

# Assign phylum name to the agglomerated taxa
GP <- phyloseq_rename_with_tax(GP, taxrank="Phylum")
taxa_names(GP)


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