Repository navigation
Study View filter bar: gene-table selections as a pill per gene, coloured by alteration (STV-FB-3 #9) - #457
Conversation
…oloured by alteration (STV-FB-3 #9) As the portal's filter bar: a gene-table selection reads "( APC or TP53 )", each gene its own pill coloured by what its table counts, the oncoprint's colours (mutation green, structural variant purple, amplification red, deep deletion blue), its OQL line in the tooltip, and its own ×, which takes only that gene out (geneTablePills, removeOqlLine). Typed OQL and a gene chart's clauses keep the generic pill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| /** any other clause: a gene table's selection as the portal draws it, a pill per gene coloured by alteration (STV-FB-3 #9); else the generic pill */ | ||
| const other = (clause: number) => { | ||
| const genes = geneTablePills(draft.all![clause]); | ||
| if (!genes) return <ClausePill key={clause} clause={draft.all![clause]} onRemove={() => onRemoveClause(clause)} onCustomData={onCustomData} />; |
There was a problem hiding this comment.
The generic ClausePill fallback dropped the portal prop the old code passed (<ClausePill ... portal />). Every non-gene-table clause (typed OQL, gene-chart clauses, etc.) in the study-view bar now renders in the non-portal style, a regression unrelated to this feature. Re-add portal.
|
Review verdict: changes Blocking:
Checked and fine: one pill per gene with the OQL line in the tooltip; colours match legacy STV-FB-3 #9 (MUT_COLOR_MISSENSE #008000, SV #8b00c9, AMP #ff0000, HOMDEL #0000ff) via the shared |
The fallback pill for clauses that are not a gene table's selection passes `portal` again, as master does, so gene-chart and typed-OQL OR groups keep #453's parentheses and lower-case "or". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
… wrote, by their tag geneTablePills now needs the table's name on the clause (`chart`, written by geneSelection since #455), so a Gene status chart's "KRAS: MUT" beside its "profiled KRAS" keeps the generic pill and its × no longer removes the alteration alone. Removing one gene keeps the tag on the rest. Seen on coadread: KRAS Mutated + APC, TP53 from Mutated Genes reads "profiled KRAS · OQL KRAS: MUT and ( APC or TP53 )". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
|
Fixed in d4eb382, with master merged in:
|
|
Re-review: pass. 4e65895 puts Note: the per-gene pills need #455's tags, so until #455 merges, gene-table clauses show as generic pills. That's harmless. |
Summary
A gene table's selection now reads in Explore's filter bar as the portal draws it (STV-FB-3 #9):
STYLE.glyph, invariant 8): a mutation green #008000, a structural variant purple #8b00c9, an amplification red #ff0000, a deep deletion blue #0000ff.removeOqlLine). Before, the × removed the whole selection."chart"on the oql leaf, written since Study View: Add chart's Genomic tab (STV-AC-2, STV-AC-4) #455), and its lines are "GENE: MUT|AMP|HOMDEL|FUSION", optionally_DRIVER(geneTablePills,lib/study-view-pills.ts). A Gene status chart writes the same text ("KRAS: MUT" beside "profiled KRAS"), untagged.Spec IDs
Verification
Browser, dev server, coadread:
e2e: the drivers step in
test/e2e/explore.cjswaited for the text "EGFR: MUT_DRIVER" in the filter bar. That text now sits in the pill's tooltip, so the step waits for the pill whose tooltip it is. Run on its own against my dev server: pass (60 counted, 60 matched).Unit tests: in
test/study-view-pills.test.ts:_DRIVERwith their colours;npm test6,884 pass, 0 fail (with master merged in).Coverage: passes.
Planted bugs: 3 in
scripts/mutants/study-view/gene-pills.ts(guardunit).Tracker
Under "Study View → filters, actions and tabs", this line (docs/PORTAL-PARITY.md:471):
becomes what is left:
Scorecard
31-study-view-shell.md, row STV-FB-3 (was| STV-FB-3 | 🟡 | B | Clinical (incl. NA) named by the chart's display name, a pill per value or range; gene, GA, case-list, event and derived clauses still the generic pills; no group-filter or treatment pills |):| STV-FB-3 | 🟡 | B | Clinical (incl. NA) named by the chart's display name, a pill per value or range; gene-table selections a pill per gene coloured by alteration (
geneTablePills); gene-chart, GA, case-list, event and derived clauses still the generic pills; no group-filter or treatment pills |Preview
/lab?tab=explore&study=coadread_tcga_pan_can_atlas_2018: check APC and TP53 in Mutated Genes, Apply filter; then KRAS.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht