Each capture spot on a spatial array (e.g. Visium-style) sits over many cells at once. A spot's measured transcript counts are a spatial mixture of the cell types beneath it, and its exact footprint may be slightly mis-registered against the underlying histology image. Deconvolution estimates per-spot cell-type proportions from that mixed signal.
This scene simulates a tissue section as an underlying cell-type field sampled by a grid of capture spots. Larger spots (lower resolution) average over a wider footprint and mix more cell types together; a registration offset shifts the sampled field relative to the spot grid, exactly as image-to-array misalignment does in a real pipeline.
spot color(x,z) = Σ_k w_k(x+δx, z+δz) · color_k
purity(x,z) = max_k w_k
UMI(x,z) = round(150 + 650·density(x,z)·(1 + η·U(-.5,.5)))
QC pass = UMI(x,z) ≥ threshold
- Spot resolution — number of capture spots per row/column; also shrinks each spot's sampling footprint, directly reducing cell-type mixing.
- Registration offset — shifts the sampled cell-type field relative to the spot grid (δx, δz), modelling image-to-array alignment error.
- Capture noise (η) — random variation added to UMI counts and mixture weights, modelling technical/dropout noise.
- QC UMI threshold — spots below this transcript count fail QC and sink out of the array (excluded from purity stats).
- Tissue pattern — changes the ground-truth cell-type field (gradient / radial / striped) that the array is trying to recover.
In practice this mirrors real pipelines: platform resolution (Visium vs. Xenium/MERFISH), H&E-to-spot alignment (e.g. Space Ranger fiducial registration), reference-based deconvolution (e.g. cell2location, RCTD), and per-spot QC filtering before downstream integration.