Skill Tracer
Skills › Scientific Agent Skills › onekgpd › onekgpd_commands.md

onekgpd_commands.md

357 lines · skills/onekgpd/references/onekgpd_commands.md at 5f2bc03

Open on GitHub

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

1# OneKGPd command reference
2
3Full argument tables for every `onekgpd_api.py` subcommand and the schema of a
4returned variant. Run with `uv run scripts/onekgpd_api.py <command> [flags]`.
5
6Coordinates are **GRCh38, 1-based inclusive**. Resolve a gene/feature to
7coordinates against an authoritative source before querying. Every command
8writes full JSON to a file (`--output PATH`, default a temp file) and prints a
9short summary to stdout.

OneKGPd command reference

Full argument tables for every onekgpd_api.py subcommand and the schema of a returned variant. Run with uv run scripts/onekgpd_api.py <command> [flags].

Coordinates are GRCh38, 1-based inclusive. Resolve a gene/feature to coordinates against an authoritative source before querying. Every command writes full JSON to a file (--output PATH, default a temp file) and prints a short summary to stdout.

Raw lines 1 to 10
Runs code scripts/onekgpd_api.py :4
11## Shared flags

Shared flags

Raw lines 11 to 12
13### Connection / output (all commands)
15| flag | type | required | default | description |
16| --- | --- | --- | --- | --- |
17| `--timeout` | float | no | 30 | Positive finite seconds per RPC. Whole-fetch retries and pagination can exceed this overall. |
18| `--output` | path | no | temp file | Write full JSON here; otherwise a `onekgpd_<cmd>_*.json` temp file is created and its path printed. |
20There is no endpoint, credential, or assembly override: the skill targets
21the public 1000 Genomes instance on GRCh38 only.

Connection / output (all commands)

flagtyperequireddefaultdescription
--timeoutfloatno30Positive finite seconds per RPC. Whole-fetch retries and pagination can exceed this overall.
--outputpathnotemp fileWrite full JSON here; otherwise a onekgpd_<cmd>_*.json temp file is created and its path printed.

There is no endpoint, credential, or assembly override: the skill targets the public 1000 Genomes instance on GRCh38 only.

Raw lines 13 to 22
23### Region input (count/select variants and samples)
25Provide **either** a single region **or** one-or-more `--region`, not both.
27| flag | type | required | default | description |
28| --- | --- | --- | --- | --- |
29| `--chrom` | str | single-region mode | – | Chromosome: `chr17`, `17`, `X`, `MT` (case-insensitive). |
30| `--start` | int | with `--chrom` | – | 1-based inclusive start. |
31| `--end` | int | with `--chrom` | – | 1-based inclusive end (≥ start). |
32| `--ref` | str | no | – | Narrow to one reference allele (single-region only). |
33| `--alt` | str | no | – | Narrow to one alternate allele (single-region only). |
34| `--region` | `CHR:START-END` | multi-region mode | – | A region; repeat the flag for multiple regions. |
35| `--min-len-bp` | int | no | – | Minimum alternate-allele length (bp). |
36| `--max-len-bp` | int | no | – | Maximum alternate-allele length (bp). |

Region input (count/select variants and samples)

Provide either a single region or one-or-more --region, not both.

flagtyperequireddefaultdescription
--chromstrsingle-region mode–Chromosome: chr17, 17, X, MT (case-insensitive).
--startintwith --chrom–1-based inclusive start.
--endintwith --chrom–1-based inclusive end (≥ start).
--refstrno–Narrow to one reference allele (single-region only).
--altstrno–Narrow to one alternate allele (single-region only).
--regionCHR:START-ENDmulti-region mode–A region; repeat the flag for multiple regions.
--min-len-bpintno–Minimum alternate-allele length (bp).
--max-len-bpintno–Maximum alternate-allele length (bp).
Raw lines 23 to 37
38### Zygosity (count/select variants and samples)
40| flag | type | required | default | description |
41| --- | --- | --- | --- | --- |
42| `--het-only` | switch | no | both | Include HETEROZYGOUS variants ONLY (0/1 genotypes). |
43| `--hom-only` | switch | no | both | Include HOMOZYGOUS variants ONLY (1/1 genotypes). |
45With no zygosity flag, both HETEROZYGOUS (0/1) and HOMOZYGOUS (1/1) carriage are
46queried — use the default when you need homozygous OR heterozygous variants, or
47when uncertain. `--het-only` and `--hom-only` are mutually exclusive.

