Skill Tracer
Skills › Scientific Agent Skills › onekgpd

onekgpd

skill · 429 lines · MIT · skills/onekgpd/SKILL.md

The facts

Its description

Queries the 1000 Genomes Project dataset (3,202 whole-genome-sequenced individuals, GRCh38) at the level of individual participants. Use when a question is about individuals or variants in the 1000 Genomes Project cohort: which individuals carry variants matching specific criteria in a gene or region, which individuals are homozygous-reference at a position, which variants exist in the dataset or carried by specified individuals in a gene or region, the relatedness between two specified individuals. Variants are returned with 1000 Genomes allele frequencies (AF), gnomAD v4.1 exome and genome AF, AlphaMissense score, and HGVSp annotations.

The description the agent reads to decide when to use it.

From its settingsline 3

Tools it may use, or may not

allowed-tools: Write Bash

Tools it may use while it runs without asking you first.

From its settingsline 15

Runs scripts

scripts/onekgpd_api.py, scripts/onekgpd_meta.py (first 5 of 14 lines)

Scripts the text names. Found by matching words, so treat them as pointers.

Found by matching wordsline 102 line 104 line 242 line 248 line 255

Files it mentions

scripts/onekgpd_api.py, scripts/onekgpd_meta.py, references/onekgpd_commands.md (first 5 of 8 lines)

Files the text names, such as ones to read or write. Found by matching words, so treat them as pointers.

Found by matching wordsline 102 line 104 line 275 line 298 line 336

Licence

MIT, from the skill file

The terms its author shares it under, which let it be shown here.

From its settingsline 13 licence text

Other settings

compatibility: Requires Python >=3.11. Variant and sample queries require outbound network access to the public 1000 Genomes query endpoint over TLS; the sample/population metadata commands run fully offline over a data file bundled in the skill. No credentials, API keys, or environment variables are used. metadata: version: "1.4" last-reviewed: "2026-09-30" upstream-version: "dnaerys 0.2.1; proto R1.20.0" skill-author: Dnaerys

More settings at the top of the file, shown as written.

From its settingsline 14 line 16
Other files in this skill (4) Close

The text

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1---
2name: onekgpd
3description: >
4 Queries the 1000 Genomes Project dataset (3,202 whole-genome-sequenced
5 individuals, GRCh38) at the level of individual participants.
6 Use when a question is about individuals or variants in the 1000 Genomes
7 Project cohort: which individuals carry variants matching specific criteria
8 in a gene or region, which individuals are homozygous-reference at a position,
9 which variants exist in the dataset or carried by specified individuals
10 in a gene or region, the relatedness between two specified individuals.
11 Variants are returned with 1000 Genomes allele frequencies (AF),
12 gnomAD v4.1 exome and genome AF, AlphaMissense score, and HGVSp annotations.
13license: MIT
14compatibility: Requires Python >=3.11. Variant and sample queries require outbound network access to the public 1000 Genomes query endpoint over TLS; the sample/population metadata commands run fully offline over a data file bundled in the skill. No credentials, API keys, or environment variables are used.
15allowed-tools: Write Bash
16metadata:
17 version: "1.4"
18 last-reviewed: "2026-09-30"
19 upstream-version: "dnaerys 0.2.1; proto R1.20.0"
20 skill-author: Dnaerys
21---
23# OneKGPd: Individual-Level Queries over the 1000 Genomes Project

OneKGPd: Individual-Level Queries over the 1000 Genomes Project

Raw lines 1 to 24
25## Scope
27This skill queries the 1000 Genomes Project dataset — the extended high-coverage cohort
28of 3,202 whole-genome-sequenced individuals, on the GRCh38 assembly. All results
29are drawn from this cohort, and sample names returned by the skill (for example
30`HG00096` or `NA21130`) identify its participants.
32Queries resolve against the cohort's per-individual genotype data. This supports
33two complementary classes of question: selecting **variants** carried within a
34region (across the whole cohort or within a specified set of individuals), and
35selecting the **individuals** who carry variants matching given criteria.
36Variant selection can be filtered by allele frequency, predicted consequence,
37clinical significance, AlphaMissense classification, and the other annotation
38axes listed below. Relatedness between two named individuals is also available.
40The genotype state in which a variant is carried — heterozygous or homozygous —
41is a criterion that queries may specify; results are returned as variants or as
42sample names, not as raw genotypes.
44The public service is **TLS gRPC at `db.dnaerys.org:443`**, accessed with
45`dnaerys 0.2.1` (Python 3.11+); it is not a REST base URL. The maintained
46service snapshot advertises VEP 115 / GENCODE 49, ClinVar 202502, and gnomAD
474.1. These are the service's annotation releases, not the latest release of
48each upstream resource. Record them when interpreting results.

Scope

This skill queries the 1000 Genomes Project dataset — the extended high-coverage cohort of 3,202 whole-genome-sequenced individuals, on the GRCh38 assembly. All results are drawn from this cohort, and sample names returned by the skill (for example HG00096 or NA21130) identify its participants.

Queries resolve against the cohort's per-individual genotype data. This supports two complementary classes of question: selecting variants carried within a region (across the whole cohort or within a specified set of individuals), and selecting the individuals who carry variants matching given criteria. Variant selection can be filtered by allele frequency, predicted consequence, clinical significance, AlphaMissense classification, and the other annotation axes listed below. Relatedness between two named individuals is also available.

