View source: R/aggregateTaxa.R
aggregateTaxa | R Documentation |
Given a taxon and a lineage matrix, aggregate taxa belonging to the same higher-level taxon at the specified taxonomic level by summing their abundance.
aggregateTaxa( x, lineages, taxon.level = "class", unknown = c(NA, "unclassified"), keepUnknown = FALSE, keepSumUnknown = FALSE, returnLineages = FALSE )
x |
an abundance matrix with taxa as rows and samples as columns |
lineages |
a lineage matrix where row names match row names of taxa; taxa must be provided in the same order as in x; first column gives kingdom, following columns give phylum, class, order, family, genus and species |
taxon.level |
taxonomic level to which data set is aggregated (kingdom, phylum, class, order, family, genus or species) |
unknown |
descriptors for unclassified taxa |
keepUnknown |
keep taxa without higher-level taxon classification; cannot be used together with keepSumUnknown |
keepSumUnknown |
keep the sum of taxa without higher-level taxon classification on the desired level as last row (row name: sumUnknown) |
returnLineages |
return lineage matrix for higher-level taxon matrix; if true a list is returned with two elements: abundances and lineages |
the aggregated abundance matrix; if returnLineages is true, a list with aggregated abundances and matching lineages
data("ibd_taxa") data("ibd_lineages") ibd_class=aggregateTaxa(x=ibd_taxa,lineages=ibd_lineages)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.