Contents
FetchGWASCatalogRule
GWAS Catalog fetch rule
FetchGWASCatalogRule resolves a single GWAS Catalog request into one
gwas.sumstats resource.
Details
Reactive rule that materializes gwas.sumstats resources from GWAS Catalog
requests.
Retrieval is arranged as a ladder so that anything reachable on the GWAS Catalog is reachable here, regardless of how a study is exposed through the REST API:
- the harmonized FTP directory is derived deterministically from the accession (blocks of 1000), so no study-metadata endpoint is required to locate the data -- this is the primary path;
- harmonized metadata (YAML) and summary statistics are read from that directory, trying the conventional file names first and falling back to a directory listing for legacy layouts;
- study-level metadata is fetched as optional enrichment (REST v2, then v1); any failure is swallowed and never blocks retrieval;
- all sources are folded into one canonical metadata bag in which
traitandbuildare always populated (harmonized YAML is the reliable floor); - summary statistics are read column-selected and filtered at
pval <= pval.maxbefore any per-column coercion; betais taken from the reported effect size where a row has one and derived aslog(odds_ratio)where it does not. The fallback is per row, not per column: a harmonized file carries both columns whatever the study reported, so a study that published odds ratios leaves the beta column present and empty. The fetch fails only when no row has a usable value in either.
beta and se are on the log scale in what this rule emits; odds_ratio,
ci_lower and ci_upper are passed through on the ratio scale as the
Catalog published them. Nothing in PolyGenius reads the latter three, but
anyone inspecting $variants directly should know the table holds both.
Super class
PolyGenius::Rule -> FetchGWASCatalogRule
Methods
Public methods
FetchGWASCatalogRule$new()FetchGWASCatalogRule$matches()FetchGWASCatalogRule$inputs()FetchGWASCatalogRule$requirements()FetchGWASCatalogRule$run()FetchGWASCatalogRule$clone()
Method new()
Create the GWAS Catalog fetch rule.
Usage
FetchGWASCatalogRule$new()
Method matches()
Check whether this rule can produce the requested output.
Usage
FetchGWASCatalogRule$matches(output.spec)
Arguments
output.spec — Output resource specification.
Returns
TRUE for GWAS Catalog gwas.sumstats outputs.
Method inputs()
Build rule input specifications.
Usage
FetchGWASCatalogRule$inputs(output.spec)
Arguments
output.spec — Output resource specification.
Returns
Empty named list; GWAS Catalog source details live on output.spec.
Method requirements()
Declare resource requirements for this rule.
Usage
FetchGWASCatalogRule$requirements(output.spec, inputs)
Arguments
output.spec — Output resource specification.
inputs — Bound input values/specifications.
Returns
Named list with cores and memory.
Method run()
Execute GWAS Catalog retrieval for one request.
Usage
FetchGWASCatalogRule$run(output.spec, inputs, logger = pg.logger())
Arguments
output.spec — Output resource specification.
inputs — Named list of bound input values.
logger — Rule logger.
Returns
Rule result list with data, meta, and logs.
Method clone()
The objects of this class are cloneable with this method.
Usage
FetchGWASCatalogRule$clone(deep = FALSE)
Arguments
deep — Whether to make a deep clone.
See Also
Other source-rules:
FetchOpenGWASRule,
FetchPGSCatalogRule,
LoadLocalGWASRule