Repository navigation
Conversation
The CYP2D6 depth check read only the share of MAPQ 0 reads, so flanks at 6x with every read mapped well passed as fit for a copy-number call, and two callers could agree on too few reads. Flanks under 10x at MAPQ >= 1 now make the verdict unreliable, with the message "agreement not counted (depth)". Multi-mapped reads are still named first. Bead: pgx-09 Bead: D10
A pypgx CYP2D6 call whose defining variants are not all PASS, or not of good quality, now reads "weak evidence (...)" in the Evidence column of pgx_consensus.tsv. A call Cyrius agrees with is still passed: the flag shows the weakness, it does not withhold the call. Bead: pgx-01
…ypgx evidence shows Bead: pgx-09 Bead: pgx-01
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
# Conflicts: # CHANGELOG.md
Problem
Step 36 passes a CYP2D6 call to PharmCAT when pypgx and Cyrius agree and the CYP2D6 depth check passed. That check looked only at the share of reads with MAPQ 0. Flanks at 6x, with every read mapped well, passed as "fit for a copy-number call". Two callers could then agree on too few reads, and their shared diplotype steered drug guidance.
The consensus table also hid weak pypgx evidence. When the variants that define pypgx's star alleles were not all
PASS, or had a low GQ, an agreed call read the same as a well-supported one.Fix
og pgx cyp2d6-check(rust/crates/og-bam/src/cyp2d6.rs) now also needs 10x or more in the flanks at MAPQ >= 1, the reads the callers use. 10x is the approved threshold (D10). Under it the status isunreliableand the message readsCYP2D6 copy number unreliable, agreement not counted (depth): .... Multi-mapped reads keep their own message and are named first, because realigning fixes that cause.okstatus as a failed check. So pypgx's CYP2D6 row readsIndeterminate, Cyrius's call gets FilterCYP2D6_depth_unreliable, and step 36 withholds CYP2D6 with the message as its reason. No script or module changes.og pgx outside-calls(rust/crates/og-steps/src/pgx_rules.rs) reads step 32'sDefining_filterandQualitycolumns. When either is weak, theEvidencecolumn readspypgx: *1/*4, weak evidence (<the weak columns>). A call Cyrius agrees with is still passed: the flag shows the weakness, it does not withhold the call. A summary from before those columns gets no flag.docs/32-pypgx.md,docs/21-cyrius.md,docs/36-pgx-consensus.mdand the changelog say the same.Output changes: no file name or column changes. The depth check's verdict on flanks under 10x is new (
unreliableinstead ofok), and theEvidencetext ofpgx_consensus.tsvgains the weak-evidence note.Decisions:
pgx-cyp2d6-checkshadow still agrees there. The shadow rule says a tool leavesOG_SHADOWonce og differs from its oracle on purpose..github/workflows/e2e.ymlis not in this package's files, so the orchestrator should decide whether to drop it.Left for a follow-up
These need files outside this package, so this PR does not touch them:
og pgx cyp2d6-checknow differs from its Python oracle on purpose when the flanks are under 10x at MAPQ >= 1. It should leaveOG_SHADOWin.github/workflows/e2e.yml,docs/testing.mdshould stop listing it as shadowed, and a shallow-flank parity case (q0/q1 tables with 6x flanks, inputs undertests/parity/inputs/pgx-cyp2d6-check/, a row intests/parity/cases.tsv) with its golden undertests/parity/golden/pgx-cyp2d6-check/should pin the difference. Nothing breaks today: every depth table and both fixture BAMs have flanks near 30x.docs/lessons-learned.md,docs/releases/v1.0.0.md(which also says the og cyp2d6 ports write what the Python writes), and the comments inscripts/32-pypgx.sh,scripts/21-cyrius.sh,modules/local/pypgx/main.nfandmodules/local/cyrius/main.nf.How it was checked
rust/crates/og-bam/tests/i411_cyp2d6_gate.rs: flanks at 6x giveunreliableandagreement not counted (depth). 12x and 10x giveok. 9.99x fails. 11x of all reads with 9x at MAPQ >= 1 fails. Multi-mapped shallow flanks keep the multi-mapped message.assessturned off (else if false && q1.flank < MIN_FLANK_DEPTH), two of the four tests fail withleft: "ok",right: "unreliable".pgx_rules.rs:weak_pypgx_evidence_is_flagged_not_withheld(weak filter and quality, a missing GQ, one caller only, and a clean call with no flag) andshallow_flanks_do_not_count_an_agreement. Red first: with the weak-evidence arm turned off, the weak test fails, because the Evidence column has no flag.cargo test -p og-bam,-p og-stepsand-p og-summaryall pass.cargo clippy -p og-bam -p og-steps --all-targets -- -D warningsandcargo fmt --checkare clean.i411_hla_ties.rsstill passes, so the agreed call stays passed whatever pypgx's evidence columns say.7e6654ef, all fast checks green:tests/test_live_demo.pyon a page attribute order check, a test this PR does not touch; the rerun of that shard passed)e2e cases the batch tip must run:
tests/e2e/pgx-1-depth-check.sh,tests/e2e/pgx-2-outside-calls.sh,tests/e2e/pypgx-cyp2d6-section-1-summary.sh,tests/e2e/hla-second-caller-1-bash.sh,tests/e2e/hla-second-caller-2-nextflow.sh, plus the e2e base (the shadow ofpgx-cyp2d6-check).Beads: pgx-09, pgx-01, D10 (the CYP2D6 flank threshold).
Summary by CodeRabbit