Skip to content

fix(rseqc): honor explicit infer-experiment sampling limits - #184

Draft
NicoDeVeaux wants to merge 4 commits into
mainfrom
codex/fix-infer-experiment-sampling
Draft

NicoDeVeaux wants to merge 4 commits into
mainfrom
codex/fix-infer-experiment-sampling

Conversation

@NicoDeVeaux

@NicoDeVeaux NicoDeVeaux commented Nov 1, 2026 •

Copy link
Copy Markdown

Explicit --infer-experiment-sample-size and YAML rna.infer_experiment.sample_size values are ignored. A generated 300,000-record witness reports all-read fractions 0.8533/0.1467 even when the requested first 200,000 eligible records imply 0.7800/0.2200. That changes the downstream strandedness/QC decision in this synthetic boundary case. The intentional all-read default remains intact; the published 186M-read benchmark still indicates strong reverse-strandedness under both sampling policies.

The history keeps the reproducer, behavioral fix and follow-ups independently reviewable:

  1. 6fdb1c: generated BAM/CRAM fixtures and CLI assertions; production code unchanged. The seven sampling tests fail on the old application.
  2. 10d12d: honor each input's finite cap in file order, independent of chromosome scheduling and thread count. CLI overrides YAML; unset and maximum caps retain all-read behavior. A zero cap emits the native RSeQC Unknown Data type\n frame. The writer uses that exact 18-byte frame for every Unknown report, including no-data and mixed reports; a direct writer test covers the formatting change.
  3. 66cd9e: update only crossbeam-epoch to 0.9.20 and libz-sys to 1.1.31 in Cargo.lock, fixing the two audit failures without new ignore rules.
  4. 652d10: retain the benchmark rationale for all-read sampling and qualify its conclusion to that dataset.

Run at the reproducer and behavioral-fix commits:

cargo test --release --test infer_sampling

Fixtures are generated with existing dependencies; no external executable or downloaded scientific dataset is needed. Controls cover SE/PE records, filtering and ambiguous overlaps, supplementary reads, chromosome aliases/prefixes, CRAM with a configured reference, CLI/YAML precedence, zero/unset/maximum caps, threads 1/2/4/8 and cap reset with reversed multi-input order. Full flagstat equality checks that sampling leaves the other analysis unchanged.

Local release validation after the dependency updates passes all 240 tests, and formatting passes. cargo audit now exits zero with zero vulnerabilities using the same advisory database and policy; informational warnings remain. The sampling suite and Unknown-report writer control pass. The filtered-read flagstat control compares bytes to this branch's uncapped baseline, keeping #175's existing QC-column repair separate.

Hosted CI passes all seven checks on the final head: Linux baseline, Linux x86-64-v3 and macOS ARM tests, formatting, Clippy, MSRV and security audit.

The local toolchain still reports three inherited needless_range_loop diagnostics in strict Clippy. Unchanged-main control code reproduces them; no lint suppression is included. Hosted Clippy is checked separately. The PR remains draft for maintainer review.

Finite caps require an additional streaming prefix pass, potentially a full extra scan if too few records qualify. The current global default remains unchanged; workflows must explicitly request their intended limit after adopting a fixed artifact. Unknown-strand annotation eligibility and full RNA/workflow equivalence remain outside this repair. The existing counting repairs remain separate.

This is written by an AI agent (model name unavailable) on Nico DeVeaux’s behalf.

This branch has not been deployed

No deployments
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.

1 participant