Zygosity (count/select variants and samples)

flagtyperequireddefaultdescription
--het-onlyswitchnobothInclude HETEROZYGOUS variants ONLY (0/1 genotypes).
--hom-onlyswitchnobothInclude HOMOZYGOUS variants ONLY (1/1 genotypes).

With no zygosity flag, both HETEROZYGOUS (0/1) and HOMOZYGOUS (1/1) carriage are queried — use the default when you need homozygous OR heterozygous variants, or when uncertain. --het-only and --hom-only are mutually exclusive.

Raw lines 38 to 48
49### Annotation filters (count/select variants and samples)
51See `annotation_vocabularies.md` for the valid CSV terms. Different filter fields
52combine with **AND**; multiple CSV values within one field combine with **OR**.
54| flag | type | maps to |
55| --- | --- | --- |
56| `--af-lt` / `--af-gt` | float | 1000 Genomes dataset AF bounds |
57| `--gnomad-exomes-af-lt` / `--gnomad-exomes-af-gt` | float | gnomAD v4.1 exomes AF bounds |
58| `--gnomad-genomes-af-lt` / `--gnomad-genomes-af-gt` | float | gnomAD v4.1 genomes AF bounds |
59| `--clin-significance` | CSV | ClinVar significance terms |
60| `--consequence` | CSV | SO consequence terms |
61| `--impact` | CSV | VEP impact (HIGH,MODERATE,LOW,MODIFIER) |
62| `--variant-type` | CSV | SO variant class terms |
63| `--feature-type` | CSV | VEP feature types |
64| `--bio-type` | CSV | VEP biotypes |
65| `--alpha-missense-class` | CSV | AM_LIKELY_BENIGN,AM_LIKELY_PATHOGENIC,AM_AMBIGUOUS |
66| `--alpha-missense-score-lt` / `--alpha-missense-score-gt` | float | AlphaMissense score bounds |
67| `--biallelic-only` / `--multiallelic-only` | switch | site multiplicity (mutually exclusive) |
68| `--exclude-males` / `--exclude-females` | switch | sex exclusion (mutually exclusive) |
70Mutual exclusions enforced: `--biallelic-only`/`--multiallelic-only`,
71`--exclude-males`/`--exclude-females`, and `--alpha-missense-class` vs the
72AlphaMissense score bounds. Every numeric AF/AlphaMissense bound must be finite,
73in `(0, 1]`, and remain nonzero when encoded as float32. **Zero means unset in
74the protobuf API**; the wrapper rejects it rather than silently dropping the
75filter. Setting a positive `*-gt` ≥ its matching `*-lt` defines an empty range.
77The gnomAD `< X` bounds include unannotated variants, represented by AF = 0.
78Choose a scientifically meaningful positive lower bound to exclude those zeros;
79this also excludes annotated values at or below that bound. For exact annotation
80presence, retrieve complete variants and post-filter the relevant AF > 0 locally.
81Do not substitute an arbitrary epsilon without documenting its effect.
83---

Annotation filters (count/select variants and samples)

See annotation_vocabularies.md for the valid CSV terms. Different filter fields combine with AND; multiple CSV values within one field combine with OR.

flagtypemaps to
--af-lt / --af-gtfloat1000 Genomes dataset AF bounds
--gnomad-exomes-af-lt / --gnomad-exomes-af-gtfloatgnomAD v4.1 exomes AF bounds
--gnomad-genomes-af-lt / --gnomad-genomes-af-gtfloatgnomAD v4.1 genomes AF bounds
--clin-significanceCSVClinVar significance terms
--consequenceCSVSO consequence terms
--impactCSVVEP impact (HIGH,MODERATE,LOW,MODIFIER)
--variant-typeCSVSO variant class terms
--feature-typeCSVVEP feature types
--bio-typeCSVVEP biotypes
--alpha-missense-classCSVAM_LIKELY_BENIGN,AM_LIKELY_PATHOGENIC,AM_AMBIGUOUS
--alpha-missense-score-lt / --alpha-missense-score-gtfloatAlphaMissense score bounds
--biallelic-only / --multiallelic-onlyswitchsite multiplicity (mutually exclusive)
--exclude-males / --exclude-femalesswitchsex exclusion (mutually exclusive)

