Aggregate OTU Table by Taxonomy Level
Source:R/mStat_aggregate_by_taxonomy2.R
mStat_aggregate_by_taxonomy2.Rd
This function aggregates an OTU table by a specified taxonomy level. It checks for consistency between OTU and taxonomy tables before aggregation.
Details
The function first checks that the row names of OTU and taxonomy tables match. If any mismatches are found, a message is displayed but the function continues. The OTU and taxonomy tables are joined by row names. The OTU table is then aggregated by summing abundance values for each sample at the specified taxonomy level. Rows with all zero values after aggregation are removed.