[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M735KM2SFJSTWQRB7ACSQZJN":3,"skill-same:01M735KM2SFJSTWQRB7ACSQZJN":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M735KM2SFJSTWQRB7ACSQZJN","alterlab-gnomad",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. Part of the AlterLab Academic Skills suite.","roohe\u002Fagentic-super-skills","roohe","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99054084?v=4","01M734WCDFP6RZVT5CNM00QR26","01M734WCE4BD0T4NZS5PCV9V5F",10,"CC0-1.0","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-gnomad\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: alterlab-gnomad\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. Part of the AlterLab Academic Skills suite.\nlicense: CC0-1.0\nmetadata:\n    skill-author: AlterLab\n    version: \"1.0.0\"\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":14,"metadata":23,"description":7},{"version":24,"skill-author":25},"1.0.0","AlterLab","master","f483e54f3ad5f202a77d45f2e57f8d970b71195f","skills_library\u002Falterlab-gnomad",2,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills","https:\u002F\u002Fgithub.com\u002Froohe","yoou.link","2026-05-19 15:56:07",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add roohe\u002Fagentic-super-skills --skill alterlab-gnomad",{"tool":40,"command":41},"bunx","bunx skills add roohe\u002Fagentic-super-skills --skill alterlab-gnomad",{"tool":43,"command":44},"pnpm","pnpm dlx skills add roohe\u002Fagentic-super-skills --skill alterlab-gnomad","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-gnomad\u002FSKILL.md",true,[48,54],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"references\u002Fgraphql_queries.md","REFERENCE","参考文档",5340,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-gnomad\u002Freferences\u002Fgraphql_queries.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fvariant_interpretation.md",3551,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-gnomad\u002Freferences\u002Fvariant_interpretation.md",[59,67,74,81,88,95],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":63,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M73D865CZME2FCMKA4PQM348","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\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":63,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M73D7Z64J4ABWZJD7P44XBBF","youtube-downloader","Download and process YouTube content for research. Use when: downloading competitor videos for analysis; extracting audio for podcasts; getting transcripts for content repurposing; archiving webinars; research content curation","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fyoutube-downloader\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":63,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M73D7K8778TGZV3GJFR3703D","yc-pitch-deck","Create a compelling startup pitch deck that follows the structure proven to raise billions from top investors. Master the YC and Sequoia formats that get founders funded. Use when: **Fundraising** to create investor pitch decks; **YC application** to structure your narrative; **Demo Day prep** to craft your 2-minute pitch; **Angel investors** to communicate your opportunity; **Partnership pitches** to structure compelling asks","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fyc-pitch-deck\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":63,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M73D70KJSE0E8Z28YMNNRT04","x-twitter-scraper","Use when the user needs X (Twitter) data or confirmation-gated X actions through Xquik: tweet search, user lookup, follower extraction, media download, monitoring, webhooks, MCP, SDKs, posting, likes, DMs, and profile updates. Requires a Xquik API key. Never ask for X login material.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fx-twitter-scraper\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":63,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":18},"01M73D6ED01GV077R7K4NZNFZJ","write-vignette","Create R package vignettes using R Markdown or Quarto. Covers vignette setup, YAML configuration, code chunk options, building and testing, and CRAN requirements for vignettes. Use when adding a Getting Started tutorial, documenting complex workflows spanning multiple functions, creating domain-specific guides, or when CRAN submission requires user-facing documentation beyond function help pages.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fwrite-vignette\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":63,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":18},"01M73D69YJR0BK3NFHE0CYG3EF","write-validation-documentation","Write IQ\u002FOQ\u002FPQ validation documentation for computerized systems in regulated environments. Covers protocols, reports, test scripts, deviation handling, and approval workflows. Use when validating R or other software for regulated use, preparing for a regulatory audit, documenting qualification of computing environments, or creating and updating validation protocols and reports for new or re-qualified systems.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fwrite-validation-documentation\u002FSKILL.md",[],[]]