Mutual exclusions enforced: --biallelic-only/--multiallelic-only, --exclude-males/--exclude-females, and --alpha-missense-class vs the AlphaMissense score bounds. Every numeric AF/AlphaMissense bound must be finite, in (0, 1], and remain nonzero when encoded as float32. Zero means unset in the protobuf API; the wrapper rejects it rather than silently dropping the filter. Setting a positive *-gt ≥ its matching *-lt defines an empty range.

The gnomAD < X bounds include unannotated variants, represented by AF = 0. Choose a scientifically meaningful positive lower bound to exclude those zeros; this also excludes annotated values at or below that bound. For exact annotation presence, retrieve complete variants and post-filter the relevant AF > 0 locally. Do not substitute an arbitrary epsilon without documenting its effect.


Raw lines 49 to 84
85## Commands
87### `dataset-info`
89No flags beyond `--output` / `--timeout`. Returns dataset totals (sample count, sex split,
90variant total, assembly) and the cohort breakdown. Doubles as a connectivity
91check.
93JSON: `{command, samples_total, females_total, males_total, variants_total,
94assembly, cohorts:[{cohort_name, samples_count, female_count, male_count,
95synthetic}]}`.

dataset-info

No flags beyond --output / --timeout. Returns dataset totals (sample count, sex split, variant total, assembly) and the cohort breakdown. Doubles as a connectivity check.

JSON: {command, samples_total, females_total, males_total, variants_total, assembly, cohorts:[{cohort_name, samples_count, female_count, male_count, synthetic}]}.

Raw lines 87 to 96
97### `count-variants`
99Region + zygosity + annotation flags. Counts variants in the region(s),
100cohort-wide. JSON: `{command, count, request, result_incomplete}`.

count-variants

Region + zygosity + annotation flags. Counts variants in the region(s), cohort-wide. JSON: {command, count, request, result_incomplete}.

Raw lines 97 to 101
102### `select-variants`
104SELECT variants which exist in ANY genomic region provided.
106Region + zygosity + annotation flags, plus pagination:
108| flag | type | required | default | description |
109| --- | --- | --- | --- | --- |
110| `--limit` | int | no | 200 | Hard cap on returned variants (mutually exclusive with `--page-size`). |
111| `--page-size` | int | no | – | Retrieve ALL matching variants in pages of this size (full walk). |
113JSON: `{command, count_returned, truncated, request, result_incomplete,
114variants:[…]}`. `truncated` is true when the count hit `--limit` (more may
115exist; raise `--limit` or use `--page-size`). Empty `variants` array if no
116matches. Paging accumulates the complete result in memory. Check
117`result_incomplete` separately from `truncated`; a count taken before selection
118is not a transactional snapshot.

select-variants

SELECT variants which exist in ANY genomic region provided.

Region + zygosity + annotation flags, plus pagination:

flagtyperequireddefaultdescription
--limitintno200Hard cap on returned variants (mutually exclusive with --page-size).
--page-sizeintno–Retrieve ALL matching variants in pages of this size (full walk).

JSON: {command, count_returned, truncated, request, result_incomplete, variants:[…]}. truncated is true when the count hit --limit (more may exist; raise --limit or use --page-size). Empty variants array if no matches. Paging accumulates the complete result in memory. Check result_incomplete separately from truncated; a count taken before selection is not a transactional snapshot.

Raw lines 102 to 119
120### `count-variants-in-samples`
122As `count-variants`, plus `--samples CSV` (required) — counts variants carried
123by the named individuals. Blank/empty CSV is rejected before connecting, because
124the SDK otherwise routes an empty sample list to the cohort-wide endpoint.

count-variants-in-samples

As count-variants, plus --samples CSV (required) — counts variants carried by the named individuals. Blank/empty CSV is rejected before connecting, because the SDK otherwise routes an empty sample list to the cohort-wide endpoint.

Raw lines 120 to 125
126### `select-variants-in-samples`
128As `select-variants`, plus `--samples CSV` (required) — selects variants carried
129by the named individuals.

select-variants-in-samples

As select-variants, plus --samples CSV (required) — selects variants carried by the named individuals.

Raw lines 126 to 130
131### `count-samples`
133Region + zygosity + annotation flags. Counts how many individuals carry a
134matching variant. JSON: `{command, count, request, result_incomplete}`.

count-samples

Region + zygosity + annotation flags. Counts how many individuals carry a matching variant. JSON: {command, count, request, result_incomplete}.

