Skip to content

Study View: a gene-state chart's Summary Data in the portal's codes (SD14) - #467

Merged
alisman merged 1 commit into
masterfrom
studyview-gene-summary-codes
Nov 19, 2026
Merged

alisman merged 1 commit into
masterfrom
studyview-gene-summary-codes

Conversation

@alisman

@alisman alisman commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A gene-state chart's ☰ › Download › Summary Data now writes the portal's backend codes, byte for byte (SD14), as the user decided on 2026-11-19.

  • A mutation chart ("KRAS: somatic mutations"): MUTATED, NOT_MUTATED, NOT_PROFILED, as /api/mutation-data-counts gives them.
  • A copy-number chart ("KRAS: copy-number alterations"): the discrete level, 2, 1, 0, -1 or -2, and NA for Not profiled, as /api/genomic-data-counts gives them.
  • Unchanged: the rows' order (count, NA last) and percentages; the chart's figure download keeps the names on screen.
  • OncoKB drivers only: the states keep their names. The portal has no such chart.
  • Code: geneStateCode in lib/study-view-download.ts; summaryDownload takes the file's category for a value shown.

Spec IDs

  • Covered: download-cases SD14 (gene-state Summary Data as the portal's file).

Verification

  • Against cbioportal.org, coadread KRAS: /api/mutation-data-counts answers MUTATED 218, NOT_MUTATED 316, NOT_PROFILED 60, and /api/genomic-data-counts (gistic) -1 67, -2 1, 0 390, 1 128, 2 6, NA 2.

  • Browser, dev server, coadread, KRAS charted from both profiles: the two files read, in the portal's order (count, NA last):

    • NOT_MUTATED 316 53.2% · MUTATED 218 36.7% · NOT_PROFILED 60 10.1%
    • 0 390 65.7% · 1 128 21.5% · -1 67 11.3% · 2 6 1.0% · -2 1 0.2% · NA 2 0.3%

    No page errors.

  • Unit tests: test/study-view-download-spec.test.ts:

    • SD14 case by case: every state of both kinds, and drivers only keeping names;
    • coadread KRAS copy number's whole file, row for row.

    npm test 6,931 pass, 0 fail; tsc --noEmit and eslint clean.

  • Coverage: passes.

  • Planted bugs: 2 in scripts/mutants/study-view/gene-summary-codes.ts (guard unit).

Tracker

The line (docs/PORTAL-PARITY.md:444) is already ticked and stays as it is.

download-cases.md, row SD14 (was | SD14 | ⚠ Gene-state charts | Category is the state as the chart names it (Mutated, Not mutated, Not profiled, …). The portal writes its backend codes here (MUTATED, NOT_PROFILED, -2), while its Full Data and screen use names | SPS:10424-10431 vs SVU:2050-2061 |):

| SD14 | ✓ Gene-state charts | Category is the portal's backend code, as its file writes it: MUTATED, NOT_MUTATED, NOT_PROFILED for a mutation chart; the discrete level (2, 1, 0, -1, -2), NA when not profiled, for a copy-number chart (geneStateCode). Its Full Data and screen use names; so does ours. Under OncoKB drivers only, a chart the portal lacks, the names | SPS:10424-10431 vs SVU:2050-2061 |

Preview

/lab?tab=explore&study=coadread_tcga_pan_can_atlas_2018: Add chart → Gene status → KRAS (Mutations, then GISTIC); each chart's ☰ › Download › Summary Data.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…SD14)

The user's answer (2026-11-19): write legacy's backend codes byte for byte. A mutation chart's
file writes MUTATED / NOT_MUTATED / NOT_PROFILED and a copy-number chart's the discrete level
(2, 1, 0, -1, -2) with NA for not profiled, as /api/mutation-data-counts and
/api/genomic-data-counts give them; the rows' order and percentages are unchanged. The figure
keeps the names on screen. Under OncoKB drivers only, a chart the portal does not have, the
states keep their names. Seen on coadread KRAS: both files equal the portal's counts row for row.

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

vercel Bot commented Nov 19, 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 19, 2026 5:27pm UTC
cbiolab-new Ready Ready Preview Nov 19, 2026 5:27pm UTC
cohort-lab Ready Ready Preview Nov 19, 2026 5:27pm UTC

Request Review

@alisman

alisman commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Review: pass. No blocking findings.

Checked against the user's decision (2026-11-19, item 11: legacy codes byte for byte) and download-cases SD7/SD10/SD14:

  • Codes: mutation chart MUTATED / NOT_MUTATED / NOT_PROFILED; copy-number chart 2 / 1 / 0 / -1 / -2, NA when not profiled. These match the /api/mutation-data-counts and /api/genomic-data-counts values quoted for coadread KRAS. The app has no structural-variant gene-state chart (GeneFacet.type is MUTATION | CNA), so there are no SV codes to map.
  • File layout: the header, LF line endings and order (count first, NA last per SD7) all come from the existing summaryDataTsv. CNA's NA sorts last; the mutation chart's NOT_PROFILED sorts by count, as in the portal's file.
  • On screen: labels are unchanged. Only the Summary Data rows are mapped through geneStateCode. ValueList and the figure keep the names.
  • Tests and planted bugs: each code is pinned case by case, plus a whole file for coadread KRAS CNA. Both planted bugs (names instead of codes, NOT_PROFILED instead of NA) are killed by the unit tests.

Not blocking:

  • nit: the wiring in GeneFacets (passing code to summaryDownload) has no test. Dropping that argument would keep every unit test green. SD14 was taken off the "covered elsewhere (UI wiring)" list in the spec test's header, so nothing pins it now.

CI: gate-e2e and gate-warehouse are still pending; everything else is green.

@alisman
alisman added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit c21cec1 Nov 19, 2026
12 checks passed
@alisman
alisman deleted the studyview-gene-summary-codes branch November 19, 2026 17:48

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 4d70624a Deployed Nov 19, 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