Expand N-handling test coverage + remove dead has_r2 guard - #315
Merged
Conversation
Follow-up to the v4.6.0 N-handling work (PR #313/#314). Closes gaps found while reviewing the release PR: - Test that finalize_read_and_write actually threads n_handling through to convert_masking (default -> literal N, telomere -> TTAGGG fill); the new parameter was previously unexercised end-to-end. - Add a paired positive control (both mates clean -> fragment kept) and cover the read1-in-gap drop direction, not just read2-in-gap. - Add a GC-bias-path exclusion test; the prior end-to-end test only covered the uniform sampler, leaving the GC path's filter call sites untested. - Validate the n_handling choice schema and n_max_fraction range, and assert their defaults in test_default_values. - Fix a now-stale comment claiming the `choice` validator is unused by any production option (n_handling uses it). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 14, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the v4.6.0 N-handling work (#313, released via #314). Closes coverage gaps and a small dead-code finding from reviewing the release PR. Mostly test-only, plus one behavior-preserving cleanup.
Tests
finalize_read_and_writethreading — the newn_handlingparameter was never exercised end-to-end. Added tests that the default (exclude) leaves a literalNin the emitted FASTQ and thattelomerereachesconvert_maskingand fills it._filter_n_regionscall sites. Added a GC-path test (non-uniform model, asserted vianot gc_model.is_uniform).n_handlingchoice schema andn_max_fraction[0,1] range, and asserted both defaults intest_default_values.test_check_and_log_error_choice_validclaimed thechoicevalidator is unused by any production option;n_handlingnow uses it. Corrected.Cleanup (production)
has_r2guard in_filter_n_regions. In the paired branch read2 is always a real in-bounds window ((e - read_len, e)withe >= read_len + 10), sohas_r2was always True; the(0, 0)placeholder only occurs single-ended, which never reaches that branch. Behavior-preserving (covered by the paired N-filter tests); also drops a misleading "filtered upstream" comment.Testing
pytest tests/test_read_simulator/→ 402 passed.gitnexus detect-changes→ low risk.🤖 Generated with Claude Code