
Gnomad Database
Pull gnomAD gene constraint metrics (pLI, LOEUF, etc.) for a symbol into JSON for variant or gene prioritization research.
Overview
Gnomad-database is an agent skill for the Idea phase that retrieves gnomAD gene constraint metrics via GraphQL and saves them as JSON for research workflows.
Install
npx skills add https://github.com/google-deepmind/science-skills --skill gnomad-databaseWhat is this skill?
- Queries gnomAD GraphQL API for per-gene constraint fields
- Built-in HTTP client throttled to ~10 queries per minute API policy
- Writes results to a caller-specified output path as JSON
- Python 3.10+ with shared scienceskillscommon dependency pattern
- CLI-oriented script suitable for agent-orchestrated bioinformatics pipelines
- Rate limit enforced at 10 queries per minute against the gnomAD API
Adoption & trust: 534 installs on skills.sh; 1.7k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need official gnomAD constraint numbers for a gene symbol without manually using the web UI or violating API rate limits.
Who is it for?
Bioinformatics-minded solo builders scripting gene triage, literature agents, or validation notebooks that cite gnomAD.
Skip if: Bulk genome-wide scraping, offline-only environments without network, or workflows that need variant-level VCF mining in one shot.
When should I use this skill?
Fetch gnomAD constraint metrics for a gene symbol when building or validating genomics research outputs.
What do I get? / Deliverables
A JSON file with the requested constraint payload is written to your output path, fetched under the documented queries-per-minute cap.
- JSON file with gnomAD gene constraint fields at the specified output path
Recommended Skills
Journey fit
Early scientific and product research on genetic targets needs authoritative population constraint data before committing to a build. Research subphase covers external database lookups that inform whether a gene is worth deeper validation work.
How it compares
Use as a rate-limited API skill rather than ad-hoc curl against gnomAD without throttling or schema knowledge.
Common Questions / FAQ
Who is gnomad-database for?
Solo builders and researchers building genomics agents or data pipelines who need constraint metrics from gnomAD in a scriptable, agent-invokable form.
When should I use gnomad-database?
During Idea research when prioritizing genes or explaining pathogenicity hypotheses; also early Validate scope work when constraint data defines MVP feature requirements.
Is gnomad-database safe to install?
It only calls the public gnomAD API and writes local JSON—review the Security Audits panel on this page and treat output paths as sensitive if embedded in clinical contexts.
SKILL.md
READMESKILL.md - Gnomad Database
# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Fetches gene constraint metrics from gnomAD. This script retrieves constraint metrics (pLI, LOEUF, etc.) for a given gene from the gnomAD database using its GraphQL API. It enforces a rate limit of 10 queries per minute to respect the API's usage policy. """ # /// script # requires-python = ">=3.10" # dependencies = [ # "scienceskillscommon", # ] # [tool.uv.sources] # scienceskillscommon = { path = "../../scienceskillscommon" } # /// import argparse import json import os from science_skills.scienceskillscommon import http_client # Respect 10 queries per minute requirement. CLIENT = http_client.HttpClient("https://gnomad.broadinstitute.org", qps=0.1666) def get_gene_constraint( gene_symbol: str, output_path: str, ): """Fetch gene constraint from gnomAD.""" url = "https://gnomad.broadinstitute.org/api" query = """ query($geneSymbol: String!, $referenceGenome: ReferenceGenomeId!) { gene(gene_symbol: $geneSymbol, reference_genome: $referenceGenome) { gene_id symbol gnomad_constraint { pli oe_lof oe_lof_lower oe_lof_upper oe_mis oe_mis_lower oe_mis_upper } } } """ variables = {"geneSymbol": gene_symbol, "referenceGenome": "GRCh38"} response_data = CLIENT.fetch_json( url, method="POST", json_body={"query": query, "variables": variables}, ) result = json.dumps(response_data, indent=2) os.makedirs(os.path.dirname(output_path), exist_ok=True) with open(output_path, "w") as f: f.write(result) f.write("\n") if __name__ == "__main__": parser = argparse.ArgumentParser( description="Fetch gene constraint from gnomAD" ) parser.add_argument("--gene", required=True, help="Gene symbol (e.g. PCSK9)") parser.add_argument( "--output", "-o", required=True, help="Output file path. Prints to stdout if not specified.", ) args = parser.parse_args() get_gene_constraint(args.gene, args.output) # Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Fetches variant frequency from gnomAD.""" # /// script # requires-python = ">=3.10" # dependencies = [ # "scienceskillscommon", # ] # [tool.uv.sources] # scienceskillscommon = { path = "../../scienceskillscommon" } # /// import argparse import json import os import sys from science_skills.scienceskillscommon import http_client # Respect 10 queries per minute requirement. CLIENT = http_client.HttpClient("https://gnomad.broadinstitute.org", qps=0.1666) def resolve_rsid(rsid: str, dataset: str) -> str: """Resolves an rsID to a variant ID.""" url = "https://gnomad.broadinstitute.org/api" query = """ query($query: String!, $dataset: DatasetId!) { variant_search(query: $query, dataset: $dataset) { variant_id } } """ variables = {"query": rsid, "dataset": dataset} response_data = CLIENT.fetch_json(