Description Usage Arguments Value Examples
Generate a matrix of samples by taxa, at the specified taxonomic rank.
1 | taxa.rollup(biom, rank = "OTU", map = NULL, lineage = FALSE, sparse = FALSE)
|
biom |
A |
rank |
The taxonomic rank. E.g. “OTU”, “Phylum”, etc. May also be given numerically: 0 for OTU, 1 for the highest level (i.e. Kingdom), and extending to the number of taxonomic ranks encoded in the original biom file. See example below to fetch the names of all available ranks. |
map |
A character matrix defining the value that each taxa IDs is
assigned for each taxonomic rank. If |
lineage |
Include all ranks in the name of the taxa. For instance,
setting to |
sparse |
If true, returns a sparse matrix as described by
|
A numeric matrix with samples as column names, and taxonomic identifiers as row names.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(rbiom)
infile <- system.file("extdata", "hmp50.bz2", package = "rbiom")
biom <- read.biom(infile)
colnames(biom$taxonomy)
phyla <- taxa.rollup(biom, 'Phylum')
phyla[1:4,1:6]
# Custom matrices should be formatted like so:
counts <- as.matrix(biom$counts)
map <- biom$taxonomy
counts[1:3,1:6]
map[1:3,1:4]
phyla <- taxa.rollup(counts, 'Phylum', map=map)
phyla[1:3,1:6]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.