Skip to content

fix(callability): say when a gene's own step never ran instead of showing coverage alone - #543

Open
geiresx wants to merge 4 commits into
GeiserX:mainfrom
geiresx:pgp/i411-callability-honesty
Open

geiresx wants to merge 4 commits into
GeiserX:mainfrom
geiresx:pgp/i411-callability-honesty

Conversation

@geiresx

@geiresx geiresx commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Problem

Some hard genes have a step of their own: Parascopy (step 35) for SMN1 and 45 others, pypgx (step 32) for CYP2D6 and seven others, and the copy-number engine for HBA1, HBA2, CYP21A2, HP, CCL3L1, LPA and RHD. When step 16b does not read such a gene, summary.json lists it under not_read_owned with its owner, and the report says "called by a step of their own". That stays true when the owner's step never ran for the sample. The gene then has no answer anywhere, and its coverage line reads as if one exists.

Fix

Each not_read_owned entry gains two fields:

  • owner_step: the step that calls it (35, 32, 46 or 41).
  • owner_status: ran when that step wrote its own file in the sample folder, else not run.

The files are the ones each step writes: a Parascopy table paralogs/<s>_<table>_copy_number.tsv (not the HBA or Paraphase table, which share the folder), pypgx/<s>_pypgx_summary.tsv (not CPIC's comparison, which shares the folder), paralogs/<s>_hba_copy_number.tsv, _cyp21a2_psv.tsv, _cn_dosage.tsv, lpa/<s>_lpa_kiv2.tsv and bloodtype/<s>_bloodtype.tsv. The Nextflow report task links the same files into the same folders, so both paths agree.

Fields are only added. Nothing is renamed or removed. The share already keeps four decimals, so 0.8988 stays 0.8988; a test now pins that. The reports do not show the new fields yet; the display is a separate change.

Decisions:

  • The collector finds the sample folder from the table's own path (<folder>/mosdepth/ or coverage/), so the change stays inside sections.rs.
  • rust/crates/og-summary/src/collect/tests.rs is outside this package's file list. Its callability test asserts the exact not_read_owned entry, so I added the two fields to its expected value (one line).
  • docs/results/clinvar.md has no callability text, so it is unchanged.

Goldens touched (summary-collect): all, all-nf and all-history gain the two keys on each owned entry (54 entries each, nothing else changes). full, nf and stale get a golden for the first time, because their oracle has no such keys.

How it was checked

  • New rust/crates/og-summary/tests/i411_callability_honesty.rs, with the shipped catalog: every owned gene reads not run when no owner file exists (and every owner maps to a step); every one reads ran with each owner file present, in the Nextflow layout; HBA's and Paraphase's tables do not count as Parascopy, and CPIC's comparison does not count as pypgx; an SMN1 share of 0.8988 stays 0.8988.
  • Red on main's code: 3 of the 4 tests fail with no owner_step in Object({"gene": Str("RHD"), "owner": Str("cn_loci:RHD"), ...}). The share test passes on main too, because main already rounds to four decimals.
  • cargo test -p og-summary, -p og-render, -p og-facts: all pass. cargo clippy -p og-summary --all-targets -D warnings and cargo fmt --check: clean.
  • scripts/ci/oracle-diff.sh summary-collect against the oracle: before the goldens, the six cases differed only by the two new keys; after them, those cases pass.
  • tests/e2e/callability-2-genes.sh gains part 3. It collects the base case's folder again and compares each owner_status with a shell test of that step's files. It also checks that HTML_REPORT run alone, with no owner output, reads not run for every owned gene. I checked the comparison on a synthetic folder: it passes, and a planted wrong status on SMN1 is reported.
  • Fork fast checks on 26ce319: running, links follow.

Bead: clin-25

A gene that Parascopy, pypgx or the copy-number engine calls and that
step 16b did not read was listed under not_read_owned with its owner
only, so it read as answered even when that step never ran. Each entry
now names the owner's step (owner_step) and says ran or not run
(owner_status), from the file that step writes in the sample folder.

The summary-collect goldens of the cases with owned genes gain the two
keys; full, nf and stale get a golden for the first time.

Bead: clin-25
callability-2-genes collects the base case's folder again and compares
every owner_status with a shell test of that step's files; HTML_REPORT
run alone, with no owner output, must read not run for every owned gene.

Bead: clin-25
@coderabbitai

coderabbitai Bot commented Nov 20, 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 55 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 3748117 and 26ce319.

Files selected for processing: 12

  • CHANGELOG.md
  • docs/16b-mosdepth.md
  • rust/crates/og-summary/src/collect/sections.rs
  • rust/crates/og-summary/src/collect/tests.rs
  • rust/crates/og-summary/tests/i411_callability_honesty.rs
  • tests/e2e/callability-2-genes.sh
  • tests/parity/golden/summary-collect/all-history/all-history.json
  • tests/parity/golden/summary-collect/all-nf/all-nf.json
  • tests/parity/golden/summary-collect/all/all.json
  • tests/parity/golden/summary-collect/full/full.json
  • tests/parity/golden/summary-collect/nf/nf.json
  • tests/parity/golden/summary-collect/stale/stale.json
  • 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 20, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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