junidude14 commited on
Commit
614e74a
·
verified ·
1 Parent(s): 50142bb

Archive 4 checkpoints (1-4)

Browse files
.gitattributes CHANGED
@@ -69,3 +69,5 @@ paper-releases/pbisc-diffusion/updates/20261001T023742Z-deck-calibration-giroux-
69
  paper-releases/pbisc-diffusion/updates/20261001T023742Z-deck-calibration-giroux-sexgenes/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx filter=lfs diff=lfs merge=lfs -text
70
  paper-releases/pbisc-diffusion/updates/20261001T145641Z-lora-rank-sweep-calibration-budget/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pdf filter=lfs diff=lfs merge=lfs -text
71
  paper-releases/pbisc-diffusion/updates/20261001T145641Z-lora-rank-sweep-calibration-budget/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx filter=lfs diff=lfs merge=lfs -text
 
 
 
69
  paper-releases/pbisc-diffusion/updates/20261001T023742Z-deck-calibration-giroux-sexgenes/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx filter=lfs diff=lfs merge=lfs -text
70
  paper-releases/pbisc-diffusion/updates/20261001T145641Z-lora-rank-sweep-calibration-budget/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pdf filter=lfs diff=lfs merge=lfs -text
71
  paper-releases/pbisc-diffusion/updates/20261001T145641Z-lora-rank-sweep-calibration-budget/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx filter=lfs diff=lfs merge=lfs -text
