Skip to content

Fix three validator false positives on real-world data - #36

Merged
zhemingfan merged 1 commit into
mainfrom
fix/validator-real-world-falsepos
Jul 4, 2026
Merged

Fix three validator false positives on real-world data#36
zhemingfan merged 1 commit into
mainfrom
fix/validator-real-world-falsepos

Conversation

@zhemingfan

Copy link
Copy Markdown
Owner

Summary

The real-world fixtures added in #35 (now merged) immediately caught three validators flagging valid canonical data as invalid. This fixes all three (each spec-backed) and strengthens the fixture suite so it can't happen again.

What real data exposed

Validator Real input Was flagged Fix
GFF3 (300/300 GENCODE lines, error) tag=basic,Ensembl_canonical,GENCODE_Primary "custom attribute can't be comma-separated" — the multi-value whitelist was exhaustive Only flag reserved single-value attributes; custom + reserved multi-value attributes may be comma-separated (GFF3 spec)
GTF (20 GENCODE lines, warning) gene-type features (no transcript_id) "must contain transcript_id" Require transcript_id only on non-gene features — genes legitimately omit it
VCF (8 GRIDSS lines, warning) single breakend ALT TTTT. / .AATC "ALT does not match spec patterns" Accept single-breakend notation (VCF 4.2 §5.4.9)

After the fixes, all 11 canonical fixtures validate with zero diagnostics.

The guard (why this can't regress)

The #35 verify suite only asserted "doesn't throw" — which is why those false positives slipped through green. This adds a per-fixture assertion that canonical data produces zero diagnostics (with a maxDiagnostics escape hatch for any future genuine advisory). So a new false positive on real GENCODE/GRIDSS/etc. output now fails CI.

Tests

  • GFF3: custom tag=a,b allowed; reserved single-value ID=a,b still flagged; reserved multi-value Parent=a,b allowed.
  • GTF: gene feature without transcript_id not warned; exon without it still warned. (Updated one existing test that had asserted the old behavior via a gene line.)
  • VCF: leading/trailing-dot single breakends accepted; a genuinely invalid ALT still flagged.
  • Fixtures: the new zero-diagnostic guard across all 11.
  • Full suite: 868 unit tests pass; lint, type-check, build green.

Real-fixture verification (GENCODE, GRIDSS) surfaced three validators flagging
valid canonical data:

- GFF3: comma-separated custom attributes (e.g. GENCODE
  tag=basic,Ensembl_canonical) were rejected because the multi-value whitelist
  was treated as exhaustive. Only reserved single-value attributes are now
  flagged; custom and reserved multi-value attributes may be comma-separated.
- GTF: gene-type features were warned for missing transcript_id, which
  GENCODE/Ensembl legitimately omit on genes. transcript_id is now required
  only on non-gene features.
- VCF: single-breakend ALTs (a contig with a leading/trailing ".", e.g. GRIDSS
  "TTTT." per VCF 4.2 section 5.4.9) were flagged as non-spec; now accepted.

Adds targeted unit tests for each fix and strengthens the real-fixtures suite to
assert every canonical fixture validates with zero diagnostics, so a future
false positive on real data fails CI.
@zhemingfan
zhemingfan merged commit a3692f8 into main Jul 4, 2026
3 checks passed
@zhemingfan
zhemingfan deleted the fix/validator-real-world-falsepos branch July 4, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant