[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EFGS14VJRJ4Y7ZB49E9F20":3,"skill-same:01M6EFGS14VJRJ4Y7ZB49E9F20":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6EFGS14VJRJ4Y7ZB49E9F20","gnomad-database",null,"Query gnomAD (Genome Aggregation Database) for population allele frequencies, variant constraint scores (pLI, LOEUF), and loss-of-function intolerance. Essential for variant pathogenicity interpretation, rare disease genetics, and identifying loss-of-function intolerant genes.","levalencia\u002Fagent-god-mode","levalencia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6962857?v=4","01M6EB0FZZ4BPQPC4HET4QY6NM","Luis Valencia ","01M6EB0G4HWHPWW0H9X7QKSAHP",3,"CC0-1.0","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fgnomad-database\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33],"database","gnomad database","gnomad","interpretation","aggregation","query","genetics","essential","rare disease genetics","variant pathogenicity","2026-11-10 10:12:30",false,"---\nname: gnomad-database\ndescription: Query gnomAD (Genome Aggregation Database) for population allele frequencies, variant constraint scores (pLI, LOEUF), and loss-of-function intolerance. Essential for variant pathogenicity interpretation, rare disease genetics, and identifying loss-of-function intolerant genes.\nlicense: CC0-1.0\nmetadata:\n    skill-author: Kuan-lin Huang\n---\n\n# gnomAD Database\n\n## Overview\n\nThe 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.\n\n**Key resources:**\n- gnomAD browser: https:\u002F\u002Fgnomad.broadinstitute.org\u002F\n- GraphQL API: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\n- Data downloads: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fdownloads\n- Documentation: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fhelp\n\n## When to Use This Skill\n\nUse gnomAD when:\n\n- **Variant frequency lookup**: Checking if a variant is rare, common, or absent in the general population\n- **Pathogenicity assessment**: Rare variants (MAF \u003C 1%) are candidates for disease causation; gnomAD helps filter benign common variants\n- **Loss-of-function intolerance**: Using pLI and LOEUF scores to assess whether a gene tolerates protein-truncating variants\n- **Population-stratified frequencies**: Comparing allele frequencies across ancestries (African\u002FAfrican American, Admixed American, Ashkenazi Jewish, East Asian, Finnish, Middle Eastern, Non-Finnish European, South Asian)\n- **ClinVar\u002FACMG variant classification**: gnomAD frequency data feeds into BA1\u002FBS1 evidence codes for variant classification\n- **Constraint analysis**: Identifying genes depleted of missense or loss-of-function variation (z-scores, pLI, LOEUF)\n\n## Core Capabilities\n\n### 1. gnomAD GraphQL API\n\ngnomAD uses a GraphQL API accessible at `https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi`. Most queries fetch variants by gene or specific genomic position.\n\n**Datasets available:**\n- `gnomad_r4` — gnomAD v4 exomes (recommended default, GRCh38)\n- `gnomad_r4_genomes` — gnomAD v4 genomes (GRCh38)\n- `gnomad_r3` — gnomAD v3 genomes (GRCh38)\n- `gnomad_r2_1` — gnomAD v2 exomes (GRCh37)\n\n**Reference genomes:**\n- `GRCh38` — default for v3\u002Fv4\n- `GRCh37` — for v2\n\n### 2. Querying Variants by Gene\n\n```python\nimport requests\n\ndef query_gnomad_gene(gene_symbol, dataset=\"gnomad_r4\", reference_genome=\"GRCh38\"):\n    \"\"\"Fetch variants in a gene from gnomAD.\"\"\"\n    url = \"https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\"\n\n    query = \"\"\"\n    query GeneVariants($gene_symbol: String!, $dataset: DatasetId!, $reference_genome: ReferenceGenomeId!) {\n      gene(gene_symbol: $gene_symbol, reference_genome: $reference_genome) {\n        gene_id\n        gene_symbol\n        variants(dataset: $dataset) {\n          variant_id\n          pos\n          ref\n          alt\n          consequence\n          genome {\n            af\n            ac\n            an\n            ac_hom\n            populations {\n              id\n              ac\n              an\n              af\n            }\n          }\n          exome {\n            af\n            ac\n            an\n            ac_hom\n          }\n          lof\n          lof_flags\n          lof_filter\n        }\n      }\n    }\n    \"\"\"\n\n    variables = {\n        \"gene_symbol\": gene_symbol,\n        \"dataset\": dataset,\n        \"reference_genome\": reference_genome\n    }\n\n    response = requests.post(url, json={\"query\": query, \"variables\": variables})\n    return response.json()\n\n# Example\nresult = query_gnomad_gene(\"BRCA1\")\ngene_data = result[\"data\"][\"gene\"]\nvariants = gene_data[\"variants\"]\n\n# Filter to rare PTVs\nrare_ptvs = [\n    v for v in variants\n    if v.get(\"lof\") == \"LC\" or v.get(\"consequence\") in [\"stop_gained\", \"frameshift_variant\"]\n    and v.get(\"genome\", {}).get(\"af\", 1) \u003C 0.001\n]\nprint(f\"Found {len(rare_ptvs)} rare PTVs in {gene_data['gene_symbol']}\")\n```\n\n### 3. Querying a Specific Variant\n\n```python\nimport requests\n\ndef query_gnomad_variant(variant_id, dataset=\"gnomad_r4\"):\n    \"\"\"Fetch details for a specific variant (e.g., '1-55516888-G-GA').\"\"\"\n    url = \"https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\"\n\n    query = \"\"\"\n    query VariantDetails($variantId: String!, $dataset: DatasetId!) {\n      variant(variantId: $variantId, dataset: $dataset) {\n        variant_id\n        chrom\n        pos\n        ref\n        alt\n        genome {\n          af\n          ac\n          an\n          ac_hom\n          populations {\n            id\n            ac\n            an\n            af\n          }\n        }\n        exome {\n          af\n          ac\n          an\n          ac_hom\n          populations {\n            id\n            ac\n            an\n            af\n          }\n        }\n        consequence\n        lof\n        rsids\n        in_silico_predictors {\n          id\n          value\n          flags\n        }\n        clinvar_variation_id\n      }\n    }\n    \"\"\"\n\n    response = requests.post(\n        url,\n        json={\"query\": query, \"variables\": {\"variantId\": variant_id, \"dataset\": dataset}}\n    )\n    return response.json()\n\n# Example: query a specific variant\nresult = query_gnomad_variant(\"17-43094692-G-A\")  # BRCA1 missense\nvariant = result[\"data\"][\"variant\"]\n\nif variant:\n    genome_af = variant.get(\"genome\", {}).get(\"af\", \"N\u002FA\")\n    exome_af = variant.get(\"exome\", {}).get(\"af\", \"N\u002FA\")\n    print(f\"Variant: {variant['variant_id']}\")\n    print(f\"  Consequence: {variant['consequence']}\")\n    print(f\"  Genome AF: {genome_af}\")\n    print(f\"  Exome AF: {exome_af}\")\n    print(f\"  LoF: {variant.get('lof')}\")\n```\n\n### 4. Gene Constraint Scores\n\ngnomAD constraint scores assess how tolerant a gene is to variation relative to expectation:\n\n```python\nimport requests\n\ndef query_gnomad_constraint(gene_symbol, reference_genome=\"GRCh38\"):\n    \"\"\"Fetch constraint scores for a gene.\"\"\"\n    url = \"https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\"\n\n    query = \"\"\"\n    query GeneConstraint($gene_symbol: String!, $reference_genome: ReferenceGenomeId!) {\n      gene(gene_symbol: $gene_symbol, reference_genome: $reference_genome) {\n        gene_id\n        gene_symbol\n        gnomad_constraint {\n          exp_lof\n          exp_mis\n          exp_syn\n          obs_lof\n          obs_mis\n          obs_syn\n          oe_lof\n          oe_mis\n          oe_syn\n          oe_lof_lower\n          oe_lof_upper\n          lof_z\n          mis_z\n          syn_z\n          pLI\n        }\n      }\n    }\n    \"\"\"\n\n    response = requests.post(\n        url,\n        json={\"query\": query, \"variables\": {\"gene_symbol\": gene_symbol, \"reference_genome\": reference_genome}}\n    )\n    return response.json()\n\n# Example\nresult = query_gnomad_constraint(\"KCNQ2\")\ngene = result[\"data\"][\"gene\"]\nconstraint = gene[\"gnomad_constraint\"]\n\nprint(f\"Gene: {gene['gene_symbol']}\")\nprint(f\"  pLI:   {constraint['pLI']:.3f}  (>0.9 = LoF intolerant)\")\nprint(f\"  LOEUF: {constraint['oe_lof_upper']:.3f}  (\u003C0.35 = highly constrained)\")\nprint(f\"  Obs\u002FExp LoF: {constraint['oe_lof']:.3f}\")\nprint(f\"  Missense Z:  {constraint['mis_z']:.3f}\")\n```\n\n**Constraint score interpretation:**\n| Score | Range | Meaning |\n|-------|-------|---------|\n| `pLI` | 0–1 | Probability of LoF intolerance; >0.9 = highly intolerant |\n| `LOEUF` | 0–∞ | LoF observed\u002Fexpected upper bound; \u003C0.35 = constrained |\n| `oe_lof` | 0–∞ | Observed\u002Fexpected ratio for LoF variants |\n| `mis_z` | −∞ to ∞ | Missense constraint z-score; >3.09 = constrained |\n| `syn_z` | −∞ to ∞ | Synonymous z-score (control; should be near 0) |\n\n### 5. Population Frequency Analysis\n\n```python\nimport requests\nimport pandas as pd\n\ndef get_population_frequencies(variant_id, dataset=\"gnomad_r4\"):\n    \"\"\"Extract per-population allele frequencies for a variant.\"\"\"\n    url = \"https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\"\n\n    query = \"\"\"\n    query PopFreqs($variantId: String!, $dataset: DatasetId!) {\n      variant(variantId: $variantId, dataset: $dataset) {\n        variant_id\n        genome {\n          populations {\n            id\n            ac\n            an\n            af\n            ac_hom\n          }\n        }\n      }\n    }\n    \"\"\"\n\n    response = requests.post(\n        url,\n        json={\"query\": query, \"variables\": {\"variantId\": variant_id, \"dataset\": dataset}}\n    )\n    data = response.json()\n    populations = data[\"data\"][\"variant\"][\"genome\"][\"populations\"]\n\n    df = pd.DataFrame(populations)\n    df = df[df[\"an\"] > 0].copy()\n    df[\"af\"] = df[\"ac\"] \u002F df[\"an\"]\n    df = df.sort_values(\"af\", ascending=False)\n    return df\n\n# Population IDs in gnomAD v4:\n# afr = African\u002FAfrican American\n# ami = Amish\n# amr = Admixed American\n# asj = Ashkenazi Jewish\n# eas = East Asian\n# fin = Finnish\n# mid = Middle Eastern\n# nfe = Non-Finnish European\n# sas = South Asian\n# remaining = Other\n```\n\n### 6. Structural Variants (gnomAD-SV)\n\ngnomAD also contains a structural variant dataset:\n\n```python\nimport requests\n\ndef query_gnomad_sv(gene_symbol):\n    \"\"\"Query structural variants overlapping a gene.\"\"\"\n    url = \"https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\"\n\n    query = \"\"\"\n    query SVsByGene($gene_symbol: String!) {\n      gene(gene_symbol: $gene_symbol, reference_genome: GRCh38) {\n        structural_variants {\n          variant_id\n          type\n          chrom\n          pos\n          end\n          af\n          ac\n          an\n        }\n      }\n    }\n    \"\"\"\n\n    response = requests.post(url, json={\"query\": query, \"variables\": {\"gene_symbol\": gene_symbol}})\n    return response.json()\n```\n\n## Query Workflows\n\n### Workflow 1: Variant Pathogenicity Assessment\n\n1. **Check population frequency** — Is the variant rare enough to be pathogenic?\n   - Use gnomAD AF \u003C 1% for recessive, \u003C 0.1% for dominant conditions\n   - Check ancestry-specific frequencies (a variant rare overall may be common in one population)\n\n2. **Assess functional impact** — LoF variants have highest prior probability\n   - Check `lof` field: `HC` = high-confidence LoF, `LC` = low-confidence\n   - Check `lof_flags` for issues like \"NAGNAG_SITE\", \"PHYLOCSF_WEAK\"\n\n3. **Apply ACMG criteria:**\n   - BA1: AF > 5% → Benign Stand-Alone\n   - BS1: AF > disease prevalence threshold → Benign Supporting\n   - PM2: Absent or very rare in gnomAD → Pathogenic Moderate\n\n### Workflow 2: Gene Prioritization in Rare Disease\n\n1. Query constraint scores for candidate genes\n2. Filter for pLI > 0.9 (haploinsufficient) or LOEUF \u003C 0.35\n3. Cross-reference with observed LoF variants in the gene\n4. Integrate with ClinVar and disease databases\n\n### Workflow 3: Population Genetics Research\n\n1. Identify variant of interest from GWAS or clinical data\n2. Query per-population frequencies\n3. Compare frequency differences across ancestries\n4. Test for enrichment in specific founder populations\n\n## Best Practices\n\n- **Use gnomAD v4 (gnomad_r4)** for the most current data; use v2 (gnomad_r2_1) only for GRCh37 compatibility\n- **Handle null responses**: Variants not observed in gnomAD are not necessarily pathogenic — absence is informative\n- **Distinguish exome vs. genome data**: Genome data has more uniform coverage; exome data is larger but may have coverage gaps\n- **Rate limit GraphQL queries**: Add delays between requests; batch queries when possible\n- **Homozygous counts** (`ac_hom`) are relevant for recessive disease analysis\n- **LOEUF is preferred over pLI** for gene constraint (less sensitive to sample size)\n\n## Data Access\n\n- **Browser**: https:\u002F\u002Fgnomad.broadinstitute.org\u002F — interactive variant and gene browsing\n- **GraphQL API**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi — programmatic access\n- **Downloads**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fdownloads — VCF, Hail tables, constraint tables\n- **Google Cloud**: gs:\u002F\u002Fgcp-public-data--gnomad\u002F\n\n## Additional Resources\n\n- **gnomAD website**: https:\u002F\u002Fgnomad.broadinstitute.org\u002F\n- **gnomAD blog**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fnews\n- **Downloads**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fdownloads\n- **API explorer**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi (interactive GraphiQL)\n- **Constraint documentation**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fhelp\u002Fconstraint\n- **Citation**: Karczewski KJ et al. (2020) Nature. PMID: 32461654; Chen S et al. (2024) Nature. PMID: 38conservation\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Fbroadinstitute\u002Fgnomad-browser\n","# gnomAD Database\n\n## Overview\n\nThe 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.\n\n**Key resources:**\n- gnomAD browser: https:\u002F\u002Fgnomad.broadinstitute.org\u002F\n- GraphQL API: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\n- Data downloads: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fdownloads\n- Documentation: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fhelp\n\n## When to Use This Skill\n\nUse gnomAD when:\n\n- **Variant frequency lookup**: Checking if a variant is rare, common, or absent in the general population\n- **Pathogenicity assessment**: Rare variants (MAF \u003C 1%) are candidates for disease causation; gnomAD helps filter benign common variants\n- **Loss-of-function intolerance**: Using pLI and LOEUF scores to assess whether a gene tolerates protein-truncating variants\n- **Population-stratified frequencies**: Comparing allele frequencies across ancestries (African\u002FAfrican American, Admixed American, Ashkenazi Jewish, East Asian, Finnish, Middle Eastern, Non-Finnish European, South Asian)\n- **ClinVar\u002FACMG variant classification**: gnomAD frequency data feeds into BA1\u002FBS1 evidence codes for variant classification\n- **Constraint analysis**: Identifying genes depleted of missense or loss-of-function variation (z-scores, pLI, LOEUF)\n\n## Core Capabilities\n\n### 1. gnomAD GraphQL API\n\ngnomAD uses a GraphQL API accessible at `https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi`. Most queries fetch variants by gene or specific genomic position.\n\n**Datasets available:**\n- `gnomad_r4` — gnomAD v4 exomes (recommended default, GRCh38)\n- `gnomad_r4_genomes` — gnomAD v4 genomes (GRCh38)\n- `gnomad_r3` — gnomAD v3 genomes (GRCh38)\n- `gnomad_r2_1` — gnomAD v2 exomes (GRCh37)\n\n**Reference genomes:**\n- `GRCh38` — default for v3\u002Fv4\n- `GRCh37` — for v2\n\n### 2. Querying Variants by Gene\n\n```python\nimport requests\n\ndef query_gnomad_gene(gene_symbol, dataset=\"gnomad_r4\", reference_genome=\"GRCh38\"):\n    \"\"\"Fetch variants in a gene from gnomAD.\"\"\"\n    url = \"https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\"\n\n    query = \"\"\"\n    query GeneVariants($gene_symbol: String!, $dataset: DatasetId!, $reference_genome: ReferenceGenomeId!) {\n      gene(gene_symbol: $gene_symbol, reference_genome: $reference_genome) {\n        gene_id\n        gene_symbol\n        variants(dataset: $dataset) {\n          variant_id\n          pos\n          ref\n          alt\n          consequence\n          genome {\n            af\n            ac\n            an\n            ac_hom\n            populations {\n              id\n              ac\n              an\n              af\n            }\n          }\n          exome {\n            af\n            ac\n            an\n            ac_hom\n          }\n          lof\n          lof_flags\n          lof_filter\n        }\n      }\n    }\n    \"\"\"\n\n    variables = {\n        \"gene_symbol\": gene_symbol,\n        \"dataset\": dataset,\n        \"reference_genome\": reference_genome\n    }\n\n    response = requests.post(url, json={\"query\": query, \"variables\": variables})\n    return response.json()\n\n# Example\nresult = query_gnomad_gene(\"BRCA1\")\ngene_data = result[\"data\"][\"gene\"]\nvariants = gene_data[\"variants\"]\n\n# Filter to rare PTVs\nrare_ptvs = [\n    v for v in variants\n    if v.get(\"lof\") == \"LC\" or v.get(\"consequence\") in [\"stop_gained\", \"frameshift_variant\"]\n    and v.get(\"genome\", {}).get(\"af\", 1) \u003C 0.001\n]\nprint(f\"Found {len(rare_ptvs)} rare PTVs in {gene_data['gene_symbol']}\")\n```\n\n### 3. Querying a Specific Variant\n\n```python\nimport requests\n\ndef query_gnomad_variant(variant_id, dataset=\"gnomad_r4\"):\n    \"\"\"Fetch details for a specific variant (e.g., '1-55516888-G-GA').\"\"\"\n    url = \"https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\"\n\n    query = \"\"\"\n    query VariantDetails($variantId: String!, $dataset: DatasetId!) {\n      variant(variantId: $variantId, dataset: $dataset) {\n        variant_id\n        chrom\n        pos\n        ref\n        alt\n        genome {\n          af\n          ac\n          an\n          ac_hom\n          populations {\n            id\n            ac\n            an\n            af\n          }\n        }\n        exome {\n          af\n          ac\n          an\n          ac_hom\n          populations {\n            id\n            ac\n            an\n            af\n          }\n        }\n        consequence\n        lof\n        rsids\n        in_silico_predictors {\n          id\n          value\n          flags\n        }\n        clinvar_variation_id\n      }\n    }\n    \"\"\"\n\n    response = requests.post(\n        url,\n        json={\"query\": query, \"variables\": {\"variantId\": variant_id, \"dataset\": dataset}}\n    )\n    return response.json()\n\n# Example: query a specific variant\nresult = query_gnomad_variant(\"17-43094692-G-A\")  # BRCA1 missense\nvariant = result[\"data\"][\"variant\"]\n\nif variant:\n    genome_af = variant.get(\"genome\", {}).get(\"af\", \"N\u002FA\")\n    exome_af = variant.get(\"exome\", {}).get(\"af\", \"N\u002FA\")\n    print(f\"Variant: {variant['variant_id']}\")\n    print(f\"  Consequence: {variant['consequence']}\")\n    print(f\"  Genome AF: {genome_af}\")\n    print(f\"  Exome AF: {exome_af}\")\n    print(f\"  LoF: {variant.get('lof')}\")\n```\n\n### 4. Gene Constraint Scores\n\ngnomAD constraint scores assess how tolerant a gene is to variation relative to expectation:\n\n```python\nimport requests\n\ndef query_gnomad_constraint(gene_symbol, reference_genome=\"GRCh38\"):\n    \"\"\"Fetch constraint scores for a gene.\"\"\"\n    url = \"https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\"\n\n    query = \"\"\"\n    query GeneConstraint($gene_symbol: String!, $reference_genome: ReferenceGenomeId!) {\n      gene(gene_symbol: $gene_symbol, reference_genome: $reference_genome) {\n        gene_id\n        gene_symbol\n        gnomad_constraint {\n          exp_lof\n          exp_mis\n          exp_syn\n          obs_lof\n          obs_mis\n          obs_syn\n          oe_lof\n          oe_mis\n          oe_syn\n          oe_lof_lower\n          oe_lof_upper\n          lof_z\n          mis_z\n          syn_z\n          pLI\n        }\n      }\n    }\n    \"\"\"\n\n    response = requests.post(\n        url,\n        json={\"query\": query, \"variables\": {\"gene_symbol\": gene_symbol, \"reference_genome\": reference_genome}}\n    )\n    return response.json()\n\n# Example\nresult = query_gnomad_constraint(\"KCNQ2\")\ngene = result[\"data\"][\"gene\"]\nconstraint = gene[\"gnomad_constraint\"]\n\nprint(f\"Gene: {gene['gene_symbol']}\")\nprint(f\"  pLI:   {constraint['pLI']:.3f}  (>0.9 = LoF intolerant)\")\nprint(f\"  LOEUF: {constraint['oe_lof_upper']:.3f}  (\u003C0.35 = highly constrained)\")\nprint(f\"  Obs\u002FExp LoF: {constraint['oe_lof']:.3f}\")\nprint(f\"  Missense Z:  {constraint['mis_z']:.3f}\")\n```\n\n**Constraint score interpretation:**\n| Score | Range | Meaning |\n|-------|-------|---------|\n| `pLI` | 0–1 | Probability of LoF intolerance; >0.9 = highly intolerant |\n| `LOEUF` | 0–∞ | LoF observed\u002Fexpected upper bound; \u003C0.35 = constrained |\n| `oe_lof` | 0–∞ | Observed\u002Fexpected ratio for LoF variants |\n| `mis_z` | −∞ to ∞ | Missense constraint z-score; >3.09 = constrained |\n| `syn_z` | −∞ to ∞ | Synonymous z-score (control; should be near 0) |\n\n### 5. Population Frequency Analysis\n\n```python\nimport requests\nimport pandas as pd\n\ndef get_population_frequencies(variant_id, dataset=\"gnomad_r4\"):\n    \"\"\"Extract per-population allele frequencies for a variant.\"\"\"\n    url = \"https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\"\n\n    query = \"\"\"\n    query PopFreqs($variantId: String!, $dataset: DatasetId!) {\n      variant(variantId: $variantId, dataset: $dataset) {\n        variant_id\n        genome {\n          populations {\n            id\n            ac\n            an\n            af\n            ac_hom\n          }\n        }\n      }\n    }\n    \"\"\"\n\n    response = requests.post(\n        url,\n        json={\"query\": query, \"variables\": {\"variantId\": variant_id, \"dataset\": dataset}}\n    )\n    data = response.json()\n    populations = data[\"data\"][\"variant\"][\"genome\"][\"populations\"]\n\n    df = pd.DataFrame(populations)\n    df = df[df[\"an\"] > 0].copy()\n    df[\"af\"] = df[\"ac\"] \u002F df[\"an\"]\n    df = df.sort_values(\"af\", ascending=False)\n    return df\n\n# Population IDs in gnomAD v4:\n# afr = African\u002FAfrican American\n# ami = Amish\n# amr = Admixed American\n# asj = Ashkenazi Jewish\n# eas = East Asian\n# fin = Finnish\n# mid = Middle Eastern\n# nfe = Non-Finnish European\n# sas = South Asian\n# remaining = Other\n```\n\n### 6. Structural Variants (gnomAD-SV)\n\ngnomAD also contains a structural variant dataset:\n\n```python\nimport requests\n\ndef query_gnomad_sv(gene_symbol):\n    \"\"\"Query structural variants overlapping a gene.\"\"\"\n    url = \"https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi\"\n\n    query = \"\"\"\n    query SVsByGene($gene_symbol: String!) {\n      gene(gene_symbol: $gene_symbol, reference_genome: GRCh38) {\n        structural_variants {\n          variant_id\n          type\n          chrom\n          pos\n          end\n          af\n          ac\n          an\n        }\n      }\n    }\n    \"\"\"\n\n    response = requests.post(url, json={\"query\": query, \"variables\": {\"gene_symbol\": gene_symbol}})\n    return response.json()\n```\n\n## Query Workflows\n\n### Workflow 1: Variant Pathogenicity Assessment\n\n1. **Check population frequency** — Is the variant rare enough to be pathogenic?\n   - Use gnomAD AF \u003C 1% for recessive, \u003C 0.1% for dominant conditions\n   - Check ancestry-specific frequencies (a variant rare overall may be common in one population)\n\n2. **Assess functional impact** — LoF variants have highest prior probability\n   - Check `lof` field: `HC` = high-confidence LoF, `LC` = low-confidence\n   - Check `lof_flags` for issues like \"NAGNAG_SITE\", \"PHYLOCSF_WEAK\"\n\n3. **Apply ACMG criteria:**\n   - BA1: AF > 5% → Benign Stand-Alone\n   - BS1: AF > disease prevalence threshold → Benign Supporting\n   - PM2: Absent or very rare in gnomAD → Pathogenic Moderate\n\n### Workflow 2: Gene Prioritization in Rare Disease\n\n1. Query constraint scores for candidate genes\n2. Filter for pLI > 0.9 (haploinsufficient) or LOEUF \u003C 0.35\n3. Cross-reference with observed LoF variants in the gene\n4. Integrate with ClinVar and disease databases\n\n### Workflow 3: Population Genetics Research\n\n1. Identify variant of interest from GWAS or clinical data\n2. Query per-population frequencies\n3. Compare frequency differences across ancestries\n4. Test for enrichment in specific founder populations\n\n## Best Practices\n\n- **Use gnomAD v4 (gnomad_r4)** for the most current data; use v2 (gnomad_r2_1) only for GRCh37 compatibility\n- **Handle null responses**: Variants not observed in gnomAD are not necessarily pathogenic — absence is informative\n- **Distinguish exome vs. genome data**: Genome data has more uniform coverage; exome data is larger but may have coverage gaps\n- **Rate limit GraphQL queries**: Add delays between requests; batch queries when possible\n- **Homozygous counts** (`ac_hom`) are relevant for recessive disease analysis\n- **LOEUF is preferred over pLI** for gene constraint (less sensitive to sample size)\n\n## Data Access\n\n- **Browser**: https:\u002F\u002Fgnomad.broadinstitute.org\u002F — interactive variant and gene browsing\n- **GraphQL API**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi — programmatic access\n- **Downloads**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fdownloads — VCF, Hail tables, constraint tables\n- **Google Cloud**: gs:\u002F\u002Fgcp-public-data--gnomad\u002F\n\n## Additional Resources\n\n- **gnomAD website**: https:\u002F\u002Fgnomad.broadinstitute.org\u002F\n- **gnomAD blog**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fnews\n- **Downloads**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fdownloads\n- **API explorer**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fapi (interactive GraphiQL)\n- **Constraint documentation**: https:\u002F\u002Fgnomad.broadinstitute.org\u002Fhelp\u002Fconstraint\n- **Citation**: Karczewski KJ et al. (2020) Nature. PMID: 32461654; Chen S et al. (2024) Nature. PMID: 38conservation\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Fbroadinstitute\u002Fgnomad-browser\n",{"name":5,"license":15,"metadata":39,"description":7},{"skill-author":40},"Kuan-lin Huang","main","fa638b97a18ff6d9f26cf0eaf3dfa123531bcc87","organized-skills\u002Fgnomad-database",1,"https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode","https:\u002F\u002Fgithub.com\u002Flevalencia","https:\u002F\u002Fmedium.com\u002F@luisevalencia","Microsoft MVP - Artificial Intelligence\r\nMachine Learning Enthusiast\r\n","2026-05-02 06:55:36",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add levalencia\u002Fagent-god-mode --skill gnomad-database",{"tool":56,"command":57},"bunx","bunx skills add levalencia\u002Fagent-god-mode --skill gnomad-database",{"tool":59,"command":60},"pnpm","pnpm dlx skills add levalencia\u002Fagent-god-mode --skill gnomad-database","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fgnomad-database\u002FSKILL.md",true,[64,70],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fgraphql_queries.md","REFERENCE","参考文档",5340,"https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fgnomad-database\u002Freferences\u002Fgraphql_queries.md",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fvariant_interpretation.md",3551,"https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fgnomad-database\u002Freferences\u002Fvariant_interpretation.md",[75,98,132,159,185,213],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":34},"01M6EM8ES5M9J4S8N78NJST0YC","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","MIT","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fzarr-python\u002FSKILL.md",[],[83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],"python","zarr python","storage","integration","s3","gcs","cloud","dask","parallel","pipelines","arrays","numpy","scientific computing","scale","scientific",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":113,"publishedAt":34},"01M6EM8AR6ZFKZ9YVW8TTG850Z","zabbix","Zabbix monitoring system automation via API and Python. Use when: (1) Managing hosts, templates, items, triggers, or host groups, (2) Automating monitoring configuration, (3) Sending data via Zabbix trapper\u002Fsender, (4) Querying historical data or events, (5) Bulk operations on Zabbix objects, (6) Maintenance window management, (7) User\u002Fpermission management","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fzabbix-api-skill\u002FSKILL.md",[104,105,108],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":106,"categoryName":107,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":109,"categoryName":110,"taxonomyType":111,"taxonomyTypeDesc":112},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[100,83,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131],"automation","window management","monitoring","data","templates","api","system","operations","use","maintenance","objects","permission","bulk operations","triggers","host","events","via","bulk",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":34},"01M6EM6Q9JG846ECQY9A210A26","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fx-twitter-growth\u002FSKILL.md",[],[139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158],"twitter","x twitter growth","growth","competitive intelligence","search","analyzing","plan","marketing","web search","competitors","analyze","write","optimize","social","intelligence","viral","growth engine","mechanics","grow","competitive",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":34},"01M6EM3FQNPYNKPC4CV9TCVNGD","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fwhat-if-oracle\u002FSKILL.md",[],[166,167,168,169,170,171,172,173,174,175,176,177,122,178,179,180,181,182,183,184],"oracle","what if oracle","test","planning","ux","futures","risk","analysis","explore","decision","branch","question","exploration","options","stress-test","strategies","trigger","case","multi",{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":194,"publishedAt":34},"01M6EM08C06RGDYCJ86HAPK0FF","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fvercel-react-best-practices\u002FSKILL.md",[191],{"categoryNo":192,"categoryName":193,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[195,196,197,198,199,200,201,202,203,204,205,206,207,117,208,209,210,211,212,127],"react","vercel react best practices","best practices","react best practices","vercel","writing","performance","components","react components","guidelines","tasks","code","Optimization","Next.js","refactoring","performance optimization","next","pages",{"skillNo":214,"name":215,"nameZh":6,"description":216,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":79,"licenseFileUrl":6,"sourceHtmlUrl":217,"categories":218,"keywords":229,"publishedAt":34},"01M6EM00S13326QM08DTM94J6Z","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002Flevalencia\u002Fagent-god-mode\u002Fblob\u002Fmain\u002Forganized-skills\u002Fvenue-templates\u002FSKILL.md",[219,222,225,226],{"categoryNo":220,"categoryName":221,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":223,"categoryName":224,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":106,"categoryName":107,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":227,"categoryName":228,"taxonomyType":111,"taxonomyTypeDesc":112},"01JBSEEDCAT000000000000036","内容创作者",[118,230,231,204,232,233,234,235,236,237,238,150,239,240,241,242,243,244,97,245],"venue templates","research","NeurIPS","ICML","LaTeX","science","Bash","access","read","edit","proposals","Academic","requirements","formatting","journal","chi"]