knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  fig.height = 4,
  fig.width = 8,
  dev="ragg_png"
)

rbiom

cran conda downloads dev covr

This package is a toolkit for working with Biological Observation Matrix (BIOM) files. Features include reading/writing all 'BIOM' formats, rarefaction, alpha diversity, beta diversity (including 'UniFrac'), summarizing counts by taxonomic level, subsetting, visualizations, and statistical analysis. All CPU intensive operations are written in C.

Reference material is available online at https://cmmr.github.io/rbiom/index.html

Source code can be found at https://github.com/cmmr/rbiom

Installation

The latest stable version can be installed from CRAN.

install.packages("pak")
pak::pak("rbiom")

The development version is available on GitHub.

pak::pak("cmmr/rbiom")

Usage

Import and rarefy abundance counts.

library(rbiom)

infile <- system.file(package = "rbiom", "extdata", "hmp50.bz2")
biom   <- rarefy(infile)

Explore associations with metadata.

bdiv_ord_plot(biom, stat.by = "Body Site", facet.by = "Sex")
adiv_boxplot(biom, x = "Sex", adiv = c("otu", "shan"), stat.by = "Body Site")
taxa_corrplot(biom, x = "Age", layers = "ptc", taxa = 2, stat.by = "bod")

Summarize counts by taxonomic rank.

taxa_heatmap(biom, taxa = 30, tracks = c("body", "age"))
taxa_stacked(biom, rank = "Phylum")
taxa_table(biom, 'Phylum')


cmmr/rbiom documentation built on June 10, 2025, 9:24 p.m.