gact

An R Package for Creating a Database of Genomic Associations of Complex Traits

The R package gact is designed for establishing and populating a comprehensive database focused on genomic associations with complex traits. The package serves two primary functions: infrastructure creation and data acquisition. It facilitates the assembly of a structured repository that includes single marker associations, carefully curated to maintain high data quality. Beyond individual genetic markers, the package integrates a broad spectrum of genomic entities, encompassing genes, proteins, and an array of biological complexes (chemical and protein), as well as various biological pathways. It is designed to aid in the biological interpretation of genomic associations, shedding light on their complex relationships in the context of genomic associations of complex traits.

gact provides an infrastructure for efficient processing of large-scale genomic association data, including core functions for:




gact constructs gene and genetic marker sets from a range of biological databases including:


Installation of the gact package

Install gact from GitHub and the standalone gsuite analysis packages with:

options(repos=c(
  gsuite="https://psoerensen.github.io/gtools/gsuite/repository",
  CRAN="https://cloud.r-project.org"
))
devtools::install_github("psoerensen/gact")
gact::install_gsuite()

Tutorials for downloading and installing the gact database

Below is a set of tutorials used for the gact package:

Download, save and reopen the gact database, inspect its contents, and review storage and timing information:

Download and install gact database

Download and process genotype data from the 1000 Genomes Project (1000G) for different ancestries (European, East Asian, South Asian) used in different genomic analysis:
Download and process of 1000G data

Computing sparse Linkage Disequilibrium (LD) matrices for 1000 Genomes Project (1000G) data across different ancestries and exploring the LD data which is used in a number of genomic analysis (LD score regression, Vegas gene analysis, Bayesian Linear Regression models):
Compute sparse LD matrices for 1000G data

Downloading and processing genome-wide association summary statistic and ingest into database:
Download and process new GWAS summary statistics

Tutorials for various types of genomic analysis using the gact database

Check summary statistics against reference LD and impute missing Z-scores for multiple studies:

Summary-statistics imputation

Gene analysis using the VEGAS (Versatile Gene-based Association Study) approach using the 1000G LD reference data processed above:
Gene analysis using VEGAS

Gene set enrichment analysis (GSEA) based on BLR (Bayesian Linear Regression) model derived gene-level statistics and MAGMA (Multi-marker Analysis of GenoMic Annotation) (Bai et al. 2024).
Gene set analysis using MAGMA

Pathway prioritization using a single and multiple trait Bayesian MAGMA models and gene-level statistics derived from VEGAS (Gholipourshahraki et al. 2024).
Gene set analysis using Bayesian MAGMA

Gene ranking with chromosome-held-out ridge, BayesC and BayesR PoPS models using gene-level statistics derived from VEGAS.

Gene ranking using PoPS

Individual-level linear regression and LOCO mixed-model association using the standalone glma package on the same simulated-human panel: Linear regression and LOCO mixed models with glma

Individual-level BayesC and BayesR, full and scheduled marker updates, held-out prediction and genetic variance decomposition on sparse and polygenic simulated traits: Individual-level Bayesian regression with gbayes

Finemapping with single trait Bayesian Linear Regression models and simulated data (Shrestha et al. 2023).
Finemapping using BLR models on simulated data

Finemapping of gene and LD regions using single trait Bayesian Linear Regression models (Shrestha et al. 2023).
Finemapping using BLR models on real data

Polygenic scoring (PGS) using Bayesian Linear Regression models and biological pathway information (work in progress).
Polygenic scoring using BLR models

Polygenic scoring (PGS) using summary statistics from PGS catalog and biological pathway information.
Polygenic scoring using PGS Catalog

LD score regression for estimating genomic heritability and correlations.
LD score regression

CAD/T2D genetic correlation with standalone gcorr: stored LD scores, regional HESS/rho-HESS, timing and memory.

Genetic correlation with gcorr

Benchmark overview: consolidated runtime, memory, simulated scoring evidence and remaining measurement gaps.

Tutorial timings and memory

Workflow requirements and interpretation

Use a genetic reference panel matched to the GWAS ancestry and genome build. The default database uses GRCh37; summary statistics from another build require coordinate conversion and checks of marker identity and allele orientation before ingestion. Review the mappings returned by detectStatSchema() and provide an explicit schema when a required field is ambiguous. normalizeStatSchema() and validateStatSchema() support checking the resulting canonical fields before writing to the database.

The analysis tutorials use the standalone gsuite R packages with familiar qgg-style arguments. gact imports gbase for shared preparation and marker-set helpers; install_gsuite() installs the analysis packages explicitly. BLR-MAGMA in these tutorials is the Bayesian gene-set workflow; it is distinct from running the standalone MAGMA executable. PoPS prioritizes genes and does not produce individual polygenic scores. Fine-mapping and polygenic-scoring examples have different inputs and model controls; retain the arguments and diagnostics for each run. Successful execution alone does not establish MCMC convergence.

For optional LD consistency checking and missing Z-score imputation, keep gaps when extracting statistics and use an ancestry-matched Glist reference:

stat <- getMarkerStat(GAlist, studyID=c("GWAS1", "GWAS2"), rm.na=FALSE)
stat <- gbase::checkStat(Glist, stat, ldcheck=TRUE, impute=TRUE)

The same call handles all trait columns. Accepted observed scores remain intact; poor-quality predictions stay missing. See the summary preparation guide for ancestry groups, explicit meta-analysis mixtures and diagnostic flags. The gact imputation example shows the CAD/T2D workflow. Missing sample sizes and effect estimates are not inferred.

Reference preparation, LD computation, model fitting, and scoring have separate resource requirements. Check disk and memory capacity before computing genome-wide LD. Runtime depends on marker counts, reference sample size, model settings, and thread limits. Measurements of a tutorial example do not establish completion of every analysis reported in a manuscript.

Workshop and Course Materials

Workshop:
From Integrative Genomics to Polygenic Risk Scoring — presented at the 9th Annual Danish Bioinformatics Conference.

Course:
Bayesian Linear Regression — theoretical notes, lecture slides, and practical R examples.
Course Materials

Funding

These notes and scripts are prepared in the BALDER project funded by the ODIN platform. ODIN is sponsored by the Novo Nordisk Foundation (grant number NNF20SA0061466)

References

  1. Rohde PD, Sørensen IF, Sørensen P. qgg: an R package for large-scale quantitative genetic analyses. Bioinformatics 36:8 (2020). https://doi.org/10.1093/bioinformatics/btz955

  2. Rohde PD, Sørensen IF, Sørensen P. Expanded utility of the R package, qgg, with applications within genomic medicine. Bioinformatics 39:11 (2023). https://doi.org/10.1093/bioinformatics/btad656

  3. Shrestha et al. Evaluation of Bayesian Linear Regression Models as a Fine Mapping Tool. Submitted (2024) https://doi.org/10.1101/2023.09.01.555889

  4. Bai et al. Evaluation of multiple marker mapping methods using single trait Bayesian Linear Regression models. BMC Genomics 25:1236 (2024). https://doi.org/10.1186/s12864-024-11026-2

  5. Gholipourshahraki et al. Evaluation of Bayesian Linear Regression Models for Pathway Prioritization. PLOS Genetics 20(11) e1011463 (2025). https://doi.org/10.1371/journal.pgen.1011463.

  6. Kunkel et al. Improving polygenic prediction from summary data by learning patterns of effect sharing across multiple phenotypes. Plos Genetics 21 (1), e1011519 (2025). https://doi.org/10.1371/journal.pgen.1011519.