Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
alisman
force-pushed
the
session/cmp-mutations
branch
from
November 9, 2026 02:31
5c439ad to
af39134
Compare
alisman
force-pushed
the
session/cmp-mutations
branch
from
November 9, 2026 15:41
af39134 to
e437674
Compare
alisman
force-pushed
the
session/cmp-mutations
branch
from
November 9, 2026 18:31
e437674 to
e5dc421
Compare
A new view kind, `mutcompare`, laid out as cBioPortal's group-comparison Mutations tab and wired into /portal/comparison after Genomic Alterations. It shows one gene's mutations in exactly two cohorts. The first cohort is drawn above the protein and the second below it, with the codon axis on top and the Pfam domains in the middle. Each half's y axis is a share of that cohort's patients profiled for the gene (the default) or a count of patients. Both halves share one scale, labelled 0 and max as the portal labels it. The stems, colours, labels and domains come from lib/lollipop.ts, shared with the results page's lollipop. The table has a row per protein change. Each row gives the patients carrying the change in each cohort and their share of the profiled patients, and log2 of the first share over the second. It also gives a two-sided Fisher's exact test against the rest of the profiled patients, BH q across the changes, and the cohort the change is enriched in. The ratio, the ties and the column tips follow the portal's. The gene picker ranks genes by their higher share of mutated samples over profiled samples, as the portal's genesSortedByMutationFrequency does: by frequency, not significance. The picker offers the ten "Highest Frequency" genes as pills, and the result carries the first 200. Four settings are applied in the browser from the whole result, so none re-runs the view: the y-axis % / # switch, each group's Driver/VUS badges (`hide`), the selected codons (`positions`, a click on a stem, which filters the table) and the gene's Fisher line. A comparison of other than two groups is refused with the portal's message. The page leaves the tab out, saying why, for other than two groups or a study with no mutation profile. The per-gene mutated and profiled SQL that the enrichment view used moved to lib/federation-views.ts unchanged, so both kinds share one copy. The method record recomputes every p, q and the gene's p with scipy and statsmodels. Verified against cbioportal.org's REST API on brca_tcga_pan_can_atlas_2018, PAM50 basal-like (171) against luminal A (499), TP53: - profiled patients, 171 / 499 - mutated patients, 153 / 53 - 132 protein changes - the top 10 changes' counts and Fisher p (R342* 6/0, p 2.587e-4; R175H 9/4, p 1.036e-3; …), all identical - ranking shares PIK3CA 47.49% and TTN 23.98%, also identical Also: unit tests, view snapshots (recorded), boundary, coverage and lint. I looked at the tab in a browser: a stem click filters the table, and the gene pill and the # axis work. Also ticks Per-sample CN segments (#161), which is merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTWaXhwWhadqM9gbFNK
alisman
force-pushed
the
session/cmp-mutations
branch
from
November 9, 2026 23:05
e5dc421 to
009b2de
Compare
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.
Summary
This adds a new view kind,
mutcompare, laid out as cBioPortal's group-comparison Mutations tab, and wires it into/portal/comparisonright after Genomic Alterations, where the portal puts it.The plot
lib/lollipop.ts, the same code the results page's lollipop uses. There is no second lollipop implementation.The gene picker
genesSortedByMutationFrequency: genes are ordered by their higher share of mutated samples over profiled samples. That is frequency, not significance. The task brief said "ranked by significance", but the portal ranks by frequency, so this follows the portal.Below the plot
Other changes
dataPart), so none of them re-runs the view. Changing the gene does re-run it.enrichmentused moved, unchanged, fromlib/views/enrichment/sql.tstolib/federation-views.ts. Kinds can't import each other, so this lets both kinds share one copy.docs/PORTAL-PARITY.md: ticks this gap, with the leftovers as sub-items. It also ticks Per-sample CN segments (Copy-number segments view: per-sample segment tracks (the portal's CN Segments tab) #161), which is merged; its two sub-items stay unticked.Legacy reference
Studied:
GroupComparisonMutationsTab.tsx,GroupComparisonMutationMapper(Wrapper).tsx,GroupComparisonMutationTable.tsxLollipopGeneSelector.tsx,LollipopTooltipCountInfo.tsx,FisherExactTwoSidedTestLabel.tsxGroupComparisonUtils(getProteinChangeToMutationRowData, theMUTATIONS_*messages)GroupComparisonStore/ComparisonStore:genesSortedByMutationFrequency,groupToProfiledPatients,showMutationsTabLollipopPlotNoTooltip(the two-group layout) andAxisScaleSwitchMatched:
Deliberately different (cBioLab conventions):
Verification
Cross-checked against cbioportal.org's REST API on
brca_tcga_pan_can_atlas_2018, comparing PAM50 basal-like (SUBTYPE=BRCA_Basal) against luminal A (BRCA_LumA). Data came from/clinical-data,/molecular-profiles/…_mutations/mutations/fetchand/sample-lists/…_sequenced, with scipy for the tests. Everything below is identical:Tests and checks:
npm testpasses (3,290 tests, 0 fail).test/mutcompare.test.ts, plus cases intest/comparison-layout.test.ts.node --test test/view-snapshots*.test.ts: a newmutcomparecase, with answers recorded from the public warehouse. No outside HTTP calls needed recording: TP53's Genome Nexus answers were already recorded.test/boundary.test.tscovers the newmutcompareProfiledSql.npm run report:coverage && npm run check:coveragepasses: 100% of changed lib lines run.npm run docs:genandnpm run docs:counts: only my example was added; no existing count moved.eslintandknipare clean. ruff did not run locally (no Python venv), and nothing in Python changed.Looked at in a browser (Playwright, dev server) with no console errors:
Not done
These are listed as unticked sub-items in PORTAL-PARITY.md:
e2ePending.Preview
/portal/comparison?doc=eyJzdHVkeSI6ICJicmNhX3RjZ2FfcGFuX2Nhbl9hdGxhc18yMDE4IiwgInZpZXdzIjogW10sICJjb2hvcnRzIjogeyJCYXNhbC1saWtlIjogeyJhbGwiOiBbeyJraW5kIjogImNsaW5pY2FsIiwgImF0dHJpYnV0ZSI6ICJTVUJUWVBFIiwgInZhbHVlcyI6IFsiQlJDQV9CYXNhbCJdfV19LCAiTHVtaW5hbCBBIjogeyJhbGwiOiBbeyJraW5kIjogImNsaW5pY2FsIiwgImF0dHJpYnV0ZSI6ICJTVUJUWVBFIiwgInZhbHVlcyI6IFsiQlJDQV9MdW1BIl19XX19fQ&tab=Mutations🤖 Generated with Claude Code
https://claude.ai/code/session_01Q3ezTWaXhwWhadqM9gbFNK