Skip to content

fix(junction_saturation): thread-independent output and RSeQC's sampling points - #201

Merged
ewels merged 1 commit into
seqeralabs:mainfrom
rhassaine:fix/junction-saturation-parity
Nov 26, 2026
Merged

ewels merged 1 commit into
seqeralabs:mainfrom
rhassaine:fix/junction-saturation-parity

Conversation

@rhassaine

Copy link
Copy Markdown
Contributor

junction_saturation: make the output independent of --threads and align it with RSeQC where RSeQC is deterministic.

  • Junction observations are kept in BAM file order across worker merges, so the output is identical for any --threads. Before, the merge order, and so the shuffle input, depended on thread scheduling.
  • Reads on chromosomes without an annotated transcript are ignored, as RSeQC does with its BED gene model.
  • The sampling series is RSeQC's range(floor, ceiling, step) + [100], with its float window arithmetic int(N * (p / 100.0)).
  • The R script names the PDF <sample>.junctionSaturation_plot.pdf, as RSeQC does.

The shuffle still uses RustQC's seeded RNG, so intermediate points are reproducible but don't match RSeQC's unseeded random draws. The x-axis and the 100% point match RSeQC 5.0.4 on hs_ribo_chr19_22_se_fwd, hs_chr6_pe_rev and sc_se_rev, with default and non-default -l/-u/-s/-m/-q/-v, whenever the sampling windows cover all observations (as with the defaults).

Replaces #197.

🤖 Generated with Claude Code

…ries and chromosome filter

- Keep junction observations in BAM file order across worker merges, so the
  output is identical for any --threads value.
- Ignore reads on chromosomes without an annotated transcript, as RSeQC does
  with its BED gene model.
- Use RSeQC's sampling series, range(floor, ceiling, step) + [100], and its
  float window arithmetic int(N * (p / 100.0)).
- Name the PDF in the R script without the output directory, as RSeQC does.

The shuffle keeps RustQC's seeded RNG: intermediate points are reproducible
but do not match RSeQC's unseeded random draws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ewels
ewels merged commit ef35a7a into seqeralabs:main Nov 26, 2026
7 checks passed
@rhassaine
rhassaine deleted the fix/junction-saturation-parity branch November 27, 2026 15:52
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.

2 participants