Skip to content
A companion R package for the MicrobiomeAnalyst web server
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
R support for partial correlation Jul 12, 2019
docs moving files Jun 24, 2019
man support for partial correlation Jul 12, 2019
.Rbuildignore added ignore Jun 24, 2019
.gitignore update documentation + add to do Jul 3, 2019
DESCRIPTION added dot + volcano plots Jul 11, 2019
MicrobiomeAnalystR.Rproj added ignore Jun 24, 2019
NAMESPACE support for partial correlation Jul 12, 2019 added dot + volcano plots Jul 11, 2019


MicrobiomeAnalystR contains the R functions and libraries underlying the popular MicrobiomeAnalyst web server, including > 200 functions for statistical, functional, and visual analysis of microbiome data. The package is synchronized with the MicrobiomeAnalyst web server. After installing and loading the package, users will be able to reproduce the same results from their local computers using the corresponding R command history downloaded from MicrobiomeAnalyst, thereby achieving maximum flexibility and reproducibility. With this R package we also aim to address an important gap left in its web version. Raw sequence data processing.

To demonstrate this new functionality, we provide the "MicrobiomeAnalystR Workflow" vignette. In this vignette, we perform end-to-end microbiome data analysis on a subset of clinical IBD samples.

Getting Started

Step 1. Install package dependencies

To use MicrobiomeAnalystR , first install all package dependencies. Ensure that you are able to download packages from bioconductor. To install package dependencies, use the pacman R package (for those with >R 3.5.1). Note that some of these packages may require additional library dependencies that need to be installed prior to their own successful installation. For users who wish to perform raw sequence data processing, dada2 will also need to be installed.



pacman::p_load(phyloseq, metacoder, pryr, biomformat, RColorBrewer, ggplot2, gplots, Cairo, igraph, 
BiocParallel, randomForest, metagenomeSeq, MASS, DESeq2, vegan, RJSONIO, ggfortify, pheatmap, xtable, genefilter,
data.table, reshape, stringr, ape, Tax4Fun, grid, gridExtra, splitstackshape, edgeR, globaltest, R.utils, viridis, ggrepel)

Step 2. Install the package

MicrobiomeAnalystR is freely available from GitHub. Note that the Rpackage is currently under construction. The package documentation, including the vignettes for each module and user manual is available within the downloaded R package file. If all package dependencies were installed, you will be able to install the MicrobiomeAnalystR. There are three options, A) using the R package devtools, B) cloning the github, C) manually downloading the .tar.gz file. Note that the MicrobiomeAnalystR github will have the most up-to-date version of the package.

Option A) Install the package directly from github using the devtools package. Open R and enter:

Due to issues with Latex, some users may find that they are only able to install MicrobiomeAnalystR without any documentation (i.e. vignettes).

# Step 1: Install devtools

# Step 2: Install MicrobiomeAnalystR WITHOUT documentation
devtools::install_github("xia-lab/MicrobiomeAnalystR", build = TRUE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"))

# Step 2: Install MicrobiomeAnalystR WITH documentation
devtools::install_github("xia-lab/MicrobiomeAnalystR", build = TRUE, build_opts = c("--no-resave-data", "--no-manual"))

Option B) Clone Github and install locally

The * must be replaced by what is actually downloaded and built.

git clone
R CMD build MicrobiomeAnalystR
R CMD INSTALL MicrobiomeAnalystR_*.tar.gz

Option C) Manual download of MicrobiomeAnalystR.tar.gz and install locally

Manually download the .tar.gz file from here. The * must be replaced by what is actually downloaded and built.

cd ~/Downloads
R CMD INSTALL MicrobiomeAnalystR_*.tar.gz

Case Studies

MicrobiomeAnalyst Workflow

To showcase how to utilize MicrobiomeAnalystR , we provide a detailed tutorial to perform a comprehensive end-to-end workflow from raw sequence data preprocessing to knowledge-based analysis. The dataset showcased in the tutorial consists of a subset of pediatric IBD stool samples obtained from the Integrative Human Microbiome Project Consortium ( The tutorial is available as a PDF here and is also available inside the R package as a vignette.


For detailed tutorials on how to use MicrobiomeAnalystR, please refer to the R package vignettes. These vignettes include a comprehensive tutorial introducing MicrobiomeAnalystR, four detailed step-by-step tutorials with example data for each of the main MetaboAnalytR modules, and a case-study showcasing the end-to-end functionality of MicrobiomeAnalystR. Note, the functions below work only if the R package vignettes were built.

Within R:


Within a web-browser:



MicrobiomeAnalystR has been developed by the XiaLab at McGill University. The original manuscript (web-based version) can be found here.

We encourage users to further develop the package to suit their needs. If you use the R package, please cite us:

Dhariwal A, Chong J, Habib S, King IL, Agellon LB, Xia J. MicrobiomeAnalyst: a web-based tool for comprehensive statistical, visual and meta-analysis of microbiome data. Nucleic acids research. 2017 Jul 3;45(W1):W180-8.

From within R:


Bugs or feature requests

To inform us of any bugs or requests, please open a new issue or send an email to

MicrobiomeAnalystR History & Updates

07-11-2019 - Added volcano + dot plots for RNAseq analysis 07-08-2019 - Testing R code for local use + creating vignettes 07-03-2019 - Updating R code + documentation 06-22-2019 - Prepping R package for stable release

MicrobiomeAnalystR TO DO

Add 3D visualizations using plotly

Add back bar plots for LEfSe/RF

Add function to make multiple feature box plots

Add volcano plot for DESeq2 - added, cut ASV names

You can’t perform that action at this time.