Repository navigation
feat(group,dedup): add --no-umi mode for position-only grouping - #56
Conversation
📝 WalkthroughWalkthroughAdds a 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b01f8df to
07d82bb
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
==========================================
+ Coverage 83.29% 83.36% +0.06%
==========================================
Files 126 126
Lines 50944 51234 +290
==========================================
+ Hits 42436 42709 +273
- Misses 8508 8525 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/commands/dedup.rs`:
- Around line 2897-2949: Add a unit test for the raw-byte path that mirrors the
existing RecordBuf tests: create a config from default_filter_config with
config.no_umi = true, a fresh FilterMetrics, and a raw-style template/record
that has no UMI (i.e., no RX tag) and is mapped; then call
filter_template_raw(&raw_template, &config, &mut metrics) and assert it returns
true and increments metrics.accepted_templates to 1. Locate the raw-template
constructor used elsewhere (e.g., create_mapped_template_raw or the
RecordBuf/TemplateRaw builder) to build the no-RX test input, and place the test
near the other no_umi tests so the raw-byte logic at filter_template_raw is
covered.
In `@src/commands/group.rs`:
- Around line 807-810: The #[arg(...)] attribute on the boolean field no_umi
includes a redundant default_value = "false"; remove that default_value so
clap's derive can infer ArgAction::SetTrue for the no_umi bool flag (i.e., leave
#[arg(long = "no-umi")] on the no_umi field or, if you prefer being explicit,
replace default_value with action = ArgAction::SetTrue), ensuring the flag
toggles true when provided.
🧹 Nitpick comments (2)
src/commands/dedup.rs (1)
282-522:filter_templateandfilter_template_raware near-duplicates offilter.rs.Both files carry identical filtering logic (flag checks, MQ tag, UMI validation,
no_umibypass). Every change, like theno_umiadditions here, must be mirrored. Consider extracting shared filtering into a common module.src/commands/group.rs (1)
3075-3193: Good test coverage for no-umi mode.Covers missing tags, position-only grouping, N-in-UMI acceptance, and paired rejection. Consider adding a multi-threaded no-umi test (e.g.
ThreadingOptions::new(2)) to exercise the raw-byte pipeline path, but not blocking.,
07d82bb to
beb8a78
Compare
Adds `--no-umi` flag to both `group` and `dedup` commands for position-only grouping without UMI tags (like Picard MarkDuplicates). When enabled: - Strategy is forced to identity with edits=0 - UMI validation (Ns, min-length, missing tag) is skipped - All templates at the same position are assigned to one group - Paired strategy is rejected with a clear error Both noodles and raw-byte code paths are updated.
beb8a78 to
1dfb847
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/commands/group.rs (1)
4460-4461: Consider adding a raw byte filter unit test forno_umi: true.Integration tests cover this path via the pipeline, but a direct
filter_template_rawunit test withno_umi: truewould strengthen coverage.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/group.rs` around lines 4460 - 4461, Add a unit test that calls filter_template_raw with a configuration where no_umi: true to verify the raw-byte filtering branch; create input raw bytes containing a UMI region, call filter_template_raw (and any helper like TemplateFilter or FilterConfig used in the diff), and assert the returned bytes match the expected output with the UMI removed and other bytes unchanged; place the test alongside existing tests for filter_template_raw and ensure it constructs the same config object (setting no_umi: true) so the no_umi branch is exercised.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/commands/group.rs`:
- Around line 4460-4461: Add a unit test that calls filter_template_raw with a
configuration where no_umi: true to verify the raw-byte filtering branch; create
input raw bytes containing a UMI region, call filter_template_raw (and any
helper like TemplateFilter or FilterConfig used in the diff), and assert the
returned bytes match the expected output with the UMI removed and other bytes
unchanged; place the test alongside existing tests for filter_template_raw and
ensure it constructs the same config object (setting no_umi: true) so the no_umi
branch is exercised.
Summary
--no-umiflag to bothgroupanddedupcommands to enable position-only grouping/deduplication without UMI tagsChanges
When
--no-umiis specified:--strategy pairedTest plan
filter_templatewithno_umi: truein dedup.rs--no-umiused with--strategy pairedUsage