diff --git a/docs/HANDOFF-2026-11-28-ablation-power-and-curation.md b/docs/HANDOFF-2026-11-28-ablation-power-and-curation.md new file mode 100644 index 0000000..49db5e8 --- /dev/null +++ b/docs/HANDOFF-2026-11-28-ablation-power-and-curation.md @@ -0,0 +1,163 @@ +# Handoff 2026-11-28 — ablation power calibration, and what it says about curation + +Continues `docs/HANDOFF-2026-11-27-adhesion-benchmark-and-round2.md`. Read that one first for the +benchmark's construction and the round 2 structural search; this one covers only what came after. + +--- + +## State in one paragraph + +`adhesion_v1` is frozen. The cross-clade structural search is finished and returned a negative. The +2b ablation harness was **not** built, because a power calibration run first (PR 0, merged as #179) +showed the benchmark cannot adjudicate the components the harness was going to test. The +calibration results and the curation analysis that follows from them are committed on +`ablation-power-calibration` and **not yet pushed**. There is nothing running on the HPCC. + +## Where the code is + +| | | +|---|---| +| `origin/main` | `9796b83` (PRs #175–#179 all merged) | +| current branch | `ablation-power-calibration`, **2 commits ahead of main, unpushed** | +| | `287e172` calibration report | +| | `25997d0` PF21671 correction + curation requirement | +| open PRs | none | + +**First action on resume: push `ablation-power-calibration` and open the PR.** The owner pushes; +the agent does not. + +Untracked and unrelated to this work, left alone: `m`, `to_import/kiss2019_jgi/`, `uv.lock`. + +--- + +## The result + +**`adhesion_v1` cannot adjudicate the components the 2b harness was designed to test.** + +Job 32519688, `exfab`/gpu12, 16 cores, 1:15:15, commit `5bbd85a`, 1000 replicates and 1000 +permutations, both declared training pools. Report: +`docs/reports/data/ablation_calibration_2026-11-27/`. + +A domain call needs **66% sensitivity** on positives (at 5% FPR on hard negatives) before the +benchmark detects it at 80% power — and that is the *optimistic* training pool. No candidate +component has a measured sensitivity, so that is the standard each must clear sight-unseen. + +Effective sample size is **16.4 positives**, not 50: 33 positive clusters, 27 of them singletons, +with ALS alone contributing 9 proteins. + +### Three findings that were not in the plan + +**1. The training pool was an undeclared assumption and it dominates.** It decides which bar even +wins — `composition_length` under `all`, bare `length` under `scored` — and moves the MDE by nearly +a factor of two. Under `scored` the largest fold trains on 32 proteins and a single noise column +costs 0.145 concordance. That figure has the same signature as the C-pinning bug fixed during +development, so it was checked: the per-fold C is recorded in `baseline.json` for both pools and +matches. It is genuine small-sample behaviour. It only moves the answer one way — `all` is the +optimistic pool. + +**2. The decision rule is conservative, not anti-conservative.** The review feared a nominal 5% +might really be 9.5%. Measured: 0.006 at one noise dimension, 0.003 at five, 0.000 at twenty. +Adding features costs accuracy, so a noise component starts below zero while the permutation null +is symmetric about zero. Validity is safe; **power is being given away**. Centring the null on the +measured penalty would recover it — but that changes the decision rule and must be declared before +any component is tested. + +**3. A wall that curation cannot move.** See `curation_requirement.md`. Fitting Δ(s) = 0.1064·s − +0.0217 (which reproduces the measured MDE: 0.655 predicted vs 0.66 observed), the intercept is the +measured dimensionality penalty, and Δ(s) = 0 at **s ≈ 0.20**. Below ~20% sensitivity a component +is not hard to detect — it is *not an improvement at all*. No quantity of curation changes that. + +### What curation would actually buy + +Extrapolated as 1/√N in independent positive families, **validated only at the current size**: + +| to detect sensitivity | families needed | vs today's 33 | +|---|---|---| +| 0.50 | 77 | 2.3× | +| 0.40 | 175 | 5.3× | +| 0.30 | 728 | 22× | +| 0.25 | 3,172 | 96× | + +Doubling the curated truth moves the detectable sensitivity from 0.66 only to 0.52. + +--- + +## Correction carried forward + +An earlier claim in this session — repeated in commit `287e172` — said PF21671 "recovers 12 of 50 +positives = 24% sensitivity". **That is wrong.** PF21671 is a Pucciniomycotina (*Rhodotorula*) +family; the benchmark's three scorable folds are entirely Ascomycota and contain no *Rhodotorula* +row at all. Its sensitivity on these 50 positives is 0. Corrected in `25997d0`; the calibration +numbers themselves were never affected. + +The corrected reading is sharper and should drive planning: **the project can discover in clades it +cannot evaluate in.** That taxonomic gap is independent of statistical power and is not fixed by it. + +--- + +## Recommended direction (not yet an owner decision) + +1. **Curate for coverage, not for power.** Eurotiomycetes has 5 positive clusters and cannot support + a real held-out fold. Pucciniomycotina has no truth at all, which is why the structural result + cannot be assessed. Both are fixable at realistic scale. Making a 25%-sensitivity component + testable is not. +2. **Reframe the component question.** "Does PF21671 improve a global classifier?" needs ~1,000 + families. "Of the 12 proteins PF21671 flags, how many are genuine adhesins, and does it miss a + known one in its own clade?" needs about a dozen curated entries and is answerable now. + Component-ablation is an instrument for general-purpose features; most of what this project has + found is clade-restricted. +3. **Settle the null-centring question before any component is tested**, so the choice cannot be + made after seeing a result. + +## Open measurements, in priority order + +| | what | cost | +|---|---|---| +| 1 | **Learning curve.** Replace the 1/√N assumption: re-run the calibration on nested subsamples of the positive clusters (12/18/24/33, several draws each), fit the real exponent. This is the single most load-bearing assumption in the curation table. | one SLURM job, ~1 h | +| 2 | **`--attenuation 0` rerun.** `plant_heterogeneous` keeps the signal's sign outside the strong fold and the metric is rank-based, so that row is a second optimistic bound, not the realistic case. The genuinely non-transferring case is `--attenuation 0`. Flag already exists; no code change. | one pool, ~47 min | +| 3 | Deferred review items, before any PR 3: length-stratified reporting, label-associated missingness, reuse of `analysis/step1_compare/phasec/bootstrap.py`, pre-registration artefact, `indirect=yes` stratified report. | — | + +--- + +## Running it again + +```bash +# worktree is already detached at 5bbd85a +W=/bigdata/stajichlab/jstajich/projects/adhesionPred/_workdir/ablation_power +sbatch --export=ALL,PROJ_ROOT=$W/code,CODE_COMMIT=,BENCH=$W/code/data/benchmark/adhesion_v1,OUT=$W/ \ + -o $W/logs/%x.%j.log -e $W/logs/%x.%j.log analysis/ablation_power/power.sbatch +``` + +`$OUT` must not exist; the script refuses to overwrite. It also refuses a dirty or unpinned commit +and a benchmark that fails its `SHA256SUMS`. + +## Gotchas added this session + +- **Do not run the power code with `python3 -I`.** Isolated mode implies `-s`, which drops user + site-packages, and numpy/scipy/sklearn live in `~/.local/lib/python3.12` on this cluster. The + earlier failure was masked because the ssh wrapper swallowed the exit code. A capability check + must use *the flag the run will use*; mine did not, which is how this got through. +- **`ssh hpcc2 'bash -s'` is not a login shell** — `sbatch`, `squeue` and `module` are missing from + `PATH`. Use `bash -ls`. +- **`pkill -f ` matches its own ssh command line** and will kill the connection. Bracket a + character (`run[_]power`) or use the job id. +- `scp` of a remote path containing `*` is glob-expanded by zsh before it leaves the laptop. Quote + it, or use `/.`. +- The bar and the component-augmented model **must be fitted at the same per-fold C**. Fitting the + bar with a tuned C while components ran at C=1.0 made pure noise appear to cost 0.15 concordance. + `choose_bar` returns its per-fold C for this reason and two tests pin it. +- The power run writes nothing until a pool finishes, so a wall-clock timeout loses everything + computed. Worth a per-grid-point checkpoint if the grid grows. + +## Leftovers + +- `/bigdata/stajichlab/jstajich/projects/adhesionPred/_workdir/ablation_power/` — 614 MB: `code/` + worktree at `5bbd85a`, `logs/`, and `calibration/`. **Purgeable**: `calibration/` is now copied + into the repo in full. +- Older loose ends still open: `input_tests` collects zero tests; `aga1_class` needs pandas; the + analysis CI jobs are still `continue-on-error`, so a green tick there does not prove much. +- Contamination is systemic and undeclared per component: + `data/controls/repeat-mechanism/curation_table.tsv` overlaps 105 of the 125 scored proteins and + underpins the `repeats` component. AGA1 is worse — 66 of 166 (40%) of the benchmark was in its + training set, and the leakage-free remainder (27 pos / 22 neg, Eurotiomycetes at 4/1) is too thin + to test. Any PR 3 needs per-component provenance declarations before it means anything. diff --git a/docs/reports/data/ablation_calibration_2026-11-27/README.md b/docs/reports/data/ablation_calibration_2026-11-27/README.md new file mode 100644 index 0000000..5c63f4e --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/README.md @@ -0,0 +1,165 @@ +# Ablation power calibration — can `adhesion_v1` adjudicate anything? + +**Date:** 2026-11-27 · **Job:** 32519688 (`exfab`, gpu12, 16 cores, 1:15:15) · **Code:** `5bbd85a` +**Benchmark:** `adhesion_v1`, SHA256SUMS digest `ae9a6995…3893` · **Settings:** 1000 replicates, 1000 +permutations, seed 0, α = 0.05, both declared training pools. + +This ran **before** the 2b ablation harness was built, to answer one question first: + +> How large an improvement would a component have to make before this benchmark could tell? + +**No real component was tested.** Every signal here is planted. + +--- + +## The answer + +**`adhesion_v1` cannot adjudicate the components the 2b harness was designed to test.** + +A domain call must reach **66% sensitivity** on positives, at 5% false-positive rate on hard +negatives, before this benchmark detects it at 80% power — and that is the *optimistic* training +pool. No candidate component has a measured sensitivity on this benchmark, so that threshold is +the standard every one of them has to clear sight-unseen. + +PF21671, the only domain family the cross-clade structural search confirmed, **cannot be evaluated +here at all**, for a reason more basic than power: it is a Pucciniomycotina (*Rhodotorula*) family, +the three scorable folds are entirely Ascomycota, and there is no *Rhodotorula* row anywhere in the +benchmark. Its sensitivity on these 50 positives is 0, not low. + +Had PR 1 been built first, it would have produced six null results, not one of them informative. + +### Minimum detectable effect at 80% power + +| signal | pool `all` | pool `scored` | +|---|---|---| +| homogeneous — same effect in every clade (optimistic bound) | d = 1.48 (Δ +0.041) | d = 2.47 (Δ +0.081) | +| heterogeneous — see caveat 1 below | d = 1.62 (Δ +0.029) | not reached on the grid | +| **domain call at 5% FPR (sensitivity needed)** | **0.66** (Δ +0.048) | **not reached (> 0.80)** | + +### Power against the actionable shape (pool `all`) + +| sensitivity | 0.05 | 0.15 | 0.25 | 0.35 | 0.45 | 0.60 | 0.80 | +|---|---|---|---|---|---|---|---| +| power | 0.013 | 0.073 | **0.159** | 0.297 | 0.434 | 0.730 | 0.956 | + +The bolded column is the level at which a component contributes almost nothing detectable: a call +that finds a quarter of the positives is seen one time in six. + +--- + +## Why the benchmark is smaller than it looks + +- 50 positives and 75 hard negatives, in 84 clusters across the scorable folds. +- **Effective sample size: 16.4 positives** (Kish ESS over 33 positive clusters). ALS alone is 9 of + those 33 clusters. A paralogue family is one observation, not nine. + +Quote the effective number, not 50. + +--- + +## The training pool was an undeclared assumption, and it dominates + +The original 2b plan never stated which proteins train the bar. It turns out to decide which bar +even wins, and to move the MDE by a factor approaching two: + +| | pool `all` | pool `scored` | +|---|---|---| +| bar chosen by inner cluster-grouped CV | `composition_length` (21 features) | `length` (1 feature) | +| largest fold's training set | 44 pos / 29 neg = **73** | 18 pos / 14 neg = **32** | +| mean Δ under a 1-dim noise component | −0.007 | **−0.145** | +| type-I rate, 1 / 5 / 20 dims | 0.006 / 0.003 / 0.000 | 0.000 / 0.000 / 0.000 | + +Under `scored`, the largest fold trains on 32 proteins, and the winning bar is a single feature. +Adding one noise column to a one-feature model at that sample size costs 0.145 concordance — twenty +times the penalty under `all`. + +That figure has the same arithmetic signature as the C-pinning bug fixed during development (a noise +component appearing to cost 0.15), so it was checked rather than assumed: the bar and the augmented +model are fitted at the same per-fold C, which `baseline.json` records under `bar_C_per_fold` for +both pools. The effect is genuine small-sample behaviour. + +**This only moves the answer one way.** `all` is the optimistic pool and even it demands 66% +sensitivity. The conclusion is robust to the assumption that was never declared. + +--- + +## The decision rule is conservative, not anti-conservative + +The review's concern was that a nominal 5% might really be 9.5%. The measurement says the opposite: + +| component dims | rejection rate, pool `all` | mean Δ under the null | +|---|---|---| +| 1 | 0.006 | −0.0067 | +| 5 | 0.003 | −0.0206 | +| 20 | 0.000 | −0.0582 | + +This is explainable. Adding features *costs* accuracy, so a pure-noise component starts below zero +and must climb back before it can even reach zero. The permutation null is symmetric about zero by +construction, while the true null sits below it — so the rule under-rejects, and under-rejects +harder as the component gets wider. + +**Validity is safe; sensitivity is being given away.** The MDE figures above already carry this +penalty, so they are honest about what it takes to clear the rule *as written*. Centring the null on +the measured dimensionality penalty would recover real power at no cost to validity — but that is a +change to the decision rule, and it must be declared before any component is tested. + +--- + +## Caveats + +**1. The heterogeneous row does not measure what it claims.** `plant_heterogeneous` scales the +signal by `attenuation` (default 1/3) outside the strong fold but **keeps the same sign everywhere**. +The primary metric is rank-based, so a model trained on the attenuated folds still learns the right +direction and ranks the held-out clade nearly as well as under a uniform signal. That is why the +heterogeneous and homogeneous curves nearly coincide (d = 1.62 vs 1.48) when the docstring predicts +a large gap. + +A genuinely non-transferring signal is `attenuation = 0`: present in one clade, absent elsewhere. +The flag already exists (`--attenuation`), so this needs a rerun, not a code change. It matters +because clade-restricted families are the normal case in this project — PF21671 is one, and the +expected result, power collapsing to the type-I rate at every effect size, would mean a +narrow-clade family is undetectable by leave-one-clade-out at **any** effect size. That is a +sharper and more general constraint than "needs d = 1.62". + +**Until that rerun, treat the heterogeneous row as a second optimistic bound, not as the realistic +case.** The binary row is unaffected and remains the actionable one. + +**2. Power estimates near 0.8 carry a standard error of about 1.3%** at 1000 replicates. The MDE is +read off a 9-point grid by interpolation, so quote it to two significant figures at most. + +--- + +## How to read a null result from this benchmark + +A component that fails to clear this bar has **not** been shown to be useless. It has been shown to +be **undetectable at this benchmark's size**. Report the interval's upper bound — "rules out an +improvement above X" — never the bare phrase "no improvement". + +Treating "no evidence against" as "evidence for keeping" is how the cruft removed in PR #171 +accumulated in the first place. The same error in the other direction would discard working +components on the strength of six uninformative nulls. + +--- + +## What follows + +1. **Curating more truth outranks building the ablation harness** — but see + `docs/reports/data/ablation_calibration_2026-11-27/curation_requirement.md` for how much growth + the ablation design would actually need, because the answer is not "somewhat more". +2. **Rerun the heterogeneous shape at `--attenuation 0`** before the heterogeneous row is cited. +3. **Decide the null-centring question before any component is tested**, so the choice cannot be + made after seeing a result. + +## Files + +| file | what it holds | +|---|---| +| `provenance.txt` | commit, node, interpreter, package versions, benchmark digest, settings | +| `{all,scored}/baseline.json` | bar, per-fold C, splits and leakage drops, per-fold report, effective sample sizes, every setting | +| `{all,scored}/type_i.tsv` | rejection rate and mean null Δ at 1, 5, 20 noise dimensions | +| `{all,scored}/power.tsv` | power and mean Δ for each shape × effect | +| `{all,scored}/summary.md` | the run's own generated summary | + +Reproduce with `analysis/ablation_power/power.sbatch` at commit `5bbd85a`. Note that the run must +**not** use `python3 -I`: isolated mode drops user site-packages, where numpy, scipy and +scikit-learn live on this cluster. diff --git a/docs/reports/data/ablation_calibration_2026-11-27/all/baseline.json b/docs/reports/data/ablation_calibration_2026-11-27/all/baseline.json new file mode 100644 index 0000000..06ff945 --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/all/baseline.json @@ -0,0 +1,121 @@ +{ + "bar": "composition_length", + "bar_C_per_fold": { + "Eurotiomycetes": 0.01, + "Pezizomycotina": 0.1, + "Saccharomycetes": 0.01 + }, + "baseline_family": { + "composition": { + "C_per_fold": { + "Eurotiomycetes": 0.1, + "Pezizomycotina": 10.0, + "Saccharomycetes": 0.01 + }, + "stratified_concordance": 0.8644670050761422 + }, + "composition_length": { + "C_per_fold": { + "Eurotiomycetes": 0.01, + "Pezizomycotina": 0.1, + "Saccharomycetes": 0.01 + }, + "stratified_concordance": 0.9005076142131979 + }, + "length": { + "C_per_fold": { + "Eurotiomycetes": 0.01, + "Pezizomycotina": 0.01, + "Saccharomycetes": 0.01 + }, + "stratified_concordance": 0.8888324873096447 + } + }, + "benchmark_sha256sums_digest": "ae9a69955e0d03bb7ac097e36f245db5ea3a73e80d479fe662c9c0d3101f3893", + "benchmark_version": "adhesion_v1", + "effective_sample_size": { + "negatives": { + "kish_ess": 29.761904761904763, + "n_clusters": 51, + "n_proteins": 75 + }, + "positives": { + "kish_ess": 16.44736842105263, + "n_clusters": 33, + "n_proteins": 50 + } + }, + "per_fold": { + "Eurotiomycetes": { + "ap": 0.4538095238095238, + "ap_normalised": 0.2055411255411255, + "auc": 0.41818181818181815, + "n": 16, + "pairs": 55, + "prevalence": 0.3125 + }, + "Pezizomycotina": { + "ap": 0.8326634060945802, + "ap_normalised": 0.5218954459845149, + "auc": 0.6483516483516484, + "n": 20, + "pairs": 91, + "prevalence": 0.65 + }, + "Saccharomycetes": { + "ap": 0.8848016783564782, + "ap_normalised": 0.8201289363811677, + "auc": 0.9276315789473685, + "n": 89, + "pairs": 1824, + "prevalence": 0.3595505617977528 + } + }, + "pooled_counts": { + "clusters": 84, + "negatives": 75, + "positives": 50 + }, + "settings": { + "alpha": 0.05, + "attenuation": 0.3333333333333333, + "binary_fpr": 0.05, + "packages": { + "numpy": "2.5.2", + "scikit-learn": "1.9.1", + "scipy": "1.18.1" + }, + "permutations": 1000, + "python": "3.12.15", + "replicates": 1000, + "seed": 0, + "workers": 16 + }, + "splits": [ + { + "dropped_for_leakage": 4, + "fold": "Saccharomycetes", + "test_negative": 57, + "test_positive": 32, + "train_negative": 29, + "train_positive": 44 + }, + { + "dropped_for_leakage": 5, + "fold": "Pezizomycotina", + "test_negative": 7, + "test_positive": 13, + "train_negative": 79, + "train_positive": 62 + }, + { + "dropped_for_leakage": 4, + "fold": "Eurotiomycetes", + "test_negative": 11, + "test_positive": 5, + "train_negative": 75, + "train_positive": 71 + } + ], + "train_pool": "all" +} diff --git a/docs/reports/data/ablation_calibration_2026-11-27/all/power.tsv b/docs/reports/data/ablation_calibration_2026-11-27/all/power.tsv new file mode 100644 index 0000000..ae3ef57 --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/all/power.tsv @@ -0,0 +1,26 @@ +shape effect replicates power mean_delta +homogeneous 0.0 1000 0.007 -0.0067893401015227915 +homogeneous 0.25 1000 0.023 -0.004732487309644617 +homogeneous 0.5 1000 0.083 5.3956838996782606e-17 +homogeneous 0.75 1000 0.172 0.008481218274111729 +homogeneous 1.0 1000 0.366 0.019423857868020356 +homogeneous 1.5 1000 0.82 0.04233147208121833 +homogeneous 2.0 1000 0.986 0.06153299492385793 +homogeneous 2.5 1000 1.0 0.07467969543147214 +homogeneous 3.0 1000 1.0 0.08253502538071072 +heterogeneous 0.0 1000 0.007 -0.0067893401015227915 +heterogeneous 0.25 1000 0.025 -0.005175126903553243 +heterogeneous 0.5 1000 0.058 -0.0018329949238578163 +heterogeneous 0.75 1000 0.149 0.0035461928934010702 +heterogeneous 1.0 1000 0.335 0.009632994923857921 +heterogeneous 1.5 1000 0.748 0.025089340101522896 +heterogeneous 2.0 1000 0.961 0.039259390862944214 +heterogeneous 2.5 1000 0.999 0.05305025380710666 +heterogeneous 3.0 1000 1.0 0.06334771573604067 +binary 0.05 1000 0.013 -0.00414771573604056 +binary 0.15 1000 0.073 -0.00023248730964461583 +binary 0.25 1000 0.159 0.007365989847715791 +binary 0.35 1000 0.297 0.015129441624365539 +binary 0.45 1000 0.434 0.023867005076142186 +binary 0.6 1000 0.73 0.040325380710659955 +binary 0.8 1000 0.956 0.06550609137055843 diff --git a/docs/reports/data/ablation_calibration_2026-11-27/all/summary.md b/docs/reports/data/ablation_calibration_2026-11-27/all/summary.md new file mode 100644 index 0000000..caae35e --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/all/summary.md @@ -0,0 +1,34 @@ +# Ablation power calibration (2026-11-27) + +Benchmark `adhesion_v1`, training pool `all`, bar `composition_length` (best of the declared family by inner cluster-grouped CV). + +## What the benchmark actually weighs + +- 50 positives and 75 hard negatives in 84 clusters across the scorable folds. +- **Effective sample size 16.4 positives** (33 clusters), not 50: paralogue families are one observation, not many. + +## Does the decision rule mean what it says? + +Rejection rate under a pure-noise component, nominal alpha = 0.05: + +| component dims | rejection rate | mean delta under the null | +|---|---|---| +| 1 | 0.006 | -0.0067 | +| 5 | 0.003 | -0.0206 | +| 20 | 0.000 | -0.0582 | + +A rejection rate above alpha means the rule is anti-conservative and every later component test is easier to pass than it claims. A non-zero mean delta means a component is rewarded or penalised for its feature count alone, which is why the null for a real component must be a permutation of that component, never the number zero. + +## Minimum detectable effect at 80% power + +| signal | effect | delta in stratified concordance | +|---|---|---| +| Gaussian, same in every clade (optimistic bound) | 1.48 | +0.041 | +| Gaussian, full in Saccharomycetes, 0.33x elsewhere (realistic) | 1.62 | +0.029 | +| domain call at 5% FPR (sensitivity needed) | 0.66 | +0.048 | + +The binary row is the actionable one: it says what sensitivity a domain model would need, at the stated false-positive rate on hard negatives, before this benchmark could see it. + +## How to read a null result + +A component that fails to clear this bar has not been shown to be useless. It has been shown to be undetectable at this benchmark's size. Report the interval's upper bound, not the phrase "no improvement". diff --git a/docs/reports/data/ablation_calibration_2026-11-27/all/type_i.tsv b/docs/reports/data/ablation_calibration_2026-11-27/all/type_i.tsv new file mode 100644 index 0000000..ce1741c --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/all/type_i.tsv @@ -0,0 +1,4 @@ +dims replicates alpha rejection_rate mean_delta_under_null fraction_delta_positive +1 1000 0.05 0.006 -0.006731472081218219 0.149 +5 1000 0.05 0.003 -0.02055786802030451 0.083 +20 1000 0.05 0.0 -0.05821218274111669 0.007 diff --git a/docs/reports/data/ablation_calibration_2026-11-27/curation_requirement.md b/docs/reports/data/ablation_calibration_2026-11-27/curation_requirement.md new file mode 100644 index 0000000..c0fb782 --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/curation_requirement.md @@ -0,0 +1,102 @@ +# How much curation growth would the ablation design need? + +Companion to `README.md`. The calibration says a component needs **66% sensitivity** before +`adhesion_v1` can detect it. The obvious follow-up is "so how much bigger must the benchmark be?" +This note answers that, and the answer is not "somewhat bigger". + +**Status: extrapolation, not measurement.** Everything below assumes the detectable effect shrinks +as 1/√N in the number of independent positive families. That is the standard asymptotic rate and it +reproduces the measured MDE at current size (0.655 predicted vs 0.66 measured), but it has not been +verified at other sizes. The measurement that would settle it is a learning curve — subsample the +benchmark to several sizes and re-measure the MDE at each. That job has not been run. + +## What the benchmark is made of + +| | value | +|---|---| +| positives (scorable folds) | 50 proteins in **33 clusters** | +| Kish effective sample size | **16.4** | +| singleton clusters | 27 of 33 | +| largest cluster | **ALS, 9 proteins** (18% of all positives) | +| positive clusters per fold | Saccharomycetes 17 · Pezizomycotina 11 · Eurotiomycetes 5 | + +The clustering is already doing its job — 27 of 33 families are singletons. The problem is not +redundancy inflation. It is **absolute scarcity of independent families**. + +## The scaling + +Fitting the measured relationship between a domain call's sensitivity and the concordance gain it +produces (over s ≥ 0.25, pool `all`): + +> Δ(s) = 0.1064·s − 0.0217 + +| independent families | growth | effective N | detectable Δ | **detectable sensitivity** | +|---|---|---|---|---| +| 33 | 1× | 16 | 0.0480 | **0.66** | +| 50 | 1.5× | 25 | 0.0392 | 0.57 | +| 66 | 2× | 33 | 0.0339 | 0.52 | +| 99 | 3× | 49 | 0.0277 | 0.46 | +| 132 | 4× | 66 | 0.0240 | 0.43 | +| 330 | 10× | 164 | 0.0152 | 0.35 | +| 1386 | 42× | 689 | 0.0074 | 0.27 | + +Read the other way: + +| to detect a component at sensitivity | needs growth | independent positive families | +|---|---|---| +| 0.50 | 2.3× | **77** | +| 0.40 | 5.3× | **175** | +| 0.30 | 22× | **728** | +| 0.25 | 96× | **3,172** | + +Doubling the curated truth — 33 families to 66, a very large undertaking — moves the detectable +sensitivity only from 0.66 to 0.52. + +## There is a wall that curation cannot move + +The fitted intercept is negative, and that is not noise: it is the **dimensionality penalty** +measured directly in `type_i.tsv` (a pure-noise component costs −0.007 at one dimension, −0.058 at +twenty). A component must first pay for the features it adds before any of its signal counts. + +Setting Δ(s) = 0 gives **s ≈ 0.20**. + +Below roughly 20% sensitivity, a domain call is not "hard to detect" — it is **not an improvement +at all** under this bar and this rule. It makes the model worse. No quantity of curation changes +that, because the limit is not sampling error. Only reducing the penalty can: fewer features per +component, stronger regularisation, or centring the null on the measured penalty instead of on zero. + +This is why the 0.25 row above reads 3,172 families. The design is asking for an impossible number +because it is approaching an asymptote, not because the truth set is slightly too small. + +## What this means for the project + +**1. Curation is still necessary, but not sufficient, and not primarily for the ablation harness.** +At 5 positive clusters, Eurotiomycetes cannot support a meaningful held-out fold at all; that is a +coverage failure curable by curation at a realistic scale. Making a 24%-sensitivity component +testable is not. + +**2. There is a taxonomic gap between where discovery happens and where evaluation is possible.** +The cross-clade structural search confirmed PF21671 in *Rhodotorula* (Pucciniomycotina). The +benchmark's three scorable folds are entirely Ascomycota and contain no *Rhodotorula* at all. The +project can currently *discover* in clades it cannot *evaluate* in. Curation aimed at the ablation +harness and curation aimed at closing that gap are different target lists, and the second is the +one that makes the structural work assessable. + +**3. The ablation question is the wrong question for a narrow component.** "Does adding PF21671 +improve a global adhesin classifier?" needs on the order of a thousand independent families to +answer. "Of the proteins PF21671 flags, how many are genuine adhesins, and does it miss any known +one in its own clade?" needs only the twelve proteins it flags, plus curated truth in +Pucciniomycotina. The second question is answerable now, at a curation cost of perhaps a dozen +entries, and it is the question a biologist would actually ask of a domain family. + +A component-ablation harness is the right instrument for asking whether a *general-purpose* feature +earns its place in a *general-purpose* model. It is the wrong instrument for a clade-restricted +domain family, and most of what this project has found is clade-restricted. + +## Recommended next measurement + +Replace the 1/√N assumption with a learning curve before any curation target is committed to: +re-run the calibration on nested subsamples of the positive clusters (say 12, 18, 24, 33 families, +several draws each) and fit the observed MDE against family count. If the real exponent is shallower +than 1/√N the table above is pessimistic; if steeper, the wall is nearer than it looks. Either way +the number in a curation plan should be measured, not assumed. diff --git a/docs/reports/data/ablation_calibration_2026-11-27/provenance.txt b/docs/reports/data/ablation_calibration_2026-11-27/provenance.txt new file mode 100644 index 0000000..cfe640c --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/provenance.txt @@ -0,0 +1,8 @@ +job: ablation_power (power calibration for the 2b harness) +commit: 5bbd85a3cb0f26ed7a0f9b7a5038044026ec5374 (pinned: 5bbd85a3cb0f26ed7a0f9b7a5038044026ec5374) +node: gpu12; cores: 16 +python: Python 3.12.15 +packages: numpy 2.5.2 scipy 1.18.1 sklearn 1.9.1 +benchmark: /bigdata/stajichlab/jstajich/projects/adhesionPred/_workdir/ablation_power/code/data/benchmark/adhesion_v1 sha256(SHA256SUMS) ae9a69955e0d03bb7ac097e36f245db5ea3a73e80d479fe662c9c0d3101f3893 +replicates: 1000; permutations: 1000; seed 0; alpha 0.05 +training pools: all, scored diff --git a/docs/reports/data/ablation_calibration_2026-11-27/scored/baseline.json b/docs/reports/data/ablation_calibration_2026-11-27/scored/baseline.json new file mode 100644 index 0000000..7d01c81 --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/scored/baseline.json @@ -0,0 +1,121 @@ +{ + "bar": "length", + "bar_C_per_fold": { + "Eurotiomycetes": 0.01, + "Pezizomycotina": 0.01, + "Saccharomycetes": 0.01 + }, + "baseline_family": { + "composition": { + "C_per_fold": { + "Eurotiomycetes": 0.1, + "Pezizomycotina": 1.0, + "Saccharomycetes": 1.0 + }, + "stratified_concordance": 0.6908629441624365 + }, + "composition_length": { + "C_per_fold": { + "Eurotiomycetes": 0.1, + "Pezizomycotina": 1.0, + "Saccharomycetes": 1.0 + }, + "stratified_concordance": 0.6796954314720812 + }, + "length": { + "C_per_fold": { + "Eurotiomycetes": 0.01, + "Pezizomycotina": 0.01, + "Saccharomycetes": 0.01 + }, + "stratified_concordance": 0.8888324873096447 + } + }, + "benchmark_sha256sums_digest": "ae9a69955e0d03bb7ac097e36f245db5ea3a73e80d479fe662c9c0d3101f3893", + "benchmark_version": "adhesion_v1", + "effective_sample_size": { + "negatives": { + "kish_ess": 29.761904761904763, + "n_clusters": 51, + "n_proteins": 75 + }, + "positives": { + "kish_ess": 16.44736842105263, + "n_clusters": 33, + "n_proteins": 50 + } + }, + "per_fold": { + "Eurotiomycetes": { + "ap": 0.4144078144078144, + "ap_normalised": 0.14822954822954817, + "auc": 0.32727272727272727, + "n": 16, + "pairs": 55, + "prevalence": 0.3125 + }, + "Pezizomycotina": { + "ap": 0.8605294000804835, + "ap_normalised": 0.6015125716585242, + "auc": 0.7582417582417582, + "n": 20, + "pairs": 91, + "prevalence": 0.65 + }, + "Saccharomycetes": { + "ap": 0.8483075119929592, + "ap_normalised": 0.7631468169714626, + "auc": 0.9122807017543859, + "n": 89, + "pairs": 1824, + "prevalence": 0.3595505617977528 + } + }, + "pooled_counts": { + "clusters": 84, + "negatives": 75, + "positives": 50 + }, + "settings": { + "alpha": 0.05, + "attenuation": 0.3333333333333333, + "binary_fpr": 0.05, + "packages": { + "numpy": "2.5.2", + "scikit-learn": "1.9.1", + "scipy": "1.18.1" + }, + "permutations": 1000, + "python": "3.12.15", + "replicates": 1000, + "seed": 0, + "workers": 16 + }, + "splits": [ + { + "dropped_for_leakage": 4, + "fold": "Saccharomycetes", + "test_negative": 57, + "test_positive": 32, + "train_negative": 14, + "train_positive": 18 + }, + { + "dropped_for_leakage": 2, + "fold": "Pezizomycotina", + "test_negative": 7, + "test_positive": 13, + "train_negative": 66, + "train_positive": 37 + }, + { + "dropped_for_leakage": 4, + "fold": "Eurotiomycetes", + "test_negative": 11, + "test_positive": 5, + "train_negative": 60, + "train_positive": 45 + } + ], + "train_pool": "scored" +} diff --git a/docs/reports/data/ablation_calibration_2026-11-27/scored/power.tsv b/docs/reports/data/ablation_calibration_2026-11-27/scored/power.tsv new file mode 100644 index 0000000..4b51f83 --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/scored/power.tsv @@ -0,0 +1,26 @@ +shape effect replicates power mean_delta +homogeneous 0.0 1000 0.0 -0.14054517766497462 +homogeneous 0.25 1000 0.0 -0.13502335025380713 +homogeneous 0.5 1000 0.0 -0.12668527918781727 +homogeneous 0.75 1000 0.0 -0.09735939086294419 +homogeneous 1.0 1000 0.002 -0.06554416243654825 +homogeneous 1.5 1000 0.01 0.0004375634517766178 +homogeneous 2.0 1000 0.258 0.050568020304568494 +homogeneous 2.5 1000 0.829 0.08247969543147206 +homogeneous 3.0 1000 0.993 0.09825025380710656 +heterogeneous 0.0 1000 0.0 -0.14054517766497462 +heterogeneous 0.25 1000 0.002 -0.13394568527918785 +heterogeneous 0.5 1000 0.001 -0.11756446700507618 +heterogeneous 0.75 1000 0.005 -0.09375025380710664 +heterogeneous 1.0 1000 0.013 -0.06934974619289344 +heterogeneous 1.5 1000 0.05 -0.007080710659898511 +heterogeneous 2.0 1000 0.142 0.03266852791878169 +heterogeneous 2.5 1000 0.351 0.065943654822335 +heterogeneous 3.0 1000 0.596 0.08130304568527916 +binary 0.05 1000 0.001 -0.025210152284263983 +binary 0.15 1000 0.002 -0.028723857868020338 +binary 0.25 1000 0.011 -0.009992385786802064 +binary 0.35 1000 0.004 0.0071421319796954 +binary 0.45 1000 0.001 0.02185126903553296 +binary 0.6 1000 0.0 0.04520507614213194 +binary 0.8 1000 0.408 0.07650507614213194 diff --git a/docs/reports/data/ablation_calibration_2026-11-27/scored/summary.md b/docs/reports/data/ablation_calibration_2026-11-27/scored/summary.md new file mode 100644 index 0000000..168ada8 --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/scored/summary.md @@ -0,0 +1,34 @@ +# Ablation power calibration (2026-11-27) + +Benchmark `adhesion_v1`, training pool `scored`, bar `length` (best of the declared family by inner cluster-grouped CV). + +## What the benchmark actually weighs + +- 50 positives and 75 hard negatives in 84 clusters across the scorable folds. +- **Effective sample size 16.4 positives** (33 clusters), not 50: paralogue families are one observation, not many. + +## Does the decision rule mean what it says? + +Rejection rate under a pure-noise component, nominal alpha = 0.05: + +| component dims | rejection rate | mean delta under the null | +|---|---|---| +| 1 | 0.000 | -0.1447 | +| 5 | 0.000 | -0.2830 | +| 20 | 0.000 | -0.3380 | + +A rejection rate above alpha means the rule is anti-conservative and every later component test is easier to pass than it claims. A non-zero mean delta means a component is rewarded or penalised for its feature count alone, which is why the null for a real component must be a permutation of that component, never the number zero. + +## Minimum detectable effect at 80% power + +| signal | effect | delta in stratified concordance | +|---|---|---| +| Gaussian, same in every clade (optimistic bound) | 2.47 | +0.081 | +| Gaussian, full in Saccharomycetes, 0.33x elsewhere (realistic) | **not reached on the grid** | — | +| domain call at 5% FPR (sensitivity needed) | **not reached on the grid** | — | + +The binary row is the actionable one: it says what sensitivity a domain model would need, at the stated false-positive rate on hard negatives, before this benchmark could see it. + +## How to read a null result + +A component that fails to clear this bar has not been shown to be useless. It has been shown to be undetectable at this benchmark's size. Report the interval's upper bound, not the phrase "no improvement". diff --git a/docs/reports/data/ablation_calibration_2026-11-27/scored/type_i.tsv b/docs/reports/data/ablation_calibration_2026-11-27/scored/type_i.tsv new file mode 100644 index 0000000..58468b1 --- /dev/null +++ b/docs/reports/data/ablation_calibration_2026-11-27/scored/type_i.tsv @@ -0,0 +1,4 @@ +dims replicates alpha rejection_rate mean_delta_under_null fraction_delta_positive +1 1000 0.05 0.0 -0.14467512690355336 0.014 +5 1000 0.05 0.0 -0.2829736040609137 0.0 +20 1000 0.05 0.0 -0.33797817258883256 0.0