Archive 4 checkpoints (1-4)
Browse files- paper-releases/pbisc-diffusion/updates/20261010T153319Z-manuscript-rewrite-from-deck/diffusion/dataset/server_1/manuscript/sections/introduction.tex +24 -0
- paper-releases/pbisc-diffusion/updates/20261010T153319Z-manuscript-rewrite-from-deck/diffusion/dataset/server_1/manuscript/sections/methods_eval.tex +61 -0
- paper-releases/pbisc-diffusion/updates/20261010T153319Z-manuscript-rewrite-from-deck/diffusion/dataset/server_1/manuscript/sections/methods_model.tex +74 -0
- paper-releases/pbisc-diffusion/updates/20261010T153319Z-manuscript-rewrite-from-deck/diffusion/dataset/server_1/manuscript/sections/methods_paired.tex +63 -0
paper-releases/pbisc-diffusion/updates/20261010T153319Z-manuscript-rewrite-from-deck/diffusion/dataset/server_1/manuscript/sections/introduction.tex
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
% Introduction. Written 2026-10-10 to frame the Results drafts (results_fig1.tex ... results_fig6.tex).
|
| 2 |
+
% Every number is taken from those drafts and checked against the deck (slides 17, 23, 30, 33-34, 38-39, 49) and
|
| 3 |
+
% DECK/data: sec05_condition_space_numbers.csv, fig23_healthy.csv, sec09_fewpair_cells.csv, sec09_time_to_apply.csv,
|
| 4 |
+
% fig3_time_days.csv, fig4_disease.csv (13/20 and 14/20 recounted from the draw rows), fig5_rare_states.csv.
|
| 5 |
+
% Tightened 2026-10-10 (copy edit, 740 to about 655 words): no number, claim or citation added; every kept number unchanged.
|
| 6 |
+
% Repaired 2026-10-10 after the tightening check (about 670 words): restored the four-type average in the logFC r
|
| 7 |
+
% definition (brief 7b.9), the DDPM/DDIM attribution, "Semi-profiling with", and named the bulk-to-pseudobulk offset.
|
| 8 |
+
% Review fixes 2026-10-11: dropped the early Fig. 3d pointer (figures cited in order); defined the five-donor draw
|
| 9 |
+
% (5 to 15 paired samples per draw: DECK/data/sec06_eval_design.csv, Supplementary Table 1); Fig. 5 = 13 rare states
|
| 10 |
+
% and a positive control (methods_eval.tex; DECK/data/fig5_rare_states.csv).
|
| 11 |
+
% Fragment only: \input by main.tex after the abstract.
|
| 12 |
+
\section*{Introduction}
|
| 13 |
+
|
| 14 |
+
Generating single cells from bulk RNA sequencing (RNA-seq) would let large cohorts answer questions that now need single-cell data. Many clinical studies profile blood by bulk RNA-seq\cite{ye2026sepsis,gisby2022multiomics}, which is cheap and scales to hundreds of samples but averages over cells. Single-cell RNA-seq (scRNA-seq) shows what the average hides: each sample's cell-type composition, rare cell states that mark disease, such as MS1 monocytes in sepsis\cite{reyes2020immune} and C1Q-high monocytes in Beh\c{c}et disease\cite{zheng2022c1qbehcet}, and disease changes that differ between cell types\cite{nehar2020mapping}. It costs more per sample, so studies often apply it to only part of their samples\cite{ye2026sepsis,stephenson2025temporal}, and public bulk cohorts cannot be sampled again.
|
| 15 |
+
|
| 16 |
+
Existing methods give cell-type averages, take days or learn from pseudobulk alone. Cell-type deconvolution estimates cell-type fractions and, in some methods, per-type expression\cite{newman2019cibersortx,chu2022bayesprism,avilacobos2020benchmarking}, but returns no cells, so states within a type are lost. Semi-profiling with scSemiProfiler\cite{wang2024scsemiprofiler} measures single cells in a few representative samples and infers cells for the others from their bulk, training a model for every sample. In our tests this took hours to days of GPU time per cohort. Generative models of single cells, from variational autoencoders\cite{lopez2018scvi} to diffusion models\cite{luo2024scdiffusion} built on denoising diffusion\cite{ho2020ddpm,song2021ddim}, and single-cell foundation models\cite{cui2024scgpt,theodoris2023geneformer} can learn from millions of cells but take no bulk profile as input. Models that map bulk to cells mostly learn from, and are often tested on, pseudobulk, the sum of a sample's cells, yet real bulk is a different measurement\cite{liao2022bulk2space,zeng2024omicverse,cho2024bulk2sc}. We therefore asked three questions.
|
| 17 |
+
|
| 18 |
+
\textbf{Can a model trained on pseudobulk use real bulk?} Not directly, but a few pairs fix it. In 107 healthy donors\cite{babdor2026immicro}, real bulk lay a median 2.46 donor distances from the donor's own pseudobulk in the first 30 principal components of the model's input. A donor distance is the median gap between two donors' pseudobulks. One shift shared by all donors made up 95\% of the squared bulk-to-pseudobulk offset. Cells that our pretrained model generated from real bulk covered few real cells: coverage, the share of real cells with a generated neighbour, was 0.19. Low-rank adaptation (LoRA)\cite{hu2022lora} on the pairs of five donors raised coverage to 0.79. In this main design, five donors are drawn five times per cohort. LoRA is fine-tuned on all their pairs (5 to 15 paired samples) and generates cells for every other sample from its real bulk.
|
| 19 |
+
|
| 20 |
+
\textbf{How few paired samples are needed, and how fast?} Five paired donors and a few GPU minutes. Given the same five donors as representatives, scSemiProfiler reached a coverage of 0.04. A five-donor draw, from fine-tuning to cells for every other sample, took LoRA 3 to 11 GPU minutes on average per cohort, 17 to 59 times less GPU time than scSemiProfiler.
|
| 21 |
+
|
| 22 |
+
\textbf{Do the cells carry disease signal that the bulk alone does not?} Yes, and in most draws more of it than the other methods we tested. The logFC r is the correlation between generated and observed case-versus-control log fold changes (logFC) per cell type, averaged over T, B, monocyte and NK cells. Partial r is the same correlation after removing what the input bulk's own logFC explains. Over four disease cohorts, LoRA was ahead of scSemiProfiler given the same five donors on logFC r in 13 of 20 draws and on partial r in 14 of 20. In haemodialysis patients with and without COVID-19, partial r was 0.60 against 0.43. LoRA cells also kept rare cell states closer to their observed fractions than scSemiProfiler's in 51 of 56 state-by-cohort pairs.
|
| 23 |
+
|
| 24 |
+
Here we present \method{}, a diffusion model that generates single blood cells from one bulk profile. Built on Sparse Data Diffusion\cite{ostheimer2025sparse}, it diffuses the expression values of 6,000 genes together with whether each gene is detected. It is pretrained on a 41.4-million-cell blood corpus, each cell paired with a pseudobulk of cells from its own sample, and adapted to a cohort's real bulk by LoRA on a few paired samples (Fig.~\ref{fig:fig1}). We test it on healthy donors (Figs~\ref{fig:fig2} and~\ref{fig:fig3}) and on disease signal in four paired cohorts against scSemiProfiler and cell-type deconvolution (Fig.~\ref{fig:fig4}). With all training pairs, in 5-fold cross-validation (CV) reported separately, disease logFC r reached 0.82 in the COVID-19 haemodialysis cohort. Fig.~\ref{fig:fig5} tests 13 rare cell states and a positive control. Fig.~\ref{fig:fig6} applies the model to samples that have bulk only. \todo{Fig.~6 is to be continued: one sentence on what the bulk-only cells show.}
|
paper-releases/pbisc-diffusion/updates/20261010T153319Z-manuscript-rewrite-from-deck/diffusion/dataset/server_1/manuscript/sections/methods_eval.tex
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
% Methods, part 3: generating and reading out cells for scoring, cell labels, cell-level and disease metrics,
|
| 2 |
+
% rare cell states, the Behcet direction test, cells for bulk-only samples (Fig. 6, placeholder) and statistics.
|
| 3 |
+
% Written 2026-10-10 from the paper-summary deck (slides 14, 19, 22-24, 38-41, 49-52, 54, 58-61, 63, 72) and sources:
|
| 4 |
+
% M8/plans/paired_finetune_intradataset_20260927/tools/{score_ft.py, ft_common.py, extra_metrics.py,
|
| 5 |
+
% collect_extra_metrics.py, contrast_extra.py, contrast_extra_limma.R, pool_folds.py}, README.md, scsemi/README.md,
|
| 6 |
+
% scoring_cache/<cohort>/reference_manifest.json (query genes)
|
| 7 |
+
% M8/plans/rare_states_paired_20261008/tools/rare_paired.py; M8/plans/rare_states_screen_20261004/tools/{states.json,
|
| 8 |
+
% screen.py}; M8/plans/c1q_crossdisease_20261004/README.md; DECK/tools/fig5_rare_states.py
|
| 9 |
+
% M8/plans/utility_studies_final6k_20260925 (Behcet input comparison, sc-pseudobulk seed runs, probe and depth-control
|
| 10 |
+
% tools); M8/plans/behcet_c1q_repro_20260921/conditions; DECK/data/sec05_behcet_direction.csv
|
| 11 |
+
% M8/plans/bulkonly_lora5_20261006/README.md, M8/plans/bulkonly_lora5_k4000_20261006/README.md
|
| 12 |
+
% DECK/tools/sec09_paired_validation.py (draw verdicts, per-donor Wilcoxon)
|
| 13 |
+
% Details that do not fit here are in supp_methods_eval.tex (Supplementary Methods).
|
| 14 |
+
% Not repeated here: sampler and read-out (methods_model.tex, "Sampling and the drawn support read-out"), annotator
|
| 15 |
+
% training and SLE scoring ("SLE benchmark and frozen cell-type annotator"), contrasts, sex-linked genes and the
|
| 16 |
+
% scSemiProfiler export (methods_paired.tex).
|
| 17 |
+
% Fragment only: \input by main.tex after methods_paired.tex.
|
| 18 |
+
|
| 19 |
+
\subsection*{Generating and reading out cells for scoring}
|
| 20 |
+
\textbf{Every method's cells passed through the same read-out, labels and scorer.} Each version of \method{} generated 1,500 cells per test sample as described in ``Sampling and the drawn support read-out'', from the sample's real bulk (its calibrated bulk for zero-shot + calibration) at $K=1{,}000$, with base seed 20260927 in both designs. Zero-shot cells from the real bulk were generated once for every usable sample and scored with the test samples of each five-donor draw. Before scoring, the continuous count-like values were turned into integers by one Poisson draw per value, made over the whole generated file in row order with a fixed seed (20260916). These counts served for labels, embeddings, depths and disease contrasts, for scSemiProfiler's exported cells as for \method{}. Embeddings, depths and disease contrasts used the cohort's scoring genes: the genes of the 6,000-gene panel that both its assays measured in every paired sample (5,508 to 5,975 genes). In 5-fold CV, the test cells of the five fold models were joined into one file per method and scored in one call. scSemiProfiler-5 was scored in a separate call on the same test samples and reference cells as LoRA-5.
|
| 21 |
+
|
| 22 |
+
\subsection*{Cell labels}
|
| 23 |
+
\textbf{One frozen annotator labelled every cell.} Observed cells and the generated cells of every method were labelled by the frozen scANVI annotator described in ``SLE benchmark and frozen cell-type annotator''. A cohort's query used the annotation genes that its single-cell assay measured in every sample (1,004 to 1,006 genes); in ImMicro and Ji one model gene was unmeasured and entered as zero. No cell was left unassigned or removed, so cells labelled Other stay in every composition denominator. The finer level-2 labels, such as CD16 monocyte, plasma cell and proliferating T cell, served the rare-state and Beh\c{c}et analyses.
|
| 24 |
+
|
| 25 |
+
\subsection*{Cell-level metrics}
|
| 26 |
+
\textbf{Precision and coverage.} Cells were embedded as $\log(1+\mathrm{CP10K})$ over the cohort's scoring genes, where CP10K means counts per 10,000. For each scored sample, a fixed random permutation gave a reference set R1 of up to 150 observed cells and a disjoint, held-out set R2 of the same size. A 50-component principal component analysis (PCA) was fitted on the R1 cells of the scored samples only, and each R1 cell received a ball that reaches its tenth nearest R1 neighbour ($k=10$). For each sample we drew as many generated cells as it had R1 cells. Precision is the share of generated cells inside at least one R1 ball\cite{kynkaanniemi2019improved}. Coverage is the share of R1 cells whose ball holds at least one generated cell\cite{naeem2020reliable}. R2 gives the real-versus-real control. Absolute values depend on how many samples are scored, so arms were compared only on the same samples and reference cells. Supplementary Methods describe the versions with $k=3$ and $k=5$ and after depth matching.
|
| 27 |
+
|
| 28 |
+
\textbf{Composition.} Composition L1 is the summed absolute difference between a sample's generated and observed fractions of the six labels; it runs from 0 to 2, lower is better, and it is averaged over samples. Its null compares each sample's observed composition with the mean composition of the other donors' samples.
|
| 29 |
+
|
| 30 |
+
\textbf{Two-sample tests and $E_N$.} Classifier AUC is the area under the receiver operating characteristic curve of a $k$-nearest-neighbour classifier ($k=5$) trained to tell R2 from the generated cells of the precision and coverage step, in the same embedding. It is averaged over the folds of a stratified 5-fold cross-validation of the classifier; 0.5 means the two sets cannot be told apart\cite{lopezpaz2017revisiting}. MMD$^2$ is the unbiased squared maximum mean discrepancy with a Gaussian kernel whose bandwidth is the median distance between R1 cells\cite{gretton2012kernel}. $E_N$ is scSemiProfiler's normalised error\cite{wang2024scsemiprofiler}: the nearest-neighbour distance between a sample's observed and generated cells, scaled so that two random halves of all cells give 0 and two different samples give 1. Lower is better for MMD$^2$ and $E_N$. Supplementary Methods give the details, the real-versus-real controls and two further classifier scores.
|
| 31 |
+
|
| 32 |
+
\subsection*{Disease metrics}
|
| 33 |
+
The disease metrics below are those of the four paired disease cohorts. The SLE benchmark uses its own versions, described in ``SLE benchmark and frozen cell-type annotator''.
|
| 34 |
+
|
| 35 |
+
\textbf{logFC r.} The contrasts and the genes excluded in Giroux are given in ``Paired bulk and single-cell cohorts''. For T cells, B cells, monocytes and NK cells, we used the scoring genes detected in at least 1\% of the scored samples' observed cells of that type. Cells were normalised to CP10K. A sample's value is the mean over its cells of the type, and a group's value is the mean over its samples. A gene's logFC is $\log_2(\mathrm{case}+1)-\log_2(\mathrm{control}+1)$. Computed on generated cells, with their own labels, and on observed cells, this gives two logFC vectors per type. logFC r is their Pearson correlation, averaged over the four types, as in benchmarks of response prediction\cite{roohani2024gears,li2026systematic}.
|
| 36 |
+
|
| 37 |
+
\textbf{Partial r.} We computed the logFC of the bulk that each arm received in the same way, from its per-sample CP10K. The generated and the observed logFC were both regressed on it by ordinary least squares, and partial r is the Pearson correlation of the residuals, averaged over the four types. It is the cell-type signal beyond the bulk\cite{vinastorne2026systema}.
|
| 38 |
+
|
| 39 |
+
\textbf{Top-50 DEG.} This metric compares lists of differentially expressed genes (DEG). For each of five types (T, B, monocyte, NK and DC), counts were summed per sample over its cells of the type and transformed to $\log(1+\mathrm{CPM})$, with CPM the counts per million. Each gene was tested case against control by a two-sided Welch $t$-test with Benjamini--Hochberg correction\cite{benjamini1995fdr}. For observed and generated cells separately, genes with a false discovery rate below 0.05 were ranked by absolute logFC and the first 50 were kept. Top-50 DEG is the number of genes on both lists, summed over the types whose observed test was defined (at least two samples per group); an undefined generated test scores 0. Samples, not cells, are the replicates\cite{squair2021confronting}.
|
| 40 |
+
|
| 41 |
+
\textbf{Correspondence at the top (CAT).} CAT needs no significance cut-off\cite{irizarry2005multiple}. On the same per-sample pseudobulks, genes were ranked by the absolute moderated $t$ of limma-voom\cite{law2014voom,ritchie2015limma}, separately for observed and generated cells. CAT($k$) is the share of the observed top $k$ genes that are also in the generated top $k$ with the same logFC sign, averaged over T cells, B cells, monocytes and NK cells. Its chance level is $k/(2G)$, where $G$ is the number of genes tested on both sides. Rank-biased overlap\cite{webber2010similarity} served as a check (Supplementary Methods).
|
| 42 |
+
|
| 43 |
+
\subsection*{Rare cell states}
|
| 44 |
+
\textbf{Rules from the literature.} We scored 13 rare states and two controls with rules fixed before this analysis (marker genes in Supplementary Methods). A marker state is a cell of a parent type in which at least a set number of the state's marker genes are detected; a label state is a cell with a given level-2 label. The monocyte states are C1Q-high monocytes\cite{zheng2022c1qbehcet}, MS1 monocytes\cite{reyes2020immune} and cycling monocytes\cite{ye2026sepsis}. The T and NK cell states are cycling T and NK cells and cycling activated T cells\cite{mathew2020deep}, T cells high in interferon-stimulated genes (ISG-high T cells)\cite{nehar2020mapping}, proliferating T cells by label and cytotoxic CD4 T cells\cite{hashimoto2019single}. The other states are DN2 B cells\cite{jenks2018distinct}, plasmablasts by markers and by label\cite{mathew2020deep}, haematopoietic stem and progenitor cells\cite{stephenson2021single} and granulocyte-like cells\cite{bennett2003interferon}. ISG-high monocytes were the positive control. Platelet genes in monocytes were the negative control and are left out of the figures.
|
| 45 |
+
|
| 46 |
+
\textbf{Cells and depth.} No new cells were generated. In the four disease cohorts, we re-read every scored file of the five-donor draws (zero-shot, zero-shot + calibration, LoRA-5 and scSemiProfiler-5) and of the 5-fold calls with the benchmark's Poisson draw. Every cell matched the scorer's record, so the scorer's frozen labels apply unchanged. The observed side was every observed cell of the scored samples. Marker detection depends on depth, and generated cells are usually shallower than observed cells. For marker states, the observed parent cells were therefore thinned binomially, never upwards, to the median library of the generated parent cells, by one factor per state, arm and scoring call (seed 20261004). Label states were not thinned.
|
| 47 |
+
|
| 48 |
+
\textbf{Metrics.} A state's fraction is its share of the parent cells, pooled over the test samples. We computed four metrics; Fig.~\ref{fig:fig5}a--c show all but the detection AUROC. The first, the $\log_2$ ratio of the generated to the observed fraction, is within 2-fold when its absolute value is at most 1. Donor ranking is the Spearman correlation over test samples between generated and observed fractions. The detection AUROC, the area under the receiver operating characteristic curve, measures how well the generated fractions separate samples above the median observed fraction from those below it. The disease direction records whether the case-minus-control difference of sample means has the observed sign. Five-donor values are means over the five draws; the direction is the share of draws. A state-by-cohort pair was kept only if it passed two checks in every draw and in the 5-fold call. The observed cells of the test samples had to hold at least 30 state cells at native depth, and at least 3 samples had to hold a state cell after thinning to the depth of LoRA's cells. All 14 states (the 13 rare states and the positive control) passed in all four disease cohorts, giving 56 pairs. A draw in which a method generated no cell of a state was skipped in that method's mean $\log_2$ ratio. A state that a method generated in no draw, or not in its 5-fold call, counts as that method's miss.
|
| 49 |
+
|
| 50 |
+
\textbf{Cohorts absent from the corpus.} For the planned Fig.~\ref{fig:fig5}e, the same rules were applied to cells that the pretrained model, without fine-tuning, generated from each sample's own pseudobulk at $K=1{,}000$ (seed 20260913). The Kawasaki disease cohort (GSE168732) has 6 patients before and after intravenous immunoglobulin and 3 controls, with 5,000 cells generated per sample\cite{wang2021kawasaki}. The SLE cohort of children and adults (GSE135779) has 56 samples, with 3,000 cells generated per sample\cite{nehar2020mapping}. \todo{panel 5e: confirm the states and contrasts shown when the panel is built}
|
| 51 |
+
|
| 52 |
+
\subsection*{Beh\c{c}et disease direction test}
|
| 53 |
+
\textbf{From real bulk and from pseudobulk.} Beh\c{c}et disease has bulk RNA-seq (GSE198533; 9 patients, 10 controls) and scRNA-seq (GSE198616; 4 patients, 4 controls; 41,824 cells) from mostly different people\cite{zheng2022c1qbehcet}, so we used the pretrained model without fine-tuning. Each bulk, mapped by Ensembl identifier (19,842 genes measured), was read as the sum of 5,000 cells ($K=5{,}000$), and 5,000 cells per sample were generated under five seeds. For comparison, each single-cell sample was given the pseudobulk of its own cells, with $K$ equal to its cell count, and generated in the same way. Cells were read out and labelled as above and scored on the 5,671 genes that both sides measured. For each sample we computed the share of monocytes labelled CD16 monocyte and the share with at least one UMI of \textit{C1QA}, \textit{C1QB} or \textit{C1QC} (C1Q-high, a looser rule than above). Each is reported as the patient mean minus the control mean, in percentage points. Because C1Q detection depends on depth, the cells generated from real bulk and the observed cells were also thinned binomially to one common median monocyte library of 498.5 UMIs (Supplementary Methods). Cells generated from the single-cell pseudobulks were not scored at this common depth. \todo{LoRA-3 arm of Fig.~\ref{fig:fig5}d, to be added with the panel (details in Supplementary Methods)}
|
| 54 |
+
|
| 55 |
+
\subsection*{Cells for bulk-only samples}
|
| 56 |
+
\textbf{LoRA-5 cells exist for every bulk-only sample of two cohorts.} Sepsis holds 122 bulk samples without single cells (68 adult sepsis, 36 adult healthy controls, 17 adult and 1 paediatric intensive care controls), and Imperial holds 164 (143 COVID-19-positive, 19 negative, 2 recovery). Their conditions were built with the arithmetic and output mask of the paired benchmark; applied to the paired samples, the same extraction reproduced the benchmark's conditions byte for byte. $K$ is the number of cells that a bulk is read as, not the number of cells generated. At $K=1{,}000$, each of the five LoRA-5 models of the five-donor draws generated 1,500 cells per sample, with seed 20260927 in every draw. At $K=4{,}000$, LoRA (rank 16, 3,000 steps)\cite{hu2022lora} was retrained on the same five donor sets with conditions at $K=4{,}000$, and each model generated 4,000 cells per sample under its own seed. All cells were read out and labelled as above, except that each $K=4{,}000$ draw had its own read-out seed (Supplementary Methods). \todo{Fig.~\ref{fig:fig6}: analysis of the bulk-only cells, to be continued}
|
| 57 |
+
|
| 58 |
+
\subsection*{Statistics}
|
| 59 |
+
\textbf{Units and repeats.} The scored unit is the test sample; in Imperial, Giroux and Ji, a donor's samples count separately but always fall on the same side of a split. In the five-donor design each metric was computed once per draw; we report the mean over the five draws, and error bars show the standard deviation. Comparisons between methods are counted per draw (for example 13 of 20 draws, four disease cohorts with five draws each), and equal values count as ties. A method is better in a cohort when it is better in at least 80\% of the draws that both methods completed (four of five). The cohort is tied when at least half of these draws tie or, for top-50 DEG, when the mean difference is below one gene. In 5-fold CV each method has one pooled scoring call, so each cohort gives one value. The lupus benchmark reports the mean and standard deviation over five seeds for \method{} and one run for scSemiProfiler.
|
| 60 |
+
|
| 61 |
+
\textbf{Tests.} Paired comparisons used two-sided Wilcoxon signed-rank tests on per-sample values. In the five-donor design, the composition L1 differences between LoRA-5 and each zero-shot version were first averaged per donor over the draws in which the donor was tested, because donors recur across draws. The comparison of scSemiProfiler-5 with copying its representative instead paired every test sample of every draw (510 pairs in ImMicro), so a sample tested in several draws counts several times. How closely scSemiProfiler's composition error follows the copy's was measured by the Spearman correlation over the same pairs. In Beh\c{c}et disease, the observed 4-versus-4 difference has a descriptive Mann--Whitney $P$ value, and the generated difference at common depth was tested by exact permutation over all 92,378 relabellings of the 19 bulk samples, on per-sample means over seeds. The supplementary rare-state comparison of training with and without pretraining used a donor bootstrap (2,000 resamples, 95\% percentile intervals); the other comparisons without pretraining come from single pilot runs and have no intervals. The rare-state results of Fig.~\ref{fig:fig5}a--c are counts and were not tested. No correction for multiple comparisons was applied, and all $P$ values are descriptive.
|
paper-releases/pbisc-diffusion/updates/20261010T153319Z-manuscript-rewrite-from-deck/diffusion/dataset/server_1/manuscript/sections/methods_model.tex
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
% Methods, part 1: model, data and pretraining. Written 2026-10-10 from the paper-summary deck (slides 6-14, 42-43)
|
| 2 |
+
% and checked against the code and run records:
|
| 3 |
+
% M8/src/pbisc_sdd/{model.py, diffusion.py, data.py, gene_selection.py, panel_ladder.py, ema.py, ladder_experiment.py}
|
| 4 |
+
% M8/scripts/{train_allcell_sdd.py, sample_sdd_standalone.py, prepare_gse135779_scsemi_target42_conditions.py}
|
| 5 |
+
% M8/runs/f01_6k_1x_seed20260627/{effective_config.json, RUN_STATUS.json, ALLCELL_DATA_CONTRACT.json, history.json}
|
| 6 |
+
% M8/artifacts/panel_ladder_floor01_1m_20260923/manifest.json; Model 7 E2 index and conditioner (data_e2.py, data.py)
|
| 7 |
+
% manuscript/source_data/corpus/{README.md, corpus_summary.json}
|
| 8 |
+
% M8/plans/{aifi_scanvi_rebuild_20260916, utility_studies_final6k_20260925/sle, floor01_campaign_20260923,
|
| 9 |
+
% arch_ablation_6k_20260913, prop_condition_6k_20260916}; DECK/data/sec01_*, sec02_*, sec03_*, sec04_sle_*.
|
| 10 |
+
% Exact settings and formulas that do not fit here are in supp_methods_model.tex (Supplementary Methods).
|
| 11 |
+
% Fragment only: \input by main.tex; this file opens the Methods section.
|
| 12 |
+
|
| 13 |
+
\section*{Methods}
|
| 14 |
+
|
| 15 |
+
\subsection*{Overview of \method{}}
|
| 16 |
+
\method{} generates single-cell expression profiles from one bulk RNA-seq profile. It takes the bulk counts, the number of cells $K$ that the bulk stands for and the genes that the assays measured, and draws each requested cell independently. All cells from one bulk share one condition; they differ only in their starting noise and in a random draw that decides which genes they detect (Fig.~\ref{fig:fig1}b). The model never receives cell-type labels, cell-type proportions, disease labels or donor identities, and nothing forces the generated cells to add up to the bulk.
|
| 17 |
+
|
| 18 |
+
The model adapts sparse data diffusion (SDD)\cite{ostheimer2025sparse}, which diffuses each gene's expression value together with its detection support (whether a measured gene has a positive count) in gene space, with a skip-connected multilayer perceptron as the denoiser. We kept these parts, added the bulk condition, restricted the loss to genes that the assay measured, and replaced SDD's final hard cut on the support with a draw from the predicted detection probability (Fig.~\ref{fig:fig1}a).
|
| 19 |
+
|
| 20 |
+
\subsection*{Pretraining corpus and data splits}
|
| 21 |
+
The corpus held 41,395,184 cells from 22 public scRNA-seq datasets of peripheral blood mononuclear cells (PBMCs), with 3,199 donors, 6,507 samples and 432 count files (Fig.~\ref{fig:fig1}d; Supplementary Note~1 and Supplementary Fig.~1\todo{cite the 22 corpus datasets in Supplementary Note 1}). Two of the datasets are enriched, one for circulating haematopoietic stem and progenitor cells and one for B cells. We used the raw unique molecular identifier (UMI) counts of every cell, on a fixed axis of 20,097 protein-coding genes (GENCODE release 49). Each count file carries a binary mask of the genes its assay measured, so a measured zero is never confused with a missing gene.
|
| 22 |
+
|
| 23 |
+
We split each dataset by donor (by sample where the donor was unknown) into training, validation and test sets of 80\%, 10\% and 10\% of donors. The training split held 33,141,380 cells from 5,232 samples. No sample is in two splits, but in two datasets the corpus donor key is finer than the person: 26 subjects of GSE274680 are keyed by visit, and the one patient of GSE132802 by sample (time point or culture). These 27 people have samples in more than one split, and 38 validation or test samples (659,112 cells) come from a person who also has training samples.
|
| 24 |
+
|
| 25 |
+
\subsection*{Pseudobulk recipes and training pairs}
|
| 26 |
+
A recipe is a set of $K$ cells drawn at random, without replacement, from one training sample; its pseudobulk is the sum of their raw counts. Recipe sizes were $K\in\{250, 500, 1{,}000, 2{,}000, 4{,}000\}$ with relative weights 1:2:3:4:1. A fixed pool of 131,072 training recipes was registered before training and divided into 16 disjoint slots of 8,192. Each epoch, also called a schedule part, used one slot, so the 16 epochs passed once through the pool. Square-root weights kept large platforms, datasets and samples from dominating (Supplementary Methods).
|
| 27 |
+
|
| 28 |
+
All $K$ cells of a recipe became training targets, each paired with the pseudobulk of its full recipe, itself included (Supplementary Fig.~2). The registered recipes reached 94.0\% of training cells. The other 1,995,930 cells were placed, each exactly once, in 3,658 top-up recipes built from single samples ($K$ from 1 to 4,000) and spread over the 16 epochs. Pretraining thus used every training cell at least once: 134,730 recipes and 195,639,930 target-cell occurrences in all.
|
| 29 |
+
|
| 30 |
+
\subsection*{Gene panel}
|
| 31 |
+
We drew 128 cells at random from each of 8,192 training recipes (1,048,576 cells), scaled each cell to 10,000 counts and took $\log(1+x)$. A gene was eligible if it was measured in at least 10\% of these cells and detected in at least 0.1\%; 15,114 of 20,097 genes passed. Eligible genes were ranked with immune and interferon marker genes first (55 genes), then by dispersion, $\log(1+\mathrm{variance}/\mathrm{mean})$, standardised within 20 bins of mean expression. Panels of 2,000, 3,000, 6,000 and 15,114 genes are prefixes of this ranking, so each contains the smaller ones (Fig.~\ref{fig:fig1}f). The 0.1\% floor replaced a 1\% floor, which excluded genes specific to cell types rarer than 1\% of PBMCs. The final model uses the first 6,000 genes, the smallest panel that holds \textit{CLEC9A} (rank 3,793), a marker of type 1 conventional dendritic cells.
|
| 32 |
+
|
| 33 |
+
\subsection*{Bulk condition}
|
| 34 |
+
For a bulk or pseudobulk with counts $b_g$ over the 20,097 genes, total $L=\sum_g b_g$ and nominal cell count $K$, the gene feature is the bulk scaled to the depth of one average cell, $u_g=\log\!\bigl(1+b_g/\max(L/K,10^{-6})\bigr)$. Six scalars describe depth and profile shape: $\log(1+L)$, $\log(1+L/K)$, the fraction of genes with $b_g>0$, the mean and standard deviation of $\log(1+b_g)$, and the share of $L$ held by the 1\% highest-count genes. Features were standardised with constants from 2,048 training recipes and clipped to $[-8,8]$, and the 6,000 panel genes were kept afterwards. Two masks complete the condition: $f_g$, the fraction of the $K$ cells whose assay measured gene $g$, and $m_g$, the measured-gene mask of the assay that the generated cells should match:
|
| 35 |
+
\begin{equation}
|
| 36 |
+
c=\bigl[\,z(u_{\mathcal G}),\; z(a),\; 2f_{\mathcal G}-1,\; 2m_{\mathcal G}-1\,\bigr]\in\mathbb R^{3G+6},
|
| 37 |
+
\end{equation}
|
| 38 |
+
where $\mathcal G$ is the panel of $G=6{,}000$ genes, $a$ holds the six scalars and $z(\cdot)$ is the clipped standardisation; $c$ has 18,006 entries (Fig.~\ref{fig:fig1}c).
|
| 39 |
+
|
| 40 |
+
\subsection*{Joint diffusion of values and detection support}
|
| 41 |
+
Each measured gene of a cell with raw counts $x_g$ contributes a value and a detection sign,
|
| 42 |
+
\begin{equation}
|
| 43 |
+
v_g=2\,\mathrm{clip}\!\left(\tfrac{1}{8}\log(1+x_g),\,0,\,1\right)-1,\qquad s_g=+1\ \text{if}\ x_g>0,\ \text{else}\ -1.
|
| 44 |
+
\end{equation}
|
| 45 |
+
Unmeasured genes were set to 0 in both halves and never entered the loss. The clean state $z_0=[v,s]\in\mathbb R^{2G}$ was noised in closed form\cite{ho2020ddpm} as $z_t=\alpha(t)z_0+\sigma(t)\varepsilon$, with $t\sim\mathcal U(0,1)$ per cell, $\varepsilon\sim\mathcal N(0,I)$, $\alpha^2+\sigma^2=1$ and a cosine schedule\cite{nichol2021improved} (offset 0.008; Supplementary Methods). The denoiser predicts clean values $\hat v_g$ and detection logits $\ell_g$. Over the set $M$ of measured entries of a batch, the loss is
|
| 46 |
+
\begin{equation}
|
| 47 |
+
\mathcal L=\frac{1}{|M|}\sum_{(i,g)\in M}\Bigl[(\hat v_{ig}-v_{ig})^2+\mathrm{BCE}\bigl(\ell_{ig},\mathbb I[x_{ig}>0]\bigr)\Bigr],
|
| 48 |
+
\end{equation}
|
| 49 |
+
with BCE the binary cross-entropy on logits. The value term includes measured zeros, and the support head learns the log-odds that a gene is detected. In a random half of the batches, a first prediction made without gradients, $[\hat v,\tanh(\ell/2)]$, was fed back as an extra input (self-conditioning\cite{chen2023analog}); otherwise that input was zero.
|
| 50 |
+
|
| 51 |
+
\subsection*{Denoiser architecture}
|
| 52 |
+
The denoiser is a skip-connected multilayer perceptron (Supplementary Fig.~2). It takes the noisy state and the self-conditioning input (24,000 values) through seven blocks of widths 1,024, 1,024, 512, 256, 512, 1,024 and 1,024. Each block adds a linear map of its input to a linear map of the shared context passed through a sigmoid linear unit (SiLU), then applies layer normalisation and SiLU. The outputs of blocks 5, 6 and 7 are summed with those of blocks 3, 2 and 1, their mirror blocks of equal width. The context, of 512 dimensions, combines the encoded time (128 sinusoidal features) and the encoded condition. A shared 1,024-wide layer feeds two heads of 6,000 outputs, for values and detection logits. The model has 54,185,184 parameters and no dropout.
|
| 53 |
+
|
| 54 |
+
\subsection*{Pretraining settings}
|
| 55 |
+
We used AdamW\cite{loshchilov2019decoupled} with a learning rate of $2\times10^{-4}$ and no weight decay, batches of 256 target cells, gradient clipping at norm 5, bfloat16 mixed precision (PyTorch autocast, with 32-bit weights) and seed 20260627. An exponential moving average (EMA) of the weights was updated after every step with decay 0.999. Training ran for 16 epochs, or 764,249 steps. After each epoch the loss was computed with the EMA weights on a fixed validation set of 192 recipes from validation donors, 64 cells each, with fixed noise. It fell at every epoch, from 0.153 to 0.137. The EMA weights after epoch 16 are the pretrained model used throughout. Pretraining took 15.9 h on one NVIDIA GB10 GPU and was run once.
|
| 56 |
+
|
| 57 |
+
\subsection*{Sampling and the drawn support read-out}
|
| 58 |
+
Generation used the EMA weights and 50 deterministic steps of the denoising diffusion implicit model (DDIM) sampler\cite{song2021ddim} ($\eta=0$). Each step's clean prediction was also the next step's self-conditioning input. Each cell's starting noise came from its own seeded generator on the CPU, so it is the same whatever the batch size or hardware (Supplementary Methods).
|
| 59 |
+
|
| 60 |
+
At the last step, $p_g=\mathrm{sigmoid}(\ell_g)$ is the probability that gene $g$ is detected. We kept gene $g$ when a uniform draw $u_g$ fell below $p_g$ and the output mask allowed it; otherwise its value was exactly zero. A kept gene takes the count-like value $\exp\{8\,\mathrm{clip}[(\hat v_g+1)/2,0,1]\}-1$. This drawn (Bernoulli) read-out has no free parameter; a cell's expected number of detected genes is the sum of $p_g$ over the genes that the output mask allows. It produced every generated cell set in this study except the threshold-read-out sets of Fig.~\ref{fig:fig1}e. That panel scores the width and hint arms (Design experiments, below) with the threshold read-out of SDD, which keeps gene $g$ when $\ell_g>0$, and the four width arms also with the drawn read-out. Unless stated otherwise we generated 1,500 cells per bulk. A measured bulk has no cell count, so it was given $K=1{,}000$ at a fixed depth (see ``Paired bulk and single-cell cohorts'').
|
| 61 |
+
|
| 62 |
+
\subsection*{SLE benchmark and frozen cell-type annotator}
|
| 63 |
+
We used GSE135779, a PBMC scRNA-seq cohort of children and adults with systemic lupus erythematosus (SLE) and healthy controls\cite{nehar2020mapping}; this cohort is not in the pretraining corpus. A split of its 56 donors, locked before any method output was read, gave 14 donors to scSemiProfiler\cite{wang2024scsemiprofiler} as representatives, with their single cells (up to 1,500 per donor). The other 42 donors were targets, and no method received their single cells: 30 with SLE (25 children, 5 adults) and 12 healthy controls (8 children, 4 adults), with 251,179 cells. Each target donor's condition was its single-cell pseudobulk, with $K$ equal to its cell count (2,604 to 12,706). Every method generated 1,500 cells per donor. The final model was sampled with five seeds whose per-cell noise does not overlap.
|
| 64 |
+
|
| 65 |
+
Cell types came from a frozen scANVI\cite{xu2021scanvi} model trained on 360,310 cells from 97 donors of the Allen Institute for Immunology (AIFI) Human Immune Health Atlas\cite{gong2025multiomic}, with 29 fine classes, using the 1,005 atlas genes of the 1,006-gene scoring axis (below). Generated cells were converted to integer counts by one Poisson draw per entry before annotation. Fine classes were collapsed to six types: T, B, monocyte, natural killer (NK), dendritic cell and Other. On 11 held-out atlas donors, accuracy was 0.869 for the 29 classes and 0.992 for the six types. The same annotator labelled observed and generated cells in this benchmark and in the paired cohorts; the width experiments used an otherwise identical annotator on 2,980 genes (Supplementary Methods).
|
| 66 |
+
|
| 67 |
+
Scores were computed on a fixed gene axis, applied before any aggregation, and all methods in a comparison were scored on the same axis. The width experiments used 2,980 genes, the benchmark's working genes that are also in the earlier 6,000-gene panel. The gene-panel experiments used the 1,006 of these genes that all four gene panels contain. The final model was scored on these 1,006 genes and on the 2,279 of the 2,980 genes that its own 6,000-gene panel contains (Fig.~\ref{fig:fig4}f). Cells were summed per donor and type and transformed to $\log(1+\mathrm{CPM})$, with CPM the counts per million. LogFC r is the Pearson r between generated and observed SLE-versus-control log fold changes (logFC), averaged over the six types. Top-50 DEG (differentially expressed genes) counts the genes shared by the generated and observed lists of up to 50 significant genes (false discovery rate below 0.05; Welch t-test with Benjamini--Hochberg correction\cite{benjamini1995fdr}), ranked by absolute logFC and summed over types. Composition L1 is the summed absolute error of the six type fractions, averaged over donors. Partial r, the cell-type signal beyond the bulk, is the same r after both logFCs are residualised on the logFC of the input pseudobulk.
|
| 68 |
+
|
| 69 |
+
\subsection*{Design experiments}
|
| 70 |
+
\textbf{Width and context.} Four arms crossed the denoiser trunk (base or four times wider) with the context (512 or 2,048 dimensions), from 54.2 million to 312.6 million parameters (Supplementary Methods). A fifth arm added nine atlas cell-type fractions to the base condition; at sampling these were predicted from the bulk or taken from the donor's observed cells. All arms shared data, schedule, seed and optimiser settings, on an earlier 6,000-gene panel ranked by the same rule from 32,768 cells with a 1\% detection floor. A sixteen-fold arm (2.79 billion parameters) stopped in part 3, when free host memory fell below the run's own floor of 24 GiB, and was not resumed; Fig.~\ref{fig:fig1}e shows its loss for parts 1 and 2 only. On the SLE benchmark (2,980 genes) each arm was averaged over parts 14--16, with the threshold read-out and, for the four width arms, also with the drawn read-out (Fig.~\ref{fig:fig1}e). The model ignored the hint: predicted and true hints changed logFC r by at most 0.004 in parts 14--16. The hint arm therefore measures run-to-run noise in logFC r and top-50 DEG. The standard deviation over 16 parts of its difference from the base arm, 0.018 in logFC r and 7.2 in top-50 DEG, is the smallest difference we interpret.
|
| 71 |
+
|
| 72 |
+
\textbf{Gene panel.} The 2,000-, 3,000-, 6,000- and 15,114-gene panels were each trained with the base architecture and the full schedule (23,457,184 to 124,198,932 parameters), sampled at part 16 with the drawn read-out and scored on the 1,006 genes that every panel emits (Fig.~\ref{fig:fig1}f). The 6,000-gene panel was sampled with five seeds and the others with the first seed.
|
| 73 |
+
|
| 74 |
+
\textbf{Use of the SLE cohort.} These experiments chose the final model, so the SLE benchmark informed model selection and is not an untouched test set. The final model was fixed before any of the paired-cohort experiments reported here, and no paired cohort informed the choice of gene panel, width or read-out.
|
paper-releases/pbisc-diffusion/updates/20261010T153319Z-manuscript-rewrite-from-deck/diffusion/dataset/server_1/manuscript/sections/methods_paired.tex
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
% Methods, part 2: paired cohorts, evaluation designs, LoRA fine-tuning, other versions, scSemiProfiler,
|
| 2 |
+
% cell-type deconvolution and GPU time. Written 2026-10-10 from the paper-summary deck (slides 20, 21, 33, 34, 37,
|
| 3 |
+
% 41, 46, 58-74) and its sources:
|
| 4 |
+
% M8/plans/paired_finetune_intradataset_20260927/{README.md, data/<cohort>/QC_REPORT.md, folds.csv,
|
| 5 |
+
% fewshot_n5/DRAWS.json, tools/prepare_dataset.py, prepare_fewshot.py, ft_sdd.py, ft_sdd_aug.py,
|
| 6 |
+
% prepare_cal_budget.py, runs/*/RUN.json, data/sex_linked_genes/README.md, scsemi/README.md}
|
| 7 |
+
% M8/plans/bayesprism_paired_20261006/{README.md, tools/run_bp.R, common.py, build_cibersortx_inputs.py,
|
| 8 |
+
% run_cibersortx.sh}
|
| 9 |
+
% DECK/data/{sec09_cohorts.csv, sec06_ft_method.csv, sec06_eval_design.csv, sec09_time_to_apply.csv,
|
| 10 |
+
% fig3_time_days.csv}
|
| 11 |
+
% Per-cohort pairing rules, identity-check settings and design sizes are in Supplementary Table 1
|
| 12 |
+
% (supp_table_cohorts.tex). Fragment only: \input by main.tex after methods_model.tex.
|
| 13 |
+
|
| 14 |
+
\subsection*{Paired bulk and single-cell cohorts}
|
| 15 |
+
We used five public cohorts with bulk RNA sequencing (RNA-seq) and single-cell RNA sequencing (scRNA-seq) of the same blood sample or the same visit (Supplementary Table~1). The cohorts are ImMicro, 107 healthy donors\cite{babdor2026immicro}; sepsis, patients with sepsis and controls\cite{ye2026sepsis}; Imperial, haemodialysis patients with and without COVID-19\cite{gisby2022multiomics,stephenson2025temporal}; Giroux, COVID-19 outpatients\cite{giroux2022differential}; and Ji, patients on immune checkpoint inhibitors with or without checkpoint inhibitor-induced liver injury (ChILI)\cite{ji2025chili}. All samples are peripheral blood mononuclear cells (PBMCs) except Ji's bulk, which was measured on whole blood, so a Ji pair is the same visit but a different specimen. Imperial's COVID-19-negative pairs share patient and status but are not proven to be the same draw, because their bulk samples are undated. All single-cell data come from 10x Genomics 5$'$ assays.
|
| 16 |
+
|
| 17 |
+
\textbf{Processing.} One frozen code base processed all cohorts. Bulk counts kept the units the authors deposited and were mapped to a fixed axis of 20,097 GENCODE v49 protein-coding genes by Ensembl identifier, or by gene symbol where a bulk table had none (Giroux). Genes that a source did not report were marked as unmeasured, never set to zero. Single-cell unique molecular identifier (UMI) counts were mapped to the same axis. We kept cells with at least 200 detected genes, at least 500 UMIs and at most 20\% mitochondrial UMIs. A sample's pseudobulk is the sum of its kept cells, which enter training and scoring on the model's 6,000-gene panel.
|
| 18 |
+
|
| 19 |
+
\textbf{Identity checks.} In the disease cohorts, pairs were formed on the studies' donor and visit identifiers (on patient and status only for Imperial's undated COVID-19-negative samples), with sex, age and clinical group agreeing in the metadata. Each pair then had to pass two checks (three in Giroux). First, sex calls (XIST against Y-chromosome genes) had to agree in bulk, single cells and metadata. Second, a donor-sensitive expression match, which uses no pairing information, was run after removing the top 5 or 10 sample principal components within each assay. The pair's own donor had to be the best match in one direction and among the top five in the other (top three in Giroux). Third, a Giroux pair failed when another sampling day of the same subject matched better in all four day comparisons (two directions, each with and without removing the principal components). This removed both pairs of one subject. ImMicro pairs were linked by sample identifier and baseline visit in the public cell metadata. We used the 107 donors with at least 1,000 kept cells; one more baseline donor, with 34 cells, was left out.
|
| 20 |
+
|
| 21 |
+
\textbf{Usable pairs and contrasts.} A usable pair passed the identity check and had at least 200 kept cells. Of 430 pairs, 403 from 275 donors were usable: 15 failed the identity check, 11 were borderline and 1 had fewer than 200 cells. Excluded pairs were never used. Where donors give several samples (Imperial, Giroux and Ji), the scored unit is the sample, and every split keeps a donor's samples together. Each disease cohort has one case-versus-control contrast: sepsis against healthy and intensive care controls, COVID-19-positive against COVID-19-negative samples in Imperial, moderate against mild disease in Giroux, and ChILI against treated controls in Ji. Giroux's moderate group is labelled `severe' in the Gene Expression Omnibus (GEO); we use the paper's term. Giroux severity is confounded with sex: all 4 scored moderate subjects are female and all 5 mild subjects are male. Giroux's disease metrics therefore exclude 196 sex-linked genes: the 43 Y-chromosome genes outside the pseudoautosomal regions and 153 X-chromosome genes that escape X inactivation fully or variably, or are flagged as possible new escape genes, in Tukiainen et al.\cite{tukiainen2017landscape}; 65 of them are among Giroux's scoring genes.
|
| 22 |
+
|
| 23 |
+
\textbf{Model inputs.} Each bulk enters the model through the pretrained conditioner, unchanged. Its counts were normalised to counts per million (CPM) over its measured genes and rescaled to one fixed depth, $K=1{,}000$ cells of 3,869.6 counts each. No single-cell depth or cell count of a test sample therefore enters its condition.
|
| 24 |
+
|
| 25 |
+
\subsection*{Evaluation designs}
|
| 26 |
+
Every method was tested on donors that it had never seen, in two designs (sizes in Supplementary Table~1).
|
| 27 |
+
|
| 28 |
+
\textbf{Five-donor draws (main comparison).} In each cohort we drew five training donors, five times (seeds 20260928 to 20260932). In the disease cohorts the draws were stratified by whether a donor had a case sample. All pairs of the five donors were training pairs, 5 to 15 per draw. Every other usable sample was a test sample, generated from its real bulk alone. LoRA-5 is the pretrained model fine-tuned on these pairs with low-rank adaptation (LoRA; see below). scSemiProfiler-5 is scSemiProfiler given the same donors' single cells as representatives. Calibration and the two cell-type deconvolution methods used the same pairs, and all methods were scored on the same test samples, observed cells and code.
|
| 29 |
+
|
| 30 |
+
\textbf{5-fold cross-validation (CV), reported separately.} Folds were donor-level and stratified by group (seed 20260927). About 10\% of each fold's training donors were held out for early stopping. Each sample was generated by the fold model that never trained on its donor, and each method was scored in one pooled call over all usable samples. scSemiProfiler's representatives were exactly LoRA's training and inner-validation pairs of the fold.
|
| 31 |
+
|
| 32 |
+
\textbf{Pairs-needed curves.} Within the 5-fold CV of ImMicro and sepsis, LoRA was also trained on nested subsets of 5, 10, 20 or 40 training donors per fold, and on all of them (78--79 in ImMicro and 58--59 in sepsis). The inner-validation and test donors did not change. These five pairs per fold are not the five-donor draws. Calibration and scSemiProfiler used exactly the training and inner-validation pairs of each LoRA run.
|
| 33 |
+
|
| 34 |
+
\subsection*{Fine-tuning with LoRA}
|
| 35 |
+
Low-rank adaptation (LoRA)\cite{hu2022lora} adapts the pretrained model to a cohort's bulk protocol by training a small set of added weights, while the pretrained weights stay frozen. All 22 linear layers of the denoiser, from the time and condition encoders to the value and detection heads, received an update $W=W_0+(\alpha/r)BA$ with rank $r=16$ and $\alpha=16$. $B$ starts at zero, so training starts from the pretrained model. The added $A$ and $B$ matrices hold 1,296,224 trained weights, 2.4\% as many as the model's 54,185,184.
|
| 36 |
+
|
| 37 |
+
A training example is one cell of a training pair, conditioned on that pair's real bulk, and the loss is the pretraining loss, unchanged. Each of the 256 cells in a batch is drawn by picking a training pair uniformly at random and then one of its cells, so every pair weighs the same. We used AdamW\cite{loshchilov2019decoupled} with a learning rate of $5\times10^{-4}$, 200 warm-up steps and no weight decay, gradient clipping at norm 5, bfloat16 arithmetic and an exponential moving average (EMA) of the weights with decay 0.999.
|
| 38 |
+
|
| 39 |
+
With five donors no pair can be spared for validation, so LoRA-5 trained for a fixed 3,000 steps and kept the final EMA weights. This is close to where early stopping halted with five pairs in the pairs-needed curves (Supplementary Fig.~10). In the other designs, the inner-validation loss was computed with the EMA weights every 250 steps. The best state was kept, and training stopped after 2,000 steps without improvement or at 20,000 steps. The update was then merged into the weights (checked on a forward pass), so the standard sampler runs the checkpoint unchanged. We generated 1,500 cells per test sample with 50 DDIM steps\cite{song2021ddim}, the EMA weights, the Bernoulli detection read-out and the same sampler seed for every version.
|
| 40 |
+
|
| 41 |
+
\subsection*{Other versions of \method{}}
|
| 42 |
+
Unless stated otherwise, all other versions share LoRA's pretrained model, its fixed-depth scaling of the bulk, its sampler and its test samples. They differ only in their input or in the weights they train.
|
| 43 |
+
|
| 44 |
+
\textbf{Zero-shot} feeds the pretrained model the real bulk as measured. \textbf{Zero-shot + calibration} feeds it the bulk after a gene-wise calibration fitted on the same pairs as LoRA (its training pairs, plus the inner-validation pairs in 5-fold CV). For gene $g$, $\alpha_g=\bar{p}_g/\bar{b}_g$, where $\bar{p}_g$ and $\bar{b}_g$ are the mean CPM of the pseudobulks and of the bulks over those pairs. We estimated $\alpha_g$ where both assays measured $g$ in every pair and both means reached 1 CPM, and set it to 1 elsewhere. The test bulk in CPM was multiplied by $\alpha_g$ and rescaled to the fixed depth.
|
| 45 |
+
|
| 46 |
+
\textbf{Fine-tuning variants.} In sc-only fine-tuning, all weights were trained on the training donors' pseudobulks paired with their own cells, so the model never saw a real bulk (learning rate $5\times10^{-5}$); at test time it was fed the calibrated real bulk. Full fine-tuning trained all 54.2 million weights on the real bulk (learning rate $5\times10^{-5}$) in the 5-fold CV of ImMicro and sepsis. Condition-encoder-only fine-tuning trained the 9.48 million weights that map the bulk to the model's context (learning rate $10^{-4}$) on fold 0 of the same cohorts. LoRA ranks 4 and 64 ($\alpha=r$) were tested in the same 5-fold CV. So were two rank-16 augmentations: the real bulk shown at several $K$ from 250 to 4,000, and half of each batch taken from one pretraining-style recipe, that is, $K$ cells of one training donor conditioned on their own pseudobulk. All main results use rank 16 and $K=1{,}000$. Two supplementary analyses used the same loss, optimiser and EMA. For Supplementary Note~2, LoRA or full fine-tuning was trained on the pairs of the other cohorts with PBMC bulk, plus 44 training-only pairs of Liu et al.\cite{liu2021timeresolved}, and tested on the held-out cohort. Batches were balanced across cohorts, and Ji's pairs, whose bulk is whole blood, never entered this training pool. For Supplementary Note~3, the same denoiser was trained from a random start at the pretraining learning rate, on the pairs of one sepsis fold or on those of ImMicro, Imperial, Giroux and Liu et al.
|
| 47 |
+
|
| 48 |
+
\subsection*{scSemiProfiler}
|
| 49 |
+
We ran scSemiProfiler\cite{wang2024scsemiprofiler} from the authors' code (commit c2aea02) with its default training budget and scored its official output. Like \method{} with LoRA, it uses single cells of a few representative samples and bulk of all samples. Its representatives were exactly LoRA's training pairs, so both methods saw the same data. These were the same five donors' pairs in the draws (scSemiProfiler-5) and the fold's training and inner-validation pairs in 5-fold CV. In the equal-pair-budget runs they were each LoRA run's pairs, and the representative models of the same fold's 5-fold run were reused. Targets were the same test samples, given their real bulk only.
|
| 50 |
+
|
| 51 |
+
\textbf{The method.} For each representative, scSemiProfiler pretrains a variational autoencoder with an adversarial stage. It first reconstructs the representative's cells and then adds a loss towards the representative's pseudobulk. Each target takes its nearest representative in a principal component analysis of the bulk, upstream's own rule, and gets its own model, trained from that representative's model for five stages of 150 epochs. Real bulk enters as a gene-wise fold change between the target's and the representative's bulk. The encoder reads the representative's cells, so a target gets one generated cell per representative cell. The official output is the decoder's mean, with values of 10 or less per 10,000 counts set to zero.
|
| 52 |
+
|
| 53 |
+
\textbf{Settings and scoring.} Inputs were raw counts on the scorer's genes. Gene selection and cell filtering were switched off so that both methods use the same genes and cells. A compatibility patch changed no computation, except that it dropped a one-cell final minibatch that crashes batch normalisation, a remedy that upstream left commented out in its code. Each target's 1,500 scored cells were drawn from its generated cells and rescaled to the median UMI count per cell of the representatives' observed cells. The scorer read them out to integers with its fixed-seed Poisson draw. For Fig.~\ref{fig:fig3}c, a copy baseline gave each test sample the observed composition of its assigned representative. A read-out without the zeroing threshold modifies the official output and is reported only as a sensitivity check (Supplementary Note~4).
|
| 54 |
+
|
| 55 |
+
\subsection*{Cell-type deconvolution with BayesPrism and CIBERSORTx}
|
| 56 |
+
BayesPrism\cite{chu2022bayesprism} and CIBERSORTx\cite{newman2019cibersortx} are cell-type deconvolution methods: they return cell-type fractions and per-type expression, not single cells. They received the same paired donors as LoRA on the same splits. The reference was the observed cells of the training pairs (plus the inner-validation pairs in 5-fold CV), and the mixture was the test samples' real bulk counts. Outputs were scored with the benchmark's own functions on the same donors, observed cells, groups and gene exclusions, with each sample's estimate for a cell type treated as one profile. Fractions were converted from mRNA to cell units by dividing by each type's mean UMI count per reference cell and renormalising.
|
| 57 |
+
|
| 58 |
+
\textbf{BayesPrism} (version 2.2.3) used its recommended genes: protein-coding genes outside chromosomes X, Y and M, without ribosomal genes, measured by the single-cell assay (15,000 to 19,000 genes). The reference held the summed UMI counts of each cell state. States were the scorer's six cell types split by level-2 labels of the AIFI immune atlas\cite{gong2025multiomic}, all from the same frozen scANVI annotator\cite{xu2021scanvi}; states with fewer than 20 cells were merged within their type. Other settings were the defaults. Composition used the better of the initial and updated fractions, and disease signal used the posterior expression per cell type.
|
| 59 |
+
|
| 60 |
+
\textbf{CIBERSORTx} ran from the official Docker images, under qemu emulation on our ARM machines. Fractions used single-cell reference mode with S-mode batch correction and up to 400 reference cells per type. HiRes then estimated each sample's expression per cell type. HiRes writes exactly 1 for the genes that it does not impute for a type; we set those genes to zero (not expressed) for that type. In one Ji draw and two Giroux draws HiRes imputed no gene of the four contrast types, so 17 of 20 draws have a CIBERSORTx disease score. HiRes also needs more samples than cell types, so 5-fold folds with eight or fewer test samples (Giroux and Ji) have a composition score only.
|
| 61 |
+
|
| 62 |
+
\subsection*{GPU time}
|
| 63 |
+
We counted the GPU work that each method needs to be applied to one cohort, from each run's receipts. All runs used NVIDIA GB10 GPUs in two identical DGX Spark machines, with every step alone on its GPU. For LoRA, a draw or fold costs the recorded wall time of its fine-tuning plus that of its sampling job, which loads the model and generates 1,500 cells per test sample. For scSemiProfiler, it costs both pretraining stages of every representative plus the model trained for every test sample, from its model and export receipts. Per cohort we summed the five draws of the main comparison and, separately, the five fold models of the 5-fold CV. Neither method was charged for data preparation, scoring, work lost to interruptions, or what it provides before use: the pretrained \method{} model and scSemiProfiler's code. The equal-pair-budget scSemiProfiler runs were left out because they reuse the representative models of the 5-fold run.
|