Raw lines 131 to 135
136### `select-samples`
138Region + zygosity + annotation flags, plus pagination:
140| flag | type | required | default | description |
141| --- | --- | --- | --- | --- |
142| `--skip` | int | no | – | Skip the first N individuals. |
143| `--limit` | int | no | – | Return at most N individuals. |
145Returns the **names** of individuals carrying a matching variant. To see which
146variants qualified them, feed the names into `select-variants-in-samples`. JSON:
147`{command, count, samples:[…], request, result_incomplete}`. Empty `samples` array
148if no matches.

select-samples

Region + zygosity + annotation flags, plus pagination:

flagtyperequireddefaultdescription
--skipintno–Skip the first N individuals.
--limitintno–Return at most N individuals.

Returns the names of individuals carrying a matching variant. To see which variants qualified them, feed the names into select-variants-in-samples. JSON: {command, count, samples:[…], request, result_incomplete}. Empty samples array if no matches.

Raw lines 136 to 149
150### `count-samples-hom-ref`
152| flag | type | required | description |
153| --- | --- | --- | --- |
154| `--chrom` | str | yes | Chromosome. |
155| `--position` | int | yes | 1-based position. |
157Counts individuals with a homozygous-reference (0/0) call at the position. JSON:
158`{command, count, variant_present, request, result_incomplete}`. For a complete
159response the count uses a **sentinel**:
161- `-1` → no variant exists at the position at all (`variant_present=false`).
162- `0` → a variant exists, but no individual is homozygous reference.
163- `>0` → number of homozygous-reference individuals.
165If `result_incomplete=true`, `variant_present=null` and the count is not
166definitive. No variant record does not imply all samples are callable reference.

count-samples-hom-ref

flagtyperequireddescription
--chromstryesChromosome.
--positionintyes1-based position.

Counts individuals with a homozygous-reference (0/0) call at the position. JSON: {command, count, variant_present, request, result_incomplete}. For a complete response the count uses a sentinel:

  • -1 → no variant exists at the position at all (variant_present=false).
  • 0 → a variant exists, but no individual is homozygous reference.
  • >0 → number of homozygous-reference individuals.

If result_incomplete=true, variant_present=null and the count is not definitive. No variant record does not imply all samples are callable reference.

Raw lines 150 to 167
168### `select-samples-hom-ref`
170Same `--chrom`/`--position` as above. Lists the individuals with a homozygous-
171reference call at the position. JSON:
172`{command, count, samples:[…], request, result_incomplete}`.

select-samples-hom-ref

Same --chrom/--position as above. Lists the individuals with a homozygous- reference call at the position. JSON: {command, count, samples:[…], request, result_incomplete}.

Raw lines 168 to 173
174### `kinship`
176| flag | type | required | description |
177| --- | --- | --- | --- |
178| `--sample1` | str | yes | First sample name. |
179| `--sample2` | str | yes | Second sample name. |
181Returns the relatedness degree and the KING kinship coefficient between the two
182named individuals. JSON: `{command, sample1, sample2, degree, phi_bwf,
183result_incomplete}`. `degree` ∈ `{TWINS_MONOZYGOTIC, FIRST_DEGREE,
184SECOND_DEGREE, THIRD_DEGREE, UNRELATED}`; `phi_bwf` is the KING between-family
185robust coefficient (≈ 0.5 monozygotic, 0.25 first-degree, 0.125 second-degree,
1860.0625 third-degree).
188---

kinship

flagtyperequireddescription
--sample1stryesFirst sample name.
--sample2stryesSecond sample name.

Returns the relatedness degree and the KING kinship coefficient between the two named individuals. JSON: {command, sample1, sample2, degree, phi_bwf, result_incomplete}. degree ∈ {TWINS_MONOZYGOTIC, FIRST_DEGREE, SECOND_DEGREE, THIRD_DEGREE, UNRELATED}; phi_bwf is the KING between-family robust coefficient (≈ 0.5 monozygotic, 0.25 first-degree, 0.125 second-degree, 0.0625 third-degree).


Raw lines 174 to 189
190## Returned-variant output schema
192`select-variants` and `select-variants-in-samples` return a `variants` array;
193each element has these keys (filter-only criteria such as ClinVar significance
194and VEP consequence are **not** echoed back on a returned variant):
196| key | type | meaning |
197| --- | --- | --- |
198| `chr` | str | Chromosome, e.g. `chr17`. |
199| `start` | int | 1-based inclusive start. |
200| `end` | int | 1-based inclusive end. |
201| `ref` | str | Reference allele. |
202| `alt` | str | Alternate allele. |
203| `af` | float | Whole-dataset allele frequency, not recalculated for `--samples`. |
204| `ac` | float | Dataset allele count (0.5 for male non-PAR het calls on X and Y chromosomes). |
205| `an` | int | Dataset allele number. |
206| `hom_samples` | int | Number of all samples with a homozygous genotype. |
207| `het_samples` | int | Number of all samples with a heterozygous genotype. |
208| `mis_samples` | int | Number of all samples with a missing (no-call) genotype. |
209| `hom_samples_fx` | int | Number of female samples with a homozygous genotype, X chromosome only (0 outside X). |
210| `het_samples_fx` | int | Number of female samples with a heterozygous genotype, X chromosome only (0 outside X). |
211| `mis_samples_fx` | int | Number of female samples with a missing (no-call) genotype, X chromosome only (0 outside X). |
212| `hom_samples_mxy` | int | Number of male samples with a homozygous genotype, X & Y chromosomes only (0 outside X and Y). |
213| `het_samples_mxy` | int | Number of male samples with a heterozygous genotype, X & Y chromosomes only (0 outside X and Y). |
214| `mis_samples_mxy` | int | Number of male samples with a missing (no-call) genotype, X & Y chromosomes only (0 outside X and Y). |
215| `gnomad_exomes_af` | float | gnomAD v4.1 exomes AF. `0.0` = not annotated in this service snapshot. |
216| `gnomad_genomes_af` | float | gnomAD v4.1 genomes AF. `0.0` = not annotated in this service snapshot. |
217| `am_score` | float | AlphaMissense score. `0.0` = not annotated. |
218| `amino_acids` | str | HGVSp annotation string; may contain multiple transcript entries, canonical first. |
219| `biallelic` | bool | Whether the site was biallelic in the input VCFs. |
221---
223# Sample & population metadata commands (offline)
225A second script, `scripts/onekgpd_meta.py`, answers population/pedigree questions
226from a data file bundled in the skill (`assets/kgpe.json`) — **no network, no
227credentials, no dependencies**. Run with
228`uv run scripts/onekgpd_meta.py <command> [flags]`. The sample identifier is the
229same name used by the variant/kinship commands (e.g. `NA19240`), so the two
230layers compose (e.g. `select-samples-by-population` → `select-variants-in-samples`).
232The 1000 Genomes cohort has **5 superpopulations** (`AFR` Africa, `AMR` America,
233`EAS` East Asia, `EUR` Europe, `SAS` South Asia) and **26 populations**. Use
234`list-populations` / `list-superpopulations` to discover valid codes and full
235names. Population/superpopulation values are matched **case-insensitively**
236against either the short code or the full name; **sample IDs are case-sensitive**.
238All six commands write JSON to `--output` (or a temp file) and print a summary.

Returned-variant output schema

select-variants and select-variants-in-samples return a variants array; each element has these keys (filter-only criteria such as ClinVar significance and VEP consequence are not echoed back on a returned variant):

keytypemeaning
chrstrChromosome, e.g. chr17.
startint1-based inclusive start.
endint1-based inclusive end.
refstrReference allele.
altstrAlternate allele.
affloatWhole-dataset allele frequency, not recalculated for --samples.
acfloatDataset allele count (0.5 for male non-PAR het calls on X and Y chromosomes).
anintDataset allele number.
hom_samplesintNumber of all samples with a homozygous genotype.
het_samplesintNumber of all samples with a heterozygous genotype.
mis_samplesintNumber of all samples with a missing (no-call) genotype.
hom_samples_fxintNumber of female samples with a homozygous genotype, X chromosome only (0 outside X).
het_samples_fxintNumber of female samples with a heterozygous genotype, X chromosome only (0 outside X).
mis_samples_fxintNumber of female samples with a missing (no-call) genotype, X chromosome only (0 outside X).
hom_samples_mxyintNumber of male samples with a homozygous genotype, X & Y chromosomes only (0 outside X and Y).
het_samples_mxyintNumber of male samples with a heterozygous genotype, X & Y chromosomes only (0 outside X and Y).
mis_samples_mxyintNumber of male samples with a missing (no-call) genotype, X & Y chromosomes only (0 outside X and Y).
gnomad_exomes_affloatgnomAD v4.1 exomes AF. 0.0 = not annotated in this service snapshot.
gnomad_genomes_affloatgnomAD v4.1 genomes AF. 0.0 = not annotated in this service snapshot.
am_scorefloatAlphaMissense score. 0.0 = not annotated.
amino_acidsstrHGVSp annotation string; may contain multiple transcript entries, canonical first.
biallelicboolWhether the site was biallelic in the input VCFs.

