Skip to content

Download & Setup

KGGSum and Its Running Resources¶

KGGSum is a Java-based tool distributed as a Java Archive file (kggsum.jar). Depending on the analysis type, additional resource files may be needed:

  • Gene-based association tests (GATES, ECS) and heritability estimation (EHE) require gene annotations.
  • Gene-expression causal-effect estimation (EMIC) requires eQTL summary statistics.
  • Almost all analyses in KGGSum require reference genotypes to estimate linkage disequilibrium of variants.

The following table provides download links for the latest version of KGGSum and its resources:

File Description Main Version Size
kggsum.jar Core program file 2.0 ~37 MB
resources.zip Resource files (excluding reference genotypes and eQTL data) 2.0 ~180 MB
tutorials.zip Example datasets for tutorials 2.0 ~255 MB
For historical releases
Contents of resources.zip

The resources.zip package provides the essential annotation and coordinate-conversion files used by KGGSum:

File Description
resources/liftover/hg19ToHg38.over.chain.gz Chain file for converting coordinates from hg19 to hg38
resources/reference/CanonicalTranscript.txt.gz Canonical transcript metadata (gene symbol, Ensembl ID, etc.)
resources/reference/GEncode_hg38_kggseq_v2.txt.gz GENCODE gene annotations (hg38)
resources/reference/refGene_hg38_kggseq_v2.txt.gz RefGene gene annotations (hg38)

💡 KGGSum allows flexible resource usage — you can download only the files needed for your specific analysis.

Installation and Environment Setup¶

KGGSum requires Java Runtime Environment (JRE) 1.8 or higher. You may use either Oracle Java or OpenJDK.

To verify your installation, open a terminal (or Command Prompt on Windows) and run:

java -version

If the output shows a version ≥ 11, your Java environment is ready, and KGGSum can run normally.

💡 If KGGSum cannot start, check whether Java is added to your system PATH variable.

Also, ensure your system meets the recommended hardware specifications, especially for large datasets.

Quick Tutorial Setup¶

Follow these steps to set up a minimal working environment for KGGSum tutorials:

1. Download Required Files
kggsum.jar, resources.zip and tutorials.zip
2. Extract Files
Unzip both resources.zip and tutorials.zip into your preferred directory.
3. Organize Folder Structure
Place all components under one working folder, e.g.:
my-project/
├── kggsum.jar
├── resources/
└── tutorials/

4. Test the Installation

  • Open a terminal in the tutorials/ directory and run:

    java -jar ../kggsum.jar
    
  • If installed successfully, KGGSum will print usage information or help text.

Notes
  • The resources/ folder contains files necessary for tutorials (e.g., liftover chains, gene annotations).
  • For advanced analyses, additional resources (e.g., reference genotypes, eQTL summary statistics) may be downloaded separately.

Optional: R Backend for MR Analysis¶

Some Mendelian Randomization (MR) methods in KGGSum delegate computation to an external R process via Rserve. After the R package is installed and Rserve is listening on port 6311, pass the server address to KGGSum:

java -jar kggsum.jar causal ... --r-server localhost:6311

For a Docker-based Rserve setup, see RServerDocker.md.

Installing MendelianRandomization in R (Ubuntu)¶

If you must install the package inside R or RStudio with install.packages() (for example, when you need a specific development version), install the corresponding system development libraries on Ubuntu first.

Step 1: Install system dependencies (Ubuntu terminal)

Open a terminal and run the following commands. These packages cover network requests, TLS/crypto, font rendering, image I/O, and linear-algebra libraries commonly required by R packages:

sudo apt update
sudo apt install -y \
  build-essential \
  gfortran \
  libcurl4-openssl-dev \
  libssl-dev \
  libxml2-dev \
  libfontconfig1-dev \
  libfreetype6-dev \
  libharfbuzz-dev \
  libfribidi-dev \
  libpng-dev \
  libtiff5-dev \
  libjpeg-dev \
  liblapack-dev \
  libblas-dev

Step 2: Install the package in R

Open R or RStudio and run:

install.packages("MendelianRandomization", dependencies = TRUE)

Once Java and the tutorial files are ready, your next goal is usually to answer: