Skip to content

[codex] Fix boundary read evidence counts#172

Merged
iskandr merged 1 commit into
masterfrom
fix-read-evidence-boundaries
Apr 23, 2026
Merged

[codex] Fix boundary read evidence counts#172
iskandr merged 1 commit into
masterfrom
fix-read-evidence-boundaries

Conversation

@iskandr

@iskandr iskandr commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes read-evidence undercounting at locus boundaries and adds regression coverage around the affected cases.

What changed

  • allow insertion-locus reads to survive when the inserted bases are at the beginning or end of the aligned read
  • add direct LocusRead regressions for insertion support at read boundaries
  • add read-evidence regressions for SNVs at read starts/ends
  • add read-evidence regressions for insertion counts at read boundaries
  • add splice-boundary regressions for SNVs at the last base before an intron and the first base after an intron
  • bump isovar to 1.4.22
  • update the CLI row-count expectation to reflect the recovered real-data allele-read row
  • remove a stale test comment that still described the old exon-boundary miss

Why

ReadCollector.locus_read_from_pysam_aligned_segment(...) handled insertions by requiring mapped flanks on both sides of the insertion site. That drops reads whose inserted bases occur at the start or end of the aligned query even though those reads still contain valid allele evidence. Those drops then propagate into allele-read exports and read counts.

The older exon-boundary/read-boundary bugs were also only weakly pinned down by tests. This PR makes those cases explicit at the unit level.

Impact

  • insertion-supporting reads at read boundaries are no longer silently dropped
  • isovar-allele-reads emits one more real-data row in the bundled fixture set because the missing boundary read is now recovered
  • read-boundary and splice-boundary behavior is now covered by regressions

Validation

  • ./lint.sh
  • ./test.sh

Closes #49
Closes #23
Closes #24
Closes #55
Refs #14

@iskandr iskandr marked this pull request as ready for review April 23, 2026 16:49
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.441% (+0.01%) from 93.429% — fix-read-evidence-boundaries into master

@iskandr iskandr merged commit 5f4778a into master Apr 23, 2026
6 checks passed
@iskandr iskandr deleted the fix-read-evidence-boundaries branch April 23, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants