Workflow requirements

Use a genetic reference panel matched to the GWAS ancestry and genome build. The default database uses GRCh37. Convert coordinates from other builds and check marker identity and allele orientation before ingestion. Required fields are chr, pos, ea, nea, b, seb, and p. Supply study effect-allele frequencies as eaf when available. When eaf is omitted, gact uses the marker catalog frequencies, so the study-to-reference frequency check needs study EAF.

Review the mappings returned by detectStatSchema() when using automatic mapping. Use effect_scale = "beta" for a beta or log-odds column and effect_scale = "or" for odds ratios from a column with a different name. By default, ingestStatDB() converts columns named OR or odds_ratio to log odds. Supply seb on the same scale as the resulting effect estimate.

Beta values must be finite, standard errors must be finite and positive, and reported EAF must be between 0 and 1. By default, gact converts named -log10(p) columns such as neglog10p and LP. Use p_scale = "neglog10p" for other negative log10 p-value columns, or p_scale = "p" for ordinary p-values.

By default, gact drops A/T and C/G SNPs with unknown strand. Set strand = "forward" when the source documents forward-strand alleles for the declared build. gact keeps one copy of agreeing duplicate estimates and drops conflicting duplicates. Each retained row must describe a single allele pair that maps uniquely to a catalog rsID. This allows separate pairs at one site when they have distinct catalog rsIDs.

UK Biobank HbA1c example

Use Glycated_haemoglobin_HbA1c.imp.gz from version 1 of the NIH Figshare release (10.35092/yhjc.12355382.v1, file ID 22770197). The release uses GRCh37 and reports beta relative to ALT. Release record · Exact imputed HbA1c file

The GWAS meta-analysis combines White British, non-British White, African, and South Asian participants. The GWAS Catalog reports a study-level discovery sample size of 338,919 (327,177 European, 4,847 African, and 6,895 South Asian participants). GWAS Catalog study GCST90019509

The release does not report variant-level sample sizes. Record the study total in comments and omit n, because gact would otherwise copy the supplied count to every variant when the input has no n column.


# Load libraries
library(gact)
library(data.table)


# Load GAlist with information on gact database
GAlist <- readRDS(file="C:/Users/gact/hsa.0.0.1/GAlist_hsa.0.0.1.rds")


# Load the imputed HbA1c file from the Figshare release cited above.
fname_stat <- "C:/Users/gact/hsa.0.0.1/download/Glycated_haemoglobin_HbA1c.imp.gz"
stat <- fread(fname_stat, data.table = FALSE)

# Map the study columns. This example uses catalog frequencies for EAF.
schema <- c(chr = "#CHROM", pos = "POS", ea = "ALT", nea = "REF",
            b = "Effect", seb = "StdErr", p = "P-value")

result <- ingestStatDB(
  GAlist, stat, schema = schema, effect_scale = "beta", p_scale = "p",
  source = "NIH Figshare file 22770197 (Glycated_haemoglobin_HbA1c.imp.gz)",
  trait = "HbA1c", type = "quantitative", gender = "both", ancestry = "Mixed",
  build = "GRCh37", strand = "forward", reference = "PMID:33462484",
  comments = "Study-level discovery sample size: 338,919 (GCST90019509)"
)
GAlist <- result$GAlist
result$qc

# Save updated database
saveRDS(GAlist, file="C:/Users/gact/hsa.0.0.1/GAlist_hsa.0.0.1.rds", compress = FALSE)

The writer stages the study file and inventory before publishing them. You can retry a failed write once its cause is resolved. After a successful import, save the returned GAlist for subsequent imports and for getGWAS(). The QC summary counts input, retained, and dropped rows, with one reason for each drop and a flip count for retained rows. gact saves it as GWAS<n>.qc.json alongside the study file. Shiny displays the same counts on the Validation tab.

If you use shinyIngestGWAS(), select Download updated GAlist after your imports and reopen the downloaded .rds in future sessions.