The Huttenhower Lab > MAASLIN2


MaAsLin2 is comprehensive R package for efficiently determining multivariable association between clinical metadata and microbial meta’omic features. MaAsLin2 relies on general linear models to accommodate most modern epidemiological study designs, including cross-sectional and longitudinal, and offers a variety of data exploration, normalization, and transformation methods. 

For more information on the technical aspects:

User Manual || User Tutorial || Forum

Mallick H, Tickle TL, McIver LJ, Rahnavard G, Nguyen LH, Weingart G, Ma S, Ren B, Schwager E, Subramanian A, Paulson JN, Franzosa EA, Corrada Bravo H, Huttenhower C. “Multivariable Association in Population-scale Meta’omic Surveys”. In Submission.


  1. R software
  2. R CRAN packages: pscl, pbapply, dplyr, vegan, chemometrics, ggplot2, pheatmap, cplm, logging, data.table, lmerTest
  3. R Bioconductor packages: edgeR, metagenomeSeq

Getting Started

MaAsLin2 is an R package that can be run on the command line or as an R function. It requires the following R packages included in Biocondutor and CRAN (Comprehensive R Archive Network). Please install these packages before running MaAsLin2.



From R

  1. Install devtools and Bioconductor dependencies
    1. > install.packages('devtools'); library('devtools');
    2. > install.packages('BiocManager'); library('BiocManager');
    3. > BiocManager::install('edgeR'); BiocManager::install('metagenomeSeq'); BiocManager::install('metagenomeSeq');
  2. Install MaAsLin2 (and also all dependencies from CRAN). For tagged version information, please visit the bioBakery page for MaAsLin2. “Tip” will download the latest development build.
    1. > devtools::install_bitbucket("biobakery/maaslin2@default", ref="tip")

From command line

  1. Download and decompress the source: maaslin2.tar.gz
  2. Install the Bioconductor and CRAN dependencies
  3. Install the R package: $ R CMD INSTALLL maaslin2

Conda package and Docker image coming soon.

How to Run

MaAsLin2 can be run from the command line or as an R function. Both methods require the same arguments, have the same options, and use the same default settings.

  • To run from the command line: $ Maaslin2.R $DATA $METADATA $OUTPUT
    • Provide the full path to the MaAsLin2 executable (i.e. /R/Maaslin2.R if you are in the source folder).
    • Replace $DATA with the path to your data (or features) file.
    • Replace $METADATA with the path to your metadata file.
    • Replace $OUTPUT with the path to the folder to write the output.
  • To run as an R function: > fit_data = Maaslin2(data.tsv, metadata.tsv, output_folder)

For detailed information on how to format input and output files and data frames, as well as more information on different run parameters, please see the  MaAsLin2 User Manual.

A full tutorial is currently a work-in-progress.