oncodsl / FINDINGS.md
govindbalki's picture
Upload folder using huggingface_hub
0fff343 verified
|
Raw
History Blame Contribute Delete
19.3 kB
# OncoDSL β€” Findings
A running log of what we've learned from the engine and the data. Each entry is meant to be honest and self-contained β€” usable in front of co-founders / collaborators.
---
## Finding 1 β€” Expression can surface MLH1, but not the rest of the MMR set, and that is a data-sensor limit, not an engine limit
**Date:** 2026-06-23
### The observation
Running the diagnostic on the TMB objective (359 samples, 20,057 genes ranked by signed Spearman correlation of expression with mutation burden; most-negative = rank 1):
| Gene | corr with TMB | rank / 20,057 | percentile |
|------|---------------|----------------|------------|
| **MLH1** | βˆ’0.31 | **270** | top **1.3%** |
| PMS2 | βˆ’0.18 | 2,214 | top ~11% |
| MSH2 | βˆ’0.05 | 7,516 | ~middle |
| MSH6 | +0.09 | 15,257 | bottom ~24% (wrong direction) |
Immune markers (CD8A, GZMA, PRF1) sit at the very bottom (ranks ~19,600–20,018, strongly *positive*) β€” exactly as expected, since they rise with mutation burden. The diagnostic is behaving correctly.
### Why the four MMR genes don't all rank near the top
"MMR is linked to MLH1 / MSH2 / MSH6 / PMS2" is true at the level of **protein function** β€” break any of the four proteins and DNA repair fails. But the ranking is built on **mRNA expression**, and **expression measures how much of a gene is transcribed, not whether the protein it makes works.** The gap is explained by *how each gene gets broken*:
- **MLH1** is usually broken by **silencing** (promoter methylation) β€” the gene is turned *down*, so its expression drops. Expression is a faithful readout of its failure β†’ MLH1 ranks in the top 1.3%.
- **MSH2 / MSH6 / PMS2** are usually broken by **mutation** β€” a coding "typo" that produces a faulty protein. The gene is still transcribed at a normal level, so expression doesn't change. **Expression cannot see a typo** β†’ no usable signal (MSH2 flat; MSH6 even slightly the wrong way).
Analogy: trying to find broken spell-checkers by measuring how *loudly* each is running. MLH1's failure mode is "switched off" (volume drops β€” detectable). The others fail by "running at full volume but with a bug inside" (the volume meter shows nothing wrong). The fault is in the **sensor (expression data)**, not the search.
### Why MLH1 is rank 270 and not rank 1
Its signal is driven by the ~15% MSI-H minority and diluted across the MSS majority, so its cohort-wide correlation is moderate (βˆ’0.31). A cloud of **co-methylated "hitchhiker" genes** β€” silenced by the *same* methylation program (CIMP) that silences MLH1 β€” score even more strongly (top-10 β‰ˆ βˆ’0.42 to βˆ’0.44). Correlation cannot distinguish the causal gene from its co-silenced neighbours.
### Implications
- **The engine and DSL are not at fault.** They faithfully found the genes whose expression most tracks TMB; MLH1 is right up there.
- **There is a hard expression-only ceiling:** MSH2/MSH6/PMS2 are *invisible* to an expression matrix because their breakage doesn't change expression. No objective and no amount of compute recovers them from expression alone.
- **To detect mutation-type breakage you need a different sensor** β€” the mutation calls (`data_mutations`) β€” which directly show "this tumour has a broken MSH2." That is a multi-modal extension (expression + mutations).
- **The honest headline result:** *blind, with gene names hidden, the engine's mechanism objective ranks the causal gene MLH1 in the top ~1% of 20,000 genes* β€” and the genes above it are its own co-silenced methylation neighbourhood. That is a stronger and more defensible claim than forcing a 4/4 recovery the data cannot support.
---
## Finding 2 β€” The MSI-H / MSS biology we're testing against (confirmed mental model)
The whole project rests on one causal cascade. The MMR genes are a "spell-checker" for DNA; their state drives everything downstream:
```
working spell-checker broken spell-checker (dMMR)
MMR activity HIGH (MLH1/MSH2/MSH6/PMS2) LOW
↓ ↓ ↓
phenotype MSS (microsatellite stable) MSI-H (microsatellite unstable)
mutation burden LOW TMB HIGH TMB (errors pile up)
immune (CD8A/ LOW (immune-cold) HIGH (immune-hot β€” many
GZMA/PRF1) neoantigens attract T-cells)
driver cancer driven by OTHER cancer driven by broken MMR
mechanisms β†’ responds well to immunotherapy
```
Caveat (see Finding 1): "MMR activity LOW" is only visible in *expression* for MLH1 (silencing); MSH2/MSH6/PMS2 fail by mutation, which expression can't see.
## Finding 3 β€” Reframed success criterion: "MLH1 in the top ~1% blind"
Forcing a 4/4 MMR recovery is not supported by expression data. The honest, defensible, *reproducible* claim is: blind, the engine's mechanism objective ranks MLH1 at 270 / 20,057 (top 1.3%). This rank is a property of the data, not a lucky run β€” fully reproducible across seeds/budgets, and far beyond chance. The genes above it are MLH1's own co-silenced (CIMP) neighbourhood, so the engine rediscovered the *methylation-silencing footprint* MLH1 sits in. Stronger and more honest than a forced 4/4.
## Finding 4 β€” What DSL + GA on TCGA alone can prove (the case to make)
The asset is not "find new biology" β€” it's "a tiny language + an evolutionary engine, working blind, rediscovers *known* biology from raw numbers, honestly." Both of Toni's proposed problems are *already-solved* questions, which makes them ideal **known-answer validations** of the method. Three claims, strongest first:
1. **Generality across two independent problems with the SAME engine (flagship).** Same unchanged DSL + engine detects the MSI subtype in colorectal AND HPV status in head-&-neck/cervical (HPV+ has a strong, clean expression signature). Two cancers, two questions, both rediscovered blind = a *general* discovery engine, the real moat.
2. **The engine as an honest instrument.** Changing the objective changes what's found (label-prediction β†’ shortcuts; mechanism objective β†’ MLH1 in the top 1%), and it surfaces its own limits (Finding 1). Interpretable, falsifiable hypotheses β€” not a black box.
3. **Minimum-vocabulary discovery (Edgar's principle).** Winning programs are short, human-readable DSL; Ξ» drives toward the smallest program that works.
### Stage-2 objectives note
The expression-sensor ceiling (Finding 1) is objective-independent β€” survival and unsupervised read the same expression matrix, so neither lifts the MMR ceiling. Of the two, **unsupervised** is the on-thesis one (find the dominant structure with no labels β†’ plausibly rediscover the MSI-H axis without being told it exists). **Survival** is heavily confounded (stage/age/treatment), so it's a weaker, off-thesis "prognostic prediction" task. The real ceiling-breaker for mutation-type mechanisms is **multi-modal data** (expression + mutation calls).
---
## Finding 5 β€” HPV detection: the generality demo, and why it avoids the MMR wall
### The biology (parallel to MSI)
Where MSI is a broken internal spell-checker, HPV is an external hijacker. The virus makes two proteins, **E6** and **E7**, that disable the cell's two main brakes:
```
HPV virus β†’ E6 + E7
E6 removes p53 E7 removes RB
(protein p53 Β· gene TP53) (protein RB Β· gene RB1)
↓ ↓
HPV+ usually does NOT RB gone β†’ cell over-makes p16
mutate TP53 (virus does it) (protein p16 Β· gene CDKN2A), futilely
β†’ high p16 = the HPV+ marker
HPV+ (virus-driven) HPVβˆ’ (e.g. smoking-driven)
CDKN2A/p16 ↑ HIGH ↓ LOW
cell-cycle ↑ HIGH (E2F targets) lower / different
immune ↑ hotter cooler
TP53 usually intact βœ— MUTATED (smoking)
outcome responds well to therapy worse response
```
### Genes vs proteins (they have two names each)
| Protein | Gene | Role |
|---|---|---|
| RB (pRB) | RB1 | cell-cycle "brake" |
| p53 | TP53 | "guardian" β€” repair/kill damaged cells |
| p16 | CDKN2A | brake-booster that keeps RB engaged |
### Why p16/CDKN2A rises (the feedback)
Normally p16 keeps RB engaged, and engaged RB keeps p16 low β€” a balanced loop. E7 destroys RB, so the cell senses "no braking" and frantically over-produces p16 to compensate β€” but with RB gone it does nothing and **piles up**. High p16 is therefore the smoke-signal that RB has been removed β†’ the reliable HPV+ marker.
### Why cell-cycle (E2F) genes rise
RB's normal job is to clamp shut a master "go" switch called **E2F**. E2F, when released, turns ON the whole batch of genes that copy DNA and divide the cell (the "cell-cycle / proliferation" genes β€” e.g. MCM family, PCNA, cyclins). HPV's E7 destroys RB β†’ E2F is freed β†’ those E2F-target genes switch ON (HIGH). So the *single* root cause (E7 removes RB) produces **two** independent, expression-visible readouts: p16/CDKN2A piles up (the futile brake) **and** the E2F cell-cycle program lights up. Having two strong, readable signals from one cause is part of why HPV is a clean expression target.
### What TCGA shows / what the engine can use
- **Expression (mRNA) β€” what the engine reads:** `CDKN2A`, `TP53`, `RB1` all have expression values. **CDKN2A/p16 expression is the usable HPV+ signal** (turned up). βœ“
- **Mutation (TP53) β€” separate file**, not in the expression matrix (same sensor issue as MMR).
- **Proteins p53/p16/RB themselves β€” RPPA**, a separate modality we don't use.
### Why HPV avoids the MMR wall
The MMR wall was a sensor mismatch: 3 of 4 MMR genes fail by *mutation* (invisible to expression). HPV's defining signature is **over-expression** (p16 ↑, cell-cycle ↑, immune ↑) β€” squarely in expression. The sensor matches the signal, so a blind "HPV+ vs HPVβˆ’" run should give a clean, high held-out AUROC and recover the textbook markers (CDKN2A/p16, E2F/cell-cycle) β€” a *cleaner* win than MMR. Two honest notes: (1) the *cause* is the virus, not a host gene, so this is **detection**, not "recover a causal gene" β€” but the host-response markers ARE the clinically accepted answer; (2) the wall only reappears if you try to detect HPVβˆ’ via its *TP53 mutation* (invisible) β€” you don't need to, since HPV+ has a strong positive expression footprint.
### Cohort note
TCGA **HNSC** (head & neck) is the cohort with a genuine HPV+/βˆ’ mix (~15–25% HPV+) β€” best for a classification demo. **CESC** (cervical) is ~95%+ HPV+, so it's a positive control rather than a +/βˆ’ contrast.
---
## Finding 6 β€” Unsupervised, fixed, discovers the KRT5 (basal/squamous) axis blind β€” and honestly reports it isn't MSI
**Date:** 2026-06-23
### The fix
The first unsupervised attempts overfit: the objective selected the program with the cleanest split on the TRAINING data, so a flexible program over a small gene set could carve an in-sample split that didn't generalise (held-out silhouette of 1.000 from a `protected_div`-by-self outlier artifact, or βˆ’1.000 collapse). The fix: score the split **out-of-sample** β€” fit the winsorize bounds, standardisation, and 2-means **on the training fold only**, then assign held-out patients to those clusters and measure separation there β€” both during selection (`cv_score`) and in the final held-out (`evaluate_holdout`, now passed the training context). Plus: require unsupervised programs to `Select` genes (no whole-matrix `Reduce`), and restrict `Split` predicates to "score" (no clinical variables).
### The result (a clean, honest run)
- Winner: `Split(Reduce(Select(M,[g09331]),median), score)` β€” a single gene, **g09331 = KRT5**.
- Held-out structure **0.933** (out-of-sample β€” it generalises), permutation **p 0.0050** (beats random programs), GENES 1.
- Post-hoc alignment: MSI **AUROC 0.596** (β‰ˆ coin-flip), TMB |spearman| **0.116** (β‰ˆ 0).
### Interpretation
Blind and airgapped, the engine found a **real, generalising two-group split** of patients driven by **KRT5** β€” a basal/squamous epithelial marker that is strongly *bimodal* across the cohort. It rediscovered a genuine biological axis with **zero labels** β€” and the post-hoc check correctly reports it is **NOT** the MSI subtype. This is the honest-instrument story working end to end: it finds real structure, generalises it to unseen patients, beats chance, reveals the gene, **and tells you what the structure is and isn't**.
### Why it isn't MSI (as predicted)
The single strongest, cleanest, most-generalisable natural division in this expression data is the KRT5 (basal/squamous) axis, not MSI-H/MSS. MSI-H is a ~15% minority and a subtler, multi-gene signal β€” it can't out-separate a sharply bimodal single gene. So unsupervised honestly surfaces the dominant clean axis, not the subtype. (To recover MSI specifically, use the supervised MSI objective; to learn *what* the KRT5 split is β€” histology / mucinous vs adeno / tissue-of-origin β€” would need a clinical column, same post-hoc pattern.)
---
## Finding 7 β€” Why the engine isn't "finding MSI" (the consolidated answer)
"Find MSI" means three different things, with three different answers. The failures aren't the engine being wrong β€” they're a mismatch between what's rewarded and what MSI actually is. The engine faithfully optimises exactly what you ask; it's an honest instrument that surfaces these truths instead of faking a result.
### 1. "Tell MSI-H apart from MSS" β†’ this WORKS
Point the engine at the MSI label (supervised MSI-separation objective) and it separates the two groups on unseen patients at held-out AUROC ~0.89. Detecting the subtype is not the problem.
### 2. "Recover the causal repair genes (MLH1, MSH2, MSH6, PMS2)" β†’ mostly can't, two reasons
- **The instrument can't see most of them.** We only have gene *expression* β€” how loudly each gene is "read out." Three of the four (MSH2, MSH6, PMS2) usually break by **mutation** β€” a typo in the gene's DNA letters. The cell still reads the recipe out just as loudly; only the protein it builds is broken. Expression measures *volume*, not whether the product works β€” so a mutation-broken gene looks perfectly normal. Only **MLH1** breaks by being **silenced** (switched off β†’ volume drops), which expression *can* see.
- **The visible one gets out-competed.** MLH1 *is* visible β€” top ~1% of genes on the TMB axis β€” but not the strongest. Hundreds of louder bystanders (immune/consequence genes, and genes co-silenced alongside MLH1) move with MSI even more sharply, so a "best predictor" search grabs those. The cause is present but buried.
### 3. "Rediscover the MSI grouping with no labels (unsupervised)" β†’ won't, wrong *shape*
Unsupervised looks for the *cleanest two-group split*. MSI-H is (a) a **lopsided ~15% minority** β€” a small group inside a big crowd, not a balanced split β€” and (b) a **subtle signal** β€” many genes each shifting a little, no sharp gap. Single genes like KRT5 are sharply on/off and carve a far cleaner split, so the engine keeps finding those (KRT5, STARD6 …) and never the soft minority MSI axis. MSI simply isn't a clean cluster, so a clean-cluster-finder never lands on it.
### The unifying idea + honest bottom line
- Reward "any separator" β†’ shortcut/consequence genes, not the cause.
- Reward "cleanest split" β†’ sharp single genes, not the subtle subtype.
- And expression alone physically can't show 3 of the 4 causal genes.
So: **detecting** MSI works (~0.89); **recovering the causal genes** is limited to MLH1 (the rest need *mutation* data, not expression β€” a data-modality limit, not an engine limit); and MSI **won't emerge unsupervised** because it isn't a clean cluster. The right tool depends on the question β€” and the engine is being honest about which questions this data can and can't answer.
---
## Finding 8 β€” HPV vs MSI: why HPV is the cleaner problem, the DSL suffices, and what "causal" means here
### The three MSI problems mostly don't apply to HPV
| MSI problem | HPV? |
|---|---|
| **Sensor** β€” expression can't see mutation-broken genes (3/4 MMR genes) | **N/A.** The HPV+ fingerprint is **over-expression** (p16/CDKN2A ↑, cell-cycle/E2F ↑) β€” exactly what expression measures. The sensor matches the signal. (HPVβˆ’'s TP53 *mutation* is invisible, but you don't need it β€” HPV+ has its own loud positive signature.) |
| **Shortcut vs cause** β€” "any separator" grabs consequences, not the causal genes | **N/A.** The cause is the *virus* (E6/E7), not a host gene, so there's no host causal gene to miss; and the host-response markers you want (p16, cell-cycle) ARE the strongest separators *and* the clinically accepted answer. "Reward any separator" lands on the right genes. |
| **Wrong shape for unsupervised** β€” MSI is a lopsided ~15% minority, subtle, no clean cluster | **Partially** (HPV+ is also a ~15–25% minority, and head-&-neck has its own sharp axes), **but moot** β€” the HPV+ signal is sharp and coordinated, and you run HPV **supervised** (detect HPV+ vs HPVβˆ’), where minority/shape doesn't matter and the strong signature gives a clean win. |
Net: the two problems that actually sank MSI (sensor + shortcut-vs-cause) **don't apply** to HPV, because HPV's answer is a strong over-expression signature the data sees directly and the search rewards. HPV plays to the data's strengths instead of its blind spots β€” which is why it's the stronger generality demo.
### Will the same DSL suffice? Yes.
HPV detection is structurally identical to MSI separation (binary classification from expression). Reuse Select / Reduce / Combine / Fit / Associate / Effect / Split **unchanged β€” no new operators**. What changes is only plumbing: (1) load + anonymise the **HNSC** cohort (expression + HPV-status label), and (2) a new objective target `"hpv"` using the same binary-AUROC machinery as MSI. The demo is literally: *same DSL, same engine, same airgap β€” new cancer, new question.*
### What causal link are we establishing with HPV? Honestly, none that's new.
HPV detection **recovers the expression footprint of a cause that's already known** (virus β†’ E6/E7 disable p53/RB β†’ p16 & cell-cycle ↑). It is *recovery/validation*, not causal discovery β€” the same honest position as MSI: **TCGA is observational**, so neither proves causation; recovering MLH1 / p16 *corroborates* established biology. The project's causal reasoning lives elsewhere: (a) the DSL can *express* causal-style operations (`Effect` = confounder adjustment; mechanism-shaped objectives that target a cause's signature, not a label) β€” strong proxies on observational data, not proof; and (b) the genuine causal-discovery claim is **method-level** (the engine discovering causal structure in sparse domains, as on the maths/crypto problems). A *new* causal claim in cancer would need **interventional / treated-cohort data** (Claim B), which TCGA lacks. So HPV's value is **generality** (same engine, second cancer, known biology rediscovered blind), not new causation β€” and saying so plainly is a credibility strength, not a weakness.