read_biom {rbiom} | R Documentation |
Parse counts, metadata, taxonomy, and phylogeny from a BIOM file.
Description
Parse counts, metadata, taxonomy, and phylogeny from a BIOM file.
Usage
read_biom(src, ...)
Arguments
src |
Input data as either a file path, URL, or JSON string.
BIOM files can be formatted according to
version 1.0 (JSON) or 2.1 (HDF5)
specifications, or as
classical tabular format. URLs must begin with |
... |
Properties to set in the new rbiom object, for example,
|
Value
An rbiom object.
See Also
as_rbiom()
Examples
library(rbiom)
infile <- system.file("extdata", "hmp50.bz2", package = "rbiom")
biom <- read_biom(infile)
print(biom)
# Taxa Abundances
biom$counts[1:4,1:10] %>% as.matrix()
biom$taxonomy %>% head()
# Metadata
biom$metadata %>% head()
table(biom$metadata$Sex, biom$metadata$`Body Site`)
sprintf("Mean age: %.1f", mean(biom$metadata$Age))
# Phylogenetic tree
biom$tree %>%
tree_subset(1:10) %>%
plot()
[Package rbiom version 2.2.1 Index]