alterlab-gnomad — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited alterlab-gnomad (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
The Genome Aggregation Database (gnomAD) is the largest publicly available collection of human genetic variation, aggregated from large-scale sequencing projects. gnomAD v4 contains exome sequences from 730,947 individuals and genome sequences from 76,215 individuals across diverse ancestries. It provides population allele frequencies, variant consequence annotations, and gene-level constraint metrics that are essential for interpreting the clinical significance of genetic variants.
Key resources:
Use gnomAD when:
gnomAD uses a GraphQL API accessible at https://gnomad.broadinstitute.org/api. Most queries fetch variants by gene or specific genomic position.
Datasets available (values of the DatasetId enum):
gnomad_r4 — gnomAD v4, GRCh38 (recommended default; returns both exome and genome blocks per variant — there is no separate gnomad_r4_genomes id)gnomad_r3 — gnomAD v3 genomes, GRCh38gnomad_r2_1 — gnomAD v2, GRCh37 (use only for GRCh37 compatibility)Structural and copy-number variants use separate enums: structural_variants(dataset: gnomad_sv_r4) and copy_number_variants(dataset: gnomad_cnv_r4).
Reference genomes:
GRCh38 — default for v3/v4GRCh37 — for v2import requests
def query_gnomad_gene(gene_symbol, dataset="gnomad_r4", reference_genome="GRCh38"):
"""Fetch variants in a gene from gnomAD."""
url = "https://gnomad.broadinstitute.org/api"
query = """
query GeneVariants($gene_symbol: String!, $dataset: DatasetId!, $reference_genome: ReferenceGenomeId!) {
gene(gene_symbol: $gene_symbol, reference_genome: $reference_genome) {
gene_id
symbol
variants(dataset: $dataset) {
variant_id
pos
ref
alt
consequence
genome {
af
ac
an
ac_hom
populations {
id
ac
an
ac_hom
}
}
exome {
af
ac
an
ac_hom
}
lof
lof_flags
lof_filter
}
}
}
"""
variables = {
"gene_symbol": gene_symbol,
"dataset": dataset,
"reference_genome": reference_genome
}
response = requests.post(url, json={"query": query, "variables": variables})
return response.json()
# Example
result = query_gnomad_gene("BRCA1")
gene_data = result["data"]["gene"]
variants = gene_data["variants"]
# Filter to rare protein-truncating variants.
# Note the parentheses: without them `and` binds tighter than `or`, so the AF
# filter would silently apply only to the consequence branch.
# Per-population frequency is af = ac / an (the populations entries expose
# ac/an, not af). Genome `af` here is absent for variants seen only in exomes,
# so fall back to exome af.
def variant_af(v):
g = (v.get("genome") or {}).get("af")
return g if g is not None else (v.get("exome") or {}).get("af", 1)
rare_ptvs = [
v for v in variants
if (v.get("lof") == "HC" or v.get("consequence") in ["stop_gained", "frameshift_variant"])
and variant_af(v) < 0.001
]
print(f"Found {len(rare_ptvs)} rare PTVs in {gene_data['symbol']}")import requests
def query_gnomad_variant(variant_id, dataset="gnomad_r4"):
"""Fetch details for a specific variant (e.g., '1-55516888-G-GA')."""
url = "https://gnomad.broadinstitute.org/api"
# On a single variant, consequence/lof are NOT top-level fields — they
# live under transcript_consequences[] (per transcript). Populations
# expose ac/an only; compute per-population af = ac / an.
query = """
query VariantDetails($variantId: String!, $dataset: DatasetId!) {
variant(variantId: $variantId, dataset: $dataset) {
variant_id
chrom
pos
ref
alt
rsids
genome {
af
ac
an
ac_hom
populations { id ac an ac_hom }
}
exome {
af
ac
an
ac_hom
populations { id ac an ac_hom }
}
transcript_consequences {
gene_symbol
major_consequence
lof
lof_flags
is_canonical
}
in_silico_predictors {
id
value
flags
}
}
}
"""
response = requests.post(
url,
json={"query": query, "variables": {"variantId": variant_id, "dataset": dataset}}
)
return response.json()
# Example: query a specific variant
result = query_gnomad_variant("17-43094692-G-C") # BRCA1 missense, rs80357199
variant = result["data"]["variant"]
if variant:
genome_af = (variant.get("genome") or {}).get("af", "N/A")
exome_af = (variant.get("exome") or {}).get("af", "N/A")
# Pick the consequence from the canonical transcript when present.
tcs = variant.get("transcript_consequences") or []
canonical = next((t for t in tcs if t.get("is_canonical")), tcs[0] if tcs else {})
print(f"Variant: {variant['variant_id']}")
print(f" Consequence: {canonical.get('major_consequence')}")
print(f" Genome AF: {genome_af}")
print(f" Exome AF: {exome_af}")
print(f" LoF: {canonical.get('lof')}")gnomAD constraint scores assess how tolerant a gene is to variation relative to expectation:
import requests
def query_gnomad_constraint(gene_symbol, reference_genome="GRCh38"):
"""Fetch constraint scores for a gene."""
url = "https://gnomad.broadinstitute.org/api"
query = """
query GeneConstraint($gene_symbol: String!, $reference_genome: ReferenceGenomeId!) {
gene(gene_symbol: $gene_symbol, reference_genome: $reference_genome) {
gene_id
symbol
gnomad_constraint {
exp_lof
exp_mis
exp_syn
obs_lof
obs_mis
obs_syn
oe_lof
oe_mis
oe_syn
oe_lof_lower
oe_lof_upper
lof_z
mis_z
syn_z
pLI
}
}
}
"""
response = requests.post(
url,
json={"query": query, "variables": {"gene_symbol": gene_symbol, "reference_genome": reference_genome}}
)
return response.json()
# Example
result = query_gnomad_constraint("KCNQ2")
gene = result["data"]["gene"]
constraint = gene["gnomad_constraint"]
print(f"Gene: {gene['symbol']}")
print(f" pLI: {constraint['pLI']:.3f} (>0.9 = LoF intolerant)")
print(f" LOEUF: {constraint['oe_lof_upper']:.3f} (<0.35 = highly constrained)")
print(f" Obs/Exp LoF: {constraint['oe_lof']:.3f}")
print(f" Missense Z: {constraint['mis_z']:.3f}")Constraint score interpretation:
| Score | Range | Meaning |
|---|---|---|
pLI | 0–1 | Probability of LoF intolerance; >0.9 = highly intolerant |
LOEUF | 0–∞ | LoF observed/expected upper bound; <0.35 = constrained |
oe_lof | 0–∞ | Observed/expected ratio for LoF variants |
mis_z | −∞ to ∞ | Missense constraint z-score; >3.09 = constrained |
syn_z | −∞ to ∞ | Synonymous z-score (control; should be near 0) |
import requests
import pandas as pd
def get_population_frequencies(variant_id, dataset="gnomad_r4"):
"""Extract per-population allele frequencies for a variant."""
url = "https://gnomad.broadinstitute.org/api"
query = """
query PopFreqs($variantId: String!, $dataset: DatasetId!) {
variant(variantId: $variantId, dataset: $dataset) {
variant_id
genome {
populations {
id
ac
an
ac_hom
}
}
}
}
"""
response = requests.post(
url,
json={"query": query, "variables": {"variantId": variant_id, "dataset": dataset}}
)
data = response.json()
populations = data["data"]["variant"]["genome"]["populations"]
df = pd.DataFrame(populations)
df = df[df["an"] > 0].copy()
df["af"] = df["ac"] / df["an"]
df = df.sort_values("af", ascending=False)
return df
# Population IDs in gnomAD v4:
# afr = African/African American
# ami = Amish
# amr = Admixed American
# asj = Ashkenazi Jewish
# eas = East Asian
# fin = Finnish
# mid = Middle Eastern
# nfe = Non-Finnish European
# sas = South Asian
# remaining = OthergnomAD also contains a structural variant dataset:
import requests
def query_gnomad_sv(gene_symbol):
"""Query structural variants overlapping a gene."""
url = "https://gnomad.broadinstitute.org/api"
# structural_variants requires a dataset argument (gnomad_sv_r4).
query = """
query SVsByGene($gene_symbol: String!, $dataset: StructuralVariantDatasetId!) {
gene(gene_symbol: $gene_symbol, reference_genome: GRCh38) {
structural_variants(dataset: $dataset) {
variant_id
type
chrom
pos
end
af
ac
an
}
}
}
"""
response = requests.post(
url,
json={"query": query, "variables": {"gene_symbol": gene_symbol, "dataset": "gnomad_sv_r4"}}
)
return response.json()lof field: HC = high-confidence LoF, LC = low-confidencelof_flags for issues like "NAGNAG_SITE", "PHYLOCSF_WEAK"ac_hom) are relevant for recessive disease analysisscripts/query_gnomad.py — runnable helper for the gnomAD GraphQL API (no key). It carries inline PEP 723 deps, so run the file directly with uv run (not uv run python ...) to auto-install requests:
uv run scripts/query_gnomad.py variant 17-43094692-G-C --dataset gnomad_r4
uv run scripts/query_gnomad.py constraint BRCA1 --genome GRCh38~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.