compute_MAGMA_enrichment_linear: Compute MAGMA enrichment linear

View source: R/enrichment_testing.r

compute_MAGMA_enrichment_linearR Documentation

Compute MAGMA enrichment linear

Description

Compute GWAS enrichment in gene specificity matrices (linear analysis) with MAGMA.

Usage

compute_MAGMA_enrichment_linear(
  gene_score_matrix,
  sumstats_file,
  output_dir = NULL,
  upstream_kb = 10,
  downstream_kb = 1.5,
  gene_nomenclature = "hgnc",
  pop = "eur",
  gwas_sample_size,
  deps = dep_path(pop, "magma")
)

Arguments

gene_score_matrix

Matrix with HGNC genes as rows & cell-types as columns. Values need to be numeric.

sumstats_file

Address of properly formatted MAGMA GWAS file.

output_dir

Folder where you want the output to be stored. Default = NULL, which makes this function create a directory where results will be temporarily stored. The directory will be deleted afterwards, if this parameter is null. The only output will be the return. Otherwise, both the files and the return are kept.

upstream_kb

Number of kb upstream of gene, SNP-to-gene mapping window. Default = 10.

downstream_kb

Number of kb downstream of gene, SNP-to-gene mapping window. Default = 1.5.

gene_nomenclature

(default = hgnc)

pop

Word describing ancestry of the GWAS data. Relevant so that the proper LD panel will be used (default = eur; alternatives = afr, amr, eas, sas, subpop)

gwas_sample_size

Sample size of GWAS.

deps

A named list, containing all of the dependencies for MAGMA (e.g. executables, SNP linkage disequilibrium data, etc.). Provided by default by another function, called gwascelltyper::dep_path().

Value

Dataframe


alexandruioanvoda/gwascelltyper documentation built on April 16, 2023, 8:03 p.m.