72
+ paper-releases/pbisc-diffusion/updates/20261002T002920Z-deck-extra-metrics-scsemi-prep/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pdf filter=lfs diff=lfs merge=lfs -text
73
+ paper-releases/pbisc-diffusion/updates/20261002T002920Z-deck-extra-metrics-scsemi-prep/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx filter=lfs diff=lfs merge=lfs -text
paper-releases/pbisc-diffusion/updates/20261002T002920Z-deck-extra-metrics-scsemi-prep/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb90ec908ac173f682ee5b5fdc29daebe933d7ef3eba53100636d7e2b7017723
3
+ size 5342117
paper-releases/pbisc-diffusion/updates/20261002T002920Z-deck-extra-metrics-scsemi-prep/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_paper_summary_20260930.pptx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94ca4c943def96aeee51d200bb3a415eda97958b63f3f3a442923be338c7b70e
3
+ size 6035313
paper-releases/pbisc-diffusion/updates/20261002T002920Z-deck-extra-metrics-scsemi-prep/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/README.md ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PBISC-Diffusion paper summary deck (2026-09-30, r00)
2
+
3
+ 32-slide English summary of the PBISC-Diffusion (Model 8) paper experiments: title,
4
+ outline, 10 sections (24 content slides), then a Backup divider and 6 backup slides.
5
+ Short keyword lines only; the figures carry the results. Section 10 is planned work.
6
+
7
+ - `PBISC-Diffusion_paper_summary_20260930.pptx`: the deck
8
+ - `PBISC-Diffusion_paper_summary_20260930.pdf`: LibreOffice PDF of the deck
9
+ - `data/slides_spec.json`: slide order, titles, keywords, footnotes, speaker-note text
10
+ - `generate_deck.py`: builds the pptx from `data/slides_spec.json` only (python-pptx)
11
+ - `figures/`: all slide figures (PNG + PDF), made by `tools/sec*.py`
12
+ - `data/sec*.csv`, `data/sec09_slide_text.json`, `data/sec09_extra_slide_text.json`,
13
+ `data/sec07_rank_sweep_slide_text.json`: every plotted or quoted number with its source path
14
+ - `render/`: PDF and 70-dpi slide JPGs for checking
15
+
16
+ ## Rebuild
17
+
18
+ Everything is CPU only; no GPU or checkpoint is touched.
19
+
20
+ ```bash
21
+ cd /home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/presentations/2026-09-30--paper-summary--r00
22
+ # figures + data tables (sec03_common.py, style.py and scsemi_results.py are shared helpers, not run directly)
23
+ for f in sec01_overview sec02_backbone sec03_width_loss sec03_width_bench sec03_panel \
24
+ sec04_sle_benchmark sec05_condition_space sec05_cells_offmanifold \
25
+ sec05_behcet_direction sec05_shift_cohorts sec06_finetune_method sec07_ft_modes \
26
+ sec07_k_aug sec07_rank_sweep sec08_pairs_needed sec09_paired_validation sec09_extra_metrics \
27
+ sec10_paired_subset_cohorts; do
28
+ python3 "tools/$f.py" || break
29
+ done
30
+ python3 tools/sync_sec09_text.py # copy generated slide text (sec09, sec09_extra, sec07_rank_sweep) into the spec
31
+ python3 generate_deck.py # -> PBISC-Diffusion_paper_summary_20260930.pptx
32
+ soffice --headless --convert-to pdf --outdir render PBISC-Diffusion_paper_summary_20260930.pptx
33
+ pdftoppm -jpeg -r 70 render/PBISC-Diffusion_paper_summary_20260930.pdf render/slide
34
+ cp render/PBISC-Diffusion_paper_summary_20260930.pdf .
35
+ ```
36
+
37
+ `generate_deck.py` stops with an error if a figure is missing, a title does not fit on one
38
+ line, a footnote needs more than 2 lines, or any text contains Korean or placeholder words.
39
+
40
+ ## Notes
41
+
42
+ - Section 9 (few-pair scSemiProfiler comparison) uses all 25 scSemiProfiler draws
43
+ (5 cohorts x 5 draws). If scores change, rerun `tools/sec09_paired_validation.py`, then
44
+ `tools/sync_sec09_text.py`, then check the short footnotes it lists and rebuild.
45
+ - Section 9 update (user decisions 2026-10-01): (1) the gene-wise calibration comparator is back,
46
+ named "Zero-shot + calibration" (few-pair `zs_cal`, alpha from the same 5 donors; 5-fold `zs__cal`)
47
+ and the sc-only control is "sc-only fine-tune (+ calibration)" (`pseudo_full__cal`); (2) Giroux's
48
+ disease metrics (logFC r, partial r, top-50 DEG, broadcast) exclude 196 sex-linked genes because its
49
+ severity is confounded with sex, read from `plans/paired_finetune_intradataset_20260927/scores_nosex/`
50
+ (see its README). Both are stated in the slide footnotes.
51
+ - On-slide footnotes are one short line; the full source and method text is in the speaker
52
+ notes (`footnote_full` in the spec).
53
+ - `DRAFT_1150_*`: frozen copy shown at the 2026-09-30 12:00 meeting (23/25 scSemiProfiler
54
+ draws, long footnotes). Superseded by the files above.
55
+ - Story rule (user decision 2026-09-30): the deck and paper do not mention PBISC-VAE, reference
56
+ calibration (refcal), the TPM input variant or any calibration arm (calibration arm reinstated
57
+ 2026-10-01 as "Zero-shot + calibration"; never "refcal"). The no-fine-tune baseline is
58
+ zero-shot on real bulk as measured; the sc-only control is the sc-only fine-tune fed raw bulk.
59
+ `tools/sec04_immicro.py` (refcal vs scSemiProfiler on ImMicro) is kept but no longer in the deck.
60
+ The pre-revision deck, scripts and figures are in `_archive/2026-09-30_before_no_vae_refcal/`.
61
+
62
+ - Added 2026-10-02 (from `plans/paired_finetune_intradataset_20260927/scores_extra/` and `scores/<cohort>/rankcal_20261001.*`):
63
+ slide 23 "5 donors: realism beyond precision/coverage" (classifier AUC, MMD², scSemiProfiler's E_N per cohort;
64
+ few-pair arms, mean ± SD over draws) and three backups: slide 30 LoRA rank r = 4 / 16 / 64 (ImMicro, sepsis),
65
+ slide 31 the same realism metrics for the 5-fold pooled design, slide 32 precision/coverage at k = 3 / 5 / 10
66
+ (few-pair; the 5-fold k ranking is in the speaker notes). Scripts: `tools/sec09_extra_metrics.py` (checks every
67
+ value against `scores_extra/{fewshot,pooled}_headline.csv`) and `tools/sec07_rank_sweep.py` (checks
68
+ `rankcal_20261001.json` against the scoring calls). Their slide text is generated (`text_source` in the spec) and
69
+ synced by `tools/sync_sec09_text.py`. Pre-update deck: `_archive/2026-10-01_before_extra_metrics/`.
70
+ - scSemiProfiler 5-fold and equal-budget results are picked up automatically when they appear
71
+ (`tools/scsemi_results.py`: arm `scsemi__raw` in `scores/<cohort>/scsemi_cv_20261002/pooled*/`, arms
72
+ `scsemi_n{5,10,20,40}__raw` in `scores/<cohort>/scsemi_budget_20261002/pooled*/`, extra metrics below
73
+ `scores_extra/<cohort>/scsemi_cv_20261002/`; a call is used only for the same donors and reference cells as the
74
+ main pooled call). When present: a "scSemiProfiler, all training pairs" bar on slide 24 (Giroux disease metrics only
75
+ after a `scores_nosex/giroux2022/scsemi_cv_20261002/` rescore, else "rescore pending"), a scSemiProfiler line across
76
+ n on slides 18–19 ("all" = the 5-fold run), and a scSemiProfiler row on slide 31. When absent, each script prints a
77
+ NOTE and the figures are unchanged. After they arrive: rerun the four scripts, sync, check the hand-written keywords
78
+ of slides 18–19 (not generated) and rebuild. The presence path was tested with synthetic arms in a scratch copy
79
+ (`DECK_SCSEMI_PLAN_ROOT`, `DECK_FIGDIR`, `DECK_OUTDATA` redirect the lookup and outputs).
80
+
81
+ ## Sources
82
+
83
+ Final model: `runs/f01_6k_1x_seed20260627` (epoch 16, EMA). Scores and receipts come from
84
+ `plans/utility_studies_final6k_20260925/`, `plans/paired_finetune_intradataset_20260927/`,
85
+ `plans/immicro_scsemi_comparison_20260927/`, `plans/floor01_campaign_20260923/`,
86
+ `analysis/scsemi_benchmark_diffusion_20260913/` and the run folders named in each
87
+ `data/sec*.csv`. Manuscript: `/home/sj_server_1/PBISC/paper-release-20260928/manuscript/`.
paper-releases/pbisc-diffusion/updates/20261002T002920Z-deck-extra-metrics-scsemi-prep/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/tools/scsemi_results.py ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Where the scSemiProfiler 5-fold (CV) and equal-budget results will appear, and a tolerant lookup for them.
2
+
3
+ Shared helper of the 2026-09-30 paper-summary deck (not run directly). CPU only; reads files, never writes.
4
+
5
+ Planned locations (2026-10-02; the GPU runs are prepared by another agent and may not exist yet):
6
+ CV arm scsemi__raw <PLAN>/scores/<ds>/scsemi_cv_20261002/{fold<k>,pooled}/
7
+ equal budget arms scsemi_n{5,10,20,40}__raw <PLAN>/scores/<ds>/scsemi_budget_20261002/{fold<k>,pooled}/
8
+ (ImMicro and sepsis only)
9
+ extra metrics (classifier AUC, MMD^2, E_N, P/C at k = 3/5/10)
10
+ <PLAN>/scores_extra/<ds>/scsemi_cv_20261002/ and .../scsemi_budget_20261002/ (any depth below)
11
+ Giroux disease metrics without sex-linked genes, if rescored:
12
+ <PLAN>/scores_nosex/giroux2022/scsemi_cv_20261002/...
13
+
14
+ The deck uses cross-fitted pooled calls only: directories below <exp>/ with a path part starting with "pooled"
15
+ (pooled, pooled_deg, ...), never fold<k>/ or arms/. A call is accepted only if it scores the same donors with the
16
+ same reference cells as the main pooled call and its generation receipt is not marked unverified (accept()).
17
+
18
+ Every script that uses this module prints a note and draws nothing for scSemiProfiler when no accepted call exists.
19
+ DECK_SCSEMI_PLAN_ROOT overrides <PLAN> for these lookups only (the synthetic presence test in a scratch copy).
20
+ """
21
+ from __future__ import annotations
22
+
23
+ import json
24
+ import os
25
+ import re
26
+ from pathlib import Path
27
+
28
+ PLAN_DEFAULT = Path("/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/"
29
+ "paired_finetune_intradataset_20260927")
30
+ CV_EXP = "scsemi_cv_20261002"
31
+ BUDGET_EXP = "scsemi_budget_20261002"
32
+ CV_ARM = "scsemi__raw"
33
+ BUDGET_RE = re.compile(r"^scsemi_n(\d+)__raw$")
34
+ FOLD_RE = re.compile(r"^fold\d+$")
35
+ LABEL_CV = "scSemiProfiler, all training pairs"
36
+
37
+
38
+ def plan_root() -> Path:
39
+ return Path(os.environ.get("DECK_SCSEMI_PLAN_ROOT", str(PLAN_DEFAULT)))
40
+
41
+
42
+ def is_test_root() -> bool:
43
+ return plan_root() != PLAN_DEFAULT
44
+
45
+
46
+ def _pooled_dir(rel: Path) -> bool:
47
+ parts = rel.parts
48
+ return (not any(FOLD_RE.match(p) or p == "arms" for p in parts)) and any(p.startswith("pooled") for p in parts)
49
+
50
+
51
+ def pooled_dirs(ds: str, exp: str, tree: str = "scores") -> list[Path]:
52
+ """Directories with a summary.json of the pooled calls of one experiment, 'pooled' before 'pooled_deg' etc."""
53
+ root = plan_root() / tree / ds / exp
54
+ if not root.is_dir():
55
+ return []
56
+ out = [sp.parent for sp in root.rglob("summary.json") if _pooled_dir(sp.parent.relative_to(root))]
57
+ return sorted(out, key=lambda p: (len(p.relative_to(root).parts), p.name != "pooled", str(p)))
58
+
59
+
60
+ def _arms(d: Path) -> list[str]:
61
+ try:
62
+ return list(json.loads((d / "summary.json").read_text()).get("arms") or [])
63
+ except (OSError, ValueError):
64
+ return []
65
+
66
+
67
+ def cv_calls(ds: str, tree: str = "scores") -> list[Path]:
68
+ """Pooled call directories that contain the CV arm."""
69
+ return [d for d in pooled_dirs(ds, CV_EXP, tree) if CV_ARM in _arms(d)]
70
+
71
+
72
+ def budget_calls(ds: str, tree: str = "scores") -> dict[int, list[tuple[str, Path]]]:
73
+ """n -> [(arm, pooled call dir)] for the equal-budget arms scsemi_n<n>__raw."""
74
+ out: dict[int, list[tuple[str, Path]]] = {}
75
+ for d in pooled_dirs(ds, BUDGET_EXP, tree):
76
+ for a in _arms(d):
77
+ m = BUDGET_RE.match(a)
78
+ if m:
79
+ out.setdefault(int(m.group(1)), []).append((a, d))
80
+ return out
81
+
82
+
83
+ def accept(summary: dict, ref_summary: dict, arm: str) -> list[str]:
84
+ """Reasons to reject one scSemiProfiler arm of a call against the main pooled call ([] = accepted)."""
85
+ why = []
86
+ if arm not in (summary.get("arms") or []):
87
+ why.append(f"arm {arm} not in the call")
88
+ if set(map(str, summary.get("donors", []))) != set(map(str, ref_summary.get("donors", []))):
89
+ why.append(f"donor set differs ({len(summary.get('donors', []))} vs {len(ref_summary.get('donors', []))})")
90
+ rs = summary.get("reference", {}).get("reference_sha256")
91
+ if rs != ref_summary.get("reference", {}).get("reference_sha256"):
92
+ why.append("reference cells differ (reference_sha256)")
93
+ if summary.get("per_arm", {}).get(arm, {}).get("receipt_verified", True) is False:
94
+ why.append("generation receipt not verified")
95
+ return why
96
+
97
+
98
+ def extra_units(ds: str, exp: str) -> list[Path]:
99
+ """Extra-metric unit directories (metrics.csv + en.csv) below scores_extra/<ds>/<exp>/, pooled ones first;
100
+ fold<k>/ units are skipped (the deck shows the pooled design)."""
101
+ root = plan_root() / "scores_extra" / ds / exp
102
+ if not root.is_dir():
103
+ return []
104
+ out = []
105
+ for mp in root.rglob("metrics.csv"):
106
+ d = mp.parent
107
+ rel = d.relative_to(root)
108
+ if any(FOLD_RE.match(p) for p in rel.parts) or not (d / "en.csv").is_file():
109
+ continue
110
+ out.append(d)
111
+ return sorted(out, key=lambda p: (not any(x.startswith("pooled") for x in p.relative_to(root).parts),
112
+ len(p.relative_to(root).parts), str(p)))