MaAsLin2: Multivariate Association with Linear Models

Please note, as of April 1, 2019, MaAsLin will no longer be officially supported with development and support efforts focused on its successor, MaAsLin2.
  • For additional information, please see the MaAsLin2 User Manual (in progress)
  • Please direct questions to the MaAsLin category in Forum
  • MaAsLin Google Group(Getting deprecated soon)
  • If you find MaAsLin2 helpful to your research efforts, please cite our manuscript: 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.

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. More detailed information may be found in the MaAsLin2 User Manual.


Getting Started with MaAsLin2

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.


  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


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.

Contact Us

Are you stuck? Would you like to provide feedback?
Please do not hesitate to reach out to the MaAsLin category in Forum.