The genotype state in which a variant is carried — heterozygous or homozygous — is a criterion that queries may specify; results are returned as variants or as sample names, not as raw genotypes.

The public service is **TLS gRPC at db.dnaerys.org:443**, accessed with dnaerys 0.2.1 (Python 3.11+); it is not a REST base URL. The maintained service snapshot advertises VEP 115 / GENCODE 49, ClinVar 202502, and gnomAD 4.1. These are the service's annotation releases, not the latest release of each upstream resource. Record them when interpreting results.

Raw lines 25 to 49
50## When to Use
52**Use this skill when you need to:**
54- Find **variants** carried in a region or set of regions matching some criteria
55 across the whole cohort (`select-variants`).
56- Find **variants** carried in a region or set of regions matching some criteria
57 in specific set of individuals (`select-variants-in-samples`).
58- Find **which 1000 Genomes individuals** carry variants matching some criteria
59 in a region or set of regions (`select-samples`).
60- Count how many individuals carry specific variants (`count-samples`).
61- Restrict any variant query to **heterozygous-only or homozygous-only**
62 carriage, or query both together (default).
63- Identify which individuals are **homozygous reference** at a single position
64 (`select-samples-hom-ref`).
65- Determine the **relatedness** between two named 1000 Genomes individuals —
66 both the degree (twin / 1st / 2nd / 3rd / unrelated) and the KING kinship
67 coefficient (`kinship`).
68- Get **dataset totals** — sample count, sex split, variant count, assembly
69 (`dataset-info`).
70- Variant selection can be specified by KGP allele frequency, gnomAD 4.1 exome and
71 gnomAD 4.1 genome allele frequency, AlphaMissense Score and AlphaMissense Class,
72 ClinVar significance (202502), and VEP annotations (impact, biotype, feature type,
73 variant class, consequences).
75**Do NOT use this skill for:**
77- Resolving a gene symbol, rsID, or transcript to coordinates, or fetching
78 reference sequence. Resolve coordinates first (see Coordinate Provenance
79 below), then query this skill with the resolved GRCh38 region.
80- Any cohort other than the 1000 Genomes Project — this skill serves only that
81 dataset.

When to Use

Use this skill when you need to:

  • Find variants carried in a region or set of regions matching some criteria across the whole cohort (select-variants).
  • Find variants carried in a region or set of regions matching some criteria in specific set of individuals (select-variants-in-samples).
  • Find which 1000 Genomes individuals carry variants matching some criteria in a region or set of regions (select-samples).
  • Count how many individuals carry specific variants (count-samples).
  • Restrict any variant query to heterozygous-only or homozygous-only carriage, or query both together (default).
  • Identify which individuals are homozygous reference at a single position (select-samples-hom-ref).
  • Determine the relatedness between two named 1000 Genomes individuals — both the degree (twin / 1st / 2nd / 3rd / unrelated) and the KING kinship coefficient (kinship).
  • Get dataset totals — sample count, sex split, variant count, assembly (dataset-info).
  • Variant selection can be specified by KGP allele frequency, gnomAD 4.1 exome and gnomAD 4.1 genome allele frequency, AlphaMissense Score and AlphaMissense Class, ClinVar significance (202502), and VEP annotations (impact, biotype, feature type, variant class, consequences).

Do NOT use this skill for:

  • Resolving a gene symbol, rsID, or transcript to coordinates, or fetching reference sequence. Resolve coordinates first (see Coordinate Provenance below), then query this skill with the resolved GRCh38 region.
  • Any cohort other than the 1000 Genomes Project — this skill serves only that dataset.
