Skip to content

fix(str): stop dismissing the RFC1 flag while pathogenic-motif reads are in hand - #447

Open
geiresx wants to merge 5 commits into
GeiserX:mainfrom
geiresx:pgp/i411-rfc1-motif-minority
Open

geiresx wants to merge 5 commits into
GeiserX:mainfrom
geiresx:pgp/i411-rfc1-motif-minority

Conversation

@geiresx

@geiresx geiresx commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

A benign majority of repeat reads could hide pathogenic or unknown motifs. For example, 17 AAAAG reads and 3 AAGGG reads at RFC1 said "the flag is not supported". The same rule could dismiss a pathogenic insert at a dominant FAME locus.

The count now returns uncertain_motif in these cases. Its note names the unresolved motifs, counts and shares, so the evidence reaches the report. RFC1's note explains that the reads do not resolve either copy. Dominant loci explain that one pathogenic expansion can be sufficient.

The 3-read and 20% floors for pathogenic_motif stay unchanged. Even one pathogenic or unknown read prevents a benign verdict when at least three reads were counted. This keeps weak evidence uncertain without turning a few reads into a pathogenic result. Read shares do not establish carrier status. No output column, file name or verdict name changes.

How it was checked

  • Red first: the new synthetic BAM tests against the unchanged classifier failed on five regressions, with three positive controls passing. Failure output.
  • cargo test --locked -p og-bam --no-fail-fast: 54 tests passed, including eight new integration tests and both archived parity suites.
  • cargo clippy --locked -p og-bam --all-targets -- -D warnings, cargo fmt --all --check, and RUSTDOCFLAGS='-D warnings' cargo doc --locked -p og-bam --no-deps passed.
  • Standalone local oracle: all 71 items in 18 applicable motif cases agreed. These cases were staged from the archived BAM parity manifest because the standalone manifest has no motif rows. The crate parity suite also covers the error and multiword-argument cases.
  • Oracle harness self-test passed, including all 44 comparator controls. The Linux-only shadow self-test was skipped locally and is left to CI.
  • Synthetic cases cover 15%, 20% and 25% pathogenic reads, one or two pathogenic reads, a dominant insert, and unknown minorities and ties. Controls cover both strands, benign-only reads and low coverage. No new shell E2E case is added. The existing container E2E suites need Linux mounts and remain with CI.
  • Five release-binary runs on the same synthetic BAM with 16 counted repeat reads: median wall time 0.01 s before and after. Peak RSS was 3.03-3.05 MiB before and 3.09-3.11 MiB after. This small fixture measures startup as well as counting. No speed improvement is claimed.
  • Strict local docs build and site check passed: 97 pages, 0 errors. This fixes the first Docs run, which caught a new source link leaving the built site. The source link now uses GitHub.
  • Fast checks on a6f0861fe631545a30b896d6ddf7853d5f95d583: Guard, Rust, Lint, Nextflow, Docs, Container Test, Personal data, and Freshness.
  • Upstream E2E on a6f0861f was cancelled before any case ran. The aggregate failed only because e2e-scope ended cancelled (run). The two cases that run the changed code, tests/e2e/expansions-and-rfc1-1-motif.sh and tests/e2e/str-catalog-1-strchive.sh, have not run on this code yet. They need the HG002 fixture and the Linux images, so they could not run on the build box. E2E must run on the final head.

Decision: keep the existing above-threshold notes and parity outputs. Benign reads can belong to an interrupted allele, so a new carrier inference would overstate the evidence. The three new minority expectations live under tests/parity/want/rfc1/ and are checked by the integration test.

Decision: og str motif leaves OG_SHADOW in .github/workflows/e2e.yml. Shadow mode compares og with the old Python byte for byte and knows no goldens. After this fix og writes uncertain_motif where the Python wrote benign_motif, so any e2e input with a minority motif at a flagged locus would fail the shadow call. The oracle.ref row stays: no parity case uses it, and it only feeds scripts/ci/oracle-diff.sh materialise. docs/testing.md now says the motif count is not shadowed, and why. These two files are outside the original file list of this change and were added for this reason only.

Part of #411. Closes claim sv-28.

CodeRabbit returned a review limit notice, and the shared review queue was still taken after the last push. The independent review stage is the review of record.

Keep low-share evidence uncertain and show counts in the report note. Preserve the pathogenic threshold and avoid inferring phased alleles or carrier status from read shares.

Bead: sv-28
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9078a1d and eebe5e0.

Files ignored due to path filters: 3

  • tests/parity/want/rfc1/dominant-minority.tsv is excluded by !**/*.tsv
  • tests/parity/want/rfc1/pathogenic-minority.tsv is excluded by !**/*.tsv
  • tests/parity/want/rfc1/unknown-tie.tsv is excluded by !**/*.tsv
Files selected for processing: 6

  • .github/workflows/e2e.yml
  • CHANGELOG.md
  • docs/09b-stranger.md
  • docs/testing.md
  • rust/crates/og-bam/src/motif.rs
  • rust/crates/og-bam/tests/i411_rfc1_motif_minority.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@geiresx

geiresx commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator Author

Red-first evidence for sv-28: the new synthetic BAM suite ran against the unchanged classifier from d4d3d4b before the fix. The three expected-output files were present on this run. It failed on the incorrect benign verdicts and expected notes, not on compilation or missing inputs.

Command: cargo test -p og-bam --test i411_rfc1_motif_minority --no-fail-fast.

running 8 tests
rfc1_keeps_fifteen_percent_pathogenic_reads ... FAILED
rfc1_keeps_one_or_two_pathogenic_reads_without_calling_them_pathogenic ... FAILED
dominant_insert_can_be_a_minority_and_still_needs_confirmation ... FAILED
unknown_minority_and_tie_are_not_dismissed ... FAILED
minority_outputs_match_the_deliberate_parity_expectations ... FAILED
fewer_than_three_total_reads_remain_unresolved ... ok
twenty_and_twenty_five_percent_are_possible_without_resolving_both_copies ... ok
pure_and_mixed_known_benign_motifs_remain_benign ... ok

test result: FAILED. 3 passed; 5 failed

The false negatives returned benign_motif where the tests require uncertain_motif. With the fix, all eight pass. The first commit, 52d4fd0, contains only the regression tests. Verification ran on synthetic data through the remote build helper. Upstream CI is the final check on the pushed head.

The docs site cannot follow a relative link outside its built tree. The strict site check now passes on all 97 pages.

Bead: sv-28
…hon on purpose

The sv-28 fix makes og str motif write uncertain_motif where the old
Python wrote benign_motif, and shadow mode compares bytes with no goldens.
A minority-motif input at a flagged locus would fail the shadow call.
docs/testing.md no longer lists og str motif among the shadowed tools.
@geiresx
geiresx requested a review from GeiserX as a code owner November 15, 2026 20:21

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.

2 participants