Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
alisman
force-pushed
the
session/mut-annotation-oncokb-sv
branch
from
November 15, 2026 03:19
764069a to
46c8aa5
Compare
A new annotation source, oncokb_sv, asks OncoKB about each structural variant as the portal's Structural Variants tab does (generateAnnotateStructuralVariantQuery): site 1 and site 2 genes, OncoKB's SV type (FUSION for two genes; for one, the class when it is exactly one of OncoKB's six types, else UNKNOWN) and the sample's tumour type (the rule the mutation table uses). Keys with no curated partner are stored unasked. Stored in annotation.oncokb_sv (migration 005), licensed like annotation.oncokb. The SV table's Annotation column reads the pair's call for the sample's tumour type, falling back to the partners' gene-level Fusion calls only where the store holds no row for the variant (a study not synced). The tumour-type rule is now one CTE builder shared by the mutation and SV tables (sampleTumorTypeCte), and one pair of subqueries shared by the two sync sources. Tests written from the spec table by a separate agent before the code: unit tests for the query, the stored row and which keys are asked; a structural-variant profile in the peer fixture (FX-P45 to FX-P53, 17 SVs) and check:oncokb-sv (42 checks); four planted bugs, all caught. The fixture's new samples move the tracks-menu hand counts, recounted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTXeuA6xMdKduTsWw4c
alisman
force-pushed
the
session/mut-annotation-oncokb-sv
branch
from
November 15, 2026 03:52
46c8aa5 to
74d5834
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
A new annotation source,
oncokb_sv, asks OncoKB about each structural variant the way the portal's Structural Variants tab does (generateAnnotateStructuralVariantQuery). Each query is keyed by:The answers are stored in
annotation.oncokb_sv(migration 005, already run on the warehouse), licensed likeannotation.oncokb.The SV table's Annotation column now reads the pair's call for the sample's tumour type. It falls back to the partners' gene-level Fusion calls only for a study whose structural variants aren't synced. Two pieces are now shared:
sampleTumorTypeCte) for the mutation and SV tables;Out of scope: the oncoprint, OQL
DRIVERand plot driver axes keep the gene-level call. Their rows ingenomic_event_deriveddon't name the partner, so joining them to the pair calls is a later PR, with tumour type null as the portal's oncoprint asks. The Mutations tab's fusions (E) come next and read this store.Legacy reference
cbioportal-frontend e9d70fb:
OncoKbUtils.ts246-317:deriveStructuralVariantType,generateAnnotateStructuralVariantQuery.OncoKbUtils.ts89-100:generateQueryStructuralVariantId.StoreUtils.ts861-867 and 1049-1060: only curated partners are asked;POST /annotate/structuralVariants.ResultsViewPageStore.ts5967-5990: tumour type per sample.StoreUtils.ts2016-2062: driver oncogenicities.Spec (invariant 14)
Tests were written from this table by a separate agent, before the code, and seen to fail.
The rule, case by case
Y — the query for one structural variant (
generateAnnotateStructuralVariantQuery, OKU 284-317;deriveStructuralVariantType, OKU 246-281)||)uniqBy idT — tumour type
uniqueSampleKeyToTumorTypecancerTypeForOncoKb(key, {})→ null)D — what makes an SV a driver (the SV table's order and, in a later PR, the oncoprint)
S — stored and shown
StructuralVariantTable.tsx456-490)annotation.oncokb'Fusion' rowCorrections the test author made to the first draft of the spec:
Y7 has no fixture row: the warehouse has none (both Entrez ids set but one Hugo symbol blank).
Verification
Tests
packages/annotation-sync/test/oncokb-sv.test.ts, 20 tests (query, stored row, which keys are asked), plus the source-list and store tests.npm run check:oncokb-sv: 42/42 against the fixture DB, with SQL run rather than matched as text.check:oncokb-tumor-type: 47/47.data_clinical_*.txt.npm testwith the peer env: clean. This is the planted-bug runner'sunitbaseline.node --test test/view-snapshots*.test.ts: 61/61. The sv and mutations snapshots were re-recorded. The values are unchanged (sv still 131 rows); only the caption and method text changed, since msk_impact_2017 isn't synced.Planted bugs. Every guard's baseline passes, and all four are caught:
oncokb-sv-one-gene-is-fusiononcokb-sv-class-case-foldedoncokb-sv-tumour-type-ignoredoncokb-sv-gene-level-winsReal sync.
npm run annotate -- oncokb_sv --study acc_tcga_pan_can_atlas_2018stored 260 keys at OncoKB v7.7, with 0 failures:Cross-check with cbioportal.org:
POST /api/structural-variant/fetchfor TSC2, CDK12, RAD51C, KMT2A, APC, SUFU and ALDH2 in acc returns 9 calls. They are the same 9 pairs and samples our SV view lists.The acc SV view pinned to v7.7 shows the pair calls:
These are OncoKB's tumour-suppressor fusion rule (Likely Loss-of-function), except KMT2A, which is Likely Gain-of-function. At the app's current pin (v7.5) the same rows are blank, so nothing is read across releases (S3).
I couldn't compare OncoKB icons on cbioportal.org's page: Cloudflare's bot check blocks a headless browser, and the portal's OncoKB proxy forbids programmatic use. To spot-check by eye, open https://www.cbioportal.org/results/structuralVariants?cancer_study_list=acc_tcga_pan_can_atlas_2018&case_set_id=acc_tcga_pan_can_atlas_2018_all&profileFilter=structural_variants&gene_list=TSC2%20CDK12%20RAD51C%20KMT2A&Action=Submit — the expected values are in the table above.
Not done
annotation.oncokb(v7.5).oncokb_svholds v7.7 for acc only, so the SV tab keeps the gene-level fallback until the planned re-annotation brings all OncoKB stores to one release.DRIVERand plot drivers from pair calls: follow-up PR.Preview
/portal/results/structuralVariants?cancer_study_list=acc_tcga_pan_can_atlas_2018&gene_list=TSC2%20CDK12🤖 Generated with Claude Code
https://claude.ai/code/session_01Q3ezTXeuA6xMdKduTsWw4c