Skip to content

OncoPrint copy number: a cell shows its kind with the most calls - #215

Merged
alisman merged 1 commit into
masterfrom
session/oncoprint-cna-counts
Nov 14, 2026
Merged

alisman merged 1 commit into
masterfrom
session/oncoprint-cna-counts

Conversation

@alisman

@alisman alisman commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

A merged row or a patient column can hold several copy-number calls. The portal shows, and sorts by, the kind with the most calls. Ours kept every call: it drew and sorted by the amplification, and called the copy number a driver if any call was a driver.

Case table (legacy: DataUtils.ts fillGeneticTrackDatum 161-243, selectDisplayValue 126-158)

The portal counts calls in four separate kinds: amp, amp_rec, homdel and homdel_rec, where _rec marks a driver. cnaRenderPriority gives amp and homdel the same priority (0) and has no entry for the _rec kinds, so every comparison falls through to the count.

# Case Expected
C1 one call: VUS amp amp, not a driver
C2 merged row: VUS amp, VUS homdel, VUS homdel homdel (2 > 1)
C3 amp ×2, homdel ×1 amp
C4 driver amp ×1, VUS homdel ×2 VUS homdel; the copy number is not a driver
C5 driver amp ×1, VUS amp ×1, VUS homdel ×2 VUS homdel (amp and amp_rec are counted separately)
C6 driver amp ×2, VUS homdel ×1 driver amp
C7 patient mode: samples with amp, homdel, homdel homdel
C8, C9 equal counts portal: the first call's kind. Ours: a driver before a VUS, then amp before homdel
C10 C4 plus a driver missense the mutation stays a driver
C11 Hide VUS VUS calls are hidden before counting
C12 annotation off count only
C13 % altered unchanged
C14 sort ranks by the chosen kind, in the engine and the browser
C15 drawing the chosen glyph only
C16 Python the same

Ours, recorded in PORTAL-PARITY:

  • The equal-count rule (C8, C9).
  • A driver call that loses on count still makes the column driver-altered. That bit only feeds the gutter's driver %.

Warehouse. 40,845 patient–gene pairs in 28 studies hold both an amplification and a deep deletion. In 563 of them the deletions outnumber the amplifications.

Tests and planted bugs

  • An agent wrote the tests from the table without seeing the change: test/oncoprint-cna-calls.test.ts and python/tests/test_cna_calls.py. They failed before the change.
  • The staircase audit's D8 and D9, which were marked todo for this gap, now pass.
  • Planted bugs, all caught:
    • cna-fewest-calls
    • cna-driver-and-vus-counted-together
    • cna-losing-driver-dropped
    • In Python, the same three planted by hand were also caught.
  • npm test: 4,256 pass. The Python unittest suite passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q3ezTZRWoR5xpTndPddHAe

A merged row or a patient column can hold several copy-number calls. The portal counts them by
kind — driver amplification, VUS amplification, driver deep deletion, VUS deep deletion, each
apart (DataUtils fillGeneticTrackDatum) — and shows and sorts by the kind with the most calls:
its render priorities tie for amplification and deep deletion and are missing for the driver
kinds, so every comparison in selectDisplayValue comes down to the count. The cell's copy number
is a driver only when that kind is. Ours OR'd every call into the cell, so it kept both glyphs,
drew and sorted the amplification, and called the copy number a driver if any call was.

In the warehouse 40,845 patient–gene pairs in 28 studies hold both an amplification and a deep
deletion; in 563 the deletions outnumber the amplifications.

Ours alone, recorded in PORTAL-PARITY: on equal counts the portal takes the first call's kind, in
an order we do not have; ours takes a driver before a VUS, then an amplification. A driver call
that loses on count still makes the column driver-altered for the gutter's driver %.

Tests from a case table of the legacy source, written by an agent that did not see the change
(test/oncoprint-cna-calls.test.ts, python/tests/test_cna_calls.py: engine, browser re-sort,
drawing, Python), seen failing first; the staircase audit's D8 and D9, marked todo for this, now
pass. Three planted bugs caught, and the same three by hand in Python. npm test 4256 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTZRWoR5xpTndPddHAe
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Nov 14, 2026 8:40pm UTC
cbiolab-new Ready Ready Preview Nov 14, 2026 8:40pm UTC
cohort-lab Ready Ready Preview Nov 14, 2026 8:40pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 62cbbfc1 Deployed Nov 14, 2026 by vercel[bot]
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