Skip to content

Study View treatment tables: Intersection, the ⓘ description and Download › Data, as the portal's (STS-OT-6) - #497

Open
alisman wants to merge 2 commits into
masterfrom
studyview-treatment-extras
Open

alisman wants to merge 2 commits into
masterfrom
studyview-treatment-extras

Conversation

@alisman

@alisman alisman commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The treatment tables gain the portal's Intersection, ⓘ and Data download (STS-OT-6).

  • Union / Intersection for two or more checked rows, as on the gene tables (STS-GT-9).
    • Union stays the default: one clause of the checked treatments.
    • Intersection is a clause per row, so every checked treatment must hold.
    • An Intersection past the selection's filter limit is refused, naming the limit.
  • ⓘ beside each title, with the portal's description:
    • "List of treatments and the corresponding number of patients treated";
    • "List of treatments and the corresponding number of samples acquired before treatment or after/on treatment".
  • ☰ › Download › Data, as the portal's getPatientTreatmentDownloadData / getSampleTreatmentDownloadData: "Treatment · #" and "Treatment · Pre/Post · #", tab-separated, in the rows' order shown.
  • Code:
    • rules, treatmentClause(level, keys, op), treatmentTableTsv and TREATMENT_TABLE_DESCRIPTIONS in lib/treatment-tables.ts;
    • the table, TreatmentTable;
    • ValueList now takes the Union / Intersection choice beside its Apply button.

Spec IDs

  • Covered: STS-OT-6 (Intersection, ⓘ, Data download).
  • Left out: Compare from a table (a group per checked treatment), and the Groups / Target tiers. The tiers need enable_treatment_groups and AgentClass / AgentTarget data.

Verification

  • Against cbioportal.org: coadread, Fluorouracil and Leucovorin, Intersection: 135 patients. That is the portal's /filtered-samples count for patientTreatmentFilters {filters: [{filters: [Fluorouracil]}, {filters: [Leucovorin]}]} (135 samples, 135 patients).

  • Browser, dev server, coadread:

    • The ⓘ reads the portal's text.
    • Download › Data saves Treatment_per_Patient.txt, "Treatment\t# / Fluorouracil\t156 / Leucovorin\t137 / …".
    • The Intersection select shows once two rows are checked.
    • No page errors.
  • Unit tests: test/treatment-tables.test.ts:

    • Intersection a clause per row on both tables, Union unchanged and the default;
    • the two files;
    • the descriptions.

    npm test 7,133 pass, 0 fail; tsc --noEmit and eslint clean.

  • Coverage: passes.

  • Planted bugs: 2 more in scripts/mutants/study-view/treatment-tables.ts (guard unit).

Tracker

Under "Study View → summary charts", this line (docs/PORTAL-PARITY.md:415):

  • Treatment tables: Intersection, Compare, the ⓘ description, the Data download; the Groups / Target tiers (STS-OT-6)

becomes:

  • Treatment tables: Compare; the Groups / Target tiers (STS-OT-6)
    • Intersection, the ⓘ description, Download ▸ Data (STS-OT-6) (#PR)

Scorecard 30-study-summary.md, row STS-OT-6 (was | STS-OT-6 | 🟡 | B | Treatment per Patient and per Sample (pre/post), equal to the portal's counts (coadread, msk_chord_2024, luad, and others; first-start Pre/Post rule); Union filter (treatment clause); no Intersection, Compare, ⓘ, download, Groups / Target tiers |):

| STS-OT-6 | 🟡 | B | Treatment per Patient and per Sample (pre/post), equal to the portal's counts (coadread, msk_chord_2024, luad, and others; first-start Pre/Post rule); Union or Intersection (treatment clauses; coadread Fluorouracil ∩ Leucovorin 135 = the portal's); ⓘ and Download ▸ Data as the portal's; no Compare, Groups / Target tiers |

Preview

/lab?tab=explore&study=coadread_tcga_pan_can_atlas_2018: Treatment per Patient, check Fluorouracil and Leucovorin, choose Intersection.

🤖 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.

alisman and others added 2 commits November 19, 2026 21:18
…load ▸ Data (STS-OT-6)

- Union or Intersection for two or more checked rows, as the gene tables (STS-GT-9): Intersection
  is a clause per row, every one held; past the selection's filter limit it is refused, naming it.
- Each table's ⓘ with the portal's description ("List of treatments and the corresponding number
  of patients treated", "… samples acquired before treatment or after/on treatment").
- Download ▸ Data: "Treatment\t#" and "Treatment\tPre/Post\t#", as the portal's
  getPatientTreatmentDownloadData / getSampleTreatmentDownloadData, in the rows' order shown.
Seen on coadread: Fluorouracil and Leucovorin, Intersection, 135 patients, the portal's
/filtered-samples count for that patientTreatmentFilters.

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

# Conflicts:
#	app/lab/explore-sections.tsx
@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 10:25pm UTC
cbiolab-new Ready Ready Preview Nov 19, 2026 10:25pm UTC
cohort-lab Ready Ready Preview Nov 19, 2026 10:25pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 82b3bb3e 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