GCTB
Genome-wide Complex Trait Bayesian analysis
Overview
GCTB is a C++ software tool that comprises Bayesian mixed linear models for complex trait analyses using genome-wide SNPs.
How to compile GCTB 1.0 MPI version
GCTB 1.0 MPI version has dependencies on MPI and two C++ libraries i.e. Eigen3 and Boost.
To compile GCTB 1.0 MPI version on a Linux/Mac system, follow below steps:
- Download Eigen3 and Boost;
- Edit their path in the enclosed Makefile (these two libraries themselves do not need to be compiled);
- Load an appropriate implementation of MPI library (e.g. openMPI, intelMPI, MPICH2, etc) library (it is best to consult with the system administrator);
- Switch “SYS” to “LINUX” or “MAC” in the Makefile;
- Execute make command.
We have also included a Xcode (v7.3.1) project file for Mac system. To compile in the Xcode, follow below steps:
- Click on the project in Xcode and then click on Build Settings;
- Add “/usr/local/include” to “Search Paths – Header Search Paths”;
- Add the paths of Eigen and Boost libraries to “Search Paths – Header Search Paths”;
- Add”/usr/local/lib” to “Search Paths – Library Search Paths”;
- Add “-lmpi -lm” to “Linking – Other Linker Flags”;
- Add “/usr/local/lib/libmpi_cxx.1.dylib” to Link Binary With Libraries;
- Use Command+B to compile.
How to run GCTB 1.0 MPI version
Use the command below in the Mac terminal (with the test dataset):
mpirun -np 2 gctb --bfile data/1000G_eur_chr22 --pheno data/test.phen --bayes S --chain-length 1100 --burn-in 100 --out test
An alternative way to run the program with the parameter settings is to use a input parameter file:
mpirun -np 2 gctb --inp-file test.inp
To run in the Xcode, follow these steps:
- Edit the “schemes” of the project: change the “Executable” to mpiexec, which is located at “/usr/local/bin”, an alias of “orterun”. Note that “/usr/local/bin” is by default hidden in the Finder. To choose “orterun”, press “command + shift + G” then type in “/usr/local/bin” and press “Go”.
- Click on “Arguments” in the “schemes” of the project, for running with two processors, sequentially add “-n 2”, “$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH”, “–inp-file”, “test/res/test.inp” to “Arguments Passed On Launch”.