assign-tax_table: Assign a (new) Taxonomy Table to 'x'

Description Usage Arguments Examples

Description

Assign a (new) Taxonomy Table to x

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
tax_table(x) <- value

## S4 replacement method for signature 'phyloseq,taxonomyTable'
tax_table(x) <- value

## S4 replacement method for signature 'phyloseq,ANY'
tax_table(x) <- value

## S4 replacement method for signature 'taxonomyTable,taxonomyTable'
tax_table(x) <- value

## S4 replacement method for signature 'taxonomyTable,ANY'
tax_table(x) <- value

Arguments

x

(Required). phyloseq-class

value

(Required). taxonomyTable-class. Alternatively, value can be a phyloseq-class that has a tax_table component, or a matrix-class that can be coerced to a taxonomyTable-class with row indices that match at least some of the taxa_names of x.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# data(GlobalPatterns)
# # An example of pruning to just the first 100 taxa in GlobalPatterns.
# ex2a <- prune_taxa(taxa_names(GlobalPatterns)[1:100], GlobalPatterns)
# # The following 3 lines produces an ex2b that is equal to ex2a
# ex2b <- GlobalPatterns
# TT <- tax_table(GlobalPatterns)[1:100, ]
# tax_table(ex2b) <- TT
# identical(ex2a, ex2b)
# print(ex2b)
# # 2 examples adding a tax_table component from phyloseq or matrix classes
# ex2c <- phyloseq(otu_table(ex2b), sample_data(ex2b), phy_tree(ex2b))
# tax_table(ex2c) <- ex2b
# identical(ex2a, ex2c)
# ex2c <- phyloseq(otu_table(ex2b), sample_data(ex2b), phy_tree(ex2b))
# tax_table(ex2c) <- as(tax_table(ex2b), "matrix")
# identical(ex2a, ex2c)

Example output



phyloseq documentation built on Nov. 8, 2020, 6:41 p.m.