Skip to content

Sequence-variant corpus: substitution tranche (subs × mod, termini, VCF depth, trypsin cut-sites, MNV, variant-borne mod, double subs)#1098

Open
trishorts wants to merge 1 commit into
smith-chem-wisc:masterfrom
trishorts:variant-corpus-substitutions
Open

Sequence-variant corpus: substitution tranche (subs × mod, termini, VCF depth, trypsin cut-sites, MNV, variant-borne mod, double subs)#1098
trishorts wants to merge 1 commit into
smith-chem-wisc:masterfrom
trishorts:variant-corpus-substitutions

Conversation

@trishorts

Copy link
Copy Markdown
Contributor

Substitution tranche for the sequence-variant corpus

Follows #1084 (L0 corpus) and #1095 (L1 deletions). Test-only. Deepens the executable
spec along the substitution axis with 14 new oracle nodes. Every ExpectedForms
oracle is hand-derived from the domain model (bible), never captured from running
code
— so a green run certifies the code matches the intended behavior, and a future
regression turns a node red.

Each node runs through both families already in the fixture:

  • Corpus_Node — build XML → LoadProteinXML (variants expand at load) → digest → compare, run twice for determinism.
  • Corpus_Node_RoundTrip — same, but the consensus protein is serialized through the real ProteinDbWriter and re-read first, so encode+decode is exercised too.

New nodes

Node What it pins
S00 / S01 / S02 Substitution before / on / after a PTM. S01 (T→S) pins the D7 case for a residue-specific motif — the phospho drops both positionally and motif-wise (our mod is "on T"; S≠T).
S03 / S04 Substitution at the protein start (pos 1) and end (last residue, in-range boundary — contrast the out-of-range F04).
S05 / S06 VCF substitution passing / failing the minAlleleDepth cutoff (fully VCF-encoded, ApplyVariants depth path).
S07 / S08 / S09 Bottom-up: a substitution moves the trypsin knife — destroy a cut site (K→A), create one (A→K), and block cleavage via the not-before-proline rule (I→P under trypsin|P). First digestion-axis nodes.
S10 Multi-residue MNV (TI→VL) over a begin/end range, equal length (exercises the range apply path for a substitution).
S11 A substitution that carries a mod into the proteoformV4→T whose new T bears a phospho stored on the variant (SequenceVariation.OneBasedModifications). Reciprocal of F03; the round-trip family gives it real teeth on variant-borne-mod serialization (#1083).
SS00 / SS01 Double substitutions — two independent, and two where one lands on the PTM residue.

Harness changes (test infra only)

  • BuildMods now also registers variant-borne mods (a VMOD token on a variant), with the motif taken from the variant residue, de-duplicated by IdWithMotif.
  • BuildXml emits the nested <subfeature type="modified residue"> / <subposition> structure for VMOD, and labels VCF substitutions as missense_variant.

Result

62 / 62 green (31 nodes × 2 families). No production code touched.

🤖 Generated with Claude Code

Deepen the sequence-variant corpus along the substitution axis with 14 new
oracle nodes (hand-derived from the bible, never captured from code):

- S00-S02  sub before / on / after a PTM. S01 (T->S) pins the D7 case for a
           residue-specific motif -- dropped both positionally and motif-wise.
- S03-S04  substitution at the protein start / end (in-range boundary).
- S05-S06  VCF substitution passing / failing the minAlleleDepth cutoff.
- S07-S09  bottom-up: a substitution moves the trypsin knife -- destroy (K->A),
           create (A->K), and block-before-proline (I->P under trypsin|P).
           First digestion-axis nodes (installment 5).
- S10      multi-residue MNV (TI->VL) over a begin/end range, same length.
- S11      variant-BORNE mod: V4->T carries a phospho stored on the variant
           (reciprocal of F03); round-trip gives it teeth on smith-chem-wisc#1083 serialization.
- SS00-SS01 double substitutions: independent, and one landing on the PTM.

Harness: BuildMods now also registers variant-borne (VMOD) mods with the motif
taken from the variant residue; BuildXml emits the nested <subfeature>/
<subposition> for VMOD and labels VCF subs as missense_variant. 62/62 green
(31 nodes x Corpus_Node + Corpus_Node_RoundTrip).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.50%. Comparing base (525cb7c) to head (89cd245).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1098   +/-   ##
=======================================
  Coverage   91.50%   91.50%           
=======================================
  Files         439      439           
  Lines       53542    53542           
  Branches     6511     6511           
=======================================
  Hits        48995    48995           
  Misses       3275     3275           
  Partials     1272     1272           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@trishorts trishorts added Maintenance The user isn't impacted by it, it's purely behind the scenes ready for review labels Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance The user isn't impacted by it, it's purely behind the scenes ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant