Repository navigation
OncoKB by tumour type: tests from the spec, and three fixes they found - #218
Merged
Merged
Conversation
Tests for #202 written from a spec table cited to the portal's source, by an agent without the implementation in view (invariant 14): a peer fixture check (check:oncokb-tumor-type, 47 checks), unit tests for the sync source and the mutation table, and four planted bugs. Fixes the tests found: - blank cancer-type values count as absent, so such a sample is asked about with its study's cancer type, as the table reads it - a germline mutation gets no protein-change OncoKB call - the importer's -1 protein positions are sent, as the portal sends them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTXeuA6xMdKduTsWw4c
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CI coverage: the key space SQL ran only in the fixture check. The test checks the study is quoted by sq() and scopes both tables, and that no study means no filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTXeuA6xMdKduTsWw4c
The hand counts assumed 44 fixture samples; FX-P41 to FX-P44 make 49 (29 of the women's), recounted from data_clinical_*.txt. FX-P41-T1's CANCER_TYPE is blank, so it is at 98%, and DEAD is the third 100% row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTXeuA6xMdKduTsWw4c
Cases 12, 13, 15 and 33 run only against the fixture database (the planted-bug baseline runs them) and counted 40 patients and 44 samples. Recounted from data_clinical_*.txt for FX-P41 to FX-P44: 44 patients, 49 samples (26 and 29 of the women's). CANCER_TYPE drops to 98.0% and CANCER_TYPE_DETAILED and ONCOTREE_CODE to 95.9%, which moves them below the 100% rows in the menu order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3ezTXeuA6xMdKduTsWw4c
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
Brings #202 (OncoKB by tumour type) up to invariant 14. The spec table below was written first, with each row cited to the portal's source. A separate agent then wrote the tests from that table, without the implementation in view. The tests found three bugs in #202, all fixed here:
''for each attribute a study declares but a sample lacks. The sync treated''as a value, so a sample with both cancer-type attributes blank was asked about with no tumour type. The mutation table, though, reads it with the study's type, so it never found the call (841 warehouse samples). Blank now counts as absent, as it does in the portal, whose API never returns a blank.germlinesubstring. A germline row now gets no protein-change call, either per tumour type or gene-level.-1positions. The importer writes-1for unknown protein positions, and the portal sends them on. The sync dropped them; it now sends them.Tests
check:oncokb-tumor-type(47 checks, added to gate.sh): it syncs the peer fixture against recorded OncoKB answers and reads the Mutations table at the pin. New fixture samples: FX-P41 to FX-P44 (blank cancer types, broad type only, two tumour types in one patient, germline).packages/annotation-sync/test/oncokb-tumor-type.test.ts(rewritten) andtest/mutation-table.test.ts.scripts/check-mutants.ts, all caught byoncokb-tumor-type:oncokb-tt-blank-is-data: 1 failing checkoncokb-tt-cancer-type-not-detailed: 19 failing checksoncokb-tt-germline-called: 1 failing checkoncokb-tt-tumour-type-ignored: 8 failing checksmutationsre-recorded; the SQL changed and the rendered card did not.Verification
npm test: 4145 tests, 0 failing (34 TODO, all pre-existing).node --test test/view-snapshots*.test.ts: passes.tsc: clean. eslint on the changed files: clean.Legacy reference
cbioportal-frontend e9d70fb:
StoreUtils.ts(generateUniqueSampleKeyToTumorTypeMap1180-1203,cancerTypeForOncoKb919,fetchOncoKbData784-789,queryOncoKbData944-972),OncoKbUtils.ts103 and 169-196, and the Results table's call,DefaultMutationMapperStore988-1011 →DataFetcher296-368.Spec
T — the tumour type a mutation is asked about with (
generateUniqueSampleKeyToTumorTypeMap,cancerTypeForOncoKb)type_of_cancer.name, e.g. "Colorectal Adenocarcinoma")samplesWithoutCancerTypeClinicalData; SU 1417-1427map[k] === undefinedonly for samples without data; this sample has data); SU 919 `CLINICAL_DATA_TYPE_SAMPLE)Q — which mutations are asked, and how (
fetchOncoKbData,generateProteinChangeQuery)/utils/cancerGeneListoncokbAnnotated)Fusion, gene not curatedm.mutationType === fusionMutationType ||{alteration: proteinChange, consequence: mutationType, gene: {entrezGeneId}, proteinStart, proteinEnd, tumorType, germline: false}; no evidenceTypesgenerateQueryVariantId(id = entrez_tumorType_alteration_mutationType) and dedupS — what is stored and shown
dataannotation.oncokbannotation.oncokbrowCorrections from the test author (checked against the legacy source)
fetchOncoKbDatalets fusions through its gene filter (SU 786-787), butqueryOncoKbDatathen dropsmutationType !== 'Fusion'before both endpoints (SU 960-972, DMF 345-351): a Fusion mutation is never asked by protein change. C's exclusion was right; the test follows the portal. (mutation_derivedholds 0 Fusion rows.)''for every sample × attribute a study declares; the portal's API never returns a blank. So blank = absent: both blank → the study's type (FX-P41); CANCER_TYPE set, detailed blank → none. C keyed both-blank samples with no tumour type while the table used the study's: fixed (841 warehouse samples).indexOf('germline')). C's table showed a germline mutation the somatic call: fixed (a germline row gets no protein-change call, tumour-type or gene-level). The key space now matches the substring too.MUTATED, which is asked as the portal would.-1, which the portal passes on (DMF 361-362). C dropped-1: fixed (Q9b).DefaultMutationMapperStore.oncoKbData(DMS 988-1011) via DMF 296-368, not MMS 400-408 (group comparison's CANCER_TYPE variant).Not done
Merging this alongside #211 will conflict in
data_mutations.txt,peer-db.ts,package.json,gate.sh,TESTING.mdandcheck-mutants.ts. Each conflict is two additions side by side; keep both.Preview
/portal/results?study=paad_iatlas_prince_2022&genes=KRAS%20CDKN2A%20TP53&tab=Mutations🤖 Generated with Claude Code
https://claude.ai/code/session_01Q3ezTXeuA6xMdKduTsWw4c