GEMMA: Genome-wide Efficient Mixed Model Association
GEMMA is a software toolkit for fast application of linear mixed models (LMMs) and related models to genome-wide association studies (GWAS) and other large-scale data sets.
Check out RELEASE-NOTES.md to see what's new in each GEMMA release.
Please post suspected bugs to Github issues. For questions or other discussion, please post to the GEMMA Google Group. We also encourage contributions, for example, by forking the repository, making your changes to the code, and issuing a pull request.
Currently, GEMMA provides a runnable Docker container for 64-bit MacOS, Windows and Linux platforms. GEMMA can be installed with Debian, Conda, Homebrew and GNU Guix. With Guix you find the latest version here as it is the version we use every day on http://genenetwork.org. For installation instructions see also INSTALL.md. We use continous integration builds on Travis-CI for Linux (amd64 & arm64) and MacOS (amd64). GEMMA builds on multiple architectures, see the Debian build farm.
*(The above image depicts physiological and behavioral trait loci identified in CFW mice using GEMMA, from Parker et al, Nature Genetics, 2016.)
- Key features
- Installation
- Run GEMMA
- Help
- Citing GEMMA
- License
- Optimizing performance
- Building from source
- Input data formats
- Reporting a GEMMA bug or issue
- Code of conduct
- Credits
Key features
-
Fast assocation tests implemented using the univariate linear mixed model (LMM). In GWAS, this can correct for population structure and sample non-exchangeability. It also provides estimates of the proportion of variance in phenotypes explained by available genotypes (PVE), often called "chip heritability" or "SNP heritability".
-
Fast association tests for multiple phenotypes implemented using a multivariate linear mixed model (mvLMM). In GWAS, this can correct for population structure and sample (non)exchangeability - jointly in multiple complex phenotypes.
-
Bayesian sparse linear mixed model (BSLMM) for estimating PVE, phenotype prediction, and multi-marker modeling in GWAS.
-
Estimation of variance components ("chip/SNP heritability") partitioned by different SNP functional categories from raw (individual-level) data or summary data. For raw data, HE regression or the REML AI algorithm can be used to estimate variance components when individual-level data are available. For summary data, GEMMA uses the MQS algorithm to estimate variance components.
Installation
To install GEMMA you can
-
Download the precompiled or Docker binaries from releases.
-
Use existing package managers, see INSTALL.md.
-
Compile GEMMA from source, see INSTALL.md.
Compiling from source takes more work, but can potentially boost performance of GEMMA when using specialized C++ compilers and numerical libraries.
Precompiled binaries
-
Fetch the latest stable release and download the file appropriate for your platform.
-
For Docker images, install Docker, load the image into Docker and run with something like
docker run -w /run -v ${PWD}:/run ed5bf7499691 gemma -gk -bfile example/mouse_hs1940
-
For .gz files run
gunzip gemma.linux.gz
orgunzip gemma.linux.gz
to unpack the file. And make sure it is executable withchmod u+x gemma-linux ./gemma-linux
Run GEMMA
GEMMA is run from the command line. To run gemma
gemma -h
a typical example would be
# compute Kinship matrix
gemma -g ./example/mouse_hs1940.geno.txt.gz -p ./example/mouse_hs1940.pheno.txt \
-gk -o mouse_hs1940
# run univariate LMM
gemma -g ./example/mouse_hs1940.geno.txt.gz \
-p ./example/mouse_hs1940.pheno.txt -n 1 -a ./example/mouse_hs1940.anno.txt \
-k ./output/mouse_hs1940.cXX.txt -lmm -o mouse_hs1940_CD8_lmm
Above example files are in the git repo and can be downloaded from github.
Debugging and optimization
GEMMA has a wide range of debugging options which can be viewed with
DEBUG OPTIONS
-check enable checks (slower)
-no-fpe-check disable hardware floating point checking
-strict strict mode will stop when there is a problem
-silence silent terminal display
-debug debug output
-debug-data debug data output
-nind [num] read up to num individuals
-issue [num] enable tests relevant to issue tracker
-legacy run gemma in legacy mode
typically when running gemma you should use -debug which includes relevant checks. When compiled for debugging the debug version of GEMMA gives more information.
For performance you may want to use the -no-check option. Also check the build optimization notes in INSTALL.md.
Help
Citing GEMMA
If you use GEMMA for published work, please cite our paper:
- Xiang Zhou and Matthew Stephens (2012). Genome-wide efficient mixed-model analysis for association studies. Nature Genetics 44, 821–824.
If you use the multivariate linear mixed model (mvLMM) in your research, please cite:
- Xiang Zhou and Matthew Stephens (2014). Efficient multivariate linear mixed model algorithms for genome-wide association studies. Nature Methods 11, 407–409.
If you use the Bayesian sparse linear mixed model (BSLMM), please cite:
- Xiang Zhou, Peter Carbonetto and Matthew Stephens (2013). Polygenic modeling with bayesian sparse linear mixed models. PLoS Genetics 9, e1003264.
And if you use of the variance component estimation using summary statistics, please cite:
- Xiang Zhou (2016). A unified framework for variance component estimation with summary statistics in genome-wide association studies. Annals of Applied Statistics, in press.
License
Copyright (C) 2012–2021, Xiang Zhou, Pjotr Prins and team.
The GEMMA source code repository is free software: you can redistribute it under the terms of the GNU General Public License. All the files in this project are part of GEMMA. This project is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See file LICENSE for the full text of the license.
Both the source code for the gzstream zlib wrapper and shUnit2 unit testing framework included in GEMMA are distributed under the GNU Lesser General Public License, either version 2.1 of the License, or (at your option) any later revision.
The source code for the included Catch unit testing framework is distributed under the Boost Software Licence version 1.
Optimizing performance
Precompiled binaries and libraries may not be optimal for your particular hardware. See INSTALL.md for speeding up tips.
Building from source
More information on source code, dependencies and installation can be found in INSTALL.md.
Input data formats
Currently GEMMA takes two types of input formats
- BIMBAM format (preferred)
- PLINK format
See this example where we convert some spreadsheets for use in GEMMA.
Reporting a GEMMA bug or issue
For bugs GEMMA has an issue tracker on github. For general support GEMMA has a mailing list at gemma-discussion
Before posting an issue search the issue tracker and mailing list first. It is likely someone may have encountered something similiar. Also try running the latest version of GEMMA to make sure it has not been fixed already. Support/installation questions should be aimed at the mailing list - it is the best resource to get answers.
The issue tracker is specifically meant for development issues around the software itself. When reporting an issue include the output of the program and the contents of the .log.txt file in the output directory.
Check list:
- I have found an issue with GEMMA
- I have searched for it on the issue tracker (incl. closed issues)
- I have searched for it on the mailing list
- I have tried the latest release of GEMMA
- I have read and agreed to below code of conduct
- If it is a support/install question I have posted it to the mailing list
- If it is software development related I have posted a new issue on the issue tracker or added to an existing one
- In the message I have included the output of my GEMMA run
- In the message I have included the relevant .log.txt file in the output directory
- I have made available the data to reproduce the problem (optional)
To find bugs the GEMMA software developers may ask to install a development version of the software. They may also ask you for your data and will treat it confidentially. Please always remember that GEMMA is written and maintained by volunteers with good intentions. Our time is valuable too. By helping us as much as possible we can provide this tool for everyone to use.
Code of conduct
By using GEMMA and communicating with its communtity you implicitely agree to abide by the code of conduct as published by the Software Carpentry initiative.
Credits
The GEMMA software was developed by:
Xiang Zhou
Dept. of Biostatistics
University of Michigan
and
Pjotr Prins
Dept. of Genetics, Genomics and Informatics
University of Tennessee Health Science Center
with contributions from Peter Carbonetto, Tim Flutre, Matthew Stephens, and others.