Repository navigation
OncoPrint clinical legend in the portal's order: alphabetical, "No data" last, signed number key - #216
Merged
Conversation
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
…ta" last, signed number key A clinical track's legend listed its values in the order they take colours (most frequent first). oncoprintjs sorts the rules it shows by localeCompare of their labels (oncoprintlegendrenderer 103-157), lists only the values the drawn columns use, and puts "No data" — the NA rule, order +Infinity — last when a drawn column has no value (oncoprintruleset 700-709). A bar track's key is green when its range is not negative, red when not positive, both when it spans 0 (getValueRangeType 866-876, legend 257-305), its ends to 2 decimals; ours was always green. One rule, clinicalLegend in lib/oncoprint-style.ts, draws both the server SVG's legend and the page's (which passes the drawn columns, so Show unaltered off drops a value only hidden columns have). A value keeps its colour; only the order changes. Ours alone: at most 8 values, "+N more". The golden SVG's legend changes accordingly (CANCER_TYPE Breast, Colon, Lung; STAGE I, II, III, IV, No data); its cells do not. Tests from a case table of the legacy source, written by an agent that did not see the change (test/oncoprint-clinical-legend.test.ts), seen failing first. Four planted bugs caught. The page legend looked at on msk_impact_2017 with SAMPLE_TYPE and SEX: Metastasis, Mixed, Primary; Female, Male; no page errors. npm test 4270 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTZRWoR5xpTndPddHAe
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #215. Until #215 merges, its commit shows here too; this PR's own change is the top commit.
The clinical legend now follows the portal: values in alphabetical order, "No data" last, and a number key coloured by the sign of its range (ONC-ST-4).
Case table (legacy oncoprintjs:
oncoprintlegendrenderer.ts,oncoprintruleset.ts)clinicalLegend) for bothThe test writer also checked the table against the legacy source:
getValueRangeType.Checks
legend-frequency-orderlegend-no-data-missinglegend-hidden-valueslegend-number-one-colournpm test: 4,270 pass. The Python figure has no clinical legend, so the Python port is unaffected.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q3ezTZRWoR5xpTndPddHAe