Raw lines 50 to 82
83## Prerequisites
851. **`uv`**: This skill's script is run with `uv run`, which reads the script's
86 inline dependency metadata and provisions an ephemeral environment. Ensure
87 `uv` is installed and on PATH (https://docs.astral.sh/uv/).
882. **Data use terms**: The 1000 Genomes Project data is open; users should be
89 aware of the 1000 Genomes Project / IGSR data-use terms
90 (https://www.internationalgenome.org/data).
913. **Access constraints**: There is no API key, no `.env` file, and no
92 rate-limit token to configure.
934. **Timeouts**: network commands use `--timeout 30` seconds per RPC by default.
94 A positive finite override is allowed. Pagination makes several RPCs and
95 retryable failures retry the whole fetch up to three times, so this is not
96 a deadline for the whole command.

Prerequisites

  1. **uv**: This skill's script is run with uv run, which reads the script's inline dependency metadata and provisions an ephemeral environment. Ensure uv is installed and on PATH (https://docs.astral.sh/uv/).
  2. Data use terms: The 1000 Genomes Project data is open; users should be aware of the 1000 Genomes Project / IGSR data-use terms (https://www.internationalgenome.org/data).
  3. Access constraints: There is no API key, no .env file, and no rate-limit token to configure.
  4. Timeouts: network commands use --timeout 30 seconds per RPC by default. A positive finite override is allowed. Pagination makes several RPCs and retryable failures retry the whole fetch up to three times, so this is not a deadline for the whole command.
Raw lines 83 to 97
98## Core Rules
100- **Use the Wrappers**: ALWAYS execute the provided helper scripts rather than
101 constructing your own client calls or network requests. Use
102 `scripts/onekgpd_api.py` for variant/sample/kinship queries (it handles the
103 connection, streaming, pagination, and JSON serialization), and
104 `scripts/onekgpd_meta.py` for sample/population metadata (offline, see
105 [Sample & population metadata](#sample--population-metadata-offline)).
106- **Coordinates MUST be resolved against an authoritative source first** — see
107 [Coordinate Provenance](#coordinate-provenance-mandatory-first-step). This
108 is mandatory, not advisory.
109- **Count before you select**: every variant and sample selection has a paired
110 counting command. Call the count command FIRST to size the result set, then
111 select only if the count is manageable.
112- **Zygosity defaults to both**: selection and counting commands include both
113 heterozygous and homozygous carriage by default. Narrow with `--het-only`
114 or `--hom-only` when the question is specifically about one state. (You do
115 not need to pass anything to get both.)
116- **Output**: scripts write full JSON to a file (`--output`, default under
117 `/tmp/`) and print a concise summary to stdout. Do not read large JSON files
118 into context — use `jq` or a small disposable `uv run python` snippet to
119 extract fields. `--page-size` retrieves every page but accumulates all
120 variants in RAM; it is not a bounded-memory export. Size the query first.
121- **Check completeness**: `result_incomplete=true` means results cannot support
122 a definitive zero/absence claim. Re-run after service recovery. For capped
123 variant selections, `truncated=true` means the limit was reached and more
124 records may exist, even if the cluster result itself was complete.

Core Rules

  • Use the Wrappers: ALWAYS execute the provided helper scripts rather than constructing your own client calls or network requests. Use scripts/onekgpd_api.py for variant/sample/kinship queries (it handles the connection, streaming, pagination, and JSON serialization), and scripts/onekgpd_meta.py for sample/population metadata (offline, see Sample & population metadata).
  • Coordinates MUST be resolved against an authoritative source first — see Coordinate Provenance. This is mandatory, not advisory.
  • Count before you select: every variant and sample selection has a paired counting command. Call the count command FIRST to size the result set, then select only if the count is manageable.
  • Zygosity defaults to both: selection and counting commands include both heterozygous and homozygous carriage by default. Narrow with --het-only or --hom-only when the question is specifically about one state. (You do not need to pass anything to get both.)
  • Output: scripts write full JSON to a file (--output, default under /tmp/) and print a concise summary to stdout. Do not read large JSON files into context — use jq or a small disposable uv run python snippet to extract fields. --page-size retrieves every page but accumulates all variants in RAM; it is not a bounded-memory export. Size the query first.
  • Check completeness: result_incomplete=true means results cannot support a definitive zero/absence claim. Re-run after service recovery. For capped variant selections, truncated=true means the limit was reached and more records may exist, even if the cluster result itself was complete.
Raw lines 98 to 125
Reads a file scripts/onekgpd_api.py :102
Reads a file scripts/onekgpd_meta.py :104
126## Coordinate Provenance (MANDATORY FIRST STEP)
128Before any region-based query, resolve the gene or feature to **GRCh38**
129coordinates against an authoritative source (for example Ensembl or NCBI), and query
130with those resolved coordinates. Inputs are **1-based, inclusive**: a BED interval
131`[start0, end0)` becomes `start=start0+1, end=end0`. Record the source accession,
132annotation release, and retrieval date; gene boundaries can differ by annotation
133release even on the same assembly. The assembly must be explicit, and a gene-range
134must be resolved to precise positions before use. This is structural, not
135advisory: there is no source-side guardrail that would catch a misplaced region,
136so an unverified coordinate produces results for an unintended location with no
137error.
139```bash
140# Resolve gene symbol -> GRCh38 region with an authoritative source FIRST,
141# then pass the verified coordinates to the OneKGPd query below.
142```
144> [!CAUTION]
145> The dataset is GRCh38. A GRCh37 coordinate, or any region that does not
146> correctly correspond to the intended feature on GRCh38, will return
147> results for an unintended location without raising an error. Verify the
148> assembly and the resolved coordinates before querying.

Coordinate Provenance (MANDATORY FIRST STEP)

Before any region-based query, resolve the gene or feature to GRCh38 coordinates against an authoritative source (for example Ensembl or NCBI), and query with those resolved coordinates. Inputs are 1-based, inclusive: a BED interval [start0, end0) becomes start=start0+1, end=end0. Record the source accession, annotation release, and retrieval date; gene boundaries can differ by annotation release even on the same assembly. The assembly must be explicit, and a gene-range must be resolved to precise positions before use. This is structural, not advisory: there is no source-side guardrail that would catch a misplaced region, so an unverified coordinate produces results for an unintended location with no error.

# Resolve gene symbol -> GRCh38 region with an authoritative source FIRST,
# then pass the verified coordinates to the OneKGPd query below.
[!CAUTION] The dataset is GRCh38. A GRCh37 coordinate, or any region that does not correctly correspond to the intended feature on GRCh38, will return results for an unintended location without raising an error. Verify the assembly and the resolved coordinates before querying.
Raw lines 126 to 149
150## Command Selection Guide
152Match the question to the command. Counting commands are cheap and should
153precede their selection counterpart.
155- Which individuals carry matching variants in a region → `count-samples`
156 then `select-samples`
157- Which variants are carried in a region, cohort-wide → `count-variants`
158 then `select-variants`
159- Which variants are carried in a region, within a named set of individuals →
160 `count-variants-in-samples` then `select-variants-in-samples`
161- Who is homozygous-reference at a single position → `count-samples-hom-ref`
162 then `select-samples-hom-ref`
163- Relatedness (degree + coefficient) between two named individuals →
164 `kinship`
165- Dataset totals (sample count, sex split, variant total, assembly) →
166 `dataset-info`

Command Selection Guide

Match the question to the command. Counting commands are cheap and should precede their selection counterpart.

  • Which individuals carry matching variants in a region → count-samples then select-samples
  • Which variants are carried in a region, cohort-wide → count-variants then select-variants
  • Which variants are carried in a region, within a named set of individuals → count-variants-in-samples then select-variants-in-samples
  • Who is homozygous-reference at a single position → count-samples-hom-ref then select-samples-hom-ref
  • Relatedness (degree + coefficient) between two named individuals → kinship
  • Dataset totals (sample count, sex split, variant total, assembly) → dataset-info
Raw lines 150 to 167
168## Cohort interpretation
170The 3,202-sample cohort includes relatives: the additional 698 high-coverage
171samples extend the original 2,504-sample panel. Carrier counts therefore are
172not counts of independent observations, and cohort AF is not a population
173prevalence estimate. For association or frequency comparisons, document the
174selected populations and relatedness policy; use the bundled pedigree metadata
175and `kinship` when choosing or auditing the analysis set. See the
176[IGSR cohort announcement](https://www.internationalgenome.org/announcements/3202-samples-at-high-coverage-from-NYGC/).

Cohort interpretation

The 3,202-sample cohort includes relatives: the additional 698 high-coverage samples extend the original 2,504-sample panel. Carrier counts therefore are not counts of independent observations, and cohort AF is not a population prevalence estimate. For association or frequency comparisons, document the selected populations and relatedness policy; use the bundled pedigree metadata and kinship when choosing or auditing the analysis set. See the IGSR cohort announcement.

Raw lines 168 to 177
178## Annotation filters (shared across variant and sample selection/counting)
180All variant- and sample-selection commands (`count-variants`,
181`select-variants`, their `-in-samples` forms, `count-samples`, `select-samples`)
182accept the same annotation filters. Different filter fields are combined with
183**AND**; multiple values within one field are combined with **OR**. Enum values
184are case-insensitive (e.g. `missense_variant` or `MISSENSE_VARIANT`).
186These are selection criteria applied on the server. The fields returned on a
187selected variant are listed under
188[Variant-returning commands](#variant-returning-commands); a criterion used for
189filtering is not necessarily echoed back on the returned variant.
191- `--af-lt` / `--af-gt`: 1000 Genomes dataset allele frequency bounds
192- `--gnomad-exomes-af-lt` / `--gnomad-exomes-af-gt`: gnomAD v4.1 exome AF bounds
193- `--gnomad-genomes-af-lt` / `--gnomad-genomes-af-gt`: gnomAD v4.1 genome AF bounds
194- `--clin-significance`: ClinVar significance terms, CSV (e.g. `PATHOGENIC,LIKELY_PATHOGENIC`)
195- `--consequence`: Sequence Ontology consequence terms, CSV (e.g. `MISSENSE_VARIANT,STOP_GAINED`)
196- `--impact`: VEP impact, CSV (`HIGH,MODERATE,LOW,MODIFIER`)
197- `--variant-type`, `--feature-type`, `--bio-type`: SO variant class / VEP feature / VEP biotype, CSV
198- `--alpha-missense-class`: `AM_LIKELY_BENIGN,AM_LIKELY_PATHOGENIC,AM_AMBIGUOUS` (CSV)
199- `--alpha-missense-score-lt` / `--alpha-missense-score-gt`: AlphaMissense score bounds
200- `--biallelic-only` / `--multiallelic-only`
201- `--exclude-males` / `--exclude-females`
202- `--min-len-bp` / `--max-len-bp`: alternate-allele length bounds (bp)
204> [!NOTE]
205> `--alpha-missense-class` and `--alpha-missense-score-*` are mutually exclusive
206> (the engine ignores the class when a score bound is set). `--biallelic-only`
207> and `--multiallelic-only` are mutually exclusive. `--exclude-males` and
208> `--exclude-females` are mutually exclusive. Setting a `*-gt` bound greater than
209> or equal to its matching `*-lt` bound defines an empty range and will return
210> nothing.
212> [!NOTE]
213> `gnomad_exomes_af`, `gnomad_genomes_af`, and `am_score` use `0.0` for
214> **not annotated in this service snapshot**. This does not establish absence
215> from the current gnomAD release, biological rarity, or a benign prediction.
216> The dataset's own `af` field is a different statistic, not this sentinel.
218> [!CAUTION]
219> **A zero numeric filter is unset on the server**, so `--gnomad-exomes-af-gt 0`
220> does not exclude missing annotations. The wrapper rejects zero, nonfinite,
221> out-of-range, and float32-underflowing bounds. Choose an explicit positive
222> threshold (for example `--gnomad-exomes-af-gt 0.000001` means AF > 1e-6,
223> not merely annotation presence). For exact `> 0`, retrieve a complete variant
224> set and post-filter the returned AF locally. A `< X` filter alone includes
225> unannotated zero values. Apply the same missing-score caution to AlphaMissense.
227Categorical annotations are retained across transcripts. Combining consequence
228and impact filters does not establish that they describe the same transcript.
229`amino_acids` may contain multiple HGVSp entries; the generic gRPC service places
230canonical annotations first, whereas the separate MCP layer trims its output.
231Preserve transcript identifiers, and do not treat a model's likely-pathogenic
232class as a clinical diagnosis or a participant phenotype.

Annotation filters (shared across variant and sample selection/counting)

All variant- and sample-selection commands (count-variants, select-variants, their -in-samples forms, count-samples, select-samples) accept the same annotation filters. Different filter fields are combined with AND; multiple values within one field are combined with OR. Enum values are case-insensitive (e.g. missense_variant or MISSENSE_VARIANT).

These are selection criteria applied on the server. The fields returned on a selected variant are listed under Variant-returning commands; a criterion used for filtering is not necessarily echoed back on the returned variant.

  • --af-lt / --af-gt: 1000 Genomes dataset allele frequency bounds
  • --gnomad-exomes-af-lt / --gnomad-exomes-af-gt: gnomAD v4.1 exome AF bounds
  • --gnomad-genomes-af-lt / --gnomad-genomes-af-gt: gnomAD v4.1 genome AF bounds
  • --clin-significance: ClinVar significance terms, CSV (e.g. PATHOGENIC,LIKELY_PATHOGENIC)
  • --consequence: Sequence Ontology consequence terms, CSV (e.g. MISSENSE_VARIANT,STOP_GAINED)
  • --impact: VEP impact, CSV (HIGH,MODERATE,LOW,MODIFIER)
  • --variant-type, --feature-type, --bio-type: SO variant class / VEP feature / VEP biotype, CSV
  • --alpha-missense-class: AM_LIKELY_BENIGN,AM_LIKELY_PATHOGENIC,AM_AMBIGUOUS (CSV)
  • --alpha-missense-score-lt / --alpha-missense-score-gt: AlphaMissense score bounds
  • --biallelic-only / --multiallelic-only
  • --exclude-males / --exclude-females
  • --min-len-bp / --max-len-bp: alternate-allele length bounds (bp)
[!NOTE] --alpha-missense-class and --alpha-missense-score-* are mutually exclusive (the engine ignores the class when a score bound is set). --biallelic-only and --multiallelic-only are mutually exclusive. --exclude-males and --exclude-females are mutually exclusive. Setting a *-gt bound greater than or equal to its matching *-lt bound defines an empty range and will return nothing.
[!NOTE] gnomad_exomes_af, gnomad_genomes_af, and am_score use 0.0 for not annotated in this service snapshot. This does not establish absence from the current gnomAD release, biological rarity, or a benign prediction. The dataset's own af field is a different statistic, not this sentinel.
[!CAUTION] A zero numeric filter is unset on the server, so --gnomad-exomes-af-gt 0 does not exclude missing annotations. The wrapper rejects zero, nonfinite, out-of-range, and float32-underflowing bounds. Choose an explicit positive threshold (for example --gnomad-exomes-af-gt 0.000001 means AF > 1e-6, not merely annotation presence). For exact > 0, retrieve a complete variant set and post-filter the returned AF locally. A < X filter alone includes unannotated zero values. Apply the same missing-score caution to AlphaMissense.

Categorical annotations are retained across transcripts. Combining consequence and impact filters does not establish that they describe the same transcript. amino_acids may contain multiple HGVSp entries; the generic gRPC service places canonical annotations first, whereas the separate MCP layer trims its output. Preserve transcript identifiers, and do not treat a model's likely-pathogenic class as a clinical diagnosis or a participant phenotype.

Raw lines 178 to 233
Uses an outside tool MCP :230
234## Quick Start
236```bash
237# Step 1. NCBI Gene 672, GRCh38.p14 / NC_000017.11, RS_2025_08:
238# BRCA1 spans chr17:43044295-43170327 (1-based inclusive).
239# Source: https://www.ncbi.nlm.nih.gov/gene/672 ; re-resolve for your analysis.
240# Step 2. Size the result set: how many individuals carry predicted likely-pathogenic
241# missense variants in this region?
242uv run scripts/onekgpd_api.py count-samples \
243 --chrom chr17 --start 43044295 --end 43170327 \
244 --consequence MISSENSE_VARIANT \
245 --alpha-missense-class AM_LIKELY_PATHOGENIC \
246 --output /tmp/count.json
247# Step 3. If the count is manageable, list those individuals.
248uv run scripts/onekgpd_api.py select-samples \
249 --chrom chr17 --start 43044295 --end 43170327 \
250 --consequence MISSENSE_VARIANT \
251 --alpha-missense-class AM_LIKELY_PATHOGENIC \
252 --output /tmp/samples.json
253# Step 4. Count then select variants for actual returned sample IDs.
254# HG03169,NA20506 below are illustrative IDs; substitute the Step 3 results.
255uv run scripts/onekgpd_api.py count-variants-in-samples \
256 --chrom chr17 --start 43044295 --end 43170327 \
257 --samples HG03169,NA20506 \
258 --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
259 --output /tmp/variant_count.json
260uv run scripts/onekgpd_api.py select-variants-in-samples \
261 --chrom chr17 --start 43044295 --end 43170327 \
262 --samples HG03169,NA20506 \
263 --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
264 --output /tmp/variants.json
265```

Quick Start

# Step 1. NCBI Gene 672, GRCh38.p14 / NC_000017.11, RS_2025_08:
# BRCA1 spans chr17:43044295-43170327 (1-based inclusive).
# Source: https://www.ncbi.nlm.nih.gov/gene/672 ; re-resolve for your analysis.
# Step 2. Size the result set: how many individuals carry predicted likely-pathogenic
#    missense variants in this region?
uv run scripts/onekgpd_api.py count-samples \
  --chrom chr17 --start 43044295 --end 43170327 \
  --consequence MISSENSE_VARIANT \
  --alpha-missense-class AM_LIKELY_PATHOGENIC \
  --output /tmp/count.json
# Step 3. If the count is manageable, list those individuals.
uv run scripts/onekgpd_api.py select-samples \
  --chrom chr17 --start 43044295 --end 43170327 \
  --consequence MISSENSE_VARIANT \
  --alpha-missense-class AM_LIKELY_PATHOGENIC \
  --output /tmp/samples.json
# Step 4. Count then select variants for actual returned sample IDs.
# HG03169,NA20506 below are illustrative IDs; substitute the Step 3 results.
uv run scripts/onekgpd_api.py count-variants-in-samples \
  --chrom chr17 --start 43044295 --end 43170327 \
  --samples HG03169,NA20506 \
  --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
  --output /tmp/variant_count.json
uv run scripts/onekgpd_api.py select-variants-in-samples \
  --chrom chr17 --start 43044295 --end 43170327 \
  --samples HG03169,NA20506 \
  --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
  --output /tmp/variants.json
Raw lines 234 to 266
Runs code scripts/onekgpd_api.py :242
267## Commands
269Each command writes full JSON to a file (`--output PATH`, default a temp file)
270and prints a concise stdout summary. All region/sample commands share: the
271region input (`--chrom`/`--start`/`--end` with optional `--ref`/`--alt`, or one
272or more repeated `--region CHR:START-END`), the zygosity flags
273(`--het-only`/`--hom-only`, default both), and the annotation filters above.
274The full per-flag tables live in
275[references/onekgpd_commands.md](references/onekgpd_commands.md).

Commands

Each command writes full JSON to a file (--output PATH, default a temp file) and prints a concise stdout summary. All region/sample commands share: the region input (--chrom/--start/--end with optional --ref/--alt, or one or more repeated --region CHR:START-END), the zygosity flags (--het-only/--hom-only, default both), and the annotation filters above. The full per-flag tables live in references/onekgpd_commands.md.

Raw lines 267 to 276
277### Variant-returning commands
279`select-*` return matching variants; `count-*` return an integer count.
281- `count-variants` — count variants in a region, cohort-wide.
282- `select-variants` — select variants in a region, cohort-wide. Use `--limit N`
283 (hard cap, default 200) **or** `--page-size N` (retrieve the full set in
284 pages); the two are mutually exclusive. The summary flags `truncated` when
285 the cap is reached.
286- `count-variants-in-samples` — as `count-variants`, restricted to
287 `--samples NAME1,NAME2,...` (required).
288- `select-variants-in-samples` — as `select-variants`, restricted to
289 `--samples NAME1,NAME2,...` (required).
291Each returned variant carries these 22 keys: `chr`, `start`, `end`, `ref`,
292`alt`, `af`, `ac`, `an`, `hom_samples`, `het_samples`, `mis_samples`,
293`hom_samples_fx`, `het_samples_fx`, `mis_samples_fx`, `hom_samples_mxy`,
294`het_samples_mxy`, `mis_samples_mxy`, `gnomad_exomes_af`, `gnomad_genomes_af`,
295`am_score`, `amino_acids`, `biallelic`.
296ClinVar significance and VEP consequence are filter criteria only and are not
297returned. Full schema:
298[references/onekgpd_commands.md](references/onekgpd_commands.md).

Variant-returning commands

select-* return matching variants; count-* return an integer count.

  • count-variants — count variants in a region, cohort-wide.
  • select-variants — select variants in a region, cohort-wide. Use --limit N (hard cap, default 200) or --page-size N (retrieve the full set in pages); the two are mutually exclusive. The summary flags truncated when the cap is reached.
  • count-variants-in-samples — as count-variants, restricted to --samples NAME1,NAME2,... (required).
  • select-variants-in-samples — as select-variants, restricted to --samples NAME1,NAME2,... (required).

Each returned variant carries these 22 keys: chr, start, end, ref, alt, af, ac, an, hom_samples, het_samples, mis_samples, hom_samples_fx, het_samples_fx, mis_samples_fx, hom_samples_mxy, het_samples_mxy, mis_samples_mxy, gnomad_exomes_af, gnomad_genomes_af, am_score, amino_acids, biallelic. ClinVar significance and VEP consequence are filter criteria only and are not returned. Full schema: references/onekgpd_commands.md.

Raw lines 277 to 299
300### Sample-returning commands
302- `count-samples` — count individuals carrying a matching variant in a region.
303- `select-samples` — list the names of individuals carrying a matching variant.
304 Supports `--skip N` and `--limit N`. Returns names only; to see which
305 variants qualified an individual, feed the names into
306 `select-variants-in-samples`.

Sample-returning commands

  • count-samples — count individuals carrying a matching variant in a region.
  • select-samples — list the names of individuals carrying a matching variant. Supports --skip N and --limit N. Returns names only; to see which variants qualified an individual, feed the names into select-variants-in-samples.
Raw lines 300 to 307
308### Homozygous-reference commands
310Single position via `--chrom` + `--position` (not a region).
312- `count-samples-hom-ref` — count individuals with a 0/0 call at the position.
313 The count uses a sentinel: `-1` = no variant exists at that position at all;
314 `0` = a variant exists but no individual is homozygous reference; `>0` = the
315 number of homozygous-reference individuals. These interpretations require
316 `result_incomplete=false`; otherwise `variant_present` is `null`. No variant
317 record is not evidence that all 3,202 individuals have callable 0/0 genotypes.
318- `select-samples-hom-ref` — list the individuals with a 0/0 call at the position.

Homozygous-reference commands

Single position via --chrom + --position (not a region).

  • count-samples-hom-ref — count individuals with a 0/0 call at the position. The count uses a sentinel: -1 = no variant exists at that position at all; 0 = a variant exists but no individual is homozygous reference; >0 = the number of homozygous-reference individuals. These interpretations require result_incomplete=false; otherwise variant_present is null. No variant record is not evidence that all 3,202 individuals have callable 0/0 genotypes.
  • select-samples-hom-ref — list the individuals with a 0/0 call at the position.
Raw lines 308 to 319
320### Relatedness command
322- `kinship --sample1 NAME --sample2 NAME` — relatedness between two named
323 individuals: the degree (`TWINS_MONOZYGOTIC` / `FIRST_DEGREE` /
324 `SECOND_DEGREE` / `THIRD_DEGREE` / `UNRELATED`) and the KING kinship
325 coefficient (`phi_bwf`).

Relatedness command

  • kinship --sample1 NAME --sample2 NAME — relatedness between two named individuals: the degree (TWINS_MONOZYGOTIC / FIRST_DEGREE / SECOND_DEGREE / THIRD_DEGREE / UNRELATED) and the KING kinship coefficient (phi_bwf).
Raw lines 320 to 326
327### Dataset metadata command
329- `dataset-info` — dataset totals: `samples_total` (3,202), female/male split,
330 `variants_total`, `assembly` (GRCh38), and the cohort breakdown. No region
331 required; doubles as a connectivity check.

Dataset metadata command

  • dataset-info — dataset totals: samples_total (3,202), female/male split, variants_total, assembly (GRCh38), and the cohort breakdown. No region required; doubles as a connectivity check.
Raw lines 327 to 332
333## Sample & population metadata (offline)
335Population, sex, pedigree, and superpopulation questions are answered by a second
336script, `scripts/onekgpd_meta.py`, from a data file bundled in the skill — **no
337network, no credentials, no coordinates**. The sample IDs are the same names the
338variant commands use, so the two layers compose (e.g. pick a cohort by population,
339then query its variants). Run `uv run scripts/onekgpd_meta.py <command>`.
341The cohort has 5 superpopulations (`AFR`, `AMR`, `EAS`, `EUR`, `SAS`) and 26
342populations. Population/superpopulation values match **case-insensitively** by
343short code or full name; **sample IDs are case-sensitive**.
345- `sample-metadata --samples NA19240,HG00096` — family, gender, parents,
346 children, population, superpopulation, and phase3 status for the given samples.
347- `list-populations` — all 26 populations with superpopulation and sample count
348 (use to discover valid values).
349- `list-superpopulations` — the 5 superpopulations with sample count and
350 constituent populations.
351- `population-stats --populations YRI [--populations CHS …]` — per-population sex
352 split, phase3 count, and trio membership. Repeat `--populations` for multiple
353 values (full names contain commas, so they are not comma-separated).
354- `superpopulation-summary --superpopulations EAS [--superpopulations EUR …]` —
355 per-superpopulation totals with a per-population breakdown.
356- `select-samples-by-population --population YRI` and/or `--superpopulation AFR`,
357 with optional `--skip`/`--limit` (default 0 / 50, max 3202) — the sample IDs in
358 a population and/or superpopulation; both given intersects. Feed the names into
359 `select-variants-in-samples` to see their variants.
361See [references/onekgpd_commands.md](references/onekgpd_commands.md) for full
362argument tables and JSON output schemas.

Sample & population metadata (offline)

Population, sex, pedigree, and superpopulation questions are answered by a second script, scripts/onekgpd_meta.py, from a data file bundled in the skill — no network, no credentials, no coordinates. The sample IDs are the same names the variant commands use, so the two layers compose (e.g. pick a cohort by population, then query its variants). Run uv run scripts/onekgpd_meta.py <command>.

The cohort has 5 superpopulations (AFR, AMR, EAS, EUR, SAS) and 26 populations. Population/superpopulation values match case-insensitively by short code or full name; sample IDs are case-sensitive.

  • sample-metadata --samples NA19240,HG00096 — family, gender, parents, children, population, superpopulation, and phase3 status for the given samples.
  • list-populations — all 26 populations with superpopulation and sample count (use to discover valid values).
  • list-superpopulations — the 5 superpopulations with sample count and constituent populations.
  • population-stats --populations YRI [--populations CHS …] — per-population sex split, phase3 count, and trio membership. Repeat --populations for multiple values (full names contain commas, so they are not comma-separated).
  • superpopulation-summary --superpopulations EAS [--superpopulations EUR …] — per-superpopulation totals with a per-population breakdown.
  • select-samples-by-population --population YRI and/or --superpopulation AFR, with optional --skip/--limit (default 0 / 50, max 3202) — the sample IDs in a population and/or superpopulation; both given intersects. Feed the names into select-variants-in-samples to see their variants.

See references/onekgpd_commands.md for full argument tables and JSON output schemas.

Raw lines 333 to 363
Reads a file scripts/onekgpd_meta.py :336
Runs code scripts/onekgpd_meta.py :339
364## Typical Workflows

Typical Workflows

Raw lines 364 to 365
366### Which individuals, then which variants they carry
368The following is an illustrative template; replace all angle-bracket placeholders.
370```bash
371# Step 1: resolve gene -> verified GRCh38 region (authoritative source).
372# Step 2: count individuals carrying a qualifying variant in the region.
373uv run scripts/onekgpd_api.py count-samples \
374 --chrom <chr> --start <start> --end <end> \
375 --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
376 --output /tmp/n.json
377# Step 3: list those individuals.
378uv run scripts/onekgpd_api.py select-samples \
379 --chrom <chr> --start <start> --end <end> \
380 --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
381 --output /tmp/who.json
382# Step 4: count variants for those individuals before selecting.
383uv run scripts/onekgpd_api.py count-variants-in-samples \
384 --chrom <chr> --start <start> --end <end> \
385 --samples <name1,name2,...> \
386 --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
387 --output /tmp/variant_count.json
388uv run scripts/onekgpd_api.py select-variants-in-samples \
389 --chrom <chr> --start <start> --end <end> \
390 --samples <name1,name2,...> \
391 --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
392 --output /tmp/variants.json
393```

Which individuals, then which variants they carry

The following is an illustrative template; replace all angle-bracket placeholders.

# Step 1: resolve gene -> verified GRCh38 region (authoritative source).
# Step 2: count individuals carrying a qualifying variant in the region.
uv run scripts/onekgpd_api.py count-samples \
  --chrom <chr> --start <start> --end <end> \
  --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
  --output /tmp/n.json
# Step 3: list those individuals.
uv run scripts/onekgpd_api.py select-samples \
  --chrom <chr> --start <start> --end <end> \
  --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
  --output /tmp/who.json
# Step 4: count variants for those individuals before selecting.
uv run scripts/onekgpd_api.py count-variants-in-samples \
  --chrom <chr> --start <start> --end <end> \
  --samples <name1,name2,...> \
  --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
  --output /tmp/variant_count.json
uv run scripts/onekgpd_api.py select-variants-in-samples \
  --chrom <chr> --start <start> --end <end> \
  --samples <name1,name2,...> \
  --consequence MISSENSE_VARIANT --alpha-missense-class AM_LIKELY_PATHOGENIC \
  --output /tmp/variants.json
Raw lines 366 to 394
Runs code scripts/onekgpd_api.py :373
395### Homozygous-reference carriers at a position of interest
397Illustrative template; replace the placeholders with verified coordinates.
399```bash
400# After identifying a position of interest (verified coordinate):
401uv run scripts/onekgpd_api.py count-samples-hom-ref \
402 --chrom <chr> --position <pos> --output /tmp/homref_n.json
403uv run scripts/onekgpd_api.py select-samples-hom-ref \
404 --chrom <chr> --position <pos> --output /tmp/homref.json
405```

Homozygous-reference carriers at a position of interest

Illustrative template; replace the placeholders with verified coordinates.

# After identifying a position of interest (verified coordinate):
uv run scripts/onekgpd_api.py count-samples-hom-ref \
  --chrom <chr> --position <pos> --output /tmp/homref_n.json
uv run scripts/onekgpd_api.py select-samples-hom-ref \
  --chrom <chr> --position <pos> --output /tmp/homref.json
Raw lines 395 to 406
Runs code scripts/onekgpd_api.py :401
407## Common Mistakes
409- **Mistake:** Querying with an unverified coordinate.
410 **Fix:** Always resolve gene/feature → GRCh38 against an authoritative
411 source first.
412 A misplaced region returns results for an unintended location without error.
413- **Mistake:** Calling a selection command before its counting command.
414 **Fix:** Count first; selection result sets can be large.
415- **Mistake:** Assuming a GRCh37 coordinate will work.
416 **Fix:** The dataset is GRCh38 only.

Common Mistakes

  • Mistake: Querying with an unverified coordinate. Fix: Always resolve gene/feature → GRCh38 against an authoritative source first. A misplaced region returns results for an unintended location without error.
  • Mistake: Calling a selection command before its counting command. Fix: Count first; selection result sets can be large.
  • Mistake: Assuming a GRCh37 coordinate will work. Fix: The dataset is GRCh38 only.
Raw lines 407 to 417
418## References
420- [references/onekgpd_commands.md](references/onekgpd_commands.md) — full
421 per-command argument tables and the returned-variant output schema.
422- [references/annotation_vocabularies.md](references/annotation_vocabularies.md)
423 — the controlled-vocabulary terms accepted by the CSV filter flags
424 (consequence, impact, biotype, feature type, ClinVar significance,
425 AlphaMissense class, variant class).
426- Current API contract and live-check scope: the
427 [command reference](references/onekgpd_commands.md#verified-api-contract).
428- 1000 Genomes Project / IGSR: https://www.internationalgenome.org/
429- 1000 Genomes Project dataset online: https://dnaerys.org/online/

References

  • references/onekgpd_commands.md — full per-command argument tables and the returned-variant output schema.
  • references/annotation_vocabularies.md — the controlled-vocabulary terms accepted by the CSV filter flags (consequence, impact, biotype, feature type, ClinVar significance, AlphaMissense class, variant class).
  • Current API contract and live-check scope: the command reference.
  • 1000 Genomes Project / IGSR: https://www.internationalgenome.org/
  • 1000 Genomes Project dataset online: https://dnaerys.org/online/
Raw lines 418 to 429

From K-Dense-AI/scientific-agent-skills at 5f2bc03, 2026-10-26. Not read by a model yet. Summary and techniques by Claude Opus 5.5 on 2026-11-06.