Skip to content

Fix #152: handle mixed alleles gracefully instead of crashing#157

Merged
iskandr merged 1 commit into
masterfrom
fix-152-subclonal-allele-crash
Apr 16, 2026
Merged

Fix #152: handle mixed alleles gracefully instead of crashing#157
iskandr merged 1 commit into
masterfrom
fix-152-subclonal-allele-crash

Conversation

@iskandr

@iskandr iskandr commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • get_single_allele_from_reads now returns (allele, filtered_reads) instead of just allele.
  • Mixed alleles: uses most common, logs warning, filters to matching reads.
  • Updated caller in variant_sequence_creator.py.
  • Three new tests: uniform alleles, mixed alleles, empty raises.
  • Bumped version to 1.4.14.

Fixes #152

Test plan

  • ./test.sh passes (169 tests)
  • ./lint.sh passes

Previously raised ValueError if reads had different alleles. Now uses the
most common allele and filters to only matching reads, with a warning.
Return signature changed to (allele, filtered_reads) tuple.

This handles edge cases from indel representation ambiguity or subclonal
mixtures without crashing. Callers using the old single-return-value
signature are updated (variant_sequence_creator.py).

Fixes #152
@coveralls

coveralls commented Apr 16, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 93.174% (+0.1%) from 93.077% — fix-152-subclonal-allele-crash into master

@iskandr iskandr merged commit cd3e05c into master Apr 16, 2026
5 of 6 checks passed
@iskandr iskandr deleted the fix-152-subclonal-allele-crash branch April 16, 2026 03:52
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.

get_single_allele_from_reads crashes on subclonal mixtures instead of handling them

2 participants