Sample & population metadata commands (offline)

A second script, scripts/onekgpd_meta.py, answers population/pedigree questions from a data file bundled in the skill (assets/kgpe.json) — no network, no credentials, no dependencies. Run with uv run scripts/onekgpd_meta.py <command> [flags]. The sample identifier is the same name used by the variant/kinship commands (e.g. NA19240), so the two layers compose (e.g. select-samples-by-population → select-variants-in-samples).

The 1000 Genomes cohort has 5 superpopulations (AFR Africa, AMR America, EAS East Asia, EUR Europe, SAS South Asia) and 26 populations. Use list-populations / list-superpopulations to discover valid codes and full names. Population/superpopulation values are matched case-insensitively against either the short code or the full name; sample IDs are case-sensitive.

All six commands write JSON to --output (or a temp file) and print a summary.

Raw lines 190 to 239
Runs code scripts/onekgpd_meta.py :225
240## `sample-metadata`
242| flag | type | required | description |
243| --- | --- | --- | --- |
244| `--samples` | CSV | yes | Comma-separated sample IDs (case-sensitive), e.g. `NA19240,HG00096`. |
246JSON: `{command, samples:[{...}]}` ordered by `sample_id`. Each sample object:
248| key | type | meaning |
249| --- | --- | --- |
250| `sample_id` | str | Sample identifier (`externalIDs`). |
251| `family_id` | str\|null | Family/pedigree ID; `null` if absent. |
252| `gender` | str | `male` / `female`. |
253| `paternal_id` | str\|null | Father's `sample_id`; `null` if not in the dataset. |
254| `maternal_id` | str\|null | Mother's `sample_id`; `null` if not in the dataset. |
255| `relationship` | str\|null | `mother` / `father` / `child` / `null`. |
256| `children` | list[str] | Sorted children whose **both** parents are recorded; `[]` if none. |
257| `population_code` | str | e.g. `YRI`. |
258| `population` | str | e.g. `Yoruba in Ibadan, Nigeria`. |
259| `superpopulation_code` | str | e.g. `AFR`. |
260| `superpopulation` | str | e.g. `Africa`. |
261| `phase3` | str | `"TRUE"` / `"FALSE"` (phase-3 inclusion flag). |

sample-metadata

flagtyperequireddescription
--samplesCSVyesComma-separated sample IDs (case-sensitive), e.g. NA19240,HG00096.

JSON: {command, samples:[{...}]} ordered by sample_id. Each sample object:

keytypemeaning
sample_idstrSample identifier (externalIDs).
family_idstr\nullFamily/pedigree ID; null if absent.
genderstrmale / female.
paternal_idstr\nullFather's sample_id; null if not in the dataset.
maternal_idstr\nullMother's sample_id; null if not in the dataset.
relationshipstr\nullmother / father / child / null.
childrenlist[str]Sorted children whose both parents are recorded; [] if none.
population_codestre.g. YRI.
populationstre.g. Yoruba in Ibadan, Nigeria.
superpopulation_codestre.g. AFR.
superpopulationstre.g. Africa.
phase3str"TRUE" / "FALSE" (phase-3 inclusion flag).
Raw lines 240 to 262
263## `list-populations`
265No flags. JSON: `{command, populations:[{population_code, population,
266superpopulation_code, superpopulation, sample_count}]}`, ordered by
267(superpopulation, population). 26 entries.

list-populations

No flags. JSON: {command, populations:[{population_code, population, superpopulation_code, superpopulation, sample_count}]}, ordered by (superpopulation, population). 26 entries.

Raw lines 263 to 268
269## `list-superpopulations`
271No flags. JSON: `{command, superpopulations:[{superpopulation_code,
272superpopulation, sample_count, populations:[codes]}]}`, ordered by
273superpopulation. 5 entries.

list-superpopulations

No flags. JSON: {command, superpopulations:[{superpopulation_code, superpopulation, sample_count, populations:[codes]}]}, ordered by superpopulation. 5 entries.

