combine_otus {OTUtable} | R Documentation |
Combine OTUs based on identical taxonomic assignments
Description
Sums the abundances of OTUs with the same taxonomy at a given level into a single vector for that taxonomy. This creates a new table of relative abundance data at a higher taxonomic level than OTU. This function only works with the OTU level as input, but can be used on any subset of the OTU table created by year_subset() or bog_subset(). The OTU table must have the same number of rows as the taxonomy file (do not remove rows with no reads before running combine_otus()) If bootstrap values were not removed by expand_taxa(), this command will likely create spurious groupings based on identical bootstrap values.
Usage
combine_otus(level, table, taxonomy)
Arguments
level |
The desired level at which to combine OTUs; options are the column names from the taxonomy dataset |
table |
An OTU table containing the relative abundances of each OTU. |
taxonomy |
A taxonomy dataset in the form produced by expand_taxa(). |
Value
Returns a table of relative abundance data with each row representing all OTUs of a given taxonomic assignment summed together. Row names are now the full taxonomic assignment of each row. To keep only the the lowest taxonomic level in the row names, run the function reduce_names()
Author(s)
Alexandra Linz <amlinz16@gmail.com>
Examples
data(otu_table)
data(taxonomy)
example_table <- year_subset("05", otu_table)
example_table <- bog_subset("TBE", example_table)
phylum_table <- combine_otus("Phylum", example_table, taxonomy)