fetch_gwas: Fetch significant GWAS associations for an EFO trait

View source: R/fetch_gwas.R

fetch_gwasR Documentation

Fetch significant GWAS associations for an EFO trait

Description

Tries gwasrapidd::get_associations() first; if it returns no rows or fails, falls back to the EBI GWAS Summary Statistics REST API to retrieve significant associations up to the given p-value threshold.

Usage

fetch_gwas(efo_id = "EFO_0001663", p_cut = 5e-08)

Arguments

efo_id

character. Experimental Factor Ontology (EFO) trait identifier (e.g., "EFO_0001663").

p_cut

numeric. P-value threshold for significance (default 5e-8).

Details

This function performs network calls and may be rate-limited. Column names returned by the REST API may change; defensive checks are applied.

Value

An S4 object of class "associations" with slots:

  • associations: data frame with association_id and pvalue.

  • risk_alleles: data frame mapping association_id to variant_id.

See Also

run_gwas2crispr

Examples


  # Network call; may be rate-limited, so we mark it as \donttest.
  a <- try(fetch_gwas("EFO_0001663", p_cut = 5e-8), silent = TRUE)
  if (!inherits(a, "try-error")) {
    head(a@associations)
  }



gwas2crispr documentation built on Aug. 23, 2025, 1:12 a.m.