MWAS (microbiome-wide association study) package is an R-based toolbox for microbiome study, developped by the members of the Knights Lab at the University of Minnesota, Twin Cities. It provides three main functional modules: learning a predictve model, predicting an unknown microbiome data, and visualization of different results. The latest update is version 0.9.3 (03-2015).
MWAS is developed in R, however, it also provides a Unix command-line interface as a simplified application for those who are not familliar with R. The R code is avaiable to download here.
Download and install the latest version of R from CRAN or install RStudio;
Download the R code from https://github.com/danknights/mwas;
Use the following command to set MWAS_DIR in the Terminal (or an equivalent command window; /MWAS_directory should be your actual directory):
echo "export MWAS_DIR=$HOME/MWAS_directory" >> ~/.bash_profile
optparse. Follow the steps below to install this package:r
install.packages("optparse")
q()
The test/ directory contains demo testing data from Global Gut study. You could test whether MWAS is installed correctly and all functions work approapriately, by testing some of the commands. In the Terminal,
Rscript $MWAS_DIR/bin/mwas_analysis.R -w plot -M gradient -i test/data/taxa/GG_100nt_even10k-adults_L7.biom -o example/plot_otu_gradient -S
Or in the R Console, (setwd("~/Documents/LabProjects/mwas_git/") command sets the work space to the downloaded MWAS folder, you may need to change the directory accrodingly.)
# test code
setwd("~/Documents/LabProjects/mwas_git/")
file.sources = list.files("lib", pattern="*.R$",
#file.sources = list.files(paste(Sys.getenv('MWAS_DIR'),'/lib',sep=''), pattern="*.R$",
full.names=TRUE, ignore.case=TRUE)
invisible(sapply(file.sources, source, .GlobalEnv))
## This is vegan 2.2-1
## Loaded glmnet 1.9-8
##
## randomForest 4.6-10
## Type rfNews() to see new features/changes/bug fixes.
## Type 'citation("pROC")' for a citation.
## Plot gradient
opts <- list()
opts$mode <- "plot"
opts$method <- "gradient"
opts$input_fp <- "test/data/taxa/GG_100nt_even10k-adults_L7.biom"
opts$transform_type <- "none"
opts$suppress_relative_abundance_conversion <- FALSE
opts$min_prevalence <- NULL
opts$collapse_table <- FALSE
opts$outdir <- "example/plot_otu_gradient"
opts$shorten_taxa <- TRUE
opts$multiple_axes <- FALSE
opts$filter_kegg <- FALSE
mwas.obj <- import.plot.params(opts)
plot(mwas.obj)
## The gradient plot is saved in example/plot_otu_gradient/gradient-plot.pdf
In the example/ directory, you will find the result file plot_otu_gradient/gradient-plot.pdf, as shown below:
Hu Huang, Emmanuel Montassier, Pajau Vangay, Gabe Al Ghalith, Dan Knights. “Robust statistical models for microbiome phenotype prediction with the MWAS package” (in preparation)