tax.split: Split OTU Tables By Taxonomic Rank

Description Usage Arguments Value Note Author(s) See Also Examples

Description

This function consumes an OTU table and splits its taxonomy columns into the seven major taxonomic ranks. It returns a data frame preserving all numerical data, but changing the 'taxonomy' column to the name of the appropriate rank, and preserving only the classifications at that rank.

Usage

1
tax.split(otu1, otu2 = NULL, rank = NULL)

Arguments

otu1

the first OTU table to be used.

otu2

the second OTU table to be used.

rank

the (optional) rank to split at and return (see ?RAM.rank.formatting for formatting details).

Value

The value returned by this function may become nested lists, so for convenience, any nested lists have been given descriptive items names to make accessing its elements simple (see Examples).

Note

This function may seem similar to get.rank, but they are distinct. get.rank only returns the entries classified at that taxonomic rank, and so some OTUs might be omitted in the returned data frame. With tax.split, it is guaranteed that all OTUs will be preserved in the returned data table (although they may be missing taxonomic classification at that rank). If no OTUs are classified at the given rank, the taxonomy column for that rank will be filled with empty strings.

Author(s)

Wen Chen and Joshua Simpson.

See Also

get.rank

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(ITS1, ITS2)
# split only ITS1 data at a single rank
ITS1.tax.p <- tax.split(ITS1, rank="phylum")
# split only ITS1 data at all ranks
ITS1.tax.all <- tax.split(ITS1)
# split ITS1 and IST2 data at a given rank
lst <- tax.split(ITS1, ITS2, rank="c")
# split ITS1 and ITS2 at every rank
lst.all <- tax.split(ITS1, ITS2)
stopifnot(identical(lst.all$otu1$phylum, ITS1.tax.p))

Example output

Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-4
Loading required package: ggplot2

RAM documentation built on May 2, 2019, 3:04 p.m.