Repository navigation
test(clip): port missing fgbio SamRecordClipper and ClipBam tests - #1018
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.
WalkthroughThe pull request reuses a shared helper to count existing raw end clips and adds fgbio-derived tests for raw and command-level clipping. Tests also require clipping-related tags to exist with expected types and cover clipping outputs, mate fields, regenerated tags, metrics, and unmapped reads. ChangesRead clipping
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~30 minutes Change: Other Merge Risk: ⚪ Minimal · up to The clipping changes add tests and clarify a comment; no issue requiring correction before merge was identified. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
Comment |
|
@coderabbitai pause |
✅ Action performedReviews paused. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1018 +/- ##
==========================================
+ Coverage 96.43% 96.44% +0.01%
==========================================
Files 299 299
Lines 151289 152039 +750
==========================================
+ Hits 145894 146634 +740
- Misses 5395 5405 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
0c2d31f to
e29b074
Compare
|
@coderabbitai review |
|
32bafec to
058535a
Compare
e29b074 to
c0c9aa3
Compare
058535a to
6f4d522
Compare
ce0dacc to
ebeba98
Compare
6f4d522 to
54ebee7
Compare
…mments clip_start_of_read_raw and clip_end_of_read_raw now use the clipping_at_end_raw helper that overlap clipping already uses. Comments that pointed at the removed typed SamRecordClipper now cite fgbio, and the clip_template_records comment no longer claims the per-read helpers never upgrade clipping (they upgrade the end they clip, as fgbio does). The strand-normalization overlap tests now also run in soft-with-mask mode.
…as missing An audit of fgbio's SamRecordClipperTest and ClipBamTest (fgbio e51a661) against fgumi found 30 + 10 cases with no fgumi counterpart and 8 + 11 whose fgumi version dropped clipping modes or assertions (for example checking only the CIGAR, not bases, qualities, return values, mate info or metrics). This ports each of those cases with fgbio's inputs and expected values, in dedicated fgbio_sam_record_clipper_tests and fgbio_clip_bam_tests modules; every test cites its fgbio source line. fgumi already met every expectation, so no production code changes. Fixture-only deviations are documented on the affected tests: ClipBamTest L182's SEQ is resized to match its hard-clipped CIGAR (fgbio's fixture is malformed), and numBasesExtendingPastMate is exercised through the MC-based num_bases_extending_past_mate_raw.
28 clipper tests checked per-base tag values inside `if let Some(Value::...)`, so a missing tag or a changed value type skipped the assertion and the test passed. They now use let-else and panic.
54ebee7 to
5c14575
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Follows #1015 (merged).
#1015's bugs got through because none of fgbio's
SamRecordClipperTest/ClipBamTestcases cover overlap clipping with a far-end soft clip,soft-with-maskoverlap clipping, or empty SEQ. That prompted an audit of how completely those two suites were ported. Every fgbio case was re-run against fgumi with fgbio's exact inputs and expectations, and fgumi met all of them, so this PR is test coverage plus cleanup with no change in output.SamRecordClipperTestClipBamTestChanges
fgbio_sam_record_clipper_tests(clipper.rs, 69 tests) andfgbio_clip_bam_tests(clip.rs, 31 tests). Each cites its fgbio source line, with fgbio's expected values copied unchanged. Notable gaps closed:clipExtendingPastMateEndscases;clip{Start,End}OfReadandclip{5,3}PrimeEndOfRead;ClipBam's end-to-end metric values, mate info and NM/UQ/MD;--upgrade-clippingacross mode pairs.ClipBamTest.scala:182's SEQ is resized to match its hard-clipped CIGAR, because fgbio's fixture is malformed.numBasesExtendingPastMateis exercised through the MC-basednum_bases_extending_past_mate_raw.if let Some(Value::...), so a missing tag silently passed. They now panic instead.clip_{start,end}_of_read_rawshare theclipping_at_end_rawhelper added in fix(clip): upgrade soft clips only at the mate-facing end when clipping overlaps #1015.SamRecordClippernow cite fgbio.clip_template_recordscomment no longer claims the per-read helpers never upgrade clipping.soft-with-maskmode.Not addressed
clip_start_of_alignment/clip_end_of_alignmentstill leave an empty-SEQ (*) record's alignment unclipped, whereas fgbio clips the CIGAR. Since fix(clip): upgrade soft clips only at the mate-facing end when clipping overlaps #1015 the read-end helpers at least upgrade the existing soft clip at that end. No fgbio test reaches this.> 0(_with_multiple_insertions,_insertion_at_overlap_boundary,_complex_cigar,_soft_with_mask). The ported fgbio table now pins the same behavior exactly.Mutation check
Corrupting one expected value in each of three new tests fails exactly those three.