Archive 4 checkpoints (1-4)
Browse files- paper-releases/20260928/diffusion/data/panel/floor01_6k_20260923/tiers/6k/legacy_selection_manifest.v1.json +39 -0
- paper-releases/20260928/diffusion/data/panel/floor01_6k_20260923/tiers/6k/selected_genes.csv +0 -0
- paper-releases/20260928/diffusion/data/protocol/paired_finetune/FEASIBILITY.md +98 -0
- paper-releases/20260928/diffusion/data/protocol/paired_finetune/README.md +458 -0
paper-releases/20260928/diffusion/data/panel/floor01_6k_20260923/tiers/6k/legacy_selection_manifest.v1.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"algorithm": "universal train-only measurement-aware HVG ranking; this tier is a rank prefix emitted in canonical tensor order",
|
| 3 |
+
"corpus_fingerprint": "eeb609250457248225432b6df94573b26a8cad8ac743670b5ca43134fea7e007",
|
| 4 |
+
"implementation": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/src/pbisc_sdd/panel_ladder.py",
|
| 5 |
+
"implementation_sha256": "45116a496e1f38247dfdaa3d306ab54aa28e13736754dbe9dd75eaa5dc7d518f",
|
| 6 |
+
"n_selected_genes": 6000,
|
| 7 |
+
"parameters": {
|
| 8 |
+
"cells_per_recipe": 128,
|
| 9 |
+
"detection_floor_fraction": 0.001,
|
| 10 |
+
"mean_bins": 20,
|
| 11 |
+
"min_detected_cells": 1048,
|
| 12 |
+
"min_measured_cells": 104857,
|
| 13 |
+
"model7_root": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_7_no_annotation_sh_hwang",
|
| 14 |
+
"n_genes": 6000,
|
| 15 |
+
"recipes": 8192,
|
| 16 |
+
"seed": 20260627,
|
| 17 |
+
"statistics_reused_from": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/artifacts/panel_ladder_1m_20260922/sample_8192x128",
|
| 18 |
+
"target_sum": 10000.0,
|
| 19 |
+
"tier_sizes": {
|
| 20 |
+
"2k": 2000,
|
| 21 |
+
"6k": 6000,
|
| 22 |
+
"p15k": 15114
|
| 23 |
+
}
|
| 24 |
+
},
|
| 25 |
+
"parent_panel_ladder": {
|
| 26 |
+
"binding_sha256": "4d45ba1ec9af9236f0c53d29875b903f0985eb67589a932944d5feba453bd7e2",
|
| 27 |
+
"manifest_path": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/artifacts/panel_ladder_floor01_1m_20260923/manifest.json",
|
| 28 |
+
"schema_version": "pbisc_sdd.panel_ladder.v2",
|
| 29 |
+
"tier": "6k"
|
| 30 |
+
},
|
| 31 |
+
"positions_path": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/artifacts/panel_ladder_floor01_1m_20260923/tiers/6k/gene_positions.npy",
|
| 32 |
+
"positions_sha256": "653ffa45ac519000baa41086c52408009391d6e68cfb218bc6a50d34163fcb24",
|
| 33 |
+
"sampled_cells": 1048576,
|
| 34 |
+
"sampled_recipes": 8192,
|
| 35 |
+
"schema_version": "pbisc_sdd.hvg_selection.v1",
|
| 36 |
+
"selected_genes_path": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/artifacts/panel_ladder_floor01_1m_20260923/tiers/6k/selected_genes.csv",
|
| 37 |
+
"selected_genes_sha256": "09248a3930e3fdefe1dbcd5d60cae4be81028526dcf097dd78169f5a415edfb6",
|
| 38 |
+
"selection_scope": "train_split_only"
|
| 39 |
+
}
|
paper-releases/20260928/diffusion/data/panel/floor01_6k_20260923/tiers/6k/selected_genes.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper-releases/20260928/diffusion/data/protocol/paired_finetune/FEASIBILITY.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fine-tuning within each paired dataset: which experiments are feasible (2026-09-27)
|
| 2 |
+
|
| 3 |
+
**Proposal (user, 2026-09-27).** Release the pseudobulk-pretrained final model (f01 6k, 1×, part 16) as a model that users fine-tune on their own paired bulk + sc data. Validate it separately inside each paired dataset: split donors into train and test, fine-tune on train donors' real bulk → their sc cells, and test on held-out donors. There is no cross-dataset transfer.
|
| 4 |
+
|
| 5 |
+
Candidates come from `gblee/datalake/paired-pbmc-bulk-sc/docs/search_20260927/CONSOLIDATED.md`. Pair counts come from public metadata only; no identity check (sex genes, expression) has been run on any of them yet.
|
| 6 |
+
|
| 7 |
+
## Leakage check against the pretraining corpus
|
| 8 |
+
|
| 9 |
+
The corpus has 22 datasets (`model_7_no_annotation_sh_hwang/data/e2_full_source/dataset_manifest.json`). Its donor split is 80/10/10 per dataset (`e2_full_index/metadata/donor_splits.parquet`). Three paired datasets overlap with it:
|
| 10 |
+
|
| 11 |
+
| Paired set | Corpus dataset | Corpus split of the paired donors |
|
| 12 |
+
|---|---|---|
|
| 13 |
+
| Liu 2021, GSE161918 | 202_B_GSE161918 | 46 donors: train 37, val 5, test 4 |
|
| 14 |
+
| Sound Life, GSE271896 (WB bulk GSE279552) | 065_A_GSE271896 | 96 donors: train 77, val 10, test 9. Visits: 699 / 92 / 77 |
|
| 15 |
+
| CLUES SLE (WB bulk GSE277909) | 001_A Perez 2022 | 132 of 271 bulk IDs match a corpus donor: train 103, val 13, test 16 |
|
| 16 |
+
|
| 17 |
+
For these three, only the corpus val + test donors may be test donors. Train donors can still be used for fine-tuning. Val donors were used only for checkpoint selection, never for gradients.
|
| 18 |
+
|
| 19 |
+
No other candidate appears in the corpus. The candidates checked were ImMicro, sepsis, Imperial ESKD, Ji, Giroux, Randolph, Ravichandran, Everson, Sparks and Cambridge. The Cambridge sc comes from Stephenson 2021 (haniffa21), which is not a corpus source.
|
| 20 |
+
|
| 21 |
+
## Feasible experiments
|
| 22 |
+
|
| 23 |
+
### Main set: PBMC bulk ↔ PBMC sc, open counts, per-cell donor labels
|
| 24 |
+
|
| 25 |
+
| # | Dataset | Donors (pairs) | Contrast inside the set | sc chemistry | Bulk | Download | Test design |
|
| 26 |
+
|---|---|---|---|---|---|---|---|
|
| 27 |
+
| 1 | ImMicro | 107 (107) | healthy; age, sex, BLE1 re-seq | 10x 5′ v1.1 | poly-A counts | local | donor 5-fold CV |
|
| 28 |
+
| 2 | Sepsis, Ye 2026 | 80 | 59 sepsis vs 21 control | 10x 3′ v3.1 | htseq counts | 5.7 GB | donor 5-fold CV |
|
| 29 |
+
| 3 | Imperial ESKD COVID | 60 (172) | COVID time course in dialysis patients | 10x 5′ CITE | htseq counts | 3.8 GB + bulk csv | donor 5-fold CV (grouped by patient) |
|
| 30 |
+
| 4 | Liu 2021 | 46 (69) | COVID vs HC | 10x 5′ v1.1 CITE | counts (made for demuxlet) | 3.1 GB | fixed: train 37 / test 9 (corpus held-out) |
|
| 31 |
+
| 5 | Ji 2025 ChILI | 22 (39) | liver-injury time course | 10x 5′ | QuantSeq 3′-tag counts | 0.9 GB | donor 5-fold or leave-one-out (LOO) |
|
| 32 |
+
| 6 | Giroux 2022 | 18 (39) | COVID mild/severe vs HC | 10x 5′ v1 | NuGEN SoLo total RNA counts | 2.2 GB | donor LOO |
|
| 33 |
+
| 7 | Randolph 2021 | 89 × NI/flu (178) | flu vs NI within donor | 10x 3′ | ScaledTPM | local | donor 5-fold; per-cell donor labels must be recovered first (Zenodo) |
|
| 34 |
+
|
| 35 |
+
That is 7 datasets and about 420 donors. Two protocol contrasts come for free:
|
| 36 |
+
- **Ji:** 3′-tag bulk has no gene-length bias.
|
| 37 |
+
- **Giroux:** total-RNA bulk.
|
| 38 |
+
|
| 39 |
+
### Small sets, exploratory only (LOO, n ≤ 10)
|
| 40 |
+
|
| 41 |
+
- **Ravichandran 2024:** 10 donors, 3′ v3.1, raw counts, 0.4 GB.
|
| 42 |
+
- **Everson 2024:** 7 donors × pre/post, 3′, htseq with gene symbols.
|
| 43 |
+
- **Not usable without extra work:** Riese 2022 (CPM only), Lozano 2022 (TPM only), de Cevins 2021 (VST only).
|
| 44 |
+
|
| 45 |
+
### Needs bulk re-quantification from SRA FASTQ
|
| 46 |
+
|
| 47 |
+
| Dataset | Size | Note |
|
| 48 |
+
|---|---|---|
|
| 49 |
+
| RAG deficiency (Bosticardo 2025) | 17 donors | 5′ CITE, demuxlet labels |
|
| 50 |
+
| LBCL CAR-T (GSE267097) | 21 donors | 3′ bulk; sc is CD45+ sorted |
|
| 51 |
+
| Long COVID (Yin 2024) | 12 donors | sc is also FASTQ only, so the heaviest |
|
| 52 |
+
|
| 53 |
+
### Whole-blood bulk → PBMC sc (separate, harder task)
|
| 54 |
+
|
| 55 |
+
| Dataset | Donors (pairs) | Test design | Note |
|
| 56 |
+
|---|---|---|---|
|
| 57 |
+
| Sound Life | 96 (835 visits) | fixed: 77 train / 19 held-out (169 visits) | same draw, different tube |
|
| 58 |
+
| CLUES SLE | 132 | fixed: 103 train / 29 held-out | bulk DNA01/DNA11 visit vs sc visit not yet checked |
|
| 59 |
+
| Sparks 2023 | 40 (120) | donor 5-fold | sc Seurat object is 27 GB |
|
| 60 |
+
| Cambridge COVID | 40 (51) | donor 5-fold | bulk counts on Zenodo 10161239 |
|
| 61 |
+
|
| 62 |
+
Weaker whole-blood sets:
|
| 63 |
+
- **Infant COVID (24 donors):** sc is Multiome, so nuclei.
|
| 64 |
+
- **Lung transplant (14):** sc is BD Rhapsody.
|
| 65 |
+
- **Multi-vaccine (10):** no weakness recorded.
|
| 66 |
+
- **BNT162b2 (6):** sc is DC-enriched.
|
| 67 |
+
- **HIV (10):** bulk is ComBat CPM.
|
| 68 |
+
|
| 69 |
+
## Arms needed so the claim survives review
|
| 70 |
+
|
| 71 |
+
Evaluate every arm on the same held-out donors, always with real bulk as the input.
|
| 72 |
+
|
| 73 |
+
| Arm | What it tests |
|
| 74 |
+
|---|---|
|
| 75 |
+
| Zero-shot, raw bulk | floor |
|
| 76 |
+
| Zero-shot + refcal (AIFI / AIDA) | unpaired calibration, no cohort sc needed |
|
| 77 |
+
| Zero-shot + paired cal, α from train donors only | zero-parameter "fine-tuning"; FT must beat it |
|
| 78 |
+
| FT on train donors' **pseudobulk** (sc only, no bulk needed) | separates cohort/chemistry adaptation from learning the real-bulk mapping |
|
| 79 |
+
| FT on train donors' **real bulk** (proposal) | the claim |
|
| 80 |
+
| Same model trained from scratch on train donors | shows the value of pretraining |
|
| 81 |
+
| scSemiProfiler in the same split | closest prior work (bulk for all, sc for a subset) |
|
| 82 |
+
| Bulk broadcast, BayesPrism | disease signal and composition baselines (SLE: broadcast beats the generator) |
|
| 83 |
+
|
| 84 |
+
**Metrics** (scANVI only, frozen annotator):
|
| 85 |
+
- composition L1, precision/coverage;
|
| 86 |
+
- per-cell-type within-dataset contrast logFC r, reported next to broadcast, with partial r beyond broadcast.
|
| 87 |
+
|
| 88 |
+
**Data-efficiency curve** on ImMicro, sepsis and Imperial: n_train = 5, 10, 20, 40, all × 3 seeds. It answers "how many donors must be profiled with sc".
|
| 89 |
+
|
| 90 |
+
## Cost
|
| 91 |
+
|
| 92 |
+
- **Disk:** server_1 has 31 GB free (100 %), server_2 has 1.3 TB. Download everything to server_2. Main set ≈ 16 GB; Sparks adds 27 GB.
|
| 93 |
+
- **GPU (estimate):**
|
| 94 |
+
- Pretraining ran at ~3,800 cells/s (47,765 steps × 256 cells in ~55 min).
|
| 95 |
+
- One fine-tune on ~80 donors × 5,000 cells × 20 passes ≈ 8 M cells ≈ 35 min.
|
| 96 |
+
- Sampling 107 ImMicro donors took ~9 min.
|
| 97 |
+
- Main set: 7 datasets × 5 folds × 3 trained arms ≈ 105 runs, plus 45 learning-curve runs. That is about 2–3 GPU-days, or 1–1.5 days on both hosts.
|
| 98 |
+
- **Code:** a fine-tuning loader does not exist yet. It must pair a fixed real-bulk condition with cells drawn from the same donor. Pretraining instead builds the condition from the drawn cells. The frozen Model-7 conditioner, the gene axis and the masks stay as in `sample_sdd_standalone.py`.
|
paper-releases/20260928/diffusion/data/protocol/paired_finetune/README.md
ADDED
|
@@ -0,0 +1,458 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Within-dataset fine-tuning of the final model on paired bulk + scRNA data
|
| 2 |
+
|
| 3 |
+
User decision (2026-09-27): release the pseudobulk-pretrained final model as something users fine-tune on their own paired bulk + scRNA data. Validate it inside each paired dataset: split donors, fine-tune on the training donors' real bulk → their cells, and test on held-out donors. Start with ImMicro and Ye 2026 sepsis, run the same way. Feasibility of other datasets: `FEASIBILITY.md`.
|
| 4 |
+
|
| 5 |
+
## Setup
|
| 6 |
+
|
| 7 |
+
- **Base model:** `runs/f01_6k_1x_seed20260627/checkpoint_epoch_016.pt` (sha 8c7cd0e8…), EMA weights. E16 is also the best-validation epoch (0.13691).
|
| 8 |
+
- **Data** (`data/<dataset>/`):
|
| 9 |
+
- `features.npz`: bulk and pseudobulk on the 20,097 axis, with measured masks.
|
| 10 |
+
- `cells_panel6k.npz`: retained cells on the 6k panel. Each row's cells sum exactly to its pseudobulk.
|
| 11 |
+
- **ImMicro:** 107 donors, 392,251 baseline cells. Built by `tools/build_immicro_cells.py`.
|
| 12 |
+
- **Sepsis:** 85 pairs, 82 pass identity checks, 610,713 cells. Built by the pairing agent; details in `data/ye2026_sepsis/QC_REPORT.md`. The GEX is 5′ even though GEO says 3′.
|
| 13 |
+
- **Folds** (`tools/prepare_dataset.py`):
|
| 14 |
+
- Donor-level 5-fold, stratified by group (ImMicro pool; sepsis clinical group).
|
| 15 |
+
- About 10 % of each fold's training donors are inner-validation, used only for early stopping.
|
| 16 |
+
- Identity-failed sepsis rows sit in fold −1 and are never used.
|
| 17 |
+
- **Conditions:**
|
| 18 |
+
- Fixed depth (K = 1000, one depth anchor), the published `build_realbulk_conditions.py` arithmetic.
|
| 19 |
+
- No test donor's single-cell depth or cell count enters its condition.
|
| 20 |
+
- The ImMicro raw and pseudo NPZs equal the published fixed ones bit for bit.
|
| 21 |
+
- Paired calibration α is fitted on each fold's training donors only.
|
| 22 |
+
- **Training** (`tools/ft_sdd.py`):
|
| 23 |
+
- Pretraining loss, bf16, AdamW, grad clip 5, EMA 0.999, donor-balanced batches of 256.
|
| 24 |
+
- Up to 20,000 steps. Inner-validation loss is checked every 250 steps and the best EMA state is kept.
|
| 25 |
+
- Modes: full (54.2 M trainable parameters), LoRA r = 16 (1.3 M, merged before saving), condition encoder only (9.5 M).
|
| 26 |
+
- Output checkpoints keep the base schema, so `scripts/sample_sdd_standalone.py` samples them unchanged.
|
| 27 |
+
- **Sampling:** test donors only, 1,500 cells each, seed 20260927, DDIM 50, EMA, Bernoulli read-out. GPU only through `tools/run_queue.sh` → `ml-run`.
|
| 28 |
+
- **Scoring** (`tools/score_ft.py`, `tools/score_fold.sh`):
|
| 29 |
+
- Frozen f01common scANVI six-type gate. Metrics: composition L1, precision/coverage (PCA-50, k = 10, reference = the scored donors' observed cells), pseudobulk r, donor recovery top-1.
|
| 30 |
+
- For sepsis, also per-cell-type sepsis-vs-control logFC r against observed and against bulk broadcast.
|
| 31 |
+
- Validated against the published ImMicro native arms: composition L1 and labels are identical.
|
| 32 |
+
- Precision/coverage depends on the reference draw and on how many donors are scored, so compare arms within a fold.
|
| 33 |
+
|
| 34 |
+
## ImMicro fold 0 pilot (22 test donors; real bulk input unless noted)
|
| 35 |
+
|
| 36 |
+
| arm | comp L1 ↓ | precision | coverage | pseudobulk r | donor top-1 | monocyte % (obs 18.5) |
|
| 37 |
+
|---|---:|---:|---:|---:|---:|---:|
|
| 38 |
+
| zero-shot raw | 0.484 | 0.910 | 0.423 | 0.892 | 0.05 | 37.0 |
|
| 39 |
+
| zero-shot paired cal (fold α) | 0.168 | 0.985 | 0.725 | 0.882 | 0.14 | 14.7 |
|
| 40 |
+
| zero-shot pseudobulk | 0.188 | 0.993 | 0.722 | 0.881 | 0.09 | 13.7 |
|
| 41 |
+
| FT condition encoder only | 0.204 | 0.979 | 0.728 | 0.892 | 0.14 | 13.0 |
|
| 42 |
+
| FT LoRA r = 16 | 0.153 | 0.992 | **0.915** | 0.901 | 0.18 | 14.8 |
|
| 43 |
+
| **FT full** | **0.147** | 0.987 | 0.841 | **0.912** | **0.32** | 14.7 |
|
| 44 |
+
| FT on pseudobulk (sc only), raw input | 0.426 | 0.725 | 0.257 | 0.929 | 0.18 | 23.4 |
|
| 45 |
+
| FT on pseudobulk (sc only), paired-cal input | 0.231 | 0.954 | 0.816 | 0.917 | 0.18 | 14.3 |
|
| 46 |
+
|
| 47 |
+
Leave-one-out composition null of the observed cells: 0.163. Chance donor top-1: 0.045.
|
| 48 |
+
|
| 49 |
+
Selected inner-validation loss (pretrained 0.10985):
|
| 50 |
+
- full 0.10071, still falling at the 20,000-step cap;
|
| 51 |
+
- LoRA 0.10127;
|
| 52 |
+
- condition encoder 0.10429.
|
| 53 |
+
|
| 54 |
+
**Reading (one fold, one seed):**
|
| 55 |
+
- Real-bulk fine-tuning beats every zero-shot arm, including the pseudobulk input.
|
| 56 |
+
- It also beats sc-only adaptation. The sc-only model with paired calibration reaches similar coverage (0.82), so coverage comes largely from adapting to the cohort. Composition and donor specificity, however, need the paired bulk: L1 0.147 vs 0.231, top-1 0.32 vs 0.18.
|
| 57 |
+
- LoRA and full are close: LoRA covers more of the observed cells, full is more donor-specific.
|
| 58 |
+
- The condition encoder alone captures about 60 % of full's inner-validation gain but does not beat zero-shot calibration, so it was dropped.
|
| 59 |
+
|
| 60 |
+
## ImMicro, all five folds (107 donors, each scored by the fold model that never trained on it)
|
| 61 |
+
|
| 62 |
+
Per-fold scores, fold mean ± SD (`scores/immicro/AGGREGATE.md`):
|
| 63 |
+
|
| 64 |
+
| arm | comp L1 ↓ | precision | coverage | pseudobulk r |
|
| 65 |
+
|---|---:|---:|---:|---:|
|
| 66 |
+
| zero-shot raw | 0.454 ± 0.032 | 0.877 | 0.424 | 0.892 |
|
| 67 |
+
| zero-shot paired cal | 0.199 ± 0.029 | 0.976 | 0.725 | 0.880 |
|
| 68 |
+
| zero-shot pseudobulk | 0.204 ± 0.016 | 0.986 | 0.721 | 0.881 |
|
| 69 |
+
| FT LoRA r = 16 | 0.162 ± 0.017 | 0.989 | **0.919** | 0.900 |
|
| 70 |
+
| **FT full** | **0.157 ± 0.020** | 0.981 | 0.851 | **0.914** |
|
| 71 |
+
| sc-only FT, raw input | 0.444 ± 0.021 | 0.678 | 0.237 | 0.927 |
|
| 72 |
+
| sc-only FT, paired-cal input | 0.240 ± 0.015 | 0.955 | 0.829 | 0.917 |
|
| 73 |
+
|
| 74 |
+
**Donor-level composition L1, paired Wilcoxon over 107 donors** (FT full vs each arm):
|
| 75 |
+
|
| 76 |
+
| comparison | Δ L1 | FT full better in | p |
|
| 77 |
+
|---|---:|---:|---:|
|
| 78 |
+
| vs zero-shot paired cal | −0.042 | 68 % | 1e-7 |
|
| 79 |
+
| vs zero-shot pseudobulk | −0.048 | 74 % | 4e-8 |
|
| 80 |
+
| vs sc-only FT + paired cal | −0.083 | 91 % | 2e-16 |
|
| 81 |
+
| vs LoRA | −0.005 | 58 % | 0.14 |
|
| 82 |
+
| vs leave-one-out cohort-mean null (0.161) | −0.007 | 50 % | 0.64 |
|
| 83 |
+
|
| 84 |
+
**Across-donor correlation of generated vs observed cell-type fraction (T / B / Mono / NK):**
|
| 85 |
+
- FT full: 0.79 / 0.80 / 0.83 / 0.81
|
| 86 |
+
- zero-shot paired cal: 0.67 / 0.71 / 0.85 / 0.49
|
| 87 |
+
- zero-shot pseudobulk: 0.71 / 0.77 / 0.90 / 0.60
|
| 88 |
+
|
| 89 |
+
**Donor top-1:** 0.15 ± 0.10 for FT full vs 0.13 for zero-shot paired cal. The fold-0 value of 0.32 did not replicate.
|
| 90 |
+
|
| 91 |
+
**Pooled scoring** (`scores/immicro/pooled/`: one call over all 107 donors, reference = all 107 donors' observed cells, so absolute precision/coverage are lower than the per-fold values):
|
| 92 |
+
|
| 93 |
+
| arm | precision / coverage | depth-matched precision / coverage |
|
| 94 |
+
|---|---|---|
|
| 95 |
+
| FT LoRA | 0.924 / 0.784 | 0.961 / 0.962 |
|
| 96 |
+
| FT full | 0.890 / 0.695 | 0.946 / 0.950 |
|
| 97 |
+
| zero-shot paired cal | 0.905 / 0.527 | 0.944 / 0.769 |
|
| 98 |
+
| zero-shot pseudobulk | 0.936 / 0.524 | 0.965 / 0.741 |
|
| 99 |
+
|
| 100 |
+
**Reading:**
|
| 101 |
+
- Fine-tuning on real bulk removes the real-bulk bias.
|
| 102 |
+
- It beats the pseudobulk input, which was the zero-shot ceiling.
|
| 103 |
+
- It improves the across-donor ranking of T, B and NK fractions.
|
| 104 |
+
- It does not beat the observed cohort mean on per-donor composition L1. Healthy donors vary little, so that null is strong.
|
| 105 |
+
- Full is better on composition; LoRA gives wider coverage.
|
| 106 |
+
|
| 107 |
+
## Sepsis, all five folds (82 identity-passed pairs: 61 sepsis, 21 controls; cross-fitted)
|
| 108 |
+
|
| 109 |
+
Pooled scoring over all 82 donors (`scores/ye2026_sepsis/pooled/`). The contrast is computed over all 61 vs 21 donors. The per-fold contrast (4–5 controls per fold) is too noisy to use.
|
| 110 |
+
|
| 111 |
+
| arm | comp L1 ↓ | precision | coverage | sepsis-vs-control logFC r (T / B / Mono / NK; mean) | r of bulk broadcast | partial r beyond broadcast |
|
| 112 |
+
|---|---:|---:|---:|---|---:|---:|
|
| 113 |
+
| zero-shot raw | 0.511 | 0.614 | 0.067 | −0.11 / 0.06 / 0.07 / −0.07; **−0.01** | 0.316 | −0.095 |
|
| 114 |
+
| zero-shot paired cal | 0.401 | 0.903 | 0.431 | 0.04 / 0.16 / 0.25 / 0.04; **0.12** | 0.278 | 0.039 |
|
| 115 |
+
| zero-shot pseudobulk (sc-derived input) | **0.233** | 0.915 | 0.480 | 0.55 / 0.50 / 0.40 / 0.43; **0.47** | 0.730 | 0.210 |
|
| 116 |
+
| FT LoRA | 0.362 | **0.926** | **0.829** | 0.63 / 0.57 / 0.58 / 0.34; **0.53** | 0.316 | **0.469** |
|
| 117 |
+
| **FT full** | 0.372 | 0.866 | 0.795 | 0.62 / 0.60 / 0.63 / 0.29; **0.53** | 0.316 | **0.468** |
|
| 118 |
+
| sc-only FT, raw input | 0.472 | 0.606 | 0.134 | 0.01 / 0.22 / 0.34 / 0.03; 0.15 | 0.316 | 0.038 |
|
| 119 |
+
| sc-only FT, paired-cal input | 0.360 | 0.863 | 0.726 | 0.25 / 0.32 / 0.52 / 0.10; 0.30 | 0.278 | 0.190 |
|
| 120 |
+
|
| 121 |
+
Leave-one-out composition null: 0.515. Observed monocyte %: 20.8; the FT arms generate 18.0–18.5 %.
|
| 122 |
+
|
| 123 |
+
Per-fold means are in `scores/ye2026_sepsis/AGGREGATE.md`. The fold-level ranking is the same: FT full L1 0.372 ± 0.083 vs zero-shot paired cal 0.404 ± 0.071.
|
| 124 |
+
|
| 125 |
+
**Donor-level composition L1** (paired Wilcoxon, 82 donors):
|
| 126 |
+
|
| 127 |
+
| comparison | Δ L1 | p |
|
| 128 |
+
|---|---:|---:|
|
| 129 |
+
| FT full vs zero-shot paired cal | −0.029 | 0.24 |
|
| 130 |
+
| FT LoRA vs zero-shot paired cal | −0.039 | 0.19 |
|
| 131 |
+
| FT full vs sc-only FT + cal | +0.011 | 0.80 |
|
| 132 |
+
| FT full vs zero-shot pseudobulk | +0.138 | 2e-7 |
|
| 133 |
+
| FT full vs null | −0.144 (better in 72 %) | 7e-6 |
|
| 134 |
+
|
| 135 |
+
**Across-donor fraction correlation (T / B / Mono / NK):**
|
| 136 |
+
- FT full: 0.68 / 0.79 / 0.60 / 0.68
|
| 137 |
+
- zero-shot paired cal: 0.64 / 0.71 / 0.60 / 0.59
|
| 138 |
+
- zero-shot pseudobulk: 0.91 / 0.95 / 0.97 / 0.80
|
| 139 |
+
|
| 140 |
+
**Reading:**
|
| 141 |
+
- **Disease signal is the sepsis result.**
|
| 142 |
+
- Fine-tuned models generate cells whose per-cell-type sepsis-vs-control logFC agrees with the observed cells at r 0.53. Zero-shot calibrated bulk gives 0.12.
|
| 143 |
+
- They beat the real-bulk broadcast baseline in every cell type (T 0.62 vs 0.26, B 0.60 vs 0.28, Mono 0.63 vs 0.55, NK 0.29 vs 0.19). In SLE the zero-shot model lost to broadcast.
|
| 144 |
+
- The partial r beyond broadcast is 0.47 (zero-shot 0.04).
|
| 145 |
+
- They also exceed zero-shot generation from the sc-derived pseudobulk (0.47).
|
| 146 |
+
- **The paired bulk matters.** sc-only fine-tuning with paired-cal input reaches 0.30.
|
| 147 |
+
- **Composition does not improve over zero-shot calibration** (n.s.) and stays far behind the pseudobulk input: the sepsis real bulk carries weak composition information, monocytes especially (r 0.60).
|
| 148 |
+
- **Coverage roughly doubles** (0.43 → 0.80–0.83).
|
| 149 |
+
- **Full and LoRA are equivalent here.** LoRA has the higher precision.
|
| 150 |
+
|
| 151 |
+
## Sepsis fold 0 pilot (17 test donors: 12 sepsis, 5 controls; real bulk input unless noted)
|
| 152 |
+
|
| 153 |
+
Early stopping selected fewer steps than for ImMicro:
|
| 154 |
+
|
| 155 |
+
| arm | selected step | inner-val loss (pretrained 0.12500) |
|
| 156 |
+
|---|---:|---:|
|
| 157 |
+
| full | 3,750 | 0.11344 |
|
| 158 |
+
| LoRA | 6,500 | 0.11357 |
|
| 159 |
+
| condition encoder | 5,500 | 0.11606 |
|
| 160 |
+
| sc-only (pseudobulk) | 20,000 | 0.11275 (pretrained 0.11720, pseudobulk conditions) |
|
| 161 |
+
|
| 162 |
+
| arm | comp L1 ↓ | precision | coverage | donor top-1 | monocyte % (obs 24.6) | sepsis-vs-control logFC r, mean of T/B/Mono/NK | partial r beyond bulk broadcast |
|
| 163 |
+
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 164 |
+
| zero-shot raw | 0.451 | 0.879 | 0.181 | 0.41 | 37.3 | 0.064 | −0.035 |
|
| 165 |
+
| zero-shot paired cal | 0.388 | 0.984 | 0.626 | 0.41 | 25.7 | 0.255 | 0.161 |
|
| 166 |
+
| zero-shot pseudobulk | **0.236** | 0.990 | 0.700 | **0.65** | 29.5 | 0.328 | 0.187 |
|
| 167 |
+
| FT condition encoder | 0.380 | 0.983 | 0.741 | 0.35 | 17.5 | 0.261 | 0.181 |
|
| 168 |
+
| FT LoRA r = 16 | 0.373 | 0.986 | 0.858 | 0.47 | 15.3 | 0.487 | **0.410** |
|
| 169 |
+
| FT full | 0.388 | 0.978 | **0.871** | 0.35 | 16.2 | **0.489** | 0.393 |
|
| 170 |
+
| FT sc only, raw input | 0.422 | 0.928 | 0.351 | 0.47 | 29.6 | 0.167 | 0.030 |
|
| 171 |
+
| FT sc only, paired-cal input | 0.396 | 0.979 | 0.850 | 0.35 | 21.7 | 0.465 | 0.357 |
|
| 172 |
+
|
| 173 |
+
- The leave-one-out composition null is 0.513: donors differ far more than in ImMicro.
|
| 174 |
+
- Contrast = per-cell-type log2 fold change of donor-averaged mean CP10K, over genes detected in ≥ 1 % of observed cells of the type.
|
| 175 |
+
- **Bulk broadcast baseline** (the input real bulk's sepsis-vs-control logFC copied to every cell type):
|
| 176 |
+
- mean r 0.482 (T 0.393, B 0.470, Mono 0.702, NK 0.361);
|
| 177 |
+
- with pseudobulk instead of real bulk: 0.668.
|
| 178 |
+
|
| 179 |
+
**Reading (one fold, one seed, only 5 controls):**
|
| 180 |
+
- Fine-tuning roughly doubles the per-cell-type disease-signal agreement (0.26 → 0.49).
|
| 181 |
+
- For the first time the generated cells carry a clear part beyond the bulk broadcast (partial r ≈ 0.4). In SLE the zero-shot model gave about 0.2.
|
| 182 |
+
- By cell type, FT beats broadcast for T and B, but not for monocytes (0.57 vs 0.70).
|
| 183 |
+
- Most of the gain comes from adapting to the cohort: sc-only FT with the paired-cal input reaches 0.465 / 0.357.
|
| 184 |
+
- Composition is not improved by any real-bulk arm (0.37–0.39 vs zero-shot pseudobulk 0.236). FT arms under-produce monocytes (15–17 % vs 24.6 %).
|
| 185 |
+
- So in sepsis the real bulk does not carry the donors' composition to the model, unlike ImMicro. One candidate cause not yet checked: granulocyte or low-density-neutrophil signal in sepsis PBMC bulk.
|
| 186 |
+
|
| 187 |
+
## Sepsis top-50 DEG (added 2026-09-28; `scores/ye2026_sepsis/pooled_deg/`)
|
| 188 |
+
|
| 189 |
+
**Definition:** the NC benchmark's own `bulk2sc-paper/scripts/evaluate_generated_vs_truth.py`, imported, not copied (`welch_bh_deg`, `top_deg_genes`).
|
| 190 |
+
- Per cell type: donor pseudobulk on the 5,975 scoring genes, log1p CPM, two-sided Welch test, BH correction.
|
| 191 |
+
- List: genes with FDR < 0.05, ranked by |logFC|, top 50.
|
| 192 |
+
- Score: the number of genes shared by the observed and generated lists, summed over T/B/Mono/NK/DC (maximum 250). The SLE "81" is the same kind of sum.
|
| 193 |
+
|
| 194 |
+
| arm | T | B | Mono | NK | DC | sum / 250 | logFC r |
|
| 195 |
+
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 196 |
+
| zero-shot raw | 3 | 0 | 4 | 1 | 1 | 9 | −0.01 |
|
| 197 |
+
| zero-shot paired cal | 5 | 1 | 4 | 0 | 1 | 11 | 0.12 |
|
| 198 |
+
| zero-shot pseudobulk | 11 | 5 | 1 | 1 | 4 | 22 | 0.47 |
|
| 199 |
+
| sc-only FT + cal | 1 | 1 | 9 | 0 | 4 | 15 | 0.30 |
|
| 200 |
+
| LoRA 5 pairs | 4 | 0 | 1 | 0 | 0 | 5 | 0.29 |
|
| 201 |
+
| LoRA 10 | 3 | 1 | 4 | 0 | 0 | 8 | 0.42 |
|
| 202 |
+
| LoRA 40 | 0 | 3 | 12 | 0 | 7 | 22 | 0.48 |
|
| 203 |
+
| LoRA all (58) | 1 | 1 | 19 | 0 | 2 | 23 | 0.53 |
|
| 204 |
+
| full all | 1 | 2 | 21 | 0 | 0 | 24 | 0.53 |
|
| 205 |
+
|
| 206 |
+
Real-bulk broadcast list: 21.
|
| 207 |
+
|
| 208 |
+
**Reading:**
|
| 209 |
+
- With enough pairs, top-50 DEG doubles over zero-shot calibration (11 → 23–24).
|
| 210 |
+
- It only reaches the broadcast level, and almost all of it is monocytes.
|
| 211 |
+
- T and NK overlap is near zero because the generated T cells produce almost no significant genes (12 vs 1,578 observed for full). The disease signal is in the right direction (logFC r 0.6) but too weak for FDR-based DEG calls.
|
| 212 |
+
- Paper note: `methods.tex:87` describes CP10K, but the evaluator uses CPM.
|
| 213 |
+
|
| 214 |
+
## New datasets and the few-pair scenario (started 2026-09-28)
|
| 215 |
+
|
| 216 |
+
**Datasets** (built by agents with the same QC/identity rules; details in each `data/<ds>/QC_REPORT.md`):
|
| 217 |
+
|
| 218 |
+
| dataset | bulk | sc | usable pairs (donors) | contrast |
|
| 219 |
+
|---|---|---|---|---|
|
| 220 |
+
| Imperial ESKD COVID (Gisby 2022 + Stephenson 2025) | PBMC, htseq | 10x 5′ CITE atlas | 157 (57 patients; longitudinal) | covid_positive vs covid_negative |
|
| 221 |
+
| Giroux 2022 (Duke outpatient COVID) | PBMC, NuGEN SoLo total RNA (no RPL/RPS/MT genes) | 10x 5′ v1 | 24 (9 subjects) | severe vs mild |
|
| 222 |
+
| Ji 2025 ChILI | **PAXgene whole blood**, QuantSeq 3′ | 10x 5′ | 33 (20 patients) | ChILI (TOL, FU1) vs ICI controls (BC, AC) |
|
| 223 |
+
|
| 224 |
+
Dataset notes:
|
| 225 |
+
- **Imperial:** pairs are matched on the metadata swab day. The day in the bulk column name counts from symptom onset.
|
| 226 |
+
- **Giroux:** the author bulk table lacks the exposed and healthy subjects.
|
| 227 |
+
- **Ji:** the bulk is whole blood, so this is a whole-blood → PBMC test.
|
| 228 |
+
|
| 229 |
+
**Rules:**
|
| 230 |
+
- Rows with fewer than 200 cells are excluded (strict-QC protocol minimum). Only Imperial is affected.
|
| 231 |
+
- The scorer now accepts several samples per donor: the scored unit is the sample, and the composition null leaves out every sample of that donor.
|
| 232 |
+
|
| 233 |
+
**Few-pair scenario** (`tools/prepare_fewshot.py`, `make_fewshot_queue.sh`, `score_fewshot.sh`):
|
| 234 |
+
- **Training donors:** 5, stratified by case/control where the dataset has one. All their pairs are used.
|
| 235 |
+
- **Training:** LoRA for a fixed 3,000 steps with no inner validation (`ft_sdd.py --train-donors-file --fixed-steps`).
|
| 236 |
+
- **Test:** every other usable donor.
|
| 237 |
+
- **Comparators:**
|
| 238 |
+
- zero-shot raw;
|
| 239 |
+
- zero-shot paired cal, with alpha from the **same 5 pairs**;
|
| 240 |
+
- zero-shot pseudobulk (reference).
|
| 241 |
+
- **Repeats:** 5 draws.
|
| 242 |
+
- **Datasets:** also run on ImMicro and sepsis so all five datasets share the protocol.
|
| 243 |
+
|
| 244 |
+
**Also run:** the 5-fold CV of `make_cv_queue.sh` on each new dataset (zero-shot ×3, LoRA on all training donors, sc-only control).
|
| 245 |
+
|
| 246 |
+
**Hosts:**
|
| 247 |
+
- Imperial runs entirely on server_2 (GPU and scoring; outputs about 110 GB). `tools/run_queue_s2.sh` is the server_2 env copy of `run_queue.sh`.
|
| 248 |
+
- The rest runs on server_1.
|
| 249 |
+
- Scored ImMicro and sepsis generations were moved to server_2, sha-checked, with `.moved` markers (`tools/move_generated.sh`).
|
| 250 |
+
|
| 251 |
+
## Results: few-pair scenario (LoRA on 5 donors, fixed 3,000 steps; test = every other donor; mean ± SD over 5 draws)
|
| 252 |
+
|
| 253 |
+
| dataset | arm | comp L1 | precision | coverage | case-control logFC r | partial r beyond broadcast | top-50 DEG (sum) |
|
| 254 |
+
|---|---|---:|---:|---:|---:|---:|---:|
|
| 255 |
+
| ImMicro | zero-shot cal (same 5 pairs) | 0.203 ± 0.011 | 0.904 | 0.535 | — | — | — |
|
| 256 |
+
| ImMicro | **LoRA 5** | **0.176 ± 0.012** | **0.952** | **0.792** | — | — | — |
|
| 257 |
+
| sepsis | zero-shot cal | 0.446 ± 0.046 | 0.899 | 0.428 | 0.10 ± 0.04 | 0.00 | 9.4 ± 2.6 |
|
| 258 |
+
| sepsis | **LoRA 5** | 0.466 ± 0.044 | 0.906 | **0.694** | **0.35 ± 0.16** | **0.31** | 16.4 ± 6.7 |
|
| 259 |
+
| Ji (whole blood) | zero-shot cal | 0.514 ± 0.016 | 0.782 | 0.114 | 0.14 ± 0.09 | 0.12 | 0.0 |
|
| 260 |
+
| Ji (whole blood) | **LoRA 5** | 0.513 ± 0.115 | **0.978** | **0.707** | **0.33 ± 0.08** | **0.30** | 0.2 |
|
| 261 |
+
|
| 262 |
+
Composition, LoRA 5 vs zero-shot cal (paired over donor-draws):
|
| 263 |
+
- ImMicro: better in 69 %, p 3e-24.
|
| 264 |
+
- Sepsis: p 0.96.
|
| 265 |
+
- Ji: p 0.60.
|
| 266 |
+
|
| 267 |
+
Real-bulk broadcast r:
|
| 268 |
+
- sepsis 0.32, top-50 DEG 20;
|
| 269 |
+
- Ji 0.23.
|
| 270 |
+
|
| 271 |
+
Zero-shot from the sc-derived pseudobulk (reference):
|
| 272 |
+
- ImMicro L1 0.211;
|
| 273 |
+
- sepsis L1 0.237, r 0.48, DEG 20.8;
|
| 274 |
+
- Ji L1 0.171, r 0.18.
|
| 275 |
+
|
| 276 |
+
## Results: Ji 2025, 5-fold (33 pairs pooled; 18 ChILI vs 15 controls; whole-blood bulk → PBMC cells)
|
| 277 |
+
|
| 278 |
+
| arm | comp L1 | precision | coverage | ChILI-vs-control logFC r (T/B/Mono/NK; mean) | partial r | top-50 DEG |
|
| 279 |
+
|---|---:|---:|---:|---|---:|---:|
|
| 280 |
+
| zero-shot raw | 0.738 | 0.717 | 0.055 | 0.18/−0.08/0.22/0.02; 0.08 | 0.03 | 0 |
|
| 281 |
+
| zero-shot cal | 0.501 | 0.740 | 0.106 | 0.23/0.00/0.21/0.13; 0.14 | 0.11 | 0 |
|
| 282 |
+
| zero-shot pseudobulk (reference) | 0.173 | 0.985 | 0.685 | 0.28/−0.06/0.32/0.03; 0.14 | 0.03 | 5 |
|
| 283 |
+
| **LoRA (all training donors)** | 0.504 | **0.971** | **0.857** | **0.48/0.24/0.79/0.41; 0.48** | **0.45** | **15** |
|
| 284 |
+
| sc-only FT, raw input | 0.596 | 0.718 | 0.094 | 0.15 | 0.11 | 0 |
|
| 285 |
+
| sc-only FT, cal input | 0.609 | 0.694 | 0.113 | 0.25 | 0.22 | 0 |
|
| 286 |
+
|
| 287 |
+
Baselines:
|
| 288 |
+
- Real-bulk broadcast: r 0.24, DEG 4.
|
| 289 |
+
- Leave-donor-out composition null: 0.452.
|
| 290 |
+
|
| 291 |
+
**Reading:**
|
| 292 |
+
- Whole-blood bulk is far from PBMC; the zero-shot arms fall outside the observed cell space.
|
| 293 |
+
- LoRA on the paired whole-blood bulk brings the cells back (coverage 0.86), and the ChILI signal agrees with the observed cells at r 0.48 (monocytes 0.79).
|
| 294 |
+
- The sc-only control does not work here (coverage 0.11), so the paired bulk is what teaches the whole-blood → PBMC map.
|
| 295 |
+
- Composition stays at zero-shot-cal level and worse than the cohort mean: whole-blood bulk does not carry PBMC composition.
|
| 296 |
+
|
| 297 |
+
## Results: Imperial and Giroux (2026-09-28)
|
| 298 |
+
|
| 299 |
+
**Imperial ESKD COVID** (157 samples / 57 patients; COVID+ 113 vs COVID− 34 samples; runs and scores on server_2, copied to `scores/imperial_eskd/`)
|
| 300 |
+
|
| 301 |
+
| setting | arm | comp L1 | precision | coverage | COVID logFC r (T/B/Mono/NK; mean) | partial r | top-50 DEG |
|
| 302 |
+
|---|---|---:|---:|---:|---|---:|---:|
|
| 303 |
+
| 5 pairs | zero-shot cal | 0.506 | 0.845 | 0.634 | 0.68 | 0.41 | 104 |
|
| 304 |
+
| 5 pairs | **LoRA 5** | 0.503 | 0.853 | **0.737** | **0.75** | **0.60** | **114** |
|
| 305 |
+
| 5-fold | zero-shot cal | 0.494 | 0.842 | 0.639 | 0.68/0.62/0.71/0.70 | 0.41 | 111 |
|
| 306 |
+
| 5-fold | **LoRA** | **0.376** (p 7e-11) | 0.847 | **0.850** | **0.90/0.75/0.79/0.83; 0.82** | **0.69** | **143** |
|
| 307 |
+
| 5-fold | sc-only FT + cal | 0.461 | 0.691 | 0.555 | 0.81 | 0.63 | 129 |
|
| 308 |
+
|
| 309 |
+
Baselines:
|
| 310 |
+
- Real-bulk broadcast: r 0.66, DEG 84 (75 in the 5-pair setting).
|
| 311 |
+
- Zero-shot from the sc pseudobulk: L1 0.300, r 0.68.
|
| 312 |
+
- Composition null: 0.505.
|
| 313 |
+
|
| 314 |
+
**Giroux 2022** (24 pairs / 9 subjects; severe 11 vs mild 13)
|
| 315 |
+
|
| 316 |
+
| setting | arm | comp L1 | coverage | severe-vs-mild r | partial r | top-50 DEG |
|
| 317 |
+
|---|---|---:|---:|---:|---:|---:|
|
| 318 |
+
| 5 pairs | zero-shot cal | 0.288 | 0.944 | 0.24 | 0.11 | 1.8 |
|
| 319 |
+
| 5 pairs | **LoRA 5** | 0.256 | 0.961 | 0.33 | 0.19 | 11.6 |
|
| 320 |
+
| 5-fold | zero-shot cal | 0.266 | 0.906 | 0.31 | 0.14 | 12 |
|
| 321 |
+
| 5-fold | **LoRA** | 0.258 | 0.928 | **0.50** | **0.33** | **25** |
|
| 322 |
+
|
| 323 |
+
- Here the real-bulk broadcast beats every generated arm: r 0.64, DEG 39 (5-pair: r 0.54, DEG 25).
|
| 324 |
+
- The severe-vs-mild difference is shared across cell types.
|
| 325 |
+
|
| 326 |
+
## Five-dataset summary (LoRA vs zero-shot paired calibration)
|
| 327 |
+
|
| 328 |
+
| dataset (bulk) | cell realism (coverage) | composition | disease signal vs zero-shot | vs real-bulk broadcast |
|
| 329 |
+
|---|---|---|---|---|
|
| 330 |
+
| ImMicro (PBMC, healthy) | ↑ both settings | ↑ both settings (≈ cohort-mean null) | n/a | n/a |
|
| 331 |
+
| sepsis (PBMC) | ↑ | = | ↑ (0.12 → 0.35 with 5 pairs, 0.53 with all) | above (r); ≈ (DEG) |
|
| 332 |
+
| Ji (whole blood) | ↑↑ (0.11 → 0.71–0.86) | = | ↑ (0.14 → 0.33 / 0.48) | above (r and DEG) |
|
| 333 |
+
| Imperial (PBMC) | ↑ | = with 5 pairs, ↑ with all | ↑ (0.68 → 0.75 / 0.82; DEG 104 → 114 / 143) | above (r and DEG) |
|
| 334 |
+
| Giroux (PBMC, 9 subjects) | ≈ (already high) | = | ↑ (0.24 → 0.33 / 0.50) | below (r and DEG) |
|
| 335 |
+
|
| 336 |
+
## Recommended protocol (user decision 2026-09-28: recommend LoRA)
|
| 337 |
+
|
| 338 |
+
1. **Backbone:** the public pseudobulk-pretrained final model (6k, 1×, E16), frozen.
|
| 339 |
+
2. **Paired data:** the user's paired bulk + scRNA from the same sample (raw counts, canonical 20,097 axis, measured masks); check identity (sex genes, expression match).
|
| 340 |
+
- Hold out about 10 % of the pairs, and at least 5–7 donors, for early stopping.
|
| 341 |
+
3. **Condition:** real bulk at the fixed-depth policy (K = 1000, one depth anchor). No single-cell depth or cell count is needed at inference.
|
| 342 |
+
4. **LoRA training** (`tools/ft_sdd.py --mode lora`):
|
| 343 |
+
- Rank 16, alpha 16, on all 22 denoiser Linear layers (1.30 M trainable parameters).
|
| 344 |
+
- AdamW with lr 5e-4, warmup 200 steps, weight decay 0. Grad clip 5, bf16, EMA 0.999.
|
| 345 |
+
- Donor-balanced batches of 256 cells: draw a donor uniformly, then one of its cells; the condition is that donor's real bulk.
|
| 346 |
+
- Inner-validation loss every 250 steps; stop after 2,000 steps without improvement; cap at 20,000 steps; keep the best EMA state.
|
| 347 |
+
- Merge the LoRA into the weights; the standard sampler then works unchanged.
|
| 348 |
+
5. **Apply** only to bulk made with the same bulk protocol as the training pairs.
|
| 349 |
+
|
| 350 |
+
**What was run** (LoRA, per fold):
|
| 351 |
+
|
| 352 |
+
| dataset | train donors | inner-val donors | train cells | selected step | cell-epochs at selection | wall time |
|
| 353 |
+
|---|---:|---:|---:|---|---|---:|
|
| 354 |
+
| ImMicro | 78–79 | 7 | ~290 k | 19,500–20,000 (cap reached, loss still falling) | ~17–18 | ~13 min |
|
| 355 |
+
| sepsis | 58–59 | 7–8 | ~410–426 k | 3,750–13,000 (early stop) | 2.4–8.0, mostly ~4 | 4–11 min |
|
| 356 |
+
|
| 357 |
+
**Open questions being tested:**
|
| 358 |
+
- The minimum number of pairs is not known.
|
| 359 |
+
- Whether varied K helps is not known.
|
| 360 |
+
|
| 361 |
+
## LoRA learning curve (2026-09-28)
|
| 362 |
+
|
| 363 |
+
One nested subset per fold and n; the inner-validation donors (7–8) sit outside the training subset.
|
| 364 |
+
|
| 365 |
+
**Sepsis** (pooled over all 82 donors; contrast 61 vs 21):
|
| 366 |
+
|
| 367 |
+
| training pairs | comp L1 | precision | coverage | sepsis-vs-control logFC r (T/B/Mono/NK; mean) | partial r beyond broadcast | selected steps |
|
| 368 |
+
|---:|---:|---:|---:|---|---:|---|
|
| 369 |
+
| 0 (zero-shot paired cal) | 0.401 | 0.903 | 0.431 | 0.04/0.16/0.25/0.04; 0.12 | 0.04 | — |
|
| 370 |
+
| 5 | 0.428 | 0.911 | 0.767 | 0.36/0.37/0.25/0.19; 0.29 | 0.25 | 2,000–3,000 |
|
| 371 |
+
| 10 | 0.390 | 0.916 | 0.786 | 0.54/0.49/0.33/0.32; 0.42 | 0.37 | 2,000–3,250 |
|
| 372 |
+
| 20 | 0.380 | 0.927 | 0.807 | 0.43/0.33/0.47/0.24; 0.37 | 0.30 | 2,500–4,000 |
|
| 373 |
+
| 40 | 0.365 | 0.922 | 0.818 | 0.57/0.52/0.52/0.29; 0.48 | 0.40 | 3,000–7,000 |
|
| 374 |
+
| 58 (all) | 0.362 | 0.926 | 0.829 | 0.63/0.57/0.58/0.34; 0.53 | 0.47 | 3,750–13,000 |
|
| 375 |
+
|
| 376 |
+
Reference rows:
|
| 377 |
+
- Real-bulk broadcast: mean r 0.32.
|
| 378 |
+
- sc-only FT with all 58 donors + paired cal: 0.30.
|
| 379 |
+
- Zero-shot from the sc-derived pseudobulk: 0.47, with composition 0.233.
|
| 380 |
+
|
| 381 |
+
**ImMicro** (folds 0–3, 86 donors, per-fold scoring; the selected-step column includes fold 4):
|
| 382 |
+
|
| 383 |
+
| training pairs | comp L1 (better than zero-shot cal in, p) | coverage | across-donor fraction r (T/B/Mono/NK) | selected steps |
|
| 384 |
+
|---:|---|---:|---|---|
|
| 385 |
+
| 0 (zero-shot paired cal) | 0.206 | 0.724 | 0.65/0.68/0.85/0.47 | — |
|
| 386 |
+
| 5 | 0.176 (70 %, 4e-5) | 0.920 | 0.62/0.71/0.82/0.19 | 2,750–5,000 |
|
| 387 |
+
| 10 | 0.193 (60 %, 0.05) | 0.890 | 0.56/0.72/0.75/0.45 | 3,250–19,500 |
|
| 388 |
+
| 20 | 0.178 (70 %, 1e-4) | 0.898 | 0.63/0.73/0.78/0.61 | 5,250–20,000 (4 of 5 folds at cap) |
|
| 389 |
+
| 40 | 0.171 (73 %, 3e-5) | 0.910 | 0.69/0.75/0.82/0.70 | cap |
|
| 390 |
+
| 78–79 (all) | 0.168 (65 %, 6e-6) | 0.917 | 0.74/0.75/0.88/0.72 | cap |
|
| 391 |
+
|
| 392 |
+
**Reading:**
|
| 393 |
+
- **Five pairs already fix most of the systematic real-bulk shift.**
|
| 394 |
+
- Coverage jumps from 0.43/0.72 to 0.77/0.92.
|
| 395 |
+
- ImMicro composition drops from 0.206 to 0.176.
|
| 396 |
+
- **Donor-level ranking and the disease signal keep improving with more pairs.**
|
| 397 |
+
- ImMicro NK r goes 0.19 → 0.45 → 0.61 → 0.70 → 0.72.
|
| 398 |
+
- Sepsis contrast goes 0.29 → 0.42 → 0.37 → 0.48 → 0.53. The dip at 20 is one subset per fold, so it is noise-level.
|
| 399 |
+
- About 10 pairs already beat the real-bulk broadcast in sepsis.
|
| 400 |
+
- With few pairs, early stopping lands at about 2,000–3,000 steps. That is a usable fixed schedule when no pairs can be spared for inner validation.
|
| 401 |
+
|
| 402 |
+
**ImMicro, all five folds pooled (107 donors; reference = all 107 donors):**
|
| 403 |
+
|
| 404 |
+
| training pairs | comp L1 (vs zero-shot cal, p) | across-donor NK r |
|
| 405 |
+
|---:|---|---:|
|
| 406 |
+
| 5 | 0.171 (2e-5) | 0.20 |
|
| 407 |
+
| 10 | 0.188 (0.06) | 0.40 |
|
| 408 |
+
| 20 | 0.172 (4e-5) | 0.56 |
|
| 409 |
+
| 40 | 0.171 (1e-4) | 0.70 |
|
| 410 |
+
| all | 0.162 (2e-7) | 0.70 |
|
| 411 |
+
|
| 412 |
+
Zero-shot paired cal gives L1 0.199.
|
| 413 |
+
|
| 414 |
+
## K augmentation (2026-09-28)
|
| 415 |
+
|
| 416 |
+
**Sepsis, pooled over 82 donors; each arm vs plain LoRA:**
|
| 417 |
+
|
| 418 |
+
| arm | comp L1 | coverage | sepsis-vs-control r (mean) | partial r beyond broadcast |
|
| 419 |
+
|---|---:|---:|---:|---:|
|
| 420 |
+
| plain LoRA (K = 1000) | 0.362 | 0.829 | 0.527 | 0.469 |
|
| 421 |
+
| multi-K real bulk (K 250–4000) | 0.366 (p 0.70) | 0.819 | 0.509 | 0.447 |
|
| 422 |
+
| + half-batch pretraining recipes | 0.365 (p 0.73) | 0.817 | 0.496 | 0.431 |
|
| 423 |
+
|
| 424 |
+
- Inner-validation losses were within 0.0001 of plain LoRA in every fold.
|
| 425 |
+
- Neither augmentation helps: every metric is equal or slightly worse.
|
| 426 |
+
|
| 427 |
+
**ImMicro, pooled over 107 donors:**
|
| 428 |
+
|
| 429 |
+
| arm | comp L1 (vs plain LoRA, p) | precision | coverage | across-donor r (T/B/Mono/NK) |
|
| 430 |
+
|---|---|---:|---:|---|
|
| 431 |
+
| plain LoRA | 0.162 | 0.924 | 0.784 | 0.74/0.75/0.86/0.70 |
|
| 432 |
+
| multi-K | 0.168 (p 0.04, worse) | 0.928 | 0.775 | 0.74/0.76/0.85/0.66 |
|
| 433 |
+
| recipes | 0.161 (p 0.75) | 0.933 | 0.766 | 0.78/0.78/0.86/0.65 |
|
| 434 |
+
|
| 435 |
+
Inner-validation losses were within 0.0001 of plain LoRA in every fold.
|
| 436 |
+
|
| 437 |
+
**Conclusion:**
|
| 438 |
+
- Varying K brings no gain in either dataset. On the real-bulk side K is only a scale label.
|
| 439 |
+
- Recipes repeat the pretraining task, which does not teach the real-bulk mapping.
|
| 440 |
+
- The protocol keeps a single K = 1000 for the real-bulk condition.
|
| 441 |
+
|
| 442 |
+
## Running (2026-09-28)
|
| 443 |
+
|
| 444 |
+
- **LoRA learning curve:**
|
| 445 |
+
- n training donors ∈ {5, 10, 20, 40}, nested and stratified (sepsis keeps its case:control ratio), subset seed 1000 + fold.
|
| 446 |
+
- Inner-validation and test rows are unchanged. `--train-n` in `ft_sdd.py`.
|
| 447 |
+
- Queues `*_lora_learning_curve.txt`: sepsis first, then ImMicro.
|
| 448 |
+
- **K augmentation** (`tools/ft_sdd_aug.py`, queues `*_lora_aug.txt`, after the learning curve):
|
| 449 |
+
- `lora_multik`: each training cell sees its donor's real bulk at K ∈ {250, 500, 1000, 2000, 4000}, with the per-cell depth kept.
|
| 450 |
+
- `lora_recipe`: half of each batch comes from one pretraining-style recipe. A recipe is K cells of one training donor (K from the pretraining grid, capped at that donor's cell count); its condition is their full-axis pseudobulk at recipe size K.
|
| 451 |
+
- Recipes need the full-axis cells in `data/<dataset>/cells_full.npz`, built by `tools/build_full_cells.py`. Their panel columns equal `cells_panel6k.npz` and their per-row sums equal `pseudo_raw_sum`.
|
| 452 |
+
- **Automation:** fold scoring, aggregation and pooled scoring follow automatically (`ft-lc-finalize-*`, `ft-aug-finalize-*` units).
|
| 453 |
+
|
| 454 |
+
## Queue
|
| 455 |
+
|
| 456 |
+
- Sepsis fold 0 pilot (same eight arms) → ImMicro folds 1–4 → sepsis folds 1–4.
|
| 457 |
+
- Arms for folds 1–4: zero-shot raw/cal/pseudo, FT full, FT LoRA, sc-only FT control.
|
| 458 |
+
- Chained as systemd user units (`ft-*`), logs in `logs/`.
|