feat: add wide variant-TSV header and per-pop validation - #128
Merged
Merged
Conversation
ameynert
deployed
to
github-actions-snakemake-linting
September 4, 2026 20:00 — with
GitHub Actions
Active
ameynert
force-pushed
the
feat/tsv-variant-validation
branch
from
September 4, 2026 21:22
5f8d349 to
4c981ba
Compare
ameynert
deployed
to
github-actions-snakemake-linting
September 4, 2026 21:22 — with
GitHub Actions
Active
ameynert
force-pushed
the
feat/tsv-variant-validation
branch
from
September 8, 2026 21:00
4c981ba to
f3c7e0a
Compare
ameynert
deployed
to
github-actions-snakemake-linting
September 8, 2026 21:00 — with
GitHub Actions
Active
ameynert
marked this pull request as ready for review
September 9, 2026 17:56
znorgaard
approved these changes
Sep 11, 2026
ameynert
force-pushed
the
feat/tsv-variant-validation
branch
from
September 11, 2026 17:22
f3c7e0a to
d0b84b6
Compare
ameynert
added this pull request to stack #138
September 11, 2026 17:22
ameynert
deployed
to
github-actions-snakemake-linting
September 11, 2026 17:22 — with
GitHub Actions
Active
ameynert
added a commit
that referenced
this pull request
Sep 11, 2026
Address review on #128: - Rename the validation helper `_assert` to `_validate` (it raises ValueError, not AssertionError). - Make `_FIXED_COLUMNS` a frozenset. - Report the number of failing rows in the validation error message. - Trim the redundant second sentence from the `mask` arg docstring. Kept the extra-column passthrough (downstream reads columns by name, so extras are harmless) and `tsv_source/variants.tsv` as a committed, reused fixture. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ameynert
force-pushed
the
feat/tsv-variant-validation
branch
from
September 11, 2026 17:57
d0b84b6 to
0734f26
Compare
ameynert
deployed
to
github-actions-snakemake-linting
September 11, 2026 17:57 — with
GitHub Actions
Active
Address review on #128: - Rename the validation helper `_assert` to `_validate` (it raises ValueError, not AssertionError). - Make `_FIXED_COLUMNS` a frozenset. - Report the number of failing rows in the validation error message. - Trim the redundant second sentence from the `mask` arg docstring. Kept the extra-column passthrough (downstream reads columns by name, so extras are harmless) and `tsv_source/variants.tsv` as a committed, reused fixture. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ameynert
force-pushed
the
feat/tsv-variant-validation
branch
from
September 11, 2026 18:10
0734f26 to
513fc9c
Compare
ameynert
deployed
to
github-actions-snakemake-linting
September 11, 2026 18:10 — with
GitHub Actions
Active
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Append wide variant-TSV validation to
create_duckdb_from_tsv.py: a header check(
validate_variants_header) and a legend-driven, null-safe per-population validator(
read_and_validate_variants), plus avariants.tsvfixture and a parametrized refusal-table test.Why
The pure-Python TSV path must reject malformed input up front. Validation is vectorized (polars) and
null-safe:
contig,pos,ref,altplusAC_<pop>/AF_<pop>per population must be present;an
AC_/AF_column naming an unknown population is rejected; other extra columns (e.g.rsid)are permitted and ignored.
pos >= 1;contiga GRCh38 main-contig token;ref/altareA/C/G/T/N; each pop'sAC_/AF_is both-present-or-both-empty withAC >= 0andAF in [0, 1]; at least one definedAF per row. Failures name the first offending
(contig,pos,ref,alt); a null-derived comparisoncounts as a failure (
fill_null(False)), never a silent pass.Notes
variants.tsvcovers a SNP, a missing-population cell, an insertion, and a deletion.feat/tsv-source-metadata. Draft.Related to #114