Map SNPs (both coding and non-coding) onto genes using different methods.

map_snps2genes(
  sumstats_file,
  method = c("abc", "txdb"),
  dataset = "Nasser2020",
  abc = NULL,
  adjust_z = TRUE,
  drop_MHC = TRUE,
  model = NULL,
  log_vars = c("NSNPS", "NPARAM", "GENELEN"),
  formula = ZSTAT ~ NSNPS + logNSNPS + NPARAM + logNPARAM + GENELEN + logGENELEN,
  nCores = 1,
  save_dir = tempdir(),
  return_path = FALSE,
  verbose = TRUE
)

Arguments

sumstats_file

GWAS summary statistics munged by format_sumstats. Can be a path to the saved file or data.table.

method

Method to use for mapping SNPs to genes.

dataset

Which ABC model to import.

abc

Use a previously downloaded ABC data.table.

adjust_z

Whether to adjust Z-statistic using the model and formula.

drop_MHC

Drop genes from the MHC (Major Histocompatibility Complex) region.

model

Statistical model to use. Defaults to lm.

log_vars

Variables to perform natural log transformation on first. Only run on variables available in dat.

formula

Formula to use in model.

nCores

Number of cores to parallelise across.

save_dir

Where to save results.

verbose

Print messages.

Value

gene_hits data.table.

Other packages worth exploring

H-MAGMA Really hard to use with no docs on how to create new annot files. It's literally just MAGMA (when you provide some extra args).

PAGWAS

rsnp

https://github.com/neurogenomics/orthogene Protein-coding variants only?

https://genetics.opentargets.org/ Could use colocalization results, but these are both GWAS- and QTL-specific. Could compute mean coloc score per gene for each SNP and use that. Other position-based functional data might still be useful.