Forge Tools open_gwas

open_gwas read

scidex.forge.open_gwas

Query the IEU OpenGWAS database (>50,000 GWAS datasets) for summary statistics. Supports dataset metadata lookup by ID (e.g. ieu-b-40), genome-wide significant top hits, per-variant association lookup, and free-text trait search. Complements scidex.forge.gwas_catalog (NHGRI-EBI curated hits) with full summary statistics and a broader dataset corpus. REST API: https://gwas.mrcieu.ac.uk/api — public, no auth.

HTTP: POST /api/scidex/forge/open_gwas

Invoke

Calls scidex.tool.invoke on the substrate with this tool name. Edit the JSON below — it must match the input schema. The substrate runs the tool, records the call in substrate_tool_calls, and returns a structured envelope.

Sign in to invoke this tool. Schema and curl snippet are visible to anyone.

Schemas

Input schema
{
  "additionalProperties": false,
  "description": "Input schema for ``scidex.forge.open_gwas``.",
  "properties": {
    "gwas_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "OpenGWAS dataset ID to look up (e.g. ``'ieu-b-40'`` for BMI). Returns dataset metadata and top hits. Required when ``variants`` is provided.",
      "title": "Gwas Id"
    },
    "trait_query": {
      "anyOf": [
        {
          "maxLength": 200,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Free-text trait search (e.g. ``'BMI'``, ``'type 2 diabetes'``). Returns datasets whose trait name contains this string.",
      "title": "Trait Query"
    },
    "variants": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "rsIDs for per-variant association lookup (e.g. ``['rs1421085']``). Requires ``gwas_id``. Uses POST /associations.",
      "title": "Variants"
    },
    "pvalue_threshold": {
      "default": 5e-8,
      "description": "Maximum p-value for hit inclusion. Default 5e-8 (genome-wide significance). Raise to 1e-5 for sub-threshold hits.",
      "exclusiveMinimum": 0,
      "maximum": 1,
      "title": "Pvalue Threshold",
      "type": "number"
    },
    "limit": {
      "default": 20,
      "description": "Maximum results per query type. Default 20.",
      "maximum": 500,
      "minimum": 1,
      "title": "Limit",
      "type": "integer"
    }
  },
  "title": "ForgeOpenGWASIn",
  "type": "object"
}
Output schema
{
  "$defs": {
    "GWASAssociation": {
      "description": "One GWAS variant-trait association from OpenGWAS.",
      "properties": {
        "variant_id": {
          "description": "dbSNP rsID (e.g. ``'rs1421085'``).",
          "title": "Variant Id",
          "type": "string"
        },
        "chromosome": {
          "default": "",
          "description": "Chromosome (e.g. ``'16'``).",
          "title": "Chromosome",
          "type": "string"
        },
        "position": {
          "description": "Genomic position (bp, on the genome build reported).",
          "title": "Position",
          "type": "integer"
        },
        "effect_allele": {
          "default": "",
          "description": "Effect allele.",
          "title": "Effect Allele",
          "type": "string"
        },
        "other_allele": {
          "default": "",
          "description": "Non-effect allele.",
          "title": "Other Allele",
          "type": "string"
        },
        "beta": {
          "description": "Effect size (log-OR for binary traits).",
          "title": "Beta",
          "type": "number"
        },
        "se": {
          "description": "Standard error of ``beta``.",
          "title": "Se",
          "type": "number"
        },
        "pvalue": {
          "description": "Association p-value.",
          "title": "Pvalue",
          "type": "number"
        },
        "eaf": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Effect allele frequency.",
          "title": "Eaf"
        }
      },
      "required": [
        "variant_id",
        "position",
        "beta",
        "se",
        "pvalue"
      ],
      "title": "GWASAssociation",
      "type": "object"
    },
    "GWASDataset": {
      "description": "OpenGWAS dataset descriptor.",
      "properties": {
        "id": {
          "description": "OpenGWAS dataset ID (e.g. ``'ieu-b-40'``).",
          "title": "Id",
          "type": "string"
        },
        "trait": {
          "description": "Trait or phenotype name.",
          "title": "Trait",
          "type": "string"
        },
        "n_samples": {
          "description": "Total sample size.",
          "title": "N Samples",
          "type": "integer"
        },
        "n_cases": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Cases (case-control studies only).",
          "title": "N Cases"
        },
        "population": {
          "default": "",
          "description": "Study population (e.g. ``'European'``).",
          "title": "Population",
          "type": "string"
        },
        "build": {
          "default": "",
          "description": "Genome build (e.g. ``'HG19/GRCh37'``).",
          "title": "Build",
          "type": "string"
        },
        "author": {
          "default": "",
          "description": "First author surname.",
          "title": "Author",
          "type": "string"
        },
        "year": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Publication year.",
          "title": "Year"
        },
        "pmid": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "PubMed ID of the primary paper.",
          "title": "Pmid"
        }
      },
      "required": [
        "id",
        "trait",
        "n_samples"
      ],
      "title": "GWASDataset",
      "type": "object"
    }
  },
  "description": "Response shape for ``scidex.forge.open_gwas``.",
  "properties": {
    "gwas_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Queried GWAS dataset ID.",
      "title": "Gwas Id"
    },
    "dataset": {
      "anyOf": [
        {
          "$ref": "#/$defs/GWASDataset"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Dataset metadata."
    },
    "top_hits": {
      "description": "Top associations (p < ``pvalue_threshold``).",
      "items": {
        "$ref": "#/$defs/GWASAssociation"
      },
      "title": "Top Hits",
      "type": "array"
    },
    "trait_search_results": {
      "description": "Datasets matching a ``trait_query``.",
      "items": {
        "$ref": "#/$defs/GWASDataset"
      },
      "title": "Trait Search Results",
      "type": "array"
    },
    "not_found": {
      "default": false,
      "description": "``True`` when ``gwas_id`` was supplied but returned no dataset.",
      "title": "Not Found",
      "type": "boolean"
    },
    "source": {
      "default": "IEU OpenGWAS (gwas.mrcieu.ac.uk)",
      "description": "Data source identifier.",
      "title": "Source",
      "type": "string"
    },
    "took_ms": {
      "description": "Wall-clock time for the upstream call(s).",
      "title": "Took Ms",
      "type": "integer"
    }
  },
  "required": [
    "took_ms"
  ],
  "title": "ForgeOpenGWASOut",
  "type": "object"
}

curl snippet

Replace $SCIDEX_JWT with a valid bearer token. Read verbs are usually accessible without auth in dev; production requires a JWT.

curl -sS -X POST '/api/scidex/forge/open_gwas' \
  -H 'authorization: Bearer $SCIDEX_JWT' \
  -H 'content-type: application/json' \
  -d '{}'

Discussion

Posting anonymously. Sign in for attribution.

No comments yet — be the first.