Skip to content

refactor: bundle process_chromosome_batch params into config structs#103

Open
ewels wants to merge 1 commit intomainfrom
refactor/batch-config-structs
Open

refactor: bundle process_chromosome_batch params into config structs#103
ewels wants to merge 1 commit intomainfrom
refactor/batch-config-structs

Conversation

@ewels
Copy link
Copy Markdown
Member

@ewels ewels commented May 7, 2026

Summary

  • process_chromosome_batch() in src/rna/dupradar/counting.rs previously took 18 positional parameters, so call sites were hard to read and prone to argument-order bugs (flagged in refactor: bundle process_chromosome_batch() parameters into config structs #85).
  • Replace those with two Copy config structs:
    • BatchConfig<'a> — scalars and the BAM path (bam_path, reference, stranded, paired, htslib_threads).
    • BatchResources<'a> — shared read-only data (chromosome name table, spatial index, chromosome mapping/prefix, biotype lookup, RSeQC + Qualimap config).
  • Function body destructures both structs at the top so the rest is unchanged. Removed #[allow(clippy::too_many_arguments)].

Closes #85

Test plan

  • cargo check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --lib (200/200 pass)

🤖 Generated with Claude Code

Replace the 18 positional parameters of process_chromosome_batch() with
two Copy config structs — BatchConfig (scalars + BAM path) and
BatchResources (shared indices, mappings, and accumulator config) — so
call sites are self-documenting and adding a new parameter no longer
shuffles the positional list.

Closes #85

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ewels ewels requested a review from edmundmiller May 7, 2026 23:49
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.

refactor: bundle process_chromosome_batch() parameters into config structs

1 participant