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:
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 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.
- Install devtools and Bioconductor dependencies
> install.packages('devtools'); library('devtools');
> install.packages('BiocManager'); library('BiocManager');
> BiocManager::install('edgeR'); BiocManager::install('metagenomeSeq'); BiocManager::install('metagenomeSeq');
- 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.
> devtools::install_bitbucket("biobakery/maaslin2@default", ref="tip")
From command line
- Download and decompress the source: maaslin2.tar.gz
- Install the Bioconductor and CRAN dependencies
- 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.