Once you've run map.snps.to.genes on multiple GWAS, you can aggregate the gene-wise results into a single gene x trait matrix.

gwas_matrix_magma(
  magma_files,
  metric = c("ADJ_ZSTAT", "ZSTAT", "P"),
  drop_MHC = TRUE,
  save_path = NULL,
  mc.cores = 1,
  fillna = TRUE,
  agg_FUN = "mean"
)

Arguments

magma_files

Paths to genes.out files produced by map.snps.to.genes.

metric

Which metric to fill the matrix with

  • "ADJ_ZSTAT" : MAGMA Z-statistic after adjusting for gene length and other confounds (DEFAULT).

  • "ZSTAT" : Unadjusted MAGMA Z-statistic.

  • "P" : MAGMA P-value.

drop_MHC

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

save_path

Path to save results as RDS object.

Value

Sparse matrix