Repository navigation
Conversation
--read-length now takes one or two values. One value sets both reads as before; two values (R1 R2) set each read's length. The error model ramps each read over its own length, coverage accounts for both lengths, and the golden BAM and CpG truth tally use each mate's own genomic span. Two values are rejected with --single-end. Single-value runs (or two equal values) keep the legacy seed and produce identical output.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
simulate --read-lengthnow takes one or two values. One value sets both reads, as before; two values (--read-length 150 100) set R1 and R2 separately. Two values are rejected with--single-end, and three values (or repeating the flag) are rejected by clap.With different lengths:
--coverageusesR1 + R2bases per pair.--cpg-truth-bedgraphtally counts each mate over its own genomic span. Both now take the mate's reference positions from one helper,read::mate_ref_positions, which replaces three copies of that slicing.Reproducibility
A single value, or two equal values, keeps the legacy seed string and produces the same reads as
main: I compared release builds ofmain(ac66f99) and this branch with-l 100and-l 100 100, and the R1/R2 FASTQs and golden BAM records are byte-identical. When the lengths differ, the R2 length is appended to the seed string as a trailing suffix, so swapped lengths get different seeds.Library API
IlluminaErrorModel::new/with_r2_multipliertake an R1 and an R2 length,generate_read_pairtakesr1_lengthandr2_length, andSimulate::read_lengthis aVec<usize>.Testing
cargo ci-fmt,cargo ci-lint,cargo ci-test.mate_ref_positions; the seed for equal, different and swapped lengths; coverage maths; validation.-l 100and-l 100 100produce identical FASTQs; CLI rejection of three values and of two values with--single-end; with-l 30 90, every CpG truth bedGraph site has at most the calls rebuilt from the golden BAM'sYM:Ztags, and the totals nearly match. I checked that this test fails if the tally swaps the two lengths, flips a mate's strand, or tallies R2 over R1's length.Summary by CodeRabbit