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:

  1. Download Eigen3 and Boost;
  2. Edit their path in the enclosed Makefile (these two libraries themselves do not need to be compiled);
  3. Load an appropriate implementation of MPI library (e.g. openMPI, intelMPI, MPICH2, etc) library (it is best to consult with the system administrator);
  4. Switch “SYS” to “LINUX” or “MAC” in the Makefile;
  5. 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:

  1. Click on the project in Xcode and then click on Build Settings;
  2. Add “/usr/local/include” to “Search Paths – Header Search Paths”;
  3. Add the paths of Eigen and Boost libraries to “Search Paths – Header Search Paths”;
  4. Add”/usr/local/lib” to “Search Paths – Library Search Paths”;
  5. Add “-lmpi -lm” to “Linking – Other Linker Flags”;
  6. Add “/usr/local/lib/libmpi_cxx.1.dylib” to Link Binary With Libraries;
  7. 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:

  1. 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”.
  2. 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”.