Skip to contents

Input / Output

Get data into and out of R objects.

as_rbiom()
Convert a variety of data types to an rbiom object.
read_fasta()
Parse a fasta file into a named character vector.
read_tree()
Read a newick formatted phylogenetic tree.
write_biom() write_metadata() write_counts() write_taxonomy() write_fasta() write_tree() write_xlsx()
Save an rbiom object to a file.
convert_to_SE() convert_to_TSE()
Convert an rbiom object to a SummarizedExperiment object.

The rbiom Object

The rbiom object itself includes many methods, including $counts, $metadata, $taxonomy, $samples, $n_samples and more.

rbiom_objects
Working with rbiom Objects.
as.list(<rbiom>)
Convert an rbiom object to a base R list.
as.matrix(<rbiom>)
Convert an rbiom object to a simple count matrix.

Sample Metadata

pull(<rbiom>)
Map sample names to metadata field values.
with(<rbiom>) within(<rbiom>)
Evaluate expressions on metadata.
mutate(<rbiom>) rename(<rbiom>)
Create, modify, and delete metadata fields.
glimpse(<rbiom>)
Get a glimpse of your metadata.

Subsetting

subset(<rbiom>) `[`(<rbiom>) na.omit(<rbiom>) subset_taxa()
Subset an rbiom object by sample names, OTU names, metadata, or taxonomy.
slice(<rbiom>) slice_head(<rbiom>) slice_tail(<rbiom>) slice_min(<rbiom>) slice_max(<rbiom>) slice_sample(<rbiom>)
Subset to a specific number of samples.
rarefy()
Rarefy OTU counts.

Taxa Abundance

Map OTUs to higher order taxonomic ranks, and compare those abundances to metadata.

taxa_boxplot()
Visualize BIOM data with boxplots.
taxa_clusters()
Define sample kmeans clusters from taxa abundances.
taxa_corrplot()
Visualize taxa abundance with scatterplots and trendlines.
taxa_heatmap()
Display taxa abundances as a heatmap.
taxa_map()
Map OTUs names to taxa names at a given rank.
taxa_table() taxa_matrix()
Taxa abundances per sample.
taxa_stacked()
Display taxa abundances as a stacked bar graph.
taxa_stats()
Test taxa abundances for associations with metadata.
taxa_sums() taxa_means() taxa_apply()
Get summary taxa abundances.

Alpha Diversity

Examine the diversity of OTUs present in each individual sample, and how that diversity correlates with metadata.

adiv_boxplot()
Visualize alpha diversity with boxplots.
adiv_corrplot()
Visualize alpha diversity with scatterplots and trendlines.
adiv_matrix()
Create a matrix of samples x alpha diversity metrics.
adiv_stats()
Test alpha diversity for associations with metadata.
adiv_table()
Calculate the alpha diversity of each sample.
sample_sums() sample_apply()
Summarize the taxa observations in each sample.

Beta Diversity

See how similiar samples are to each other, and what metadata/taxa influence clustering.

bdiv_boxplot()
Visualize BIOM data with boxplots.
bdiv_clusters()
Define sample PAM clusters from beta diversity.
bdiv_corrplot()
Visualize beta diversity with scatterplots and trendlines.
bdiv_heatmap()
Display beta diversities in an all vs all grid.
bdiv_ord_plot()
Ordinate samples and taxa on a 2D plane based on beta diversity distances.
bdiv_ord_table()
Calculate PCoA and other ordinations, including taxa biplots and statistics.
bdiv_stats()
Test beta diversity for associations with metadata.
bdiv_table() bdiv_matrix() bdiv_distmat()
Distance / dissimilarity between samples.

Rarefaction

Improve signal-to-noise in analyses by ensuring all samples have an equal number of observations.

rare_corrplot()
Visualize rarefaction curves with scatterplots and trendlines.
rare_multiplot()
Combines rare_corrplot and rare_stacked into a single figure.
rare_stacked()
Visualize the number of observations per sample.
rarefy()
Rarefy OTU counts.

Low Level Functions

Most functions operate on rbiom objects. These let you use arbitrary data.frames, distance matrices, matrices, and phylo objects.

distmat_ord_table()
Run ordinations on a distance matrix.
distmat_stats()
Run statistics on a distance matrix vs a categorical or numeric variable.
rarefy_cols() rescale_cols() rescale_rows()
Transform a counts matrix.
stats_boxplot()
Visualize categorical metadata effects on numeric values.
stats_corrplot()
Visualize regression with scatterplots and trendlines.
stats_table()
Run non-parametric statistics on a data.frame.
tree_subset()
Create a subtree by specifying tips to keep.
plot_heatmap()
Create a heatmap with tracks and dendrograms from any matrix.

Advanced Operations

bdply() blply()
Apply a function to each subset of an rbiom object.
biom_merge()
Combine several rbiom objects into one.

Datasets

Example datasets included with rbiom.

hmp50
Human Microbiome Project - demo dataset (n = 50)
gems
Global Enteric Multicenter Study (n = 1,006)
babies
Longitudinal Stool Samples from Infants (n = 2,684)