junidude14 commited on
Commit
caa07ee
·
verified ·
1 Parent(s): 54ec9ad

Archive 4 checkpoints (1-4)

Browse files
paper-releases/pbisc-diffusion/updates/20261002T022002Z-deck-time-to-apply-scsemi-reps/diffusion/dataset/server_1/model8/plans/paired_finetune_intradataset_20260927/scsemi/tools/representative_dependence.py ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """How much does scSemiProfiler's output depend on which donors were single-cell profiled? (CPU only; 2026-10-02)
3
+
4
+ Few-pair draws (5 training donors = scSemiProfiler's representatives). Upstream assigns every test sample to exactly one
5
+ representative, the nearest in the bulk PCA (assignment.json), and its encoder runs on that representative's cells.
6
+
7
+ Part 1, measured (all 25 draws, every scored test sample):
8
+ copy_l1 composition L1 between the test sample's observed cells and its representative's observed cells, i.e.
9
+ the error of simply copying the representative's composition (same frozen scANVI labels as the scorer;
10
+ the observed test compositions are checked against the scorer's per_donor.csv)
11
+ scsemi_l1 scSemiProfiler-5 composition L1 (scores/<ds>/fewshot_n5/draw<j>_scsemi5/per_donor.csv)
12
+ lora_l1 LoRA-5 composition L1 (scores/<ds>/fewshot_n5/draw<j>/per_donor.csv, arm lora5)
13
+ per cohort: means, Spearman of each method's L1 with copy_l1 and with the bulk distance to the representative,
14
+ and a paired Wilcoxon of scsemi_l1 vs copy_l1 over test samples.
15
+ Part 2, proxy (not a rerun): upstream's own "global mode" picks representatives by KMeans on the same bulk PCA (the
16
+ sample nearest each cluster centre, initial_setup.py). With as many representative samples as our draws used
17
+ (5 ImMicro / sepsis, 8 Ji, 13-14 Giroux / Imperial), the copy_l1 of KMeans-picked and of random samples is computed on
18
+ the remaining samples. KMeans spreads them over as many donors; our draws keep all visits of 5 donors.
19
+
20
+ Inputs from server_2 (Imperial ran there) are copied into OUT/inputs_server2/ with their sha256.
21
+ Outputs: OUT/{per_target.csv, summary.csv, kmeans_proxy.csv, manifest.json}
22
+ """
23
+ from __future__ import annotations
24
+
25
+ import os
26
+
27
+ os.environ["CUDA_VISIBLE_DEVICES"] = ""
28
+
29
+ import hashlib
30
+ import json
31
+ import subprocess
32
+ import sys
33
+ from pathlib import Path
34
+
35
+ import h5py
36
+ import numpy as np
37
+ import pandas as pd
38
+ from scipy.stats import spearmanr, wilcoxon
39
+ from sklearn.cluster import KMeans
40
+
41
+ T = Path("/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927")
42
+ OUT = T / "scsemi" / "analysis" / "representative_dependence_20261002"
43
+ ORDER = ("immicro", "ye2026_sepsis", "imperial_eskd", "giroux2022", "ji2025_chili")
44
+ REMOTE = {"imperial_eskd"}
45
+ sys.path.insert(0, str(T / "tools"))
46
+ import ft_common as F # noqa: E402
47
+
48
+ GATE = list(F.GATE)
49
+
50
+
51
+ def sha(p: Path) -> str:
52
+ h = hashlib.sha256()
53
+ with open(p, "rb") as f:
54
+ for b in iter(lambda: f.read(1 << 20), b""):
55
+ h.update(b)
56
+ return h.hexdigest()
57
+
58
+
59
+ def draw_file(ds: str, j: int, rel: str) -> Path:
60
+ src = T / "scsemi/work" / ds / "fewshot_n5" / f"draw{j}" / rel
61
+ if ds not in REMOTE:
62
+ return src
63
+ dst = OUT / "inputs_server2" / ds / f"draw{j}" / Path(rel).name
64
+ if not dst.is_file():
65
+ dst.parent.mkdir(parents=True, exist_ok=True)
66
+ subprocess.run(["scp", "-q", f"spark-0110:{src}", str(dst)], check=True)
67
+ return dst
68
+
69
+
70
+ def observed_composition(ds: str) -> pd.DataFrame:
71
+ if ds == "immicro": # frozen published f01common labels, on the scorer's ImMicro cell table
72
+ tab = pd.read_parquet(T / "data/immicro/cells_obs.parquet", columns=["cell_index", "donor_id"])
73
+ lab = pd.DataFrame({"sample_id": tab.donor_id.astype(str).to_numpy(),
74
+ "celltype_l1_pred": F.immicro_frozen_labels(tab)[0]})
75
+ else:
76
+ lab = pd.read_parquet(T / "scoring_cache" / ds / "observed_labels/labels/labels.parquet",
77
+ columns=["sample_id", "celltype_l1_pred"])
78
+ return pd.crosstab(lab.sample_id, lab.celltype_l1_pred, normalize="index").reindex(columns=GATE, fill_value=0.0)
79
+
80
+
81
+ def bulk_pca(ds: str):
82
+ with h5py.File(draw_file(ds, 0, "scsemi_project/processed_bulkdata.h5ad")) as f:
83
+ return f["obs"][f["obs"].attrs["_index"]][:].astype(str), f["obsm/X_pca"][:]
84
+
85
+
86
+ def copy_error(names, X, comp, rep_idx) -> float:
87
+ rep = np.asarray(rep_idx)
88
+ tgt = np.setdiff1d(np.arange(len(names)), rep)
89
+ near = rep[((X[tgt, None, :] - X[None, rep, :]) ** 2).sum(-1).argmin(1)]
90
+ C = comp.loc[names].to_numpy()
91
+ return float(np.abs(C[tgt] - C[near]).sum(1).mean())
92
+
93
+
94
+ def main() -> int:
95
+ OUT.mkdir(parents=True, exist_ok=True)
96
+ rows, inputs = [], {}
97
+ comps = {ds: observed_composition(ds) for ds in ORDER}
98
+ for ds in ORDER:
99
+ obs = comps[ds]
100
+ for j in range(5):
101
+ ap = draw_file(ds, j, "assignment.json")
102
+ inputs[str(ap)] = sha(ap)
103
+ asg = json.loads(ap.read_text())["targets"]
104
+ sc = pd.read_csv(T / "scores" / ds / "fewshot_n5" / f"draw{j}_scsemi5" / "per_donor.csv").set_index("donor")
105
+ lo = pd.read_csv(T / "scores" / ds / "fewshot_n5" / f"draw{j}" / "per_donor.csv")
106
+ lo = lo[lo.arm == "lora5"].set_index("donor")
107
+ if set(sc.index) != set(lo.index) or not set(sc.index) <= set(asg):
108
+ raise SystemExit(f"{ds} draw{j}: scored samples differ between arms or assignment")
109
+ for tgt in sc.index:
110
+ rep = asg[tgt]["representative"]
111
+ o_t = sc.loc[tgt, [f"obs_{g}" for g in GATE]].to_numpy(float)
112
+ if not np.allclose(o_t, obs.loc[tgt].to_numpy(), atol=1e-6):
113
+ raise SystemExit(f"{ds} draw{j} {tgt}: observed composition differs from the scorer's")
114
+ o_r = obs.loc[rep].to_numpy()
115
+ g_s = sc.loc[tgt, [f"gen_{g}" for g in GATE]].to_numpy(float)
116
+ g_l = lo.loc[tgt, [f"gen_{g}" for g in GATE]].to_numpy(float)
117
+ rows.append(dict(cohort=ds, draw=j, target=tgt, representative=rep, bulk_distance=asg[tgt]["distances"][rep],
118
+ copy_l1=np.abs(o_r - o_t).sum(), scsemi_l1=np.abs(g_s - o_t).sum(),
119
+ lora_l1=np.abs(g_l - o_t).sum(), scsemi_vs_rep_l1=np.abs(g_s - o_r).sum()))
120
+ d = pd.DataFrame(rows)
121
+ d.to_csv(OUT / "per_target.csv", index=False)
122
+ summ = []
123
+ for ds, g in d.groupby("cohort", sort=False):
124
+ summ.append(dict(cohort=ds, n_targets=len(g), copy_l1=g.copy_l1.mean(), scsemi_l1=g.scsemi_l1.mean(),
125
+ lora_l1=g.lora_l1.mean(), scsemi_minus_copy=(g.scsemi_l1 - g.copy_l1).mean(),
126
+ scsemi_vs_copy_wilcoxon_p=wilcoxon(g.scsemi_l1, g.copy_l1).pvalue,
127
+ scsemi_vs_rep_l1=g.scsemi_vs_rep_l1.mean(),
128
+ rho_scsemi_copy=spearmanr(g.scsemi_l1, g.copy_l1)[0], rho_lora_copy=spearmanr(g.lora_l1, g.copy_l1)[0],
129
+ rho_scsemi_distance=spearmanr(g.scsemi_l1, g.bulk_distance)[0],
130
+ rho_lora_distance=spearmanr(g.lora_l1, g.bulk_distance)[0]))
131
+ s = pd.DataFrame(summ)
132
+ s.to_csv(OUT / "summary.csv", index=False)
133
+ rng = np.random.default_rng(0)
134
+ prox = []
135
+ for ds in ORDER:
136
+ names, X = bulk_pca(ds)
137
+ n = int(round(np.mean([len(json.loads(draw_file(ds, j, "assignment.json").read_text())["representative_indices"])
138
+ for j in range(5)])))
139
+ km = []
140
+ for seed in range(5): # upstream uses random_state=1; other seeds show stability
141
+ k = KMeans(n_clusters=n, random_state=seed, n_init=10).fit(X)
142
+ reps = [np.flatnonzero(k.labels_ == c)[((X[k.labels_ == c] - k.cluster_centers_[c]) ** 2).sum(1).argmin()]
143
+ for c in range(n)]
144
+ km.append(copy_error(names, X, comps[ds], reps))
145
+ rnd = [copy_error(names, X, comps[ds], rng.choice(len(names), n, replace=False)) for _ in range(200)]
146
+ g = d[d.cohort == ds]
147
+ prox.append(dict(cohort=ds, n_representative_samples=n, copy_l1_our_draws=g.copy_l1.mean(),
148
+ copy_l1_kmeans=float(np.mean(km)), copy_l1_kmeans_sd=float(np.std(km)),
149
+ copy_l1_random_samples=float(np.mean(rnd)), scsemi_l1=g.scsemi_l1.mean(), lora_l1=g.lora_l1.mean()))
150
+ inputs[str(draw_file(ds, 0, "scsemi_project/processed_bulkdata.h5ad"))] = sha(draw_file(ds, 0, "scsemi_project/processed_bulkdata.h5ad"))
151
+ p = pd.DataFrame(prox)
152
+ p.to_csv(OUT / "kmeans_proxy.csv", index=False)
153
+ (OUT / "manifest.json").write_text(json.dumps({"script": str(Path(__file__).resolve()), "script_sha256": sha(Path(__file__)),
154
+ "inputs_sha256": inputs}, indent=1))
155
+ with pd.option_context("display.width", 220):
156
+ print(s.round(3).to_string(index=False))
157
+ print(p.round(3).to_string(index=False))
158
+ return 0
159
+
160
+
161
+ if __name__ == "__main__":
162
+ sys.exit(main())
paper-releases/pbisc-diffusion/updates/20261002T022002Z-deck-time-to-apply-scsemi-reps/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/data/sec09_scsemi_representative_slide_text.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "section": "09-scsemi-representative",
3
+ "scripts": [
4
+ "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/presentations/2026-09-30--paper-summary--r00/tools/sec09_scsemi_representative.py"
5
+ ],
6
+ "generated_from": "tools/sec09_scsemi_representative.py (rerun to refresh; do not edit by hand)",
7
+ "slides": [
8
+ {
9
+ "title": "scSemiProfiler copies its representative",
10
+ "layout": "full",
11
+ "figures": [
12
+ "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/presentations/2026-09-30--paper-summary--r00/figures/sec09_scsemi_representative.png"
13
+ ],
14
+ "keywords": [
15
+ "scSemi-5 never beats copying its representative: 5/5",
16
+ "Its error tracks the representative's: rho 0.57–0.93",
17
+ "LoRA-5 below the copy error in 4/5 cohorts"
18
+ ],
19
+ "footnote_short": "Copy = composition of the one training sample scSemiProfiler assigns to each test sample.",
20
+ "footnote": "Same 25 five-donor draws. scSemiProfiler gives every test sample exactly one representative, the nearest training sample in its bulk PCA (assignment.json), and runs its encoder on that representative's cells. Copy = composition L1 between the test sample's and its representative's observed cells (same frozen scANVI labels as the scorer). Bars: mean over draws of the per-draw mean; dots = draws. scSemi vs copy: paired Wilcoxon over test samples (ImMicro p 1e-33, Sepsis p 0.014, Imperial p 0.91, Giroux p 0.0073, Ji p 0.46). Upstream's own representative choice (KMeans on the same bulk PCA, the sample nearest each centre; proxy, not a rerun) gives a lower copy error than our 5-donor draws in Imperial, Giroux and Ji, where our draws hold all visits of 5 donors and KMeans spreads the same number of samples over as many donors; equal or higher in ImMicro and sepsis. Copy error: ImMicro (5 samples) ours 0.19, KMeans 0.18, random samples 0.19; Sepsis (5 samples) ours 0.58, KMeans 0.61, random samples 0.58; Imperial (14 samples) ours 0.61, KMeans 0.53, random samples 0.56; Giroux (13 samples) ours 0.25, KMeans 0.16, random samples 0.23; Ji (8 samples) ours 0.57, KMeans 0.46, random samples 0.51. Source: plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/.",
21
+ "numbers": [
22
+ {
23
+ "value": "ImMicro: copy 0.187, scSemi-5 0.233 (Wilcoxon vs copy p 1e-33), LoRA-5 0.176; rho scSemi 0.57, LoRA 0.35",
24
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/summary.csv"
25
+ },
26
+ {
27
+ "value": "Sepsis: copy 0.580, scSemi-5 0.612 (Wilcoxon vs copy p 0.014), LoRA-5 0.466; rho scSemi 0.88, LoRA 0.56",
28
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/summary.csv"
29
+ },
30
+ {
31
+ "value": "Imperial: copy 0.608, scSemi-5 0.602 (Wilcoxon vs copy p 0.91), LoRA-5 0.503; rho scSemi 0.93, LoRA 0.55",
32
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/summary.csv"
33
+ },
34
+ {
35
+ "value": "Giroux: copy 0.253, scSemi-5 0.267 (Wilcoxon vs copy p 0.0073), LoRA-5 0.258; rho scSemi 0.81, LoRA 0.08",
36
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/summary.csv"
37
+ },
38
+ {
39
+ "value": "Ji: copy 0.570, scSemi-5 0.591 (Wilcoxon vs copy p 0.46), LoRA-5 0.511; rho scSemi 0.72, LoRA 0.39",
40
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/summary.csv"
41
+ },
42
+ {
43
+ "value": "KMeans proxy, copy error: ImMicro (5 samples) ours 0.19, KMeans 0.18, random samples 0.19; Sepsis (5 samples) ours 0.58, KMeans 0.61, random samples 0.58; Imperial (14 samples) ours 0.61, KMeans 0.53, random samples 0.56; Giroux (13 samples) ours 0.25, KMeans 0.16, random samples 0.23; Ji (8 samples) ours 0.57, KMeans 0.46, random samples 0.51",
44
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/kmeans_proxy.csv"
45
+ }
46
+ ]
47
+ }
48
+ ]
49
+ }
paper-releases/pbisc-diffusion/updates/20261002T022002Z-deck-time-to-apply-scsemi-reps/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/data/sec09_time_to_apply_slide_text.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "section": "09-time",
3
+ "scripts": [
4
+ "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/presentations/2026-09-30--paper-summary--r00/tools/sec09_time_to_apply.py"
5
+ ],
6
+ "generated_from": "tools/sec09_time_to_apply.py (rerun to refresh; do not edit by hand)",
7
+ "slides": [
8
+ {
9
+ "title": "5 donors: time to apply",
10
+ "layout": "full",
11
+ "figures": [
12
+ "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/presentations/2026-09-30--paper-summary--r00/figures/sec09_time_to_apply.png"
13
+ ],
14
+ "keywords": [
15
+ "LoRA-5: 3–11 min per draw, every test sample",
16
+ "scSemiProfiler-5: 1.0–4.1 h per draw",
17
+ "11–63× less GPU time, same 5 donors"
18
+ ],
19
+ "footnote_short": "One GB10 GPU; mean of 5 draws. Data prep and scoring not counted. PBISC pretraining (15.9 h) is done once.",
20
+ "footnote": "Same 25 draws as the previous slides (5 cohorts x 5 draws; same 5 training donors and test samples for both methods). GPU time on one GB10, every step alone on the GPU (shared lock). LoRA-5: fine-tune = RUN.json wall_seconds of the 3,000-step LoRA; generate = wall clock of the sampling job in the queue log (model load + DDIM 50, 1,500 cells per test sample). scSemiProfiler-5 (upstream c2aea02, default budget): stage 1 + stage 2 pretraining of every representative (model receipts) + its per-target inference (5 ministages x 150 epochs, export receipt total_target_seconds). Not counted on either side: CPU data preparation, scoring, work lost to interruptions, and PBISC's one-time pretraining (15.9 h, slide 15), which every cohort reuses. scSemiProfiler time grows with the number of test samples because it trains one model per sample. Per-draw ratio scSemiProfiler / LoRA: ImMicro 15–19×; Sepsis 26–47×; Imperial 19–26×; Giroux 54–63×; Ji 11–20×.",
21
+ "numbers": [
22
+ {
23
+ "value": "ImMicro: LoRA-5 8.4 min (fine-tune 1.9 + generate 6.5), scSemiProfiler-5 141 min (representatives 15 + per-sample models 126); 15–19× per draw; per test sample 4.9 s vs 83 s",
24
+ "source": "data/sec09_time_to_apply.csv"
25
+ },
26
+ {
27
+ "value": "Sepsis: LoRA-5 6.7 min (fine-tune 1.8 + generate 4.9), scSemiProfiler-5 244 min (representatives 30 + per-sample models 214); 26–47× per draw; per test sample 5.2 s vs 190 s",
28
+ "source": "data/sec09_time_to_apply.csv"
29
+ },
30
+ {
31
+ "value": "Imperial: LoRA-5 10.8 min (fine-tune 1.8 + generate 9.0), scSemiProfiler-5 229 min (representatives 32 + per-sample models 197); 19–26× per draw; per test sample 4.5 s vs 96 s",
32
+ "source": "data/sec09_time_to_apply.csv"
33
+ },
34
+ {
35
+ "value": "Giroux: LoRA-5 2.6 min (fine-tune 1.9 + generate 0.7), scSemiProfiler-5 156 min (representatives 117 + per-sample models 38); 54–63× per draw; per test sample 14.8 s vs 872 s",
36
+ "source": "data/sec09_time_to_apply.csv"
37
+ },
38
+ {
39
+ "value": "Ji: LoRA-5 3.4 min (fine-tune 1.8 + generate 1.6), scSemiProfiler-5 57 min (representatives 24 + per-sample models 33); 11–20× per draw; per test sample 8.1 s vs 137 s",
40
+ "source": "data/sec09_time_to_apply.csv"
41
+ }
42
+ ]
43
+ }
44
+ ]
45
+ }
paper-releases/pbisc-diffusion/updates/20261002T022002Z-deck-time-to-apply-scsemi-reps/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/data/slides_spec.json ADDED
@@ -0,0 +1,968 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "deck": {
3
+ "output_pptx": "PBISC-Diffusion_paper_summary_20260930.pptx",
4
+ "paths": "figure paths are relative to the deck folder",
5
+ "note": "footnote = on-slide text (max 2 lines, may be a shortened copy); footnote_full = section author's full text, put in speaker notes when it differs. Generated slide text: section 9 main slides from data/sec09_slide_text.json (sec09_index), other generated slides from the file named in text_source (data/sec09_extra_slide_text.json, data/sec07_rank_sweep_slide_text.json); refresh with tools/sync_sec09_text.py after rerunning the scripts that write them."
6
+ },
7
+ "slides": [
8
+ {
9
+ "kind": "title",
10
+ "title": "PBISC-Diffusion: bulk-to-single-cell generation",
11
+ "subtitle": "Paper summary · 2026-09-30"
12
+ },
13
+ {
14
+ "kind": "agenda",
15
+ "title": "Outline",
16
+ "items": [
17
+ "Model overview: diffusion from bulk to cells",
18
+ "Backbone: SDD, scDiffusion, bulk conditioning",
19
+ "Architecture ablation: width, context, gene panel",
20
+ "SLE benchmark vs scSemiProfiler",
21
+ "Real bulk ≠ pseudobulk: why zero-shot fails",
22
+ "Fine-tuning on paired bulk–sc data",
23
+ "LoRA: compute and ablations (K diversification)",
24
+ "How many bulk–sc pairs are needed",
25
+ "Paired-cohort validation vs scSemiProfiler",
26
+ "Next: cohorts with a paired subset (planned)"
27
+ ]
28
+ },
29
+ {
30
+ "kind": "content",
31
+ "section": "1",
32
+ "section_label": "1 Model overview",
33
+ "title": "PBISC-Diffusion: bulk in, cells out",
34
+ "layout": "full",
35
+ "figures": [
36
+ "figures/sec01_slide_a.png"
37
+ ],
38
+ "keywords": [
39
+ "Train pair: K-cell pseudobulk → each member cell"
40
+ ],
41
+ "footnote": "Fig. 1b redraw. Final model corpus: 33.1M train cells; K = 1–4,000 cells per pseudobulk.",
42
+ "footnote_full": "Top: deck redraw of manuscript Fig. 1b (larger labels; cells differ by x_T and the Bernoulli support draw, Methods 'Support read-out'). Bottom: corpus of final run f01_6k_1x_seed20260627 (index fingerprint matches). Cells per dataset = base + overlay rows (Model 7 e2_full_source/e2_full_index manifests); 33.1M cells in the donor-level 80/10/10 train split. Registered K grid = 8,192 recipes/epoch. Plus 3,658 top-up recipes over 16 epochs (196-283 per epoch, K 1-4,000), so every train cell is a target once (ALLCELL_DATA_CONTRACT.json coverage_after_topup).",
43
+ "sources": "tools/sec01_overview.py; data/sec01_model_numbers.csv, data/sec01_corpus_datasets.csv, data/sec01_recipe_k.csv"
44
+ },
45
+ {
46
+ "kind": "content",
47
+ "section": "1",
48
+ "section_label": "1 Model overview",
49
+ "title": "Denoiser: joint value + support diffusion",
50
+ "layout": "diagram",
51
+ "figures": [
52
+ "figures/sec01_fig1a_denoiser.png"
53
+ ],
54
+ "keywords": [
55
+ "6,000 genes · 54.2M params · Bernoulli support draw"
56
+ ],
57
+ "footnote": "Fig. 1a redraw. Final model f01 6k 1x, epoch 16, EMA; 50 DDIM steps.",
58
+ "footnote_full": "Deck redraw of manuscript Fig. 1a (larger labels, legend dropped). Purple dashed = soft self-conditioning feedback; gold dashed = context to all blocks. Final model f01_6k_1x_seed20260627, checkpoint_epoch_016, EMA; 7 blocks 1024-1024-512-256-512-1024-1024 (effective_config.json, RUN_STATUS.json). Sampling: 50 DDIM steps, η = 0, drawn support read-out, keep gene if u < σ(logit) (methods.tex l.58, l.99). 16 epochs = 16 disjoint 8,192-recipe slots = one pass over the 131,072-recipe pool (manuscript: part 16).",
59
+ "sources": "tools/sec01_overview.py; data/sec01_model_numbers.csv, data/sec01_fig1_label_pt.csv"
60
+ },
61
+ {
62
+ "kind": "content",
63
+ "section": "2",
64
+ "section_label": "2 Backbone",
65
+ "title": "Backbone: SDD → PBISC-Diffusion",
66
+ "layout": "diagram",
67
+ "figures": [
68
+ "figures/sec02_backbone_compare.png"
69
+ ],
70
+ "keywords": [
71
+ "Kept from SDD: value + bit, skip-MLP",
72
+ "Changed: bulk condition, masked loss, Bernoulli read-out"
73
+ ],
74
+ "footnote": "SDD: Ostheimer et al., arXiv 2502.02448. scDiffusion: Luo et al., Bioinformatics 2024.",
75
+ "sources": "tools/sec02_backbone.py; data/sec02_backbone_compare.csv, data/sec02_slide_text.csv, data/refs/",
76
+ "footnote_full": "Luo et al., Bioinformatics 2024; Ostheimer et al., arXiv 2502.02448 (code 1d5423c). PBISC: final model f01 6k 1x, part 16. σ = sigmoid; Bernoulli is the final read-out; the logit > 0 cut is also reported."
77
+ },
78
+ {
79
+ "kind": "content",
80
+ "section": "2",
81
+ "section_label": "2 Backbone",
82
+ "title": "Bulk conditioning",
83
+ "layout": "diagram",
84
+ "figures": [
85
+ "figures/sec02_bulk_conditioning.png"
86
+ ],
87
+ "keywords": [
88
+ "Same bulk condition for every generated cell",
89
+ "Final: no cell types, proportions, sum constraint",
90
+ "18,006 → 512 context into every block"
91
+ ],
92
+ "footnote": "Final model f01 6k 1x. Bar heights schematic.",
93
+ "sources": "tools/sec02_backbone.py; data/sec02_bulk_conditioning.csv, data/sec02_slide_text.csv",
94
+ "footnote_full": "Final model f01 6k 1x, part 16. Bar heights schematic."
95
+ },
96
+ {
97
+ "kind": "content",
98
+ "section": "3",
99
+ "section_label": "3 Architecture ablation",
100
+ "title": "Width & context ablation: loss saturation",
101
+ "layout": "full",
102
+ "figures": [
103
+ "figures/sec03_width_loss.png"
104
+ ],
105
+ "keywords": [
106
+ "Trunk x4: val loss −31% (0.197 → 0.136)",
107
+ "ctx x4, prop hint: loss = 1x",
108
+ "1x flat E8; trunk x4 still falling"
109
+ ],
110
+ "footnote": "Old 6k panel (1% floor); one validation set. 16x: memory-floor stop after part 2.",
111
+ "say": "All arms share the 6k panel (1% floor), corpus, seed and schedule; validation = 192 recipes x 64 cells. ctx x4, both x4 and 16x were read from server_2 snapshots.",
112
+ "sources": "tools/sec03_width_loss.py; data/sec03_width_loss.csv, data/sec03_width_saturation.csv, data/sec03_width_loss_headline.csv"
113
+ },
114
+ {
115
+ "kind": "content",
116
+ "section": "3",
117
+ "section_label": "3 Architecture ablation",
118
+ "title": "Width & context ablation: benchmark",
119
+ "layout": "full",
120
+ "figures": [
121
+ "figures/sec03_width_bench.png"
122
+ ],
123
+ "keywords": [
124
+ "trunk x4: loss −31%, no DEG gain",
125
+ "Prop hint: oracle = predicted, L1 worse",
126
+ "1x kept: ties ctx x4, 54M vs 102M"
127
+ ],
128
+ "footnote": "SLE, 42 donors, 2,980 genes; old 6k panel. ctx x4: better L1 (0.161 vs 0.197).",
129
+ "say": "Bars = mean of parts 14-16 with the cut p > 0.5; diamonds = Bernoulli read-out (4 width arms only). Prop hint = 9 L1 cell-type proportions; older panel, not the final model.",
130
+ "sources": "tools/sec03_width_bench.py; data/sec03_width_bench.csv, data/sec03_width_bench_summary.csv, data/sec03_width_bench_headline.csv"
131
+ },
132
+ {
133
+ "kind": "content",
134
+ "section": "3",
135
+ "section_label": "3 Architecture ablation",
136
+ "title": "Gene context: 2k / 3k / 6k / 15k",
137
+ "layout": "full",
138
+ "figures": [
139
+ "figures/sec03_panel.png"
140
+ ],
141
+ "keywords": [
142
+ "6k ≈ 3k: 3k r, DEG inside 6k seed range",
143
+ "2k best L1; 15k worst r, L1",
144
+ "6k kept: first panel with CLEC9A (cDC1)"
145
+ ],
146
+ "footnote": "SLE, 42 donors, 1,006 genes in every panel. 6k: 5 seeds; base seed best of 5 on r and DEG.",
147
+ "say": "Runs f01_{2k,3k,6k,p15k}_1x, part 16, Bernoulli, EMA, DDIM 50. Different gene axis from the previous slide, so the two slides cannot be compared. Loss curves are divided by each panel's own part-16 value.",
148
+ "sources": "tools/sec03_panel.py; data/sec03_panel_bench.csv, data/sec03_panel_seeds.csv, data/sec03_panel_loss.csv, data/sec03_panel_headline.csv"
149
+ },
150
+ {
151
+ "kind": "content",
152
+ "section": "4",
153
+ "section_label": "4 SLE benchmark",
154
+ "title": "SLE benchmark: PBISC vs scSemiProfiler",
155
+ "layout": "full",
156
+ "figures": [
157
+ "figures/sec04_sle_benchmark.png"
158
+ ],
159
+ "keywords": [
160
+ "42 held-out donors, sc-pseudobulk input",
161
+ "Beats scSemiProfiler on all three metrics",
162
+ "Copying bulk logFC scores higher (backup)"
163
+ ],
164
+ "footnote": "GSE135779, 42 held-out donors (30 SLE / 12 HC). PBISC: 5 seeds, mean ± SD; scSemiProfiler: 1 run.",
165
+ "sources": "tools/sec04_sle_benchmark.py; data/sec04_sle_benchmark.csv, data/sec04_sle_numbers.csv",
166
+ "footnote_full": "GSE135779, 42 held-out donors (30 SLE / 12 HC). PBISC f01 6k E16, 5 seeds (mean ± SD); baselines 1 draw. scSemiProfiler also gets real sc of 14 in-cohort donors (1,500 cells each). Dashed: input bulk logFC copied to every type (backup)."
167
+ },
168
+ {
169
+ "kind": "content",
170
+ "section": "4",
171
+ "section_label": "4 SLE benchmark",
172
+ "title": "SLE benchmark: per cell type",
173
+ "layout": "full",
174
+ "figures": [
175
+ "figures/sec04_sle_per_celltype.png"
176
+ ],
177
+ "keywords": [
178
+ "Beats scSemiProfiler in T, B, Mono, NK",
179
+ "Loses in Other; DC r ties, fewer DEGs",
180
+ "DC: ~15 generated cells per donor"
181
+ ],
182
+ "footnote": "Same 42 donors, 1,006 genes. PBISC: 5 seeds, mean ± SD; scSemiProfiler: 1 run. Other: top-50 of 12.",
183
+ "say": "PBISC's DC top list in the base seed has only 13 genes, because few DC cells are generated.",
184
+ "sources": "tools/sec04_sle_benchmark.py; data/sec04_sle_per_celltype.csv, data/sec04_sle_numbers.csv",
185
+ "footnote_full": "Same 42 donors, 1,006 genes. PBISC 5 seeds (mean ± SD), baselines 1 draw. Tick %: share of 251,179 real cells. Other top-50 is out of 12 truth genes. Bulk copy: r 0.68, top-50 113 (backup)."
186
+ },
187
+ {
188
+ "kind": "content",
189
+ "section": "5",
190
+ "section_label": "5 Real bulk vs pseudobulk",
191
+ "title": "Real bulk ≠ pseudobulk (model input)",
192
+ "layout": "figure_keywords",
193
+ "figures": [
194
+ "figures/sec05_condition_space.png"
195
+ ],
196
+ "keywords": [
197
+ "Real bulk: 2.46 D from own pseudobulk",
198
+ "95% of squared offset is one shift",
199
+ "Shift removed (diagnostic): own donor 7.5% → 75.7%"
200
+ ],
201
+ "footnote": "ImMicro, 107 healthy donors. Model input space (log1p CPM). D = median donor-to-donor distance.",
202
+ "say": "The two pseudobulk clusters on PC1 are sc pools DB1-3 vs DB4-7, so the pairing lines cross mainly because of sc batch. Shift removal subtracts the mean offset of the other 106 donors; a bulk-only deployment would not have them.",
203
+ "sources": "tools/sec05_condition_space.py; data/sec05_condition_space_numbers.csv, data/sec05_condition_space_coords.csv",
204
+ "footnote_full": "ImMicro, 107 healthy donors. Model inputs (log1p CPM, 5,508 genes), not learned ctx. D = median donor-to-donor distance; PCA-30 values are lower bounds (full space 3.19 D, 0.91 shared). Shift removal is a diagnostic that uses paired pseudobulks. Pseudobulk PC1 is sc pool batch (pool R² 0.96 on PC1)."
205
+ },
206
+ {
207
+ "kind": "content",
208
+ "section": "5",
209
+ "section_label": "5 Real bulk vs pseudobulk",
210
+ "title": "Consequence: cells off-manifold",
211
+ "layout": "two_figures",
212
+ "figures": [
213
+ "figures/sec05_cells_umap.png",
214
+ "figures/sec05_cells_metrics.png"
215
+ ],
216
+ "keywords": [
217
+ "Monocytes: raw 30.6% vs real 16.7%",
218
+ "Same noise: 19% of T cells become monocytes",
219
+ "Precision: raw 0.36 vs pseudobulk 0.92"
220
+ ],
221
+ "footnote": "ImMicro, 107 donors; same starting noise for every input. Coverage: raw 0.08, sc pseudobulk 0.51.",
222
+ "footnote_full": "ImMicro, 107 donors. Final model f01 6k 1× E16 (DDIM 50, EMA); each cell starts from the same noise under every input. Precision/coverage from one scoring call. Composition L1: raw 0.455, pseudobulk 0.166, cohort-mean null 0.161. The UMAP is fitted on real cells and overstates overlap.",
223
+ "sources": "tools/sec05_cells_offmanifold.py; data/sec05_cells_metrics.csv, data/sec05_cells_umap_coords.csv"
224
+ },
225
+ {
226
+ "kind": "content",
227
+ "section": "5",
228
+ "section_label": "5 Real bulk vs pseudobulk",
229
+ "title": "Consequence: disease direction flips",
230
+ "layout": "figure_keywords",
231
+ "figures": [
232
+ "figures/sec05_behcet_direction.png"
233
+ ],
234
+ "keywords": [
235
+ "CD16 gap: raw −3.97 vs observed +4.94",
236
+ "C1Q flip vanishes at common depth",
237
+ "sc pseudobulk: right sign in 5/5 seeds"
238
+ ],
239
+ "footnote": "Behçet. Bulk GSE198533 (9 BD / 10 HC); sc GSE198616 (4 / 4, different people) gives observed and pseudobulk.",
240
+ "say": "Raw bulk gives the wrong sign for CD16 and C1Q in 5/5 seeds. At one common monocyte depth the C1Q gap is −0.08 ± 0.09 pp (1/5 seeds positive), so the C1Q flip is a depth effect; the CD16 flip stays at −3.59. sc pseudobulk of the 8 sc donors gives the observed sign in 5/5 seeds (CD16 +5.48, C1Q +1.82). Observed p is descriptive (4 vs 4). No paired data in this cohort, so no fine-tune here.",
241
+ "sources": "tools/sec05_behcet_direction.py; data/sec05_behcet_direction.csv",
242
+ "footnote_full": "Behçet, final model. Bulk GSE198533 (BD 9, HC 10), 5,000 cells per sample; observed = sc GSE198616 (BD 4, HC 4, different people; descriptive p). At common depth, raw CD16 is −3.59 (seed 0) and raw C1Q is −0.08 ± 0.09 pp."
243
+ },
244
+ {
245
+ "kind": "content",
246
+ "section": "6",
247
+ "section_label": "6 Paired fine-tuning",
248
+ "title": "Fine-tuning with paired bulk + sc",
249
+ "layout": "diagram",
250
+ "figures": [
251
+ "figures/sec06_ft_method.png"
252
+ ],
253
+ "keywords": [
254
+ "LoRA 2–14 min vs pretraining 15.9 h"
255
+ ],
256
+ "footnote": "Base: final model f01 6k 1x E16. Times from 40 LoRA runs on this host.",
257
+ "sources": "tools/sec06_finetune_method.py; data/sec06_ft_method.csv",
258
+ "footnote_full": "Receipts: immicro/fold0/real_lora and ye2026_sepsis/fewshot_n5/draw0/lora RUN.json. Base: f01_6k_1x E16. Times: 40 local LoRA runs."
259
+ },
260
+ {
261
+ "kind": "content",
262
+ "section": "7",
263
+ "section_label": "7 LoRA ablations",
264
+ "title": "Full vs LoRA vs cond.-encoder-only",
265
+ "layout": "full",
266
+ "figures": [
267
+ "figures/sec07_ft_modes.png"
268
+ ],
269
+ "keywords": [
270
+ "LoRA ≈ full FT, 42× fewer params",
271
+ "Cond.-encoder-only ≈ ZS + cal. on ImMicro",
272
+ "LoRA beats both on coverage"
273
+ ],
274
+ "footnote": "Fold 0, cond.-enc. vs ZS + cal.: coverage 0.73 vs 0.73 / 0.74 vs 0.63, L1 p 0.06 / 0.93 (ImMicro / sepsis).",
275
+ "sources": "tools/sec07_ft_modes.py; data/sec07_ft_modes_accuracy.csv, data/sec07_ft_modes_compute.csv, data/sec07_ft_modes_wilcoxon.csv",
276
+ "footnote_full": "Base f01_6k_1x E16. ImMicro / sepsis; paired Wilcoxon on donor values, uncorrected. Full vs LoRA L1 p 0.25 / 0.71 (pooled); 42× fewer trainable params (1.3 M). Zero-shot + calibration: α_g = mean CPM(pseudobulk_g) / mean CPM(bulk_g) over the fold's 85–86 / 65–66 paired training donors (train + inner-val); bulk CPM × α, renormalised. The sc-only FT never saw real bulk, so it is fed calibrated bulk. Raw → calibrated zero-shot (pooled): L1 0.45 → 0.20 / 0.51 → 0.40, coverage 0.19 → 0.53 / 0.07 → 0.43, sepsis logFC r −0.01 → 0.12. LoRA vs ZS + cal. (pooled): coverage 0.78 vs 0.53 / 0.83 vs 0.43 (p 7e-19 / 4e-15); L1 0.16 vs 0.20 (p 2e-7) / 0.36 vs 0.40 (p 0.19); logFC r 0.53 vs 0.12. Fold 0, cond.-enc. vs ZS + cal.: L1 0.20 vs 0.17 (p 0.06) / 0.38 vs 0.39 (p 0.93), coverage 0.73 vs 0.73 (p 0.68) / 0.74 vs 0.63 (p 7e-4). Fold 0, LoRA: coverage 0.91 / 0.86; vs cond.-enc. p 4e-5 / 1e-3, vs ZS + cal. p 6e-5 / 3e-4; L1 vs cond.-enc. p 3e-5 / 0.52, vs ZS + cal. p 0.29 / 0.96. sc-only FT (+ cal.), pooled: coverage 0.62 / 0.73, logFC r 0.30. Open = fold-0 pilot; compare same marker only. Per-step time: runs early-stop differently."
277
+ },
278
+ {
279
+ "kind": "content",
280
+ "section": "7",
281
+ "section_label": "7 LoRA ablations",
282
+ "title": "K diversification: no gain",
283
+ "layout": "figure_keywords",
284
+ "figures": [
285
+ "figures/sec07_k_aug.png"
286
+ ],
287
+ "keywords": [
288
+ "No gain; keep single K 1000",
289
+ "Multi-K slightly worse on ImMicro (p 0.04)",
290
+ "Inner-val loss Δ ≤ 1.2e-4"
291
+ ],
292
+ "footnote": "LoRA r16, 5-fold pooled. p = paired Wilcoxon on donor L1, uncorrected.",
293
+ "sources": "tools/sec07_k_aug.py; data/sec07_k_aug.csv, data/sec07_k_aug_wilcoxon.csv, data/sec07_k_aug_inner_val_delta.csv",
294
+ "footnote_full": "LoRA r16 on f01_6k_1x E16, 5-fold pooled. p: paired Wilcoxon, donor L1 vs plain LoRA, uncorrected. Recipes arm: K 1000 real bulk + ½-batch pretraining pseudobulk, no multi-K."
295
+ },
296
+ {
297
+ "kind": "content",
298
+ "section": "8",
299
+ "section_label": "8 Pairs needed",
300
+ "title": "Pairs needed: composition, coverage, training steps",
301
+ "layout": "full",
302
+ "figures": [
303
+ "figures/sec08_pairs_realism.png"
304
+ ],
305
+ "keywords": [
306
+ "Calibration lifts coverage to 0.53 / 0.43",
307
+ "More pairs do not help calibration",
308
+ "LoRA, 5+7 pairs: coverage 0.84 / 0.77"
309
+ ],
310
+ "footnote": "ImMicro / sepsis, 5-fold CV (107 / 82 donors). N+7 = N training + 7 early-stop pairs; squares: same pairs.",
311
+ "footnote_full": "0 = no LoRA training: zero-shot on real bulk (pale) and zero-shot + calibration (dark blue). Calibration α_g = mean CPM(pseudobulk_g) / mean CPM(bulk_g) over all paired training donors of the fold (train + inner-val: 85–86 / 65–66, the same donors LoRA 'all' trains and early-stops on); bulk CPM × α, renormalised. ImMicro L1 axis is broken (zero-shot 0.455). Raw → calibrated: coverage 0.19 → 0.53 / 0.07 → 0.43, L1 0.455 → 0.199 / 0.511 → 0.401. L1 at 5+7 pairs vs raw zero-shot: 0.171 vs 0.455 (ImMicro, p 7e-18), 0.428 vs 0.511 (sepsis, p 0.04). LoRA vs ZS + cal.: coverage higher at every n in both cohorts (p ≤ 4e-15); L1 lower on ImMicro (all pairs 0.162 vs 0.199, p 2e-7) but not on sepsis (0.362 vs 0.401, p 0.19; 5+7 pairs 0.428). With α from the same 5 pairs (few-pair call, its own donors; LoRA fixed 3k steps, no inner-val): coverage 0.54 vs LoRA 0.79 (ImMicro), 0.43 vs 0.69 (sepsis). 20k step cap reached by ImMicro folds 1/5 (10), 4/5 (20), 5/5 (40, all); last 2k steps <0.4% of total loss drop. Squares: zero-shot + calibration with alpha fitted on exactly the pairs each LoRA run saw (N training + its inner-val pairs). Coverage stays 0.52-0.53 (ImMicro) and 0.43-0.44 (sepsis) from 5+7 pairs to all; composition L1 0.19-0.20 / 0.40-0.41. LoRA vs calibration at equal pairs, donor L1: ImMicro better at every n (p <= 0.03); sepsis 5+7 not different (0.428 vs 0.412, p 0.68), lower from 10+7 but not significant (p 0.08-0.32).",
312
+ "say": "Keywords say +7; 2 of 5 sepsis folds use 8 inner-val pairs.",
313
+ "sources": "tools/sec08_pairs_needed.py; data/sec08_pairs_realism.csv, data/sec08_selected_steps.csv, data/sec08_slide_numbers.csv"
314
+ },
315
+ {
316
+ "kind": "content",
317
+ "section": "8",
318
+ "section_label": "8 Pairs needed",
319
+ "title": "Pairs needed: donor and disease signal",
320
+ "layout": "figure_keywords",
321
+ "figures": [
322
+ "figures/sec08_pairs_signal.png"
323
+ ],
324
+ "keywords": [
325
+ "Calibration alone: logFC r ≤ 0.12",
326
+ "LoRA r above broadcast from 10+7 pairs",
327
+ "LoRA DEG passes calibration at 20+7"
328
+ ],
329
+ "footnote": "Sepsis: 61 case vs 21 control. logFC r = mean over T / B / Mono / NK. Raw zero-shot: logFC r −0.01, DEG 9.",
330
+ "footnote_full": "Zero-shot on real bulk: logFC r −0.01, DEG 9, NK r 0.49; zero-shot + calibration (α from all 85–86 / 65–66 fold pairs): 0.12, 11, 0.50; LoRA with all pairs: 0.53, 23, 0.70. LoRA passes ZS + cal. from 5+7 pairs on logFC r (0.29), from 20+7 on DEG (18) and from 20+7 on NK r (0.56). ≤10 pairs: NK r (0.20/0.40) and DEG (5/8) below both zero-shot points. ImMicro fraction r: T at or above raw zero-shot from 20 pairs, at or above ZS + cal. (0.67) from 40; Mono only with all. DEG gain is Mono/DC; T overlap 3 (zero-shot), 5 (ZS + cal.) → 0–1 from 20 pairs; NK 0 at every LoRA n (broadcast T 3, NK 2). Squares: calibration with alpha from the same pairs as each LoRA run. Sepsis logFC r 0.08 / 0.10 / 0.10 / 0.12 (5 / 10 / 20 / 40 + 7 pairs) vs LoRA 0.29 / 0.42 / 0.37 / 0.48; partial r about 0 vs 0.25-0.40; top-50 DEG 12 / 10 / 7 / 7 vs 5 / 8 / 18 / 22. ImMicro NK r 0.50-0.53 at every n vs LoRA 0.20 / 0.40 / 0.56 / 0.70.",
331
+ "sources": "tools/sec08_pairs_needed.py; data/sec08_pairs_signal.csv, data/sec08_slide_numbers.csv"
332
+ },
333
+ {
334
+ "kind": "content",
335
+ "section": "9",
336
+ "section_label": "9 Paired validation",
337
+ "sec09_index": 0,
338
+ "title": "Five paired cohorts",
339
+ "layout": "full",
340
+ "figures": [
341
+ "figures/sec09_cohorts.png"
342
+ ],
343
+ "keywords": [
344
+ "403 paired samples, 275 donors",
345
+ "Only identity-pass pairs; donor-level splits",
346
+ "Ji bulk: whole blood, not PBMC"
347
+ ],
348
+ "footnote": "Usable pair = passed identity check and ≥ 200 cells: 403 of 430 pairs; donor-level splits.",
349
+ "footnote_full": "Usable pair = passed the pairing identity check and >= 200 cells (fold >= 0 in data/<cohort>/folds.csv); dropped 15 identity-fail, 11 borderline and 1 low-cell pairs of 430. ImMicro: no identity flag, all used. Imperial, Giroux, Ji: several pairs per donor. Case vs control = samples in scores/<cohort>/pooled/summary.json. Giroux 'moderate' = GEO 'severe' (paper term); its moderate vs mild subjects are 4F/0M vs 0F/5M (scored), so its disease metrics exclude sex-linked genes. Labels: data/<cohort>/QC_REPORT.md; ImMicro: GEO GSE314922/GSE314416.",
350
+ "sources": "tools/sec09_paired_validation.py; data/sec09_cohorts.csv, data/sec09_quoted_numbers.csv, data/sec09_slide_text.json",
351
+ "numbers": [
352
+ {
353
+ "value": "403 paired samples (sum of usable rows)",
354
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/<cohort>/fewshot_n5/DRAWS.json (n_usable_rows)"
355
+ },
356
+ {
357
+ "value": "275 donors (sum of usable donors)",
358
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/<cohort>/fewshot_n5/DRAWS.json (n_usable_donors)"
359
+ },
360
+ {
361
+ "value": "dropped 15 identity-fail, 11 borderline, 1 < 200 cells, of 430",
362
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/<cohort>/features.npz (identity_pass, identity_check); samples.csv (n_cells); /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/tools/prepare_dataset.py (MIN_CELLS)"
363
+ },
364
+ {
365
+ "value": "ImMicro 107 pairs / 107 donors",
366
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/immicro/fewshot_n5/DRAWS.json"
367
+ },
368
+ {
369
+ "value": "Sepsis 82 pairs / 82 donors; sepsis 61 vs control 21",
370
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/ye2026_sepsis/fewshot_n5/DRAWS.json; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ye2026_sepsis/pooled/summary.json"
371
+ },
372
+ {
373
+ "value": "Imperial 157 pairs / 57 donors; COVID+ 113 vs COVID− 34 (+10 recovery, neither)",
374
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/imperial_eskd/fewshot_n5/DRAWS.json; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/imperial_eskd/pooled/summary.json"
375
+ },
376
+ {
377
+ "value": "Giroux 24 pairs / 9 donors; moderate 11 vs mild 13",
378
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/giroux2022/fewshot_n5/DRAWS.json; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/giroux2022/pooled/summary.json"
379
+ },
380
+ {
381
+ "value": "Ji 33 pairs / 20 donors; ChILI 18 vs ICI control 15",
382
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/ji2025_chili/fewshot_n5/DRAWS.json; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ji2025_chili/pooled/summary.json"
383
+ }
384
+ ]
385
+ },
386
+ {
387
+ "kind": "content",
388
+ "section": "9",
389
+ "section_label": "9 Paired validation",
390
+ "sec09_index": 1,
391
+ "title": "5 donors: LoRA vs scSemiProfiler — cells",
392
+ "layout": "full",
393
+ "figures": [
394
+ "figures/sec09_fewpair_cells.png"
395
+ ],
396
+ "keywords": [
397
+ "LoRA-5 > scSemi-5: coverage, precision 5/5",
398
+ "Beats zero-shot + calibration: coverage 5/5",
399
+ "Lower L1 than calibration: ImMicro only"
400
+ ],
401
+ "footnote": "5 draws per cohort; test = all other usable pairs. Calibration α from the same 5 donors. scANVI labels.",
402
+ "footnote_full": "Base f01 6k·1x·E16 (EMA, DDIM 50) + LoRA r=16, 3,000 steps. LoRA-5 / scSemi-5 = LoRA / scSemiProfiler trained on the same 5 donors (5–15 pairs); test = all other usable pairs. Zero-shot = base model without fine-tuning, fed each test pair's real bulk as measured; zero-shot + calibration = the same model fed that bulk after gene-wise calibration, alpha fitted on the same 5 training donors' pairs (both in the same call as LoRA-5). scSemi-5 scored in a separate call, same test set and reference (sha-checked); 25/25 draws. Verdict = better in >= 80% of shared draws. LoRA-5 lower L1 than scSemi-5 in 4/5 (Giroux split 3/5). LoRA-5 > zero-shot + calibration: coverage 5/5, precision 3/5, depth-matched 5/5 and 3/5 cohorts; > zero-shot (real bulk): coverage 5/5, precision 5/5, depth-matched 5/5 and 4/5. Depth-matched P/C vs scSemi-5: same ranking, coverage LoRA-5 0.83–0.97 vs scSemi-5 0.15–0.28. Composition L1, LoRA-5 minus zero-shot + calibration, per-donor Wilcoxon (gain = p < 0.05): ImMicro -0.03 (p 2e-10), Sepsis +0.02 (p 0.79), Imperial +0.02 (p 0.38), Giroux -0.06 (p 0.38), Ji -0.01 (p 0.70); minus zero-shot (real bulk): ImMicro -0.27 (p 2e-18), Sepsis -0.04 (p 0.15), Imperial -0.35 (p 2e-08), Giroux -0.11 (p 0.04), Ji -0.23 (p 0.02). scANVI labels; P/C = PCA-50, k=10 balls. Scores: scores/<cohort>/fewshot_n5/.",
403
+ "sources": "tools/sec09_paired_validation.py; data/sec09_fewpair_cells.csv, data/sec09_scsemi_status.csv, data/sec09_slide_text.json",
404
+ "numbers": [
405
+ {
406
+ "value": "LoRA-5 vs scSemi-5 coverage (shared-draw means; LoRA-better draws/n; verdict): ImMicro 0.792 vs 0.036 (5/5, lora); Sepsis 0.694 vs 0.080 (5/5, lora); Imperial 0.737 vs 0.059 (5/5, lora); Giroux 0.961 vs 0.607 (5/5, lora); Ji 0.707 vs 0.145 (5/5, lora) -> LoRA verdicts 5/5",
407
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json and draw<j>_scsemi5/summary.json"
408
+ },
409
+ {
410
+ "value": "LoRA-5 vs scSemi-5 precision (shared-draw means; LoRA-better draws/n; verdict): ImMicro 0.952 vs 0.518 (5/5, lora); Sepsis 0.906 vs 0.728 (5/5, lora); Imperial 0.853 vs 0.330 (5/5, lora); Giroux 1.000 vs 0.992 (5/5, lora); Ji 0.978 vs 0.840 (5/5, lora) -> LoRA verdicts 5/5",
411
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json and draw<j>_scsemi5/summary.json"
412
+ },
413
+ {
414
+ "value": "LoRA-5 vs scSemi-5 comp_l1 (shared-draw means; LoRA-better draws/n; verdict): ImMicro 0.176 vs 0.233 (5/5, lora); Sepsis 0.466 vs 0.612 (5/5, lora); Imperial 0.503 vs 0.602 (5/5, lora); Giroux 0.256 vs 0.270 (3/5, split); Ji 0.513 vs 0.592 (4/5, lora) -> LoRA verdicts 4/5",
415
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json and draw<j>_scsemi5/summary.json"
416
+ },
417
+ {
418
+ "value": "LoRA-5 vs scSemi-5 coverage_dm (shared-draw means; LoRA-better draws/n; verdict): ImMicro 0.966 vs 0.284 (5/5, lora); Sepsis 0.834 vs 0.158 (5/5, lora); Imperial 0.863 vs 0.152 (5/5, lora); Giroux 0.974 vs 0.238 (5/5, lora); Ji 0.908 vs 0.150 (5/5, lora) -> LoRA verdicts 5/5",
419
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json and draw<j>_scsemi5/summary.json"
420
+ },
421
+ {
422
+ "value": "LoRA-5 vs scSemi-5 precision_dm (shared-draw means; LoRA-better draws/n; verdict): ImMicro 0.975 vs 0.829 (5/5, lora); Sepsis 0.914 vs 0.504 (5/5, lora); Imperial 0.881 vs 0.429 (5/5, lora); Giroux 0.995 vs 0.426 (5/5, lora); Ji 0.974 vs 0.564 (5/5, lora) -> LoRA verdicts 5/5",
423
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json and draw<j>_scsemi5/summary.json"
424
+ },
425
+ {
426
+ "value": "LoRA-5 vs zero-shot + calibration coverage (same-draw means; LoRA-better draws/n; verdict): ImMicro 0.792 vs 0.535 (5/5, lora); Sepsis 0.694 vs 0.428 (5/5, lora); Imperial 0.737 vs 0.634 (5/5, lora); Giroux 0.961 vs 0.944 (5/5, lora); Ji 0.707 vs 0.114 (5/5, lora) -> LoRA verdicts 5/5",
427
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (arms lora5, zs_cal)"
428
+ },
429
+ {
430
+ "value": "LoRA-5 vs zero-shot + calibration precision (same-draw means; LoRA-better draws/n; verdict): ImMicro 0.952 vs 0.904 (5/5, lora); Sepsis 0.906 vs 0.899 (3/5, split); Imperial 0.853 vs 0.845 (3/5, split); Giroux 1.000 vs 0.996 (4/5, lora); Ji 0.978 vs 0.782 (5/5, lora) -> LoRA verdicts 3/5",
431
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (arms lora5, zs_cal)"
432
+ },
433
+ {
434
+ "value": "LoRA-5 vs zero-shot + calibration comp_l1 (same-draw means; LoRA-better draws/n; verdict): ImMicro 0.176 vs 0.203 (5/5, lora); Sepsis 0.466 vs 0.446 (2/5, split); Imperial 0.503 vs 0.506 (2/5, split); Giroux 0.256 vs 0.288 (2/5, split); Ji 0.513 vs 0.514 (3/5, split) -> LoRA verdicts 1/5",
435
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (arms lora5, zs_cal)"
436
+ },
437
+ {
438
+ "value": "LoRA-5 vs zero-shot + calibration coverage_dm (same-draw means; LoRA-better draws/n; verdict): ImMicro 0.966 vs 0.780 (5/5, lora); Sepsis 0.834 vs 0.658 (5/5, lora); Imperial 0.863 vs 0.681 (5/5, lora); Giroux 0.974 vs 0.937 (5/5, lora); Ji 0.908 vs 0.357 (5/5, lora) -> LoRA verdicts 5/5",
439
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (arms lora5, zs_cal)"
440
+ },
441
+ {
442
+ "value": "LoRA-5 vs zero-shot + calibration precision_dm (same-draw means; LoRA-better draws/n; verdict): ImMicro 0.975 vs 0.940 (5/5, lora); Sepsis 0.914 vs 0.909 (3/5, split); Imperial 0.881 vs 0.868 (3/5, split); Giroux 0.995 vs 0.989 (5/5, lora); Ji 0.974 vs 0.658 (5/5, lora) -> LoRA verdicts 3/5",
443
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (arms lora5, zs_cal)"
444
+ },
445
+ {
446
+ "value": "LoRA-5 vs zero-shot (real bulk) coverage (same-draw means; LoRA-better draws/n; verdict): ImMicro 0.792 vs 0.190 (5/5, lora); Sepsis 0.694 vs 0.076 (5/5, lora); Imperial 0.737 vs 0.114 (5/5, lora); Giroux 0.961 vs 0.472 (5/5, lora); Ji 0.707 vs 0.066 (5/5, lora) -> LoRA verdicts 5/5",
447
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (arms lora5, zs_raw)"
448
+ },
449
+ {
450
+ "value": "LoRA-5 vs zero-shot (real bulk) precision (same-draw means; LoRA-better draws/n; verdict): ImMicro 0.952 vs 0.677 (5/5, lora); Sepsis 0.906 vs 0.625 (5/5, lora); Imperial 0.853 vs 0.500 (5/5, lora); Giroux 1.000 vs 0.980 (5/5, lora); Ji 0.978 vs 0.799 (5/5, lora) -> LoRA verdicts 5/5",
451
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (arms lora5, zs_raw)"
452
+ },
453
+ {
454
+ "value": "LoRA-5 vs zero-shot (real bulk) comp_l1 (same-draw means; LoRA-better draws/n; verdict): ImMicro 0.176 vs 0.445 (5/5, lora); Sepsis 0.466 vs 0.510 (5/5, lora); Imperial 0.503 vs 0.806 (5/5, lora); Giroux 0.256 vs 0.351 (5/5, lora); Ji 0.513 vs 0.721 (5/5, lora) -> LoRA verdicts 5/5",
455
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (arms lora5, zs_raw)"
456
+ },
457
+ {
458
+ "value": "LoRA-5 vs zero-shot (real bulk) coverage_dm (same-draw means; LoRA-better draws/n; verdict): ImMicro 0.966 vs 0.213 (5/5, lora); Sepsis 0.834 vs 0.073 (5/5, lora); Imperial 0.863 vs 0.151 (5/5, lora); Giroux 0.974 vs 0.549 (5/5, lora); Ji 0.908 vs 0.199 (5/5, lora) -> LoRA verdicts 5/5",
459
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (arms lora5, zs_raw)"
460
+ },
461
+ {
462
+ "value": "LoRA-5 vs zero-shot (real bulk) precision_dm (same-draw means; LoRA-better draws/n; verdict): ImMicro 0.975 vs 0.671 (5/5, lora); Sepsis 0.914 vs 0.595 (5/5, lora); Imperial 0.881 vs 0.561 (5/5, lora); Giroux 0.995 vs 0.996 (2/5, split); Ji 0.974 vs 0.480 (5/5, lora) -> LoRA verdicts 4/5",
463
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (arms lora5, zs_raw)"
464
+ },
465
+ {
466
+ "value": "coverage cohort means over all draws: LoRA-5 ImMicro 0.792, Sepsis 0.694, Imperial 0.737, Giroux 0.961, Ji 0.707; scSemi-5 ImMicro 0.036, Sepsis 0.080, Imperial 0.059, Giroux 0.607, Ji 0.145; zero-shot + calibration ImMicro 0.535, Sepsis 0.428, Imperial 0.634, Giroux 0.944, Ji 0.114; zero-shot ImMicro 0.190, Sepsis 0.076, Imperial 0.114, Giroux 0.472, Ji 0.066",
467
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json and draw<j>_scsemi5/summary.json"
468
+ },
469
+ {
470
+ "value": "LoRA-5 minus zero-shot + calibration composition L1, per-donor Wilcoxon (draw-averaged): ImMicro -0.027, n=107, p=2.2e-10; Sepsis +0.018, n=82, p=0.79; Imperial +0.016, n=57, p=0.38; Giroux -0.065, n=8, p=0.38; Ji -0.012, n=20, p=0.7 -> gain in 1/5",
471
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/per_donor.csv; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/<cohort>/folds.csv"
472
+ },
473
+ {
474
+ "value": "LoRA-5 minus zero-shot (real bulk) composition L1, per-donor Wilcoxon (draw-averaged): ImMicro -0.270, n=107, p=2.2e-18; Sepsis -0.044, n=82, p=0.15; Imperial -0.348, n=57, p=1.6e-08; Giroux -0.107, n=8, p=0.039; Ji -0.232, n=20, p=0.017 -> gain in 4/5",
475
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/per_donor.csv; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/<cohort>/folds.csv"
476
+ },
477
+ {
478
+ "value": "scSemiProfiler draws used / LoRA draws: ImMicro 5/5, Sepsis 5/5, Imperial 5/5, Giroux 5/5, Ji 5/5",
479
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/presentations/2026-09-30--paper-summary--r00/data/sec09_scsemi_status.csv"
480
+ },
481
+ {
482
+ "value": "training pairs per draw: ImMicro 5, Sepsis 5, Imperial 12–15, Giroux 12–14, Ji 7–9; test pairs: ImMicro 102, Sepsis 77, Imperial 142–145, Giroux 10–12, Ji 24–26",
483
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/<cohort>/fewshot_n5/DRAWS.json (n_train_rows, n_test_rows)"
484
+ },
485
+ {
486
+ "value": "LoRA r = 16; 3000 fixed steps; base runs/f01_6k_1x_seed20260627/checkpoint_epoch_016.pt; sampling: test donors only, 1,500 cells each, seed 20260927, DDIM 50, EMA, Bernoulli read-out",
487
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/runs/immicro/fewshot_n5/draw0/lora/RUN.json; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/README.md"
488
+ },
489
+ {
490
+ "value": "P/C definition: precision/coverage/density (PCA-50 + k = 10 balls fitted on the scored donors' observed R1 cells); PCA components in every summary.json = 50",
491
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/tools/score_ft.py"
492
+ }
493
+ ]
494
+ },
495
+ {
496
+ "kind": "content",
497
+ "section": "9",
498
+ "section_label": "9 Paired validation",
499
+ "sec09_index": 2,
500
+ "title": "5 donors: LoRA vs scSemiProfiler — disease signal",
501
+ "layout": "figure_keywords",
502
+ "figures": [
503
+ "figures/sec09_fewpair_disease.png"
504
+ ],
505
+ "keywords": [
506
+ "LoRA-5 > scSemi-5: DEG 2/4, logFC r 2/4",
507
+ "logFC r: LoRA-5 > calibrated zero-shot 4/4",
508
+ "Giroux: broadcast r beats all arms"
509
+ ],
510
+ "footnote": "Giroux: sex-linked genes excluded (severity confounded with sex: 4F/0M vs 0F/5M). Top-50 DEG over 5 types.",
511
+ "footnote_full": "Same draws and verdict rule as the previous slide; DEG tie = half the draws equal or mean gap < 1 gene. logFC r = mean over T/B/Mono/NK of case-vs-control log2FC r (generated vs observed); top-50 DEG = Welch+BH overlap summed over 5 types (max 250; Giroux 1–63, Ji 75–250 per draw). Giroux test = 2 vs 2 subjects per draw. LoRA-5-better draws (verdict): vs scSemi-5 logFC r Sepsis split 3/5, Imperial lora 5/5, Giroux scSemi-5 0/5, Ji lora 5/5; DEG Sepsis lora 5/5, Imperial lora 5/5, Giroux tie 1/5, Ji tie 1/5. Vs zero-shot + calibration: logFC r Sepsis lora 4/5, Imperial lora 5/5, Giroux lora 4/5, Ji lora 5/5; DEG Sepsis lora 4/5, Imperial lora 5/5, Giroux tie 1/5, Ji tie 1/5. Vs zero-shot (real bulk): logFC r Sepsis lora 5/5, Imperial lora 5/5, Giroux split 3/5, Ji lora 5/5; DEG Sepsis lora 4/5, Imperial lora 5/5, Giroux tie 1/5, Ji tie 1/5. Broadcast = the input real bulk's own logFC. Giroux: moderate vs mild subjects are 4F/0M vs 0F/5M (scored; all paired subjects 4F/1M vs 0F/5M; sex from bulk chrY expression = sc = GEO), so its disease metrics (logFC r, partial r, top-50 DEG, broadcast) exclude 196 sex-linked genes (43 chrY non-PAR + 153 X-inactivation escape / variable-escape genes of Tukiainen et al. 2017; PAR genes kept), 65 of them scoring genes; same labels and cells as before (scores_nosex/giroux2022/). Scores: scores/<cohort>/fewshot_n5/draw<j>{,_scsemi5}/.",
512
+ "sources": "tools/sec09_paired_validation.py; data/sec09_fewpair_disease.csv, data/sec09_slide_text.json",
513
+ "numbers": [
514
+ {
515
+ "value": "Giroux sex by contrast arm (subjects, F/M): scored moderate 4F/0M vs mild 0F/5M; all paired 4F/1M vs 0F/5M",
516
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/giroux2022/features.npz (sex_bulk_expr = sex_sc_expr = sex_geo); /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/giroux2022/folds.csv"
517
+ },
518
+ {
519
+ "value": "Giroux sex-linked genes excluded from the disease metrics: 196 listed (43 chrY non-PAR + 153 X escape), 65 of 5563 scoring genes",
520
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/sex_linked_genes/sex_linked_genes_exclude.csv; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/sex_linked_genes/BUILD.json; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/pooled/summary.json (gene_exclusion)"
521
+ },
522
+ {
523
+ "value": "Top-50 DEG LoRA-5 vs scSemi-5 (shared-draw means; LoRA-better / tied draws; verdict): Sepsis 16.4 vs 5.2 (5/5, 0 tied, lora); Imperial 113.6 vs 46.8 (5/5, 0 tied, lora); Giroux 0.2 vs 0.0 (1/5, 4 tied, tie); Ji 0.2 vs 0.0 (1/5, 4 tied, tie)",
524
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>{,_scsemi5}/summary.json and contrast.csv (Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/)"
525
+ },
526
+ {
527
+ "value": "Top-50 DEG LoRA-5 vs zero-shot + calibration (shared-draw means; LoRA-better / tied draws; verdict): Sepsis 16.4 vs 9.4 (4/5, 0 tied, lora); Imperial 113.6 vs 103.8 (5/5, 0 tied, lora); Giroux 0.2 vs 0.0 (1/5, 4 tied, tie); Ji 0.2 vs 0.0 (1/5, 4 tied, tie)",
528
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>{,_scsemi5}/summary.json and contrast.csv (Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/)"
529
+ },
530
+ {
531
+ "value": "Top-50 DEG LoRA-5 vs zero-shot (real bulk) (shared-draw means; LoRA-better / tied draws; verdict): Sepsis 16.4 vs 10.0 (4/5, 0 tied, lora); Imperial 113.6 vs 105.6 (5/5, 0 tied, lora); Giroux 0.2 vs 0.0 (1/5, 4 tied, tie); Ji 0.2 vs 0.0 (1/5, 4 tied, tie)",
532
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>{,_scsemi5}/summary.json and contrast.csv (Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/)"
533
+ },
534
+ {
535
+ "value": "logFC r LoRA-5 vs scSemi-5 (shared-draw means; LoRA-better draws; verdict): Sepsis 0.350 vs 0.402 (3/5, split); Imperial 0.749 vs 0.562 (5/5, lora); Giroux 0.297 vs 0.397 (0/5, other); Ji 0.333 vs 0.153 (5/5, lora)",
536
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>{,_scsemi5}/summary.json and contrast.csv (Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/)"
537
+ },
538
+ {
539
+ "value": "logFC r LoRA-5 vs zero-shot + calibration (shared-draw means; LoRA-better draws; verdict): Sepsis 0.350 vs 0.096 (4/5, lora); Imperial 0.749 vs 0.676 (5/5, lora); Giroux 0.297 vs 0.228 (4/5, lora); Ji 0.333 vs 0.140 (5/5, lora)",
540
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>{,_scsemi5}/summary.json and contrast.csv (Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/)"
541
+ },
542
+ {
543
+ "value": "logFC r LoRA-5 vs zero-shot (real bulk) (shared-draw means; LoRA-better draws; verdict): Sepsis 0.350 vs -0.024 (5/5, lora); Imperial 0.749 vs 0.638 (5/5, lora); Giroux 0.297 vs 0.255 (3/5, split); Ji 0.333 vs 0.087 (5/5, lora)",
544
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>{,_scsemi5}/summary.json and contrast.csv (Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/)"
545
+ },
546
+ {
547
+ "value": "Sepsis broadcast logFC r 0.320 vs best arm 0.402; broadcast DEG 20.0 vs best arm 16.4 (means over all draws; arms: zero-shot, zero-shot + calibration, scSemi-5, LoRA-5)",
548
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ye2026_sepsis/fewshot_n5/draw<j>{,_scsemi5}/summary.json"
549
+ },
550
+ {
551
+ "value": "Imperial broadcast logFC r 0.656 vs best arm 0.749; broadcast DEG 74.8 vs best arm 113.6 (means over all draws; arms: zero-shot, zero-shot + calibration, scSemi-5, LoRA-5)",
552
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/imperial_eskd/fewshot_n5/draw<j>{,_scsemi5}/summary.json"
553
+ },
554
+ {
555
+ "value": "Giroux broadcast logFC r 0.492 vs best arm 0.397; broadcast DEG 0.0 vs best arm 0.2 (means over all draws; arms: zero-shot, zero-shot + calibration, scSemi-5, LoRA-5)",
556
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/fewshot_n5/draw<j>{,_scsemi5}/summary.json"
557
+ },
558
+ {
559
+ "value": "Ji broadcast logFC r 0.234 vs best arm 0.333; broadcast DEG 1.0 vs best arm 0.2 (means over all draws; arms: zero-shot, zero-shot + calibration, scSemi-5, LoRA-5)",
560
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ji2025_chili/fewshot_n5/draw<j>{,_scsemi5}/summary.json"
561
+ },
562
+ {
563
+ "value": "DEG maximum per draw: Sepsis 250, Imperial 250, Giroux 1–63, Ji 75–250",
564
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/fewshot_n5/draw<j>/summary.json (deg_top50_max; Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex)"
565
+ },
566
+ {
567
+ "value": "Giroux test subjects per draw: 2 vs 2 (moderate vs mild); test pairs 10–12",
568
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/giroux2022/fewshot_n5/DRAWS.json (train_donors); /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/giroux2022/folds.csv (group)"
569
+ }
570
+ ]
571
+ },
572
+ {
573
+ "kind": "content",
574
+ "section": "9",
575
+ "section_label": "9 Paired validation",
576
+ "text_source": {
577
+ "file": "data/sec09_extra_slide_text.json",
578
+ "index": 0
579
+ },
580
+ "title": "5 donors: realism beyond precision/coverage",
581
+ "layout": "full",
582
+ "figures": [
583
+ "figures/sec09_extra_fewpair.png"
584
+ ],
585
+ "keywords": [
586
+ "Classifier AUC: LoRA-5 best in 25/25 draws",
587
+ "E_N: LoRA-5 below scSemi-5 in 25/25 draws",
588
+ "Still separable: LoRA-5 AUC 0.89–0.95"
589
+ ],
590
+ "footnote": "E_N: scSemiProfiler's own error metric. Misses only vs calibration, e.g. Imperial E_N 1.28 vs 1.22.",
591
+ "footnote_full": "Same 5-donor draws as the previous slides; every metric on exactly the scored cells (scores_extra/, tools/extra_metrics.py). Real side for AUC and MMD² = held-out real cells of the same samples (R2), projected like the generated cells; real vs real = R2 vs R3 (AUC 0.49–0.50). Classifier AUC: 5-fold CV ROC AUC of a kNN classifier (k = 5) separating real from generated cells, 0.5 = indistinguishable; bars start at 0.5. MMD²: unbiased, Gaussian kernel, bandwidth = median distance among real cells. E_N: scSemiProfiler's normalized error (Wang et al. 2024, eq. 17–18), their code's squared L2 on all cells, per-arm PCA-100; real vs real = within-sample half split (0.07–0.38); every generated arm is above 1. LoRA-5 best of the 4 arms in 25/25 draws on kNN AUC, 25/25 on RF AUC, 25/25 on 1-NN accuracy, 23/25 on MMD², 22/25 on E_N. LoRA-5 better than scSemi-5, zero-shot and zero-shot + calibration on both AUCs, 1-NN accuracy and coverage at k = 3, 5, 10 in every draw. E_N scSemi-5 vs LoRA-5 (cohort means): ImMicro 3.65 vs 1.55; Sepsis 3.83 vs 1.46; Imperial 2.04 vs 1.28; Giroux 3.79 vs 1.99; Ji 4.27 vs 2.60; LoRA-5 lower in 25/25 draws. Draws where LoRA-5 is worse (cohort means in brackets): vs zero-shot + calibration: Sepsis precision k5 1/5 (0.778 vs 0.752), precision k10 2/5 (0.906 vs 0.899); Imperial MMD² (σ = m) 1/5 (0.0156 vs 0.0218), MMD² (σ sum) 1/5 (0.0443 vs 0.0673), E_N (all cells) 3/5 (1.28 vs 1.22), precision k3 2/5 (0.610 vs 0.598), precision k5 2/5 (0.726 vs 0.719), precision k10 2/5 (0.853 vs 0.845); Giroux MMD² (σ = m) 1/5 (0.0178 vs 0.0257), MMD² (σ sum) 1/5 (0.0584 vs 0.0838), precision k5 1/5 (0.995 vs 0.981), precision k10 1/5 (1.000 vs 0.996). LoRA-5 AUC per draw 0.88–0.97 (kNN), RF cohort means 0.90–0.96: a classifier still tells generated from real cells. Scores: scores_extra/<cohort>/fewshot_n5/draw<j>/.",
592
+ "sources": "tools/sec09_extra_metrics.py; data/sec09_extra_fewpair.csv, data/sec09_extra_quoted_numbers.csv; plans/paired_finetune_intradataset_20260927/scores_extra/ (README.md, TABLES.md)",
593
+ "numbers": [
594
+ {
595
+ "value": "LoRA-5 best of 4 arms (draws): kNN AUC 25/25, RF AUC 25/25, 1-NN 25/25, MMD² 23/25, E_N 22/25",
596
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/fewshot_n5/draw<j>/{metrics,en}.csv"
597
+ },
598
+ {
599
+ "value": "E_N LoRA-5 < scSemi-5 in 25/25 draws; cohort means scSemi-5 vs LoRA-5: ImMicro 3.65 vs 1.55; Sepsis 3.83 vs 1.46; Imperial 2.04 vs 1.28; Giroux 3.79 vs 1.99; Ji 4.27 vs 2.60",
600
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/fewshot_n5/draw<j>/en.csv (cellset all, distance sq)"
601
+ },
602
+ {
603
+ "value": "LoRA-5 kNN AUC cohort means: ImMicro 0.943, Sepsis 0.936, Imperial 0.918, Giroux 0.893, Ji 0.955; per draw 0.878–0.975",
604
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/fewshot_n5/draw<j>/{metrics,en}.csv"
605
+ },
606
+ {
607
+ "value": "real vs real: kNN AUC ImMicro 0.502, Sepsis 0.501, Imperial 0.498, Giroux 0.495, Ji 0.491; E_N ImMicro 0.382, Sepsis 0.100, Imperial 0.260, Giroux 0.145, Ji 0.073",
608
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/fewshot_n5/draw<j>/{metrics,en}.csv"
609
+ },
610
+ {
611
+ "value": "LoRA-5 worse than a comparator (draws): vs zero-shot + calibration: Sepsis precision k5 1/5 (0.778 vs 0.752), precision k10 2/5 (0.906 vs 0.899); Imperial MMD² (σ = m) 1/5 (0.0156 vs 0.0218), MMD² (σ sum) 1/5 (0.0443 vs 0.0673), E_N (all cells) 3/5 (1.28 vs 1.22), precision k3 2/5 (0.610 vs 0.598), precision k5 2/5 (0.726 vs 0.719), precision k10 2/5 (0.853 vs 0.845); Giroux MMD² (σ = m) 1/5 (0.0178 vs 0.0257), MMD² (σ sum) 1/5 (0.0584 vs 0.0838), precision k5 1/5 (0.995 vs 0.981), precision k10 1/5 (1.000 vs 0.996)",
612
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/fewshot_n5/draw<j>/{metrics,en}.csv"
613
+ },
614
+ {
615
+ "value": "cross-check: 720 cohort × arm × metric values equal scores_extra/{fewshot,pooled}_headline.csv",
616
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/fewshot_headline.csv; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/pooled_headline.csv"
617
+ }
618
+ ]
619
+ },
620
+ {
621
+ "kind": "content",
622
+ "section": "9",
623
+ "section_label": "9 Paired validation",
624
+ "text_source": {
625
+ "file": "data/sec09_time_to_apply_slide_text.json",
626
+ "index": 0
627
+ },
628
+ "title": "5 donors: time to apply",
629
+ "layout": "full",
630
+ "figures": [
631
+ "figures/sec09_time_to_apply.png"
632
+ ],
633
+ "keywords": [
634
+ "LoRA-5: 3–11 min per draw, every test sample",
635
+ "scSemiProfiler-5: 1.0–4.1 h per draw",
636
+ "11–63× less GPU time, same 5 donors"
637
+ ],
638
+ "footnote": "One GB10 GPU; mean of 5 draws. Data prep and scoring not counted. PBISC pretraining (15.9 h) is done once.",
639
+ "sources": "tools/sec09_time_to_apply.py; data/sec09_time_to_apply.csv, data/sec09_time_to_apply_runs.csv",
640
+ "footnote_full": "Same 25 draws as the previous slides (5 cohorts x 5 draws; same 5 training donors and test samples for both methods). GPU time on one GB10, every step alone on the GPU (shared lock). LoRA-5: fine-tune = RUN.json wall_seconds of the 3,000-step LoRA; generate = wall clock of the sampling job in the queue log (model load + DDIM 50, 1,500 cells per test sample). scSemiProfiler-5 (upstream c2aea02, default budget): stage 1 + stage 2 pretraining of every representative (model receipts) + its per-target inference (5 ministages x 150 epochs, export receipt total_target_seconds). Not counted on either side: CPU data preparation, scoring, work lost to interruptions, and PBISC's one-time pretraining (15.9 h, slide 15), which every cohort reuses. scSemiProfiler time grows with the number of test samples because it trains one model per sample. Per-draw ratio scSemiProfiler / LoRA: ImMicro 15–19×; Sepsis 26–47×; Imperial 19–26×; Giroux 54–63×; Ji 11–20×.",
641
+ "numbers": [
642
+ {
643
+ "value": "ImMicro: LoRA-5 8.4 min (fine-tune 1.9 + generate 6.5), scSemiProfiler-5 141 min (representatives 15 + per-sample models 126); 15–19× per draw; per test sample 4.9 s vs 83 s",
644
+ "source": "data/sec09_time_to_apply.csv"
645
+ },
646
+ {
647
+ "value": "Sepsis: LoRA-5 6.7 min (fine-tune 1.8 + generate 4.9), scSemiProfiler-5 244 min (representatives 30 + per-sample models 214); 26–47× per draw; per test sample 5.2 s vs 190 s",
648
+ "source": "data/sec09_time_to_apply.csv"
649
+ },
650
+ {
651
+ "value": "Imperial: LoRA-5 10.8 min (fine-tune 1.8 + generate 9.0), scSemiProfiler-5 229 min (representatives 32 + per-sample models 197); 19–26× per draw; per test sample 4.5 s vs 96 s",
652
+ "source": "data/sec09_time_to_apply.csv"
653
+ },
654
+ {
655
+ "value": "Giroux: LoRA-5 2.6 min (fine-tune 1.9 + generate 0.7), scSemiProfiler-5 156 min (representatives 117 + per-sample models 38); 54–63× per draw; per test sample 14.8 s vs 872 s",
656
+ "source": "data/sec09_time_to_apply.csv"
657
+ },
658
+ {
659
+ "value": "Ji: LoRA-5 3.4 min (fine-tune 1.8 + generate 1.6), scSemiProfiler-5 57 min (representatives 24 + per-sample models 33); 11–20× per draw; per test sample 8.1 s vs 137 s",
660
+ "source": "data/sec09_time_to_apply.csv"
661
+ }
662
+ ]
663
+ },
664
+ {
665
+ "kind": "content",
666
+ "section": "9",
667
+ "section_label": "9 Paired validation",
668
+ "sec09_index": 3,
669
+ "title": "All pairs, 5-fold",
670
+ "layout": "full",
671
+ "figures": [
672
+ "figures/sec09_fivefold.png"
673
+ ],
674
+ "keywords": [
675
+ "LoRA tops coverage 5/5, logFC r 4/4",
676
+ "Ji whole blood: LoRA 0.86, others 0.06–0.11",
677
+ "Giroux: broadcast r 0.58 > LoRA 0.46"
678
+ ],
679
+ "footnote": "Donor-level 5-fold CV. Giroux: sex-linked genes excluded (severity confounded with sex: 4F/0M vs 0F/5M).",
680
+ "footnote_full": "Donor-level 5-fold CV; each pair scored once, by the fold model that never trained on its donor (one pooled call per cohort). LoRA r=16 on all training donors' real bulk, early stop on inner-val donors. Zero-shot = base model without fine-tuning, fed the test pair's real bulk as measured; zero-shot + calibration = the same model fed gene-wise calibrated bulk (alpha fitted on the fold's training donors); sc-only fine-tune (+ calibration) = full fine-tune on training donors' sc pseudobulk, fed calibrated bulk. Base f01 6k·1x·E16. LoRA best of 4 arms: coverage 5/5, logFC r 4/4, top-50 DEG 4/4. Broadcast = raw real bulk. Sepsis DEG from pooled_deg. Giroux: moderate vs mild subjects are 4F/0M vs 0F/5M (scored; all paired subjects 4F/1M vs 0F/5M; sex from bulk chrY expression = sc = GEO), so its disease metrics (logFC r, partial r, top-50 DEG, broadcast) exclude 196 sex-linked genes (43 chrY non-PAR + 153 X-inactivation escape / variable-escape genes of Tukiainen et al. 2017; PAR genes kept), 65 of them scoring genes; same labels and cells as before (scores_nosex/giroux2022/). Scores: scores/<cohort>/pooled/summary.json.",
681
+ "sources": "tools/sec09_paired_validation.py; data/sec09_fivefold.csv, data/sec09_slide_text.json",
682
+ "numbers": [
683
+ {
684
+ "value": "LoRA best of 4 arms: coverage 5/5, logFC r 4/4, top-50 DEG 4/4",
685
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/pooled/summary.json (Sepsis DEG: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ye2026_sepsis/pooled_deg/summary.json; Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/pooled/summary.json)"
686
+ },
687
+ {
688
+ "value": "Ji coverage: zero-shot 0.055, zero-shot + calibration 0.106, sc-only (+ calibration) 0.113, LoRA 0.857",
689
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ji2025_chili/pooled/summary.json"
690
+ },
691
+ {
692
+ "value": "Giroux logFC r: broadcast 0.575 vs LoRA 0.461; DEG broadcast 5 vs LoRA 5",
693
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/pooled/summary.json"
694
+ },
695
+ {
696
+ "value": "LoRA logFC r vs broadcast: Sepsis 0.527 vs 0.316, Imperial 0.819 vs 0.661, Giroux 0.461 vs 0.575, Ji 0.479 vs 0.240",
697
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/pooled/summary.json (Sepsis DEG: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ye2026_sepsis/pooled_deg/summary.json; Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/pooled/summary.json)"
698
+ },
699
+ {
700
+ "value": "coverage LoRA / zero-shot + calibration / zero-shot / sc-only (+ calibration): ImMicro 0.784 / 0.527 / 0.192 / 0.623, Sepsis 0.829 / 0.431 / 0.067 / 0.726, Imperial 0.850 / 0.639 / 0.112 / 0.555, Giroux 0.928 / 0.906 / 0.281 / 0.908, Ji 0.857 / 0.106 / 0.055 / 0.113",
701
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/pooled/summary.json (Sepsis DEG: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ye2026_sepsis/pooled_deg/summary.json; Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/pooled/summary.json)"
702
+ },
703
+ {
704
+ "value": "logFC r LoRA / zero-shot + calibration / zero-shot / sc-only (+ calibration): Sepsis 0.527 / 0.123 / -0.012 / 0.296, Imperial 0.819 / 0.679 / 0.644 / 0.808, Giroux 0.461 / 0.269 / 0.334 / 0.344, Ji 0.479 / 0.142 / 0.084 / 0.245",
705
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/pooled/summary.json (Sepsis DEG: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ye2026_sepsis/pooled_deg/summary.json; Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/pooled/summary.json)"
706
+ },
707
+ {
708
+ "value": "top-50 DEG LoRA / zero-shot + calibration / zero-shot / sc-only (+ calibration): Sepsis 23 / 11 / 9 / 15, Imperial 143 / 111 / 106 / 129, Giroux 5 / 0 / 1 / 0, Ji 15 / 0 / 0 / 0",
709
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/pooled/summary.json (Sepsis DEG: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ye2026_sepsis/pooled_deg/summary.json; Giroux: /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_nosex/giroux2022/pooled/summary.json)"
710
+ },
711
+ {
712
+ "value": "Pooled n (pairs / donors): ImMicro 107/107, Sepsis 82/82, Imperial 157/57, Giroux 24/9, Ji 33/20",
713
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/<cohort>/pooled/summary.json (n_donors); /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/data/<cohort>/fewshot_n5/DRAWS.json"
714
+ },
715
+ {
716
+ "value": "early stopping: About 10 % of each fold's training donors are inner-validation, used only for early stopping",
717
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/README.md"
718
+ }
719
+ ]
720
+ },
721
+ {
722
+ "kind": "content",
723
+ "section": "10",
724
+ "section_label": "10 Paired-subset cohorts",
725
+ "title": "Next: cohorts with a paired subset (planned)",
726
+ "layout": "figure_keywords",
727
+ "figures": [
728
+ "figures/sec10_paired_subset_cohorts.png"
729
+ ],
730
+ "keywords": [
731
+ "Train LoRA on pairs, generate bulk-only",
732
+ "Sepsis controls: 21 paired + 54 bulk-only",
733
+ "ChILI pre-ICI: 11 bulk, 4 unpaired sc"
734
+ ],
735
+ "footnote": "Counts from pairing manifests. Model: f01 6k 1x E16 + LoRA r16.",
736
+ "say": "Planned: no LoRA cells exist yet for any bulk-only sample. Ji bulk is PAXgene whole blood. Only 7 of the Arunachalam pairs are strict same-visit pairs. Asan is omitted because it has no donor map.",
737
+ "sources": "tools/sec10_paired_subset_cohorts.py; data/sec10_cohort_counts.csv, data/sec10_bulk_only_groups.csv, data/sec10_quoted_numbers.csv",
738
+ "footnote_full": "Counts from pairing manifests. QC = identity check (Imperial also >=200 cells); sex-flag = bulk sex differs from metadata or is ambiguous. Not shown: Asan (no donor map), Giroux (24 pairs, 17 bulk-only; broadcast beats LoRA). Model: f01 6k 1x E16 + LoRA r16."
739
+ },
740
+ {
741
+ "kind": "divider",
742
+ "title": "Backup"
743
+ },
744
+ {
745
+ "kind": "content",
746
+ "section": "4",
747
+ "section_label": "Backup · 4 SLE benchmark",
748
+ "backup": true,
749
+ "title": "Bulk broadcast baseline",
750
+ "layout": "full",
751
+ "figures": [
752
+ "figures/sec04_sle_broadcast.png"
753
+ ],
754
+ "keywords": [
755
+ "Bulk logFC copied: r 0.68 vs 0.37",
756
+ "Type-specific part: partial r 0.21",
757
+ "scSemiProfiler: r 0.32, partial r 0.17"
758
+ ],
759
+ "footnote": "SLE, 42 donors, 1,006 genes. Partial r: both logFCs residualised on bulk logFC.",
760
+ "sources": "tools/sec04_sle_benchmark.py; data/sec04_sle_broadcast.csv, data/sec04_sle_numbers.csv",
761
+ "footnote_full": "SLE held-out, 42 donors, 1,006 genes; PBISC 5 seeds. Partial r: truth and method logFC residualised on bulk logFC. Broadcast has no residual, so it is not scored. Split-half and BayesPrism checks: sle_broadcast/RESULTS.md."
762
+ },
763
+ {
764
+ "kind": "content",
765
+ "section": "5",
766
+ "section_label": "Backup · 5 Real bulk vs pseudobulk",
767
+ "backup": true,
768
+ "title": "Same shift in three paired cohorts",
769
+ "layout": "full",
770
+ "figures": [
771
+ "figures/sec05_shift_cohorts.png"
772
+ ],
773
+ "keywords": [
774
+ "Shared shift in all 3 cohorts"
775
+ ],
776
+ "footnote": "Model inputs only, no generation. PCA fitted per cohort on sc pseudobulks.",
777
+ "sources": "tools/sec05_shift_cohorts.py; data/sec05_shift_cohorts.csv",
778
+ "footnote_full": "Model inputs only, no generation. PCA is fitted on each cohort's sc pseudobulks (Arunachalam: 11 PCs, n = 12). D uses same-condition pairs only for Randolph and Arunachalam. Shift removal is a leave-one-out diagnostic."
779
+ },
780
+ {
781
+ "kind": "content",
782
+ "section": "6",
783
+ "section_label": "Backup · 6 Paired fine-tuning",
784
+ "backup": true,
785
+ "title": "Evaluation design",
786
+ "layout": "full",
787
+ "figures": [
788
+ "figures/sec06_eval_design.png"
789
+ ],
790
+ "keywords": [
791
+ "Donor-level splits; test donors never trained",
792
+ "5-fold: other folds · few: 5 donors",
793
+ "Giroux few-pair trains 12–14 of 24 pairs"
794
+ ],
795
+ "footnote": "Bars: Ye 2026 sepsis. QC-failed pairs excluded.",
796
+ "sources": "tools/sec06_finetune_method.py; data/sec06_eval_design.csv, data/sec06_eval_design_sepsis_roles.csv",
797
+ "footnote_full": "Counts: data/<cohort>/folds.csv and fewshot_n5/DRAWS.json; QC-failed pairs (fold −1) excluded. Bars: Ye 2026 sepsis."
798
+ },
799
+ {
800
+ "kind": "content",
801
+ "section": "7",
802
+ "section_label": "Backup · 7 LoRA ablations",
803
+ "backup": true,
804
+ "text_source": {
805
+ "file": "data/sec07_rank_sweep_slide_text.json",
806
+ "index": 0
807
+ },
808
+ "title": "LoRA rank: r = 4, 16, 64",
809
+ "layout": "full",
810
+ "figures": [
811
+ "figures/sec07_rank_sweep.png"
812
+ ],
813
+ "keywords": [
814
+ "ImMicro r64, all pairs: coverage 0.78 → 0.82",
815
+ "ImMicro r4, all pairs: L1 0.162 → 0.186",
816
+ "Kept r16; r64 precision 0.92 → 0.90"
817
+ ],
818
+ "footnote": "Sepsis, all pairs: r64 logFC r 0.53 → 0.55, DEG 23 → 26; r4 0.48, DEG 18. Pooled 5-fold scores.",
819
+ "footnote_full": "LoRA fine-tune of the final model (f01 6k·1x·E16) with rank r and alpha = r, same recipe as the deck's r = 16 runs (early stop on 7–8 inner-val pairs, 20k step cap); n = training pairs, nested subsets; donor-level 5-fold CV, each pair scored once by its fold model (pooled call). Trainable parameters r4 324,056, r16 1,296,224, r64 5,184,896. ImMicro n = 5: r4: L1 0.162, P/C 0.937 / 0.789 (L1 vs r16 -0.009, Wilcoxon p 0.00088, 107 donors); r16: L1 0.171, P/C 0.946 / 0.839; r64: L1 0.177, P/C 0.946 / 0.847 (L1 vs r16 +0.005, Wilcoxon p 0.0076, 107 donors) | ImMicro n = 20: r4: L1 0.171, P/C 0.925 / 0.715 (L1 vs r16 -0.001, Wilcoxon p 0.32, 107 donors); r16: L1 0.172, P/C 0.920 / 0.755; r64: L1 0.172, P/C 0.905 / 0.794 (L1 vs r16 -0.001, Wilcoxon p 0.66, 107 donors) | ImMicro n = all: r4: L1 0.186, P/C 0.933 / 0.712 (L1 vs r16 +0.024, Wilcoxon p 9.8e-09, 107 donors); r16: L1 0.162, P/C 0.924 / 0.784; r64: L1 0.161, P/C 0.904 / 0.816 (L1 vs r16 -0.001, Wilcoxon p 0.89, 107 donors) | Sepsis n = 5: r4: L1 0.426, P/C 0.907 / 0.742, logFC r 0.27, DEG 2 (L1 vs r16 -0.002, Wilcoxon p 0.97, 82 donors); r16: L1 0.428, P/C 0.911 / 0.767, logFC r 0.29, DEG 5; r64: L1 0.429, P/C 0.906 / 0.766, logFC r 0.31, DEG 1 (L1 vs r16 +0.001, Wilcoxon p 0.66, 82 donors) | Sepsis n = 20: r4: L1 0.378, P/C 0.929 / 0.769, logFC r 0.31, DEG 14 (L1 vs r16 -0.003, Wilcoxon p 0.58, 82 donors); r16: L1 0.380, P/C 0.927 / 0.807, logFC r 0.37, DEG 18; r64: L1 0.376, P/C 0.911 / 0.808, logFC r 0.43, DEG 18 (L1 vs r16 -0.004, Wilcoxon p 0.046, 82 donors) | Sepsis n = all: r4: L1 0.363, P/C 0.923 / 0.789, logFC r 0.48, DEG 18 (L1 vs r16 +0.002, Wilcoxon p 0.77, 82 donors); r16: L1 0.362, P/C 0.926 / 0.829, logFC r 0.53, DEG 23; r64: L1 0.367, P/C 0.907 / 0.824, logFC r 0.55, DEG 26 (L1 vs r16 +0.005, Wilcoxon p 0.66, 82 donors). r64 vs r16 brings small gains in coverage and disease signal but slightly lower precision and no composition change; r4 is worse with many pairs; at n = 5 the ranks are mixed. r = 16 is kept. Scores: scores/<cohort>/lora_rank_20261001/pooled (r4, r64) and scores/<cohort>/pooled{,_deg} (r16); table: scores/<cohort>/rankcal_20261001.md.",
820
+ "sources": "tools/sec07_rank_sweep.py; data/sec07_rank_sweep.csv, data/sec07_rank_sweep_runs.csv; plans/paired_finetune_intradataset_20260927/scores/<cohort>/rankcal_20261001.md",
821
+ "numbers": [
822
+ {
823
+ "value": "ImMicro all pairs coverage r16 0.784 -> r64 0.816; precision 0.924 -> 0.904; L1 r16 0.162, r4 0.186 (Wilcoxon p 9.8e-09)",
824
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/immicro/pooled/summary.json; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/immicro/lora_rank_20261001/pooled/summary.json, per_donor.csv"
825
+ },
826
+ {
827
+ "value": "Sepsis all pairs logFC r r16 0.527, r64 0.553, r4 0.476; DEG 23 / 26 / 18",
828
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ye2026_sepsis/pooled_deg/summary.json, contrast.csv; /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores/ye2026_sepsis/lora_rank_20261001/pooled/summary.json, contrast.csv"
829
+ },
830
+ {
831
+ "value": "trainable parameters: r4 324056, r16 1296224, r64 5184896",
832
+ "source": "runs/<cohort>/fold<k>/<arm>/RUN.json (trainable.n_trainable)"
833
+ }
834
+ ]
835
+ },
836
+ {
837
+ "kind": "content",
838
+ "section": "9",
839
+ "section_label": "Backup · 9 Paired validation",
840
+ "backup": true,
841
+ "text_source": {
842
+ "file": "data/sec09_extra_slide_text.json",
843
+ "index": 1
844
+ },
845
+ "title": "5-fold: realism beyond precision/coverage",
846
+ "layout": "full",
847
+ "figures": [
848
+ "figures/sec09_extra_fivefold.png"
849
+ ],
850
+ "keywords": [
851
+ "Every metric: LoRA first in 5/5 cohorts",
852
+ "Ji whole blood: E_N 1.9 vs 7.1–10.1",
853
+ "Still separable: LoRA AUC 0.87–0.94"
854
+ ],
855
+ "footnote": "Donor-level 5-fold CV, one pooled call per cohort. E_N: scSemiProfiler's own error metric.",
856
+ "footnote_full": "Donor-level 5-fold CV; each pair scored once by the fold model that never trained on its donor (one pooled call per cohort, all cross-fitted pairs). Arms as on the 5-fold slide. Metric definitions as on the 5-donor realism slide. LoRA first among the 4 arms in all 5 cohorts on 12/12 headline metrics (kNN and RF AUC, 1-NN accuracy, MMD² at σ = m and summed, E_N all cells, precision and coverage at k = 3, 5, 10). LoRA kNN AUC ImMicro 0.941, Sepsis 0.886, Imperial 0.866, Giroux 0.881, Ji 0.908; real vs real ImMicro 0.505, Sepsis 0.506, Imperial 0.496, Giroux 0.501, Ji 0.494. E_N LoRA vs other arms: ImMicro 1.56 vs 1.77–4.83; Sepsis 1.20 vs 1.40–5.29; Imperial 1.13 vs 1.19–4.05; Giroux 1.70 vs 2.24–4.48; Ji 1.95 vs 7.08–10.13. scSemiProfiler 5-fold CV not available yet (no extra-metric unit with set scsemi__raw). Scores: scores_extra/<cohort>/pooled/.",
857
+ "sources": "tools/sec09_extra_metrics.py; data/sec09_extra_fivefold.csv, data/sec09_extra_scsemi_status.csv; plans/paired_finetune_intradataset_20260927/scores_extra/",
858
+ "numbers": [
859
+ {
860
+ "value": "LoRA first among 4 arms in all 5 cohorts on 12/12 metrics",
861
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/pooled/{metrics,en}.csv"
862
+ },
863
+ {
864
+ "value": "Ji E_N: LoRA 1.948; Zero-shot, real bulk 10.125, Zero-shot + calibration 7.076, sc-only fine-tune (+ calibration) 7.215",
865
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/pooled/{metrics,en}.csv"
866
+ },
867
+ {
868
+ "value": "LoRA kNN AUC (pooled): ImMicro 0.941, Sepsis 0.886, Imperial 0.866, Giroux 0.881, Ji 0.908",
869
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/pooled/{metrics,en}.csv"
870
+ },
871
+ {
872
+ "value": "scSemiProfiler, all training pairs: not available",
873
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/presentations/2026-09-30--paper-summary--r00/data/sec09_extra_scsemi_status.csv"
874
+ }
875
+ ]
876
+ },
877
+ {
878
+ "kind": "content",
879
+ "section": "9",
880
+ "section_label": "Backup · 9 Paired validation",
881
+ "backup": true,
882
+ "text_source": {
883
+ "file": "data/sec09_extra_slide_text.json",
884
+ "index": 2
885
+ },
886
+ "title": "5 donors: precision/coverage at k = 3, 5, 10",
887
+ "layout": "full",
888
+ "figures": [
889
+ "figures/sec09_extra_ksens.png"
890
+ ],
891
+ "keywords": [
892
+ "Smaller k lowers every set, real included",
893
+ "Coverage: LoRA-5 first at all k, 25/25",
894
+ "Precision: LoRA-5 first in 20–23/25 draws"
895
+ ],
896
+ "footnote": "5 donors, 5 draws per cohort; error bars = SD over draws. k = 10 is the value on the main slides.",
897
+ "footnote_full": "Precision and coverage recomputed with k = 3, 5, 10 nearest-neighbour balls in the scorer's PCA-50 (k = 10 reproduces the main-slide values exactly). Means over the 5 draws per cohort; error bars = SD; grey = real vs real (R1 vs R2, same samples). Both metrics fall with smaller k for every set including the real control (real coverage at k = 3: 0.92–0.99), so compare arms with the real row, not with 1. Expected coverage of a perfect generator (Naeem et al. 2020, eq. 9) at k = 3/5/10: 0.88/0.97/1.00 in every cohort. LoRA-5 first on coverage at every k in 25/25 draws; on precision in 23/21/20 of 25 draws (k = 3/5/10); not first: Sepsis 0/1/2, Imperial 2/2/2, Giroux 0/1/1 draws at k = 3/5/10, beaten by zero-shot + calibration. 5-fold pooled design (not drawn): coverage ranking of the 4 arms across k unchanged; LoRA first at every k in 5/5 cohorts. Scores: scores_extra/<cohort>/fewshot_n5/draw<j>/metrics.csv.",
898
+ "sources": "tools/sec09_extra_metrics.py; data/sec09_extra_ksens.csv; plans/paired_finetune_intradataset_20260927/scores_extra/",
899
+ "numbers": [
900
+ {
901
+ "value": "LoRA-5 first on coverage at k = 3, 5 and 10: 25/25 draws",
902
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/fewshot_n5/draw<j>/{metrics,en}.csv"
903
+ },
904
+ {
905
+ "value": "LoRA-5 first on precision (draws) at k = 3/5/10: 23/21/20 of 25",
906
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/fewshot_n5/draw<j>/{metrics,en}.csv"
907
+ },
908
+ {
909
+ "value": "real vs real coverage at k = 3: ImMicro 0.932, Sepsis 0.925, Imperial 0.919, Giroux 0.993, Ji 0.980",
910
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/fewshot_n5/draw<j>/{metrics,en}.csv"
911
+ },
912
+ {
913
+ "value": "every set falls with smaller k (cohort means): True",
914
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scores_extra/<cohort>/fewshot_n5/draw<j>/{metrics,en}.csv"
915
+ }
916
+ ]
917
+ },
918
+ {
919
+ "kind": "content",
920
+ "section": "9",
921
+ "section_label": "Backup · 9 Paired validation",
922
+ "backup": true,
923
+ "text_source": {
924
+ "file": "data/sec09_scsemi_representative_slide_text.json",
925
+ "index": 0
926
+ },
927
+ "title": "scSemiProfiler copies its representative",
928
+ "layout": "full",
929
+ "figures": [
930
+ "figures/sec09_scsemi_representative.png"
931
+ ],
932
+ "keywords": [
933
+ "scSemi-5 never beats copying its representative: 5/5",
934
+ "Its error tracks the representative's: rho 0.57–0.93",
935
+ "LoRA-5 below the copy error in 4/5 cohorts"
936
+ ],
937
+ "footnote": "Copy = composition of the one training sample scSemiProfiler assigns to each test sample.",
938
+ "sources": "plans/paired_finetune_intradataset_20260927/scsemi/tools/representative_dependence.py; tools/sec09_scsemi_representative.py; data/sec09_scsemi_representative.csv",
939
+ "footnote_full": "Same 25 five-donor draws. scSemiProfiler gives every test sample exactly one representative, the nearest training sample in its bulk PCA (assignment.json), and runs its encoder on that representative's cells. Copy = composition L1 between the test sample's and its representative's observed cells (same frozen scANVI labels as the scorer). Bars: mean over draws of the per-draw mean; dots = draws. scSemi vs copy: paired Wilcoxon over test samples (ImMicro p 1e-33, Sepsis p 0.014, Imperial p 0.91, Giroux p 0.0073, Ji p 0.46). Upstream's own representative choice (KMeans on the same bulk PCA, the sample nearest each centre; proxy, not a rerun) gives a lower copy error than our 5-donor draws in Imperial, Giroux and Ji, where our draws hold all visits of 5 donors and KMeans spreads the same number of samples over as many donors; equal or higher in ImMicro and sepsis. Copy error: ImMicro (5 samples) ours 0.19, KMeans 0.18, random samples 0.19; Sepsis (5 samples) ours 0.58, KMeans 0.61, random samples 0.58; Imperial (14 samples) ours 0.61, KMeans 0.53, random samples 0.56; Giroux (13 samples) ours 0.25, KMeans 0.16, random samples 0.23; Ji (8 samples) ours 0.57, KMeans 0.46, random samples 0.51. Source: plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/.",
940
+ "numbers": [
941
+ {
942
+ "value": "ImMicro: copy 0.187, scSemi-5 0.233 (Wilcoxon vs copy p 1e-33), LoRA-5 0.176; rho scSemi 0.57, LoRA 0.35",
943
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/summary.csv"
944
+ },
945
+ {
946
+ "value": "Sepsis: copy 0.580, scSemi-5 0.612 (Wilcoxon vs copy p 0.014), LoRA-5 0.466; rho scSemi 0.88, LoRA 0.56",
947
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/summary.csv"
948
+ },
949
+ {
950
+ "value": "Imperial: copy 0.608, scSemi-5 0.602 (Wilcoxon vs copy p 0.91), LoRA-5 0.503; rho scSemi 0.93, LoRA 0.55",
951
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/summary.csv"
952
+ },
953
+ {
954
+ "value": "Giroux: copy 0.253, scSemi-5 0.267 (Wilcoxon vs copy p 0.0073), LoRA-5 0.258; rho scSemi 0.81, LoRA 0.08",
955
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/summary.csv"
956
+ },
957
+ {
958
+ "value": "Ji: copy 0.570, scSemi-5 0.591 (Wilcoxon vs copy p 0.46), LoRA-5 0.511; rho scSemi 0.72, LoRA 0.39",
959
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/summary.csv"
960
+ },
961
+ {
962
+ "value": "KMeans proxy, copy error: ImMicro (5 samples) ours 0.19, KMeans 0.18, random samples 0.19; Sepsis (5 samples) ours 0.58, KMeans 0.61, random samples 0.58; Imperial (14 samples) ours 0.61, KMeans 0.53, random samples 0.56; Giroux (13 samples) ours 0.25, KMeans 0.16, random samples 0.23; Ji (8 samples) ours 0.57, KMeans 0.46, random samples 0.51",
963
+ "source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paired_finetune_intradataset_20260927/scsemi/analysis/representative_dependence_20261002/kmeans_proxy.csv"
964
+ }
965
+ ]
966
+ }
967
+ ]
968
+ }