Raw lines 269 to 274
275## `population-stats`
277| flag | type | required | description |
278| --- | --- | --- | --- |
279| `--populations` | repeatable | yes | One population code or full name per flag; repeat for multiple. Repeated (not CSV) because full names contain commas. Case-insensitive. |
281JSON: `{command, populations:[{population_code, population, superpopulation_code,
282superpopulation, sample_count, male_count, female_count, phase3_count,
283trio_count}]}`, ordered by population. `trio_count` = samples that are offspring
284with **both** parents in the dataset (not the `relationship` label).

population-stats

flagtyperequireddescription
--populationsrepeatableyesOne population code or full name per flag; repeat for multiple. Repeated (not CSV) because full names contain commas. Case-insensitive.

JSON: {command, populations:[{population_code, population, superpopulation_code, superpopulation, sample_count, male_count, female_count, phase3_count, trio_count}]}, ordered by population. trio_count = samples that are offspring with both parents in the dataset (not the relationship label).

Raw lines 275 to 285
286## `superpopulation-summary`
288| flag | type | required | description |
289| --- | --- | --- | --- |
290| `--superpopulations` | repeatable | yes | One superpopulation code or full name per flag; repeat for multiple. Case-insensitive. |
292JSON: `{command, superpopulations:[{superpopulation_code, superpopulation,
293sample_count, male_count, female_count, phase3_count, trio_count, populations:[
294<population-stats object>]}]}`. The per-superpopulation counts are sums over the
295nested per-population breakdown.

superpopulation-summary

flagtyperequireddescription
--superpopulationsrepeatableyesOne superpopulation code or full name per flag; repeat for multiple. Case-insensitive.

JSON: {command, superpopulations:[{superpopulation_code, superpopulation, sample_count, male_count, female_count, phase3_count, trio_count, populations:[ <population-stats object>]}]}. The per-superpopulation counts are sums over the nested per-population breakdown.

Raw lines 286 to 296
297## `select-samples-by-population`
299| flag | type | required | default | description |
300| --- | --- | --- | --- | --- |
301| `--population` | str | one of the two | – | Population code or full name (case-insensitive). |
302| `--superpopulation` | str | one of the two | – | Superpopulation code or full name (case-insensitive). |
303| `--skip` | int | no | 0 | Number of results to skip (≥ 0). |
304| `--limit` | int | no | 50 | Max results to return (1–3202). |
306At least one of `--population` / `--superpopulation` is required; when both are
307given the results are intersected (AND). JSON: `{command, count, samples:[ids],
308request:{population, superpopulation, skip, limit}}`, sample IDs ordered
309ascending then paginated by `skip`/`limit`.

select-samples-by-population

flagtyperequireddefaultdescription
--populationstrone of the two–Population code or full name (case-insensitive).
--superpopulationstrone of the two–Superpopulation code or full name (case-insensitive).
--skipintno0Number of results to skip (≥ 0).
--limitintno50Max results to return (1–3202).

At least one of --population / --superpopulation is required; when both are given the results are intersected (AND). JSON: {command, count, samples:[ids], request:{population, superpopulation, skip, limit}}, sample IDs ordered ascending then paginated by skip/limit.

Raw lines 297 to 311
312## Verified API contract
314Reviewed 2026-09-30 against released `dnaerys 0.2.1`, protobuf **R1.20.0**,
315and public TLS gRPC `db.dnaerys.org:443`. The service prefix is
316`org.dnaerys.cluster.grpc.DnaerysService/`; do not append REST routes to the host.
317All routes below were exercised with small read-only queries. Health and dataset
318metadata also succeeded: 3,202 samples, GRCh38, 138,044,723 variants, eight rings,
319and a 5,000-variant cap per ring. These are observed snapshot totals, not constants
320that clients may assume forever.
322| Wrapper operation / input | gRPC method suffix |
323| --- | --- |
324| `dataset-info` | `DatasetInfo` |
325| `count-variants`, single / multiple regions | `CountVariantsInRegion` / `CountVariantsInMultiRegions` |
326| `count-variants-in-samples`, single / multiple | `CountVariantsInRegionInSamples` / `CountVariantsInMultiRegionsInSamples` |
327| `select-variants`, single / multiple | `SelectVariantsInRegion` / `SelectVariantsInMultiRegions` |
328| `select-variants-in-samples`, single / multiple | `SelectVariantsInRegionInSamples` / `SelectVariantsInMultiRegionsInSamples` |
329| `count-samples`, single / multiple | `CountSamplesInRegion` / `CountSamplesInMultiRegions` |
330| `select-samples`, single / multiple | `SelectSamplesInRegion` / `SelectSamplesInMultiRegions` |
331| `count-samples-hom-ref` / `select-samples-hom-ref` | `CountSamplesHomReference` / `SelectSamplesHomReference` |
332| `kinship` | `KinshipDuo` |
334The SDK reuses variant routes for pagination and discovers the per-ring cap via
335`DatasetInfo`; do not reproduce per-ring offsets as global pagination. Small
336paginated results reconciled with the count. Large multi-ring exports and outage
337recovery were not stress-tested; incompleteness/retry behavior is covered by mocks.
339The protobuf and live service take precedence over prose when they disagree:
340`gnomad_exomes_af_gt=0` returned 15 variants including two zero annotations in
341a small test region; a positive bound of `1e-12` returned 13 with none missing.
342The latter is a positive threshold, not a universal definition of presence.
344Sources:
346- [Released SDK](https://pypi.org/project/dnaerys/0.2.1/) and
347 [official source](https://github.com/dnaerys/dnaerys-python).
348- [RPC definitions and zero-filter semantics](https://github.com/dnaerys/dnaerys-python/blob/master/proto/dnaerys.proto).
349- [Timeout/TLS options](https://github.com/dnaerys/dnaerys-python/blob/master/docs/source/connection.rst),
350 [pagination](https://github.com/dnaerys/dnaerys-python/blob/master/docs/source/pagination.rst),
351 and [missing-annotation convention](https://github.com/dnaerys/dnaerys-python/blob/master/docs/source/caveats.rst).
352- [Hosted cohort and annotation versions](https://github.com/dnaerys/onekgpd-mcp),
353 [annotation composition](https://github.com/dnaerys/onekgpd-mcp/blob/master/docs/annotations.md),
354 and [offline metadata source](https://github.com/dnaerys/onekgpd-mcp/blob/master/src/main/resources/kgpe.json).
355 The bundled 3,202 records matched this source on review; they are not live metadata.
356- [BRCA1 coordinate source](https://www.ncbi.nlm.nih.gov/gene/672): Gene 672,
357 GRCh38.p14, NC_000017.11:43044295-43170327, annotation RS_2025_08.

Verified API contract

Reviewed 2026-09-30 against released dnaerys 0.2.1, protobuf R1.20.0, and public TLS gRPC db.dnaerys.org:443. The service prefix is org.dnaerys.cluster.grpc.DnaerysService/; do not append REST routes to the host. All routes below were exercised with small read-only queries. Health and dataset metadata also succeeded: 3,202 samples, GRCh38, 138,044,723 variants, eight rings, and a 5,000-variant cap per ring. These are observed snapshot totals, not constants that clients may assume forever.

Wrapper operation / inputgRPC method suffix
dataset-infoDatasetInfo
count-variants, single / multiple regionsCountVariantsInRegion / CountVariantsInMultiRegions
count-variants-in-samples, single / multipleCountVariantsInRegionInSamples / CountVariantsInMultiRegionsInSamples
select-variants, single / multipleSelectVariantsInRegion / SelectVariantsInMultiRegions
select-variants-in-samples, single / multipleSelectVariantsInRegionInSamples / SelectVariantsInMultiRegionsInSamples
count-samples, single / multipleCountSamplesInRegion / CountSamplesInMultiRegions
select-samples, single / multipleSelectSamplesInRegion / SelectSamplesInMultiRegions
count-samples-hom-ref / select-samples-hom-refCountSamplesHomReference / SelectSamplesHomReference
kinshipKinshipDuo

The SDK reuses variant routes for pagination and discovers the per-ring cap via DatasetInfo; do not reproduce per-ring offsets as global pagination. Small paginated results reconciled with the count. Large multi-ring exports and outage recovery were not stress-tested; incompleteness/retry behavior is covered by mocks.

The protobuf and live service take precedence over prose when they disagree: gnomad_exomes_af_gt=0 returned 15 variants including two zero annotations in a small test region; a positive bound of 1e-12 returned 13 with none missing. The latter is a positive threshold, not a universal definition of presence.

Sources:

Raw lines 312 to 357