Archive 4 checkpoints (1-4)
Browse files- paper-releases/pbisc-diffusion/updates/20260929T062828Z-manuscript-relocation/diffusion/dataset/server_1/manuscript/scripts/cohort_calibration/package_analysis.py +87 -0
- paper-releases/pbisc-diffusion/updates/20260929T062828Z-manuscript-relocation/diffusion/dataset/server_1/model8/plans/threshold_rescore_20260922/tools/write_architecture_table.py +125 -0
- paper-releases/pbisc-diffusion/updates/20260929T062828Z-manuscript-relocation/diffusion/dataset/server_1/model8/plans/utility_studies_final6k_20260925/behcet/tools/make_manifest.py +105 -0
- paper-releases/pbisc-diffusion/updates/20260929T062828Z-manuscript-relocation/diffusion/metadata/request.json +73 -0
paper-releases/pbisc-diffusion/updates/20260929T062828Z-manuscript-relocation/diffusion/dataset/server_1/manuscript/scripts/cohort_calibration/package_analysis.py
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Bundle verified calibration figures, source tables and code into the paper."""
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
from datetime import datetime, timezone
|
| 4 |
+
import hashlib
|
| 5 |
+
import json
|
| 6 |
+
import shutil
|
| 7 |
+
import pandas as pd
|
| 8 |
+
|
| 9 |
+
ROOT=Path(__file__).resolve().parent
|
| 10 |
+
PAPER=ROOT.parents[1]
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def sha(path):
|
| 14 |
+
h=hashlib.sha256()
|
| 15 |
+
with path.open('rb') as f:
|
| 16 |
+
for x in iter(lambda:f.read(8*1024**2),b''):h.update(x)
|
| 17 |
+
return h.hexdigest()
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def main():
|
| 21 |
+
assert json.loads((ROOT/'QA.json').read_text())['state']=='passed'
|
| 22 |
+
assert json.loads((ROOT/'PUBLICATION_QA.json').read_text())['state']=='PASS'
|
| 23 |
+
destination=PAPER/'source_data/calibration'
|
| 24 |
+
scripts=PAPER/'scripts/cohort_calibration'
|
| 25 |
+
destination.mkdir(parents=True,exist_ok=True);scripts.mkdir(parents=True,exist_ok=True)
|
| 26 |
+
copied=[]
|
| 27 |
+
def copy(source,target):
|
| 28 |
+
target.parent.mkdir(parents=True,exist_ok=True)
|
| 29 |
+
shutil.copy2(source,target)
|
| 30 |
+
copied.append(target)
|
| 31 |
+
for source in sorted((ROOT/'figures').iterdir()):
|
| 32 |
+
if source.suffix in ['.pdf','.svg','.png']:
|
| 33 |
+
copy(source,PAPER/'figures'/source.name)
|
| 34 |
+
elif source.suffix in ['.csv','.json']:
|
| 35 |
+
copy(source,destination/'plot_sources'/source.name)
|
| 36 |
+
for source in sorted((ROOT/'summary').iterdir()):
|
| 37 |
+
if source.suffix in ['.csv','.json']:
|
| 38 |
+
copy(source,destination/source.name)
|
| 39 |
+
for name in ['MODEL_ASSETS.json','INPUTS.json','RUN_SIGNATURE.json','FINAL_MANIFEST.json']:
|
| 40 |
+
copy(ROOT/'results'/name,destination/('RUN_'+name if name=='FINAL_MANIFEST.json' else name))
|
| 41 |
+
for name in ['QA.json','QA_base.json','PUBLICATION_QA.json','TEST_RESULTS.xml',
|
| 42 |
+
'RUN_PROTOCOL.md','analysis-report.md','stats-appendix.md','figure-catalog.md']:
|
| 43 |
+
copy(ROOT/name,destination/name)
|
| 44 |
+
for source in sorted(ROOT.glob('*.py')):
|
| 45 |
+
copy(source,scripts/source.name)
|
| 46 |
+
# Per-sample primary 2K endpoints, rather than multi-million-row duplicates
|
| 47 |
+
# from all block/model sensitivities. Complete arrays remain in the datalake.
|
| 48 |
+
rows=[]
|
| 49 |
+
for source in sorted((ROOT/'results/partitions').glob('*/random_donor_n10_seed*/sample_metrics.csv.gz')):
|
| 50 |
+
frame=pd.read_csv(source)
|
| 51 |
+
rows.append(frame[(frame.model_id=='2k_e3')&frame.block.isin(['input','encoded'])])
|
| 52 |
+
combined=pd.concat(rows,ignore_index=True)
|
| 53 |
+
target=destination/'primary_sample_metrics.csv.gz'
|
| 54 |
+
combined.to_csv(target,index=False,compression='gzip');copied.append(target)
|
| 55 |
+
readme=destination/'README.md'
|
| 56 |
+
readme.write_text('''# Figure 6: within-cohort paired calibration
|
| 57 |
+
|
| 58 |
+
Primary paper model: frozen PBISC-Diffusion2K E3 EMA, not B048. Exactly10 paired
|
| 59 |
+
donors calibrate each of100 selections per study. This bundle includes all
|
| 60 |
+
split assignments, numerical figure source tables, primary sample metrics,
|
| 61 |
+
model/source provenance and independent QA. Complete600-partition coefficient
|
| 62 |
+
arrays and sensitivity sample metrics remain in the analysis datalake path
|
| 63 |
+
recorded in RUN_FINAL_MANIFEST.json.
|
| 64 |
+
|
| 65 |
+
Depth is standardized at K1000 and a fixed training anchor; this is not native
|
| 66 |
+
count-depth recovery or generated-cell validation. Original SC reference gene
|
| 67 |
+
support is retained. The same-condition mean control is explicitly post-hoc.
|
| 68 |
+
Selection ranges are not independent-cohort confidence intervals.
|
| 69 |
+
|
| 70 |
+
Plots can be rebuilt from publication_split_summary.csv using
|
| 71 |
+
scripts/cohort_calibration/make_figures.py. Full experiment reproduction also
|
| 72 |
+
requires the processed expression sources and frozen checkpoints listed in
|
| 73 |
+
INPUTS.json/MODEL_ASSETS.json; edit the recorded local asset paths for another
|
| 74 |
+
host. Checkpoints and raw sequencing data are not bundled or claimed newly
|
| 75 |
+
public. The primary papers and GEO/Zenodo accessions are cited in Methods.
|
| 76 |
+
''')
|
| 77 |
+
copied.append(readme)
|
| 78 |
+
manifest=dict(state='completed',created_at=datetime.now(timezone.utc).isoformat(),
|
| 79 |
+
experiment_root=str(ROOT),n_partitions=600,n_primary_sample_metric_rows=len(combined),
|
| 80 |
+
qa='passed; see QA.json and PUBLICATION_QA.json',
|
| 81 |
+
files=[dict(bundled_path=str(p.relative_to(PAPER)),bytes=p.stat().st_size,sha256=sha(p)) for p in sorted(set(copied))])
|
| 82 |
+
(destination/'MANIFEST.json').write_text(json.dumps(manifest,indent=2)+'\n')
|
| 83 |
+
print(json.dumps(dict(state='completed',n_files=len(manifest['files']),
|
| 84 |
+
primary_sample_metric_rows=len(combined),destination=str(destination))))
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
if __name__=='__main__':main()
|
paper-releases/pbisc-diffusion/updates/20260929T062828Z-manuscript-relocation/diffusion/dataset/server_1/model8/plans/threshold_rescore_20260922/tools/write_architecture_table.py
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Regenerate tables/results_architecture.tex from the scANVI snapshot.
|
| 3 |
+
|
| 4 |
+
The four width arms are read out three ways on the same checkpoints: the inherited cut at p>0.5, the
|
| 5 |
+
swept cut at tau=-2.0, and the drawn read-out that samples each gene from its predicted detection
|
| 6 |
+
probability. Writing the table from the snapshot rather than by hand keeps the manuscript numbers tied
|
| 7 |
+
to the metric files, and makes it obvious when an arm has not been scored yet.
|
| 8 |
+
|
| 9 |
+
The response column is the change in detected genes per cell per unit of threshold, measured at part 16
|
| 10 |
+
between the two thresholded read-outs on the 2,980-gene panel; it is what shows that a wide trunk stops
|
| 11 |
+
responding to the read-out at all.
|
| 12 |
+
"""
|
| 13 |
+
from __future__ import annotations
|
| 14 |
+
|
| 15 |
+
import sys
|
| 16 |
+
from pathlib import Path
|
| 17 |
+
|
| 18 |
+
import numpy as np
|
| 19 |
+
import pandas as pd
|
| 20 |
+
|
| 21 |
+
M8 = Path("/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion")
|
| 22 |
+
A = M8 / "analysis/scsemi_benchmark_diffusion_20260913"
|
| 23 |
+
OUT = Path("/home/sj_server_1/PBISC/paper-release-20260928/manuscript" # moved from bulk2sc-paper/nature-communications-overleaf on 2026-09-29
|
| 24 |
+
"/tables/results_architecture.tex")
|
| 25 |
+
EPOCHS = (14, 15, 16)
|
| 26 |
+
# label, trunk, conditioning width, parameters, validation loss at part 16,
|
| 27 |
+
# (default tag, swept tag, drawn tag), detected-genes response per threshold unit
|
| 28 |
+
ARMS = [
|
| 29 |
+
("Base", r"$1\times$", "512", "54.2M", 0.1968, ("6k", "6kt20", "bern6k"), 77),
|
| 30 |
+
("Wide condition", r"$1\times$", "2,048", "102.1M", 0.1969, ("ctx2048", "ctx2048t20", "bernctx2048"), 79),
|
| 31 |
+
("Wide trunk", r"$4\times$", "512", "240.0M", 0.1355, ("4xctx512", "4xctx512t20", "bern4xctx512"), 10),
|
| 32 |
+
("Both wide", r"$4\times$", "2,048", "312.6M", 0.1356, ("4x", "4xt20", "bern4x"), 6),
|
| 33 |
+
]
|
| 34 |
+
|
| 35 |
+
CAPTION = (
|
| 36 |
+
"Capacity lowers the loss and does not move the biology; it also removes the read-out's control. "
|
| 37 |
+
"Four models differ only in denoiser trunk width and conditioning width, trained for 16 schedule "
|
| 38 |
+
"parts on the 6,000-gene panel with the same data, seed, batch size, learning rate and schedule. "
|
| 39 |
+
"Scores are means over parts 14--16 on the held-out lupus split under three read-outs of the same "
|
| 40 |
+
"checkpoints; $r$ and DEG higher-better, composition $L_1$ lower-better. Validation loss is the "
|
| 41 |
+
"denoising objective at part 16. Response is the change in detected genes per cell when the support "
|
| 42 |
+
"threshold is lowered by one unit, measured at part 16: the two wide-trunk models barely respond, so "
|
| 43 |
+
"their sparsity cannot be set by a threshold at all."
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def snapshot() -> pd.DataFrame:
|
| 48 |
+
dirs = [A / "metrics_arch_epochs/scanvi_server2", A / "metrics_prop_epochs/scanvi_server2"]
|
| 49 |
+
cands = [p for d in dirs if d.exists() for p in d.glob("summary_tidy_*.csv")]
|
| 50 |
+
if not cands:
|
| 51 |
+
raise SystemExit("no scANVI snapshot found")
|
| 52 |
+
newest = max(cands, key=lambda p: p.stat().st_mtime)
|
| 53 |
+
t = pd.read_csv(newest)
|
| 54 |
+
t = t[(t["comparison"] == "all_diffusion") & (t["celltype_gate"] == "common_celltype_gate")]
|
| 55 |
+
return t.drop_duplicates("method").set_index("method")
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
def mean_scores(t: pd.DataFrame, tag: str):
|
| 59 |
+
rows = [t.loc[f"diffusion_{tag}_e{e}"] for e in EPOCHS if f"diffusion_{tag}_e{e}" in t.index]
|
| 60 |
+
if len(rows) != len(EPOCHS):
|
| 61 |
+
return None
|
| 62 |
+
return (float(np.mean([r["mean_logFC_pearson"] for r in rows])),
|
| 63 |
+
float(np.mean([r["total_top50_overlap"] for r in rows])),
|
| 64 |
+
float(np.mean([r["composition_l1"] for r in rows])))
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def main() -> int:
|
| 68 |
+
t = snapshot()
|
| 69 |
+
scores = {}
|
| 70 |
+
missing = []
|
| 71 |
+
for label, *_ , tags, _resp in [(a[0], a[1], a[2], a[3], a[4], a[5], a[6]) for a in ARMS]:
|
| 72 |
+
for which, tag in zip(("default", "swept", "drawn"), tags):
|
| 73 |
+
m = mean_scores(t, tag)
|
| 74 |
+
scores[(label, which)] = m
|
| 75 |
+
if m is None:
|
| 76 |
+
missing.append(f"{label}/{which} ({tag})")
|
| 77 |
+
if missing:
|
| 78 |
+
print("not scored yet: " + ", ".join(missing), file=sys.stderr)
|
| 79 |
+
return 1
|
| 80 |
+
|
| 81 |
+
best = {}
|
| 82 |
+
for which in ("default", "swept", "drawn"):
|
| 83 |
+
for j, better in enumerate((max, max, min)):
|
| 84 |
+
best[(which, j)] = better(scores[(a[0], which)][j] for a in ARMS)
|
| 85 |
+
# bold the best value of each metric across the whole table, not within a read-out
|
| 86 |
+
overall = [max(scores[(a[0], w)][0] for a in ARMS for w in ("default", "swept", "drawn")),
|
| 87 |
+
max(scores[(a[0], w)][1] for a in ARMS for w in ("default", "swept", "drawn")),
|
| 88 |
+
min(scores[(a[0], w)][2] for a in ARMS for w in ("default", "swept", "drawn"))]
|
| 89 |
+
best_loss = min(a[4] for a in ARMS)
|
| 90 |
+
|
| 91 |
+
def fmt(value: float, j: int) -> str:
|
| 92 |
+
text = f"{value:.3f}" if j != 1 else f"{value:.1f}"
|
| 93 |
+
return rf"\textbf{{{text}}}" if abs(value - overall[j]) < 1e-9 else text
|
| 94 |
+
|
| 95 |
+
lines = [
|
| 96 |
+
r"\begin{table}[t]", r"\centering", r"\footnotesize",
|
| 97 |
+
r"\setlength{\tabcolsep}{2.2pt}",
|
| 98 |
+
rf"\caption{{{CAPTION}}}", r"\label{tab:architecture}",
|
| 99 |
+
r"\begin{tabular}{lrrrrrrrrrrrrrr}", r"\toprule",
|
| 100 |
+
r" & \multicolumn{2}{c}{Width} & & Val. & \multicolumn{3}{c}{Cut at $p>0.5$}"
|
| 101 |
+
r" & \multicolumn{3}{c}{Cut at $\tau=-2.0$} & \multicolumn{3}{c}{Drawn from $p$} & Response \\",
|
| 102 |
+
r"\cmidrule(lr){2-3}\cmidrule(lr){6-8}\cmidrule(lr){9-11}\cmidrule(lr){12-14}",
|
| 103 |
+
r"Model & trunk & cond. & Params & loss & $r$ & DEG & $L_1$ & $r$ & DEG & $L_1$"
|
| 104 |
+
r" & $r$ & DEG & $L_1$ & genes/unit \\",
|
| 105 |
+
r"\midrule",
|
| 106 |
+
]
|
| 107 |
+
for label, trunk, cond, params, loss, _tags, response in ARMS:
|
| 108 |
+
loss_text = rf"\textbf{{{loss:.4f}}}" if abs(loss - best_loss) < 1e-9 else f"{loss:.4f}"
|
| 109 |
+
cells = []
|
| 110 |
+
for which in ("default", "swept", "drawn"):
|
| 111 |
+
s = scores[(label, which)]
|
| 112 |
+
cells += [fmt(s[0], 0), fmt(s[1], 1), fmt(s[2], 2)]
|
| 113 |
+
lines.append(f"{label:14s} & {trunk} & {cond} & {params} & {loss_text} & "
|
| 114 |
+
+ " & ".join(cells) + f" & {response} \\\\")
|
| 115 |
+
lines += [r"\bottomrule", r"\end{tabular}", r"\end{table}", ""]
|
| 116 |
+
OUT.write_text("\n".join(lines))
|
| 117 |
+
print(f"written: {OUT}")
|
| 118 |
+
for label, *_ in ARMS:
|
| 119 |
+
s = scores[(label, "drawn")]
|
| 120 |
+
print(f" {label:15s} drawn {s[0]:.3f} / {s[1]:.1f} / {s[2]:.3f}")
|
| 121 |
+
return 0
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
if __name__ == "__main__":
|
| 125 |
+
sys.exit(main())
|
paper-releases/pbisc-diffusion/updates/20260929T062828Z-manuscript-relocation/diffusion/dataset/server_1/model8/plans/utility_studies_final6k_20260925/behcet/tools/make_manifest.py
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
"""Write behcet/MANIFEST.json: sha256 of every input, tool and output of this task dir."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import datetime as _dt
|
| 7 |
+
import hashlib
|
| 8 |
+
import json
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
M8 = Path("/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion")
|
| 12 |
+
T = M8 / "plans/utility_studies_final6k_20260925/behcet"
|
| 13 |
+
R = M8 / "plans/behcet_c1q_repro_20260921"
|
| 14 |
+
S = M8 / "plans/aifi_scanvi_rebuild_20260916"
|
| 15 |
+
DL = Path("/home/sj_server_1/gblee/datalake/paired-pbmc-bulk-sc/datasets")
|
| 16 |
+
PAPER = Path("/home/sj_server_1/PBISC/paper-release-20260928/manuscript") # moved from bulk2sc-paper/nature-communications-overleaf on 2026-09-29
|
| 17 |
+
SEEDS = M8 / "plans/utility_studies_final6k_20260925/behcet_seeds"
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def sha(path: Path) -> str:
|
| 21 |
+
h = hashlib.sha256()
|
| 22 |
+
with path.open("rb") as fh:
|
| 23 |
+
for chunk in iter(lambda: fh.read(1 << 24), b""):
|
| 24 |
+
h.update(chunk)
|
| 25 |
+
return h.hexdigest()
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
INPUTS = {
|
| 29 |
+
"final_checkpoint": M8 / "runs/f01_6k_1x_seed20260627/checkpoint_epoch_016.pt",
|
| 30 |
+
"behcet_condition_npz": R / "conditions/behcet_donor_conditions.npz",
|
| 31 |
+
"observed_h5ad_GSE198616_pbmc_all8": R / "work/gse198616_pbmc_all8.h5ad",
|
| 32 |
+
"observed_build_manifest": R / "work/BUILD_MANIFEST.json",
|
| 33 |
+
"observed_labels_6k_v2_old": R / "work/scanvi_labels_real/labels.parquet",
|
| 34 |
+
"observed_labels_f01common_new": T / "work/scanvi_labels_real_f01common/labels.parquet",
|
| 35 |
+
"observed_labels_f01common_new_manifest": T / "work/scanvi_labels_real_f01common/labels.manifest.json",
|
| 36 |
+
"generated_npz_seed20260913": M8 / "analysis/scsemi_benchmark_diffusion_20260913/generated_behcetf016kbern.npz",
|
| 37 |
+
"generated_h5ad_seed20260913": R / "work_gen/generated_behcetf016kbern_poisson.h5ad",
|
| 38 |
+
"generated_labels_seed20260913": R / "work_gen/scanvi_labels_f016kbern_f01common/labels.parquet",
|
| 39 |
+
"generated_labels_seed20260913_manifest": R / "work_gen/scanvi_labels_f016kbern_f01common/labels.manifest.json",
|
| 40 |
+
"generated_npz_s1": SEEDS / "generated_behcetf016kbern_s1.npz",
|
| 41 |
+
"generated_npz_s1_receipt": SEEDS / "generated_behcetf016kbern_s1.log",
|
| 42 |
+
"generated_npz_s2": SEEDS / "generated_behcetf016kbern_s2.npz",
|
| 43 |
+
"generated_npz_s2_receipt": SEEDS / "generated_behcetf016kbern_s2.log",
|
| 44 |
+
"generated_h5ad_s1": T / "work/generated_behcetf016kbern_s1_poisson.h5ad",
|
| 45 |
+
"generated_labels_s1": T / "work/scanvi_labels_f016kbern_s1_f01common/labels.parquet",
|
| 46 |
+
"generated_h5ad_s2": T / "work/generated_behcetf016kbern_s2_poisson.h5ad",
|
| 47 |
+
"generated_labels_s2": T / "work/scanvi_labels_f016kbern_s2_f01common/labels.parquet",
|
| 48 |
+
"shared_gene_space_genf016k": R / "work/shared_gene_space_genf016k.csv",
|
| 49 |
+
"shared_gene_space_gen6k": R / "work/shared_gene_space_gen6k.csv",
|
| 50 |
+
"modules_v2": R / "modules_c1q_behcet_v2.json",
|
| 51 |
+
"analyzer_analyze_c1q_subset": R / "analyze_c1q_subset.py",
|
| 52 |
+
"marker_list_source_gate_diagnostic": R / "tools/gate_diagnostic.py",
|
| 53 |
+
"generated_identity_check_reference": R / "tools/generated_identity_check.py",
|
| 54 |
+
"scanvi_model_f01common": S / "runs/aifi_scanvi_f01common_v1/scanvi_model/model.pt",
|
| 55 |
+
"scanvi_model_f01common_manifest": S / "runs/aifi_scanvi_f01common_v1/MODEL_MANIFEST.json",
|
| 56 |
+
"predict_scanvi": S / "predict_scanvi.py",
|
| 57 |
+
"scanvi_common": S / "scanvi_common.py",
|
| 58 |
+
"poisson_readout": S / "poisson_readout.py",
|
| 59 |
+
"GSE198616_sample_info": DL / "GSE198616/raw/GSE198616_sample_info.csv.gz",
|
| 60 |
+
"GSE198533_series_matrix": DL / "GSE198533/metadata/GSE198533_series_matrix.txt.gz",
|
| 61 |
+
"existing_out_v2_real_gen6k_sample": R / "out/v2_real_gen6k/c1q_high_vs_other_monocyte_sample_summary.csv",
|
| 62 |
+
"existing_out_v2_real_gen6k_manifest": R / "out/v2_real_gen6k/ANALYSIS_MANIFEST.json",
|
| 63 |
+
"existing_out_v2_real_pbmc_all8_sample": R / "out/v2_real_pbmc_all8/c1q_high_vs_other_monocyte_sample_summary.csv",
|
| 64 |
+
"existing_out_v2_generated_thr00_sample": R / "out/v2_generated_thr00/c1q_high_vs_other_monocyte_sample_summary.csv",
|
| 65 |
+
"existing_out_v2_generated_thr00_manifest": R / "out/v2_generated_thr00/ANALYSIS_MANIFEST.json",
|
| 66 |
+
"existing_out_v2_generated_thr20_sample": R / "out/v2_generated_thr20/c1q_high_vs_other_monocyte_sample_summary.csv",
|
| 67 |
+
"existing_out_v2_generated_thr20_manifest": R / "out/v2_generated_thr20/ANALYSIS_MANIFEST.json",
|
| 68 |
+
"existing_out_v2_generated_f016kbern_sample": R / "out/v2_generated_f016kbern/c1q_high_vs_other_monocyte_sample_summary.csv",
|
| 69 |
+
"existing_out_v2_generated_f016kbern_group": R / "out/v2_generated_f016kbern/c1q_high_vs_other_monocyte_within_sample_summary.csv",
|
| 70 |
+
"existing_out_v2_generated_f016kbern_manifest": R / "out/v2_generated_f016kbern/ANALYSIS_MANIFEST.json",
|
| 71 |
+
"existing_out_three_arm_primary": R / "out/three_arm_primary.csv",
|
| 72 |
+
"existing_out_GATE_DIAGNOSTIC": R / "out/GATE_DIAGNOSTIC.json",
|
| 73 |
+
"existing_out_GENERATED_IDENTITY": R / "out/GENERATED_IDENTITY.json",
|
| 74 |
+
"manuscript_table_results_behcet_readonly": PAPER / "tables/results_behcet.tex",
|
| 75 |
+
"manuscript_results_tex_readonly": PAPER / "sections/results.tex",
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def main() -> int:
|
| 80 |
+
inputs = {}
|
| 81 |
+
for key, path in INPUTS.items():
|
| 82 |
+
inputs[key] = {"path": str(path), "sha256": sha(path), "bytes": path.stat().st_size} if path.exists() else {"path": str(path), "missing": True}
|
| 83 |
+
tools = {str(p.relative_to(T)): sha(p) for p in sorted((T / "tools").glob("*")) if p.is_file()}
|
| 84 |
+
outputs = {}
|
| 85 |
+
for p in sorted(T.rglob("*")):
|
| 86 |
+
if p.is_file() and "work/" not in str(p.relative_to(T)) + "/" and p.name != "MANIFEST.json" and not str(p.relative_to(T)).startswith("tools/"):
|
| 87 |
+
outputs[str(p.relative_to(T))] = sha(p)
|
| 88 |
+
work = {str(p.relative_to(T)): sha(p) for p in sorted((T / "work").rglob("*")) if p.is_file()}
|
| 89 |
+
manifest = {
|
| 90 |
+
"schema_version": "pbisc_sdd.util6k.behcet.manifest.v1",
|
| 91 |
+
"created_at": _dt.datetime.now(tz=_dt.timezone.utc).isoformat(),
|
| 92 |
+
"task": "Behcet C1Q-high table for the final model, group-level tests, selection-rule audit (CPU only)",
|
| 93 |
+
"inputs": inputs,
|
| 94 |
+
"tools": tools,
|
| 95 |
+
"work_files": work,
|
| 96 |
+
"outputs": outputs,
|
| 97 |
+
}
|
| 98 |
+
(T / "MANIFEST.json").write_text(json.dumps(manifest, indent=2) + "\n")
|
| 99 |
+
missing = [k for k, v in inputs.items() if v.get("missing")]
|
| 100 |
+
print(f"wrote {T / 'MANIFEST.json'}; {len(inputs)} inputs, missing: {missing}")
|
| 101 |
+
return 0
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
if __name__ == "__main__":
|
| 105 |
+
raise SystemExit(main())
|
paper-releases/pbisc-diffusion/updates/20260929T062828Z-manuscript-relocation/diffusion/metadata/request.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"assets": [
|
| 3 |
+
{
|
| 4 |
+
"host": "server_1",
|
| 5 |
+
"kind": "maintenance",
|
| 6 |
+
"source": "/home/sj_server_1/PBISC/paper-release-20260928/maintenance/POLICY.md",
|
| 7 |
+
"state": "completed"
|
| 8 |
+
},
|
| 9 |
+
{
|
| 10 |
+
"host": "server_1",
|
| 11 |
+
"kind": "maintenance",
|
| 12 |
+
"source": "/home/sj_server_1/PBISC/paper-release-20260928/maintenance/SCOPE.json",
|
| 13 |
+
"state": "completed"
|
| 14 |
+
},
|
| 15 |
+
{
|
| 16 |
+
"host": "server_1",
|
| 17 |
+
"kind": "maintenance",
|
| 18 |
+
"source": "/home/sj_server_1/PBISC/paper-release-20260928/maintenance/update.py",
|
| 19 |
+
"state": "completed"
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
"host": "server_1",
|
| 23 |
+
"kind": "document",
|
| 24 |
+
"source": "/home/sj_server_1/PBISC/paper-release-20260928/manuscript/AGENTS.md",
|
| 25 |
+
"state": "completed"
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"host": "server_1",
|
| 29 |
+
"kind": "document",
|
| 30 |
+
"source": "/home/sj_server_1/PBISC/paper-release-20260928/manuscript/CLAUDE.md",
|
| 31 |
+
"state": "completed"
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"host": "server_1",
|
| 35 |
+
"kind": "document",
|
| 36 |
+
"source": "/home/sj_server_1/PBISC/paper-release-20260928/manuscript/README.md",
|
| 37 |
+
"state": "completed"
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"host": "server_1",
|
| 41 |
+
"kind": "document",
|
| 42 |
+
"source": "/home/sj_server_1/PBISC/paper-release-20260928/manuscript/editorial/narrative_evidence.md",
|
| 43 |
+
"state": "completed"
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"host": "server_1",
|
| 47 |
+
"kind": "document",
|
| 48 |
+
"source": "/home/sj_server_1/PBISC/paper-release-20260928/manuscript/editorial/RELOCATION_20260929.json",
|
| 49 |
+
"state": "completed"
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"host": "server_1",
|
| 53 |
+
"kind": "code",
|
| 54 |
+
"source": "/home/sj_server_1/PBISC/paper-release-20260928/manuscript/scripts/cohort_calibration/package_analysis.py",
|
| 55 |
+
"state": "completed"
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"host": "server_1",
|
| 59 |
+
"kind": "code",
|
| 60 |
+
"source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/threshold_rescore_20260922/tools/write_architecture_table.py",
|
| 61 |
+
"state": "completed"
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"host": "server_1",
|
| 65 |
+
"kind": "code",
|
| 66 |
+
"source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/utility_studies_final6k_20260925/behcet/tools/make_manifest.py",
|
| 67 |
+
"state": "completed"
|
| 68 |
+
}
|
| 69 |
+
],
|
| 70 |
+
"inference_locations": [],
|
| 71 |
+
"project_id": "pbisc-diffusion",
|
| 72 |
+
"summary": "Relocation of the PBISC-Diffusion manuscript at the user's request (2026-09-29): the Git working tree of junidude/PBISC-diffusion-overleaf moved by same-filesystem rename from /home/sj_server_1/PBISC/immun-pbmc-fm/bulk2sc-paper/nature-communications-overleaf to /home/sj_server_1/PBISC/paper-release-20260928/manuscript (691 files incl. .git, byte-identical; inventory sha256 ad556080...), and its superseded drafts from bulk2sc-paper/archived-analyses to paper-release-20260928/archived-analyses (79 files, byte-identical; not an archive payload root). This delta carries the scope/tooling change (SCOPE.json core_roots.manuscript and update.py CORE_ROOTS, POLICY.md), the manuscript files edited for the new location (README working-copy path, location-independent packaging script, one absolute reference to the BIBM draft that stayed behind, AGENTS.md policy path) with the relocation record, and the two Model 8 scripts that write into the manuscript. Unchanged manuscript files keep their baseline archive copies (same bytes, old source path)."
|
| 73 |
+
}
|