Skip to content

Harness tests for score_caller and three other sv_pipeline functions (#825) - #860

Merged
joshfactorial merged 1 commit into
developfrom
test/825_sv_pipeline_functions
Oct 29, 2026
Merged

joshfactorial merged 1 commit into
developfrom
test/825_sv_pipeline_functions

Conversation

@joshfactorial

Copy link
Copy Markdown
Collaborator

Closes #825 (close it by hand on merge to develop).

test_score_caller.sh: 31 assertions, 11 mutants caught

score_caller is extracted verbatim. run_truvari_both is replaced by a recorder that logs each scoring call's label, truth file, query record IDs and extra arguments, which is exactly the decision under test. Real bcftools builds the subsets. Pinned:

  • The aggregate query drops BND and CNV, and keeps a call with no SVTYPE (job 20675480: manta_overall FP=24 from a 24-record truth).
  • A failed aggregate query build is counted in SCORE_COVERAGE_FAIL, never scored unfiltered.
  • The per-type loop follows SV_TYPES_SCORED_IN_LOOP. A stray truth_sv_BNDinv.vcf.gz is never scored (job 20745149).
  • A type the caller never emitted reads recall=0.000 and leaves no empty query behind.
  • The BND query is built from the raw calls, with --bnddist. Fixture IDs tell raw from converted.
  • BNDspan is scored only when calibration passed, from the unfiltered raw calls, with -t.
  • A missing aggregate truth skips only the aggregate; a missing call set scores nothing.

test_sv_pipeline_helpers.sh: 34 assertions, 15 mutants caught

  • build_bnd_spans:
    • a mate pair yields one span with the right END and SVLEN, and END is backfilled into a header that lacked it;
    • all inter-contig junctions return 2;
    • an unparsable truth returns 1 even beside inter-contig records;
    • a missing file returns 1 and names the file.
  • convert_manta_inversions: a real conversion is accepted; a no-op, an inconsistent or a crashed conversion is refused (with the converter's rc and stderr); an older Manta without the converter returns 2.
  • index_and_align: R2 is derived from R1; single-end aligns R1 alone; an aligned sample is skipped; a missing index is built before aligning.
  • index_reference_locked (lib_report.sh): a 0-byte .bwt.2bit.64 triggers a rebuild, and a real one doesn't. The mutation driver edits both files.

Mutation findings

  • One planned mutant was equivalent: a negated -i 'SVTYPE!="BND" && …'. bcftools 1.19 treats a missing SVTYPE as unequal to "BND", so it keeps the no-SVTYPE call exactly as -e does (checked). It was replaced by the regression the code's comment actually guards against, a positive type list. The finding is recorded in the suite.
  • One survivor exposed a status-only check: without the missing-file guard, build_bnd_spans still returns 1, but blames the ALT parser. The test now also requires the message to name the missing file.

Also

CLAUDE.md rule 6's "current example" said 25 of 29 functions were tested, naming these four as the gaps. All 29 are now referenced by a suite (counted by grep). The example now says what remains untested: the script's top-level flow between functions, which only Delta exercises.

Verified

  • All 22 harness suites pass locally, run the way CI's glob loop runs them; bash -n is clean.
  • Both new suites exit with 0 mutation(s) survived, which is the last line CI's non-vacuity step checks.

Not verified

  • Delta. These tests change no pipeline code.

🤖 Generated with Claude Code

…825)

test_score_caller.sh extracts score_caller verbatim and records each scoring
call (label, truth, query record IDs, extra args) in place of truvari. It pins
the seven decisions behind every quoted SV recall: BND/CNV out of the aggregate
query with no-SVTYPE calls kept, a failed query build counted, the canonical
type loop (not the files on disk), recall=0 for an unemitted type, the BND
query from the raw calls with --bnddist, and BNDspan only after a passing
calibration and with -t.

test_sv_pipeline_helpers.sh covers build_bnd_spans' three-way status,
convert_manta_inversions' refusal of a crashed, no-op or inconsistent
conversion, index_and_align, and the 0-byte index rebuild in
index_reference_locked.

Every assertion in both suites passes, and every mutant is caught (11 and 15).
One planned mutant was equivalent under bcftools 1.19 and was replaced with
the realistic regression; one survivor exposed a status-only check, which now
asserts the reason too. All 29 sv_pipeline functions are now exercised;
CLAUDE.md's rule 6 example is updated to say what is still untested.

Co-Authored-By: Claude <noreply@anthropic.com>
@joshfactorial
joshfactorial merged commit 0f5e0b1 into develop Oct 29, 2026
7 checks passed
@joshfactorial
joshfactorial deleted the test/825_sv_pipeline_functions branch October 30, 2026 03:07
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