APEX (All-in-one Package for Efficient Xqtl analysis) is a toolkit for analysis of molecular quantitative trait loci (xQTLs), such as mRNA expression or methylation levels. It performs cis and trans analysis, single- or multiple-variant analysis, and single-study or meta-analysis.
To install APEX from source or download precompiled binaries, see installation guide below.
- xQTL factor analysis.
./apex factor {options}
- Rapid high-dimensional factor analysis to account for technical and biological variation in molecular trait data.
- xQTL linear mixed model preprocessing.
./apex lmm {options}
- Precompute null model terms for rapid LMM association analysis.
- cis-xQTL analysis.
./apex cis {options}
- Analyze xQTL associations within a genomic window of each molecular trait. For example, analyze variant associations within 1 megabase (Mb) of each gene's transcription start site (TSS).
- trans-xQTL analysis.
./apex trans {options}
- Analyze xQTL genome-wide associations for each molecular trait, optionally excluding variants within the cis region.
- xQTL meta-analysis.
./apex meta {options}
- Meta-analyze xQTL association summary statistics across one or multiple studies.
- xQTL summary data storage.
./apex store {options}
- Store genotypic variance-covariance (LD) data matrices for data-sharing or meta-analysis. These files enable accurate multiple-variant analysis from xQTL summary statistics, including joint and conditional regression analysis, Bayesian finemapping, aggregation tests, and penalized regression / variable selection.
See above for documentation pages on each analysis mode (factor, lmm, cis, trans, meta, store). Additional documentation pages are listed below.
- Input file formats for individual-level analysis in modes
apex cis
,apex trans
, andapex store
. - APEX xQTL summary association data file formats generated by
apex store
and used inapex meta
. Documentation coming soon. - Bayesian finemapping using APEX xQTL summary association data files generated by
apex store
. Documentation coming soon.
- apex-factor
- Currently, apex-factor assumes sample size is less than the number of molecular traits. In the next release, we will provide optimizations for sample size > number of traits.
- Currently, apex-factor calculates inferred covariates in a format suitable for OLS or GRM LMMs. To model factor covariates as random effects, inferred covariates must be calculated internally in apex-cis and apex-trans. In the next release, apex-factor will provide inferred factor covariates in a format suitable for low-rank LMMs in apex-cis and apex-trans.
- apex-lmm
- Currently, apex-lmm supports LMMs with GRMs, but not low-rank LMMs. Low-rank LMMs can be estimated directly in apex-cis and apex-trans. In the next release, apex-lmm will also support low-rank LMMs.
- apex-cis and apex-trans
- Currently, pre-computed variance component estimates from apex-lmm can be used in apex-cis and apex-trans, but LMM trait residuals and genotypic variance interpolation points are precalculated internally in apex-cis and apex-trans. In the next release, apex-cis and apex-trans will accept precomputed LMM trait residuals and genotypic variance interpolation points from apex-lmm.
- apex-store
- Currently, apex-store provides adjusted LD for OLS models. In the next release, apex-store will provide options for adjusted LD in LMMs.
- apex-meta
- Currently, apex-meta supports only cis-xQTL meta-analysis. In the next release, apex-meta will also support trans-xQTL meta-analysis.
APEX is primarily written in C++. To compile APEX from source, run:
CMake can also be used to compile the source. Required dependencies can be obtained and compiled using cget.
# Clone repository
git clone https://github.com/lin-lab/apex.git
cd apex
# Install dependencies with cget.
cget install -f requirements.txt
# Compile with CMake.
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../cget/cget/cget.cmake -DCMAKE_INSTALL_PREFIX=/usr/local
make
# At this point, apex executable will be located in the build directory
# Optionally, to install in prefix directory, use command below
# apex executable will be installed as: $CMAKE_INSTALL_PREFIX/bin/apex
# Prefix path can be changed in cmake command above
make install
Change to -DCMAKE_BUILD_TYPE=Release
for a release build with all optimizations enabled.
Precompiled binaries are also available under the Releases section on Github.
- Eigen C++ matrix library
- HTSlib C library
- github.com/jonathonl/shrinkwrap
- github.com/Taywee/args
- Boost math C++ library
APEX is a work in progress, and under active development. We appreciate feedback and bug reports, and welcome any questions or feature requests. Contact: [email protected].
If you use APEX, please cite Quick, C; Guan, L; Z, Li; X, Li; Dey, R; Liu, Y; Scott, L; Lin, X (2020). "A versatile toolkit for molecular QTL mapping and meta-analysis at scale" URL: https://github.com/corbinq/apex
(preprint pending). Thanks!
APEX is developed by Corbin Quick and Li Guan. Special thanks to
- Yaowu Liu
- Xihao Li
- Zilin Li
- Rounak Dey
- Laura Scott
- Hyun Min Kang
- Xihong Lin