Skip to content

JianYang-Lab/GCTA

Repository files navigation

GCTA

GCTA (Genome-wide Complex Trait Analysis) is a software package, which was initially developed to estimate the proportion of phenotypic variance explained by all genome-wide SNPs for a complex trait but has been extensively extended for many other analyses of data from genome-wide association studies (GWASs). Please see the software website through the link below for more information.

Software website: https://yanglab.westlake.edu.cn/software/gcta/ License: GPLv3 (some parts of the code are released under LGPL as detailed in the files).

Credits

Jian Yang developed the original version (before v1.90) of the software (with supports from Peter Visscher, Mike Goddard and Hong Lee) and currently maintains the software.

Zhili Zheng programmed the fastGWA, fastGWA-GLMM and fastGWA-BB modules, rewrote the I/O and GRM modules, improved the GREML and bivariate GREML modules, extended the PCA module, and improved the SBLUP module.

Zhihong Zhu programmed the mtCOJO and GSMR modules and improved the COJO module.

Longda Jiang and Hailing Fang developed the ACAT-V module.

Jian Zeng rewrote the GCTA-HEreg module.

Andrew Bakshi contributed to the GCTA-fastBAT module.

Angli Xue improved the GSMR module.

Robert Maier improved the GCTA-SBLUP module.

Wujuan Zhong and Judong Shen programmed the fastGWA-GE module.

Contributions to the development of the methods implemented in GCTA (e.g., GREML methods, COJO, mtCOJO, MLMA-LOCO, fastBAT, fastGWA and fastGWA-GLMM) can be found in the corresponding publications (https://yanglab.westlake.edu.cn/software/gcta/index.html#Overview).

Questions and Help Requests

If you have any bug reports or questions please send an email to Jian Yang at jian.yang@westlake.edu.cn.

Compilation

Requirements

  1. Currently only x86_64-based operating systems are supported.
  2. Intel MKL 2017 or above (only needed when building on x86-64 machines)
  3. OpenBLAS (only needed when building on AArch64 machines)
  4. Eigen == 3.3.7 (there are bugs in the new version of Eigen)
  5. CMake >= 3.1
  6. BOOST >= 1.4
  7. zlib >= 1.2.11 (old zlib may cause an error of bgen file decompression)
  8. sqlite3 >= 3.31.1
  9. zstd >= 1.4.4
  10. Spectra >= 0.8.1
  11. gsl (GNU scientific library)

Most of the dependencies above will be downloaded by CMake automatically. You only need to install the gsl and Intel MKL manually.

Linux

  1. Kernel version >= 2.6.28 (otherwise the Intel MKL library doesn't work).
  2. GCC version >= 6.1 with C++ 11 support.

Before compilation

Update plink_ng submodule first.

git submodule update --init

On Windows, apply the patch under the third_party directory to the plink-ng.

Build

CMake Configuration

On MacOS and Linux, use following command to generate the build system:

# e.g MKL_DIR can be "/opt/intel/oneapi/mkl/latest/lib/cmake/mkl"
cmake -DCMAKE_BUILD_TYPE=Release -DMKL_DIR="<your_mkl_cmake_path>" -G Ninja -B build/Release -S .

On Windows, you should apply a patch for plink under third_party/, and then use the toolchain file in cmake/win-toolchain.cmake:

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="cmake/win-toolchain.cmake" -DLLVM_ROOT="<your_llvm_path>" -DMKL_DIR="<your_mkl_cmake_path>" -G Ninja -B build/Release -S .
Compile
cmake --build build/Release

The executable binary will be generated under build/Release.

MCP Server

GCTA provides an MCP (Model Context Protocol) server that exposes all GCTA functionality as tools, allowing AI assistants (Claude, Codex, opencode, etc.) to run GCTA analyses via natural language.

Quick Start

pip3 install mcp                    # install dependency
python3 gcta-mcp/server.py          # start MCP server

Configuration

Add the following to your AI tool's MCP configuration, replacing <GCTA_DIR> with the full path to the gcta-1.95.3-linux-x86_64 folder:

{
  "mcpServers": {
    "gcta": {
      "command": "python3",
      "args": ["<GCTA_DIR>/gcta-mcp/server.py"]
    }
  }
}

Available Tools

Tool Function
gcta_run Execute GCTA with arbitrary CLI arguments
gcta_help Get GCTA documentation
gcta_check Check GCTA configuration
gcta_make_grm Construct GRM (Genetic Relationship Matrix)
gcta_reml REML analysis (estimate heritability)
gcta_bivariate_reml Bivariate REML (estimate genetic correlation)
gcta_hereg Haseman-Elston regression
gcta_pca Principal component analysis
gcta_mlma Mixed linear model association
gcta_cojo Conditional and joint analysis
gcta_gsmr GSMR Mendelian randomization
gcta_mtcojo Multi-trait COJO analysis
gcta_fastgwa fastGWA genome-wide association
gcta_fastbat fastBAT gene-based test
gcta_simu_qt Simulate quantitative trait
gcta_simu_cc Simulate case-control phenotype
gcta_fst Fst population differentiation
gcta_make_bed Data management (format conversion, filtering)
gcta_ld_pruning LD pruning
gcta_ld_score LD score calculation
gcta_acat ACAT gene-based test
gcta_list_files List files in working directory
gcta_read_file Read file content

See gcta-mcp/README.md for detailed documentation.

About

No description, website, or topics provided.

Resources

License

Stars

16 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors