Counterfactual Diffusion Modeling Enables Spatially Targeted Reprogramming of Tissue Microenvironments.
A correction to this paper has been published: the notice, 42651747, from Europe PMC.
10 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 14 matches · 4 of them tie a paragraph to a whole file without given lines: weak matches, whose lines are not tinted
- [1] § 2. Methods › 2.4. Forward Diffusion and Joint Training Objective ↔ metrics/loss_function.py, the whole file · a weak match · score 0.77 · Euclidean distance matrices, pairwise distance, position loss, MSE, predicted, Training · block
oscr:b:B3NYP5J9G6DJ9-9· Report a mismatch - [2] § 2. Methods › 2.3. Model Architecture: SPAD-CFR ↔ models/node_encoder.py, the whole file · a weak match · score 0.72 · hidden dimensions, Linear Attention Transformer, GELU, MLPs, Layer, Encoder · block
oscr:b:9BVZSM3G5KPVZ-L· Report a mismatch - [3] § 2. Methods › 2.3. Model Architecture: SPAD-CFR ↔ models/conditional_denoising_model.py, lines 23 to 109 · score 0.71 · hidden dimensions, Linear Attention Transformer, GELU, MLPs, point cloud, Layer · block
oscr:b:PEQYQ2BEGENFM-4· Report a mismatch - [4] § 2. Methods › 2.5. Deterministic DDIM Inversion and Sampling ↔ utils/diffusion_model/diffusion/noise_model.py, lines 369 to 448 · score 0.69 · Denoising Diffusion Implicit, random noise, point cloud, DDIM, formulation, Prediction · block
oscr:b:51V89WAXG1VJ1-E· Report a mismatch - [5] § 2. Methods › 2.5. Deterministic DDIM Inversion and Sampling ↔ utils/counterfactual_prediction.py, lines 84 to 161 · score 0.66 · DDIM Inversion, inversion step, backward, point cloud, ODE, trajectory · block
oscr:b:N0YPYC0HZ44D2-3· Report a mismatch - [6] § 2. Methods › 2.1. Datasets and Data Preprocessing ↔ utils/counterfactual_prediction.py, lines 15 to 81 · score 0.64 · inverse hyperbolic sine, TCF7, arcsinh, thresholds, transformed, cell · block
oscr:b:VAGBE1CZRXTRX-A· Report a mismatch - [7] § 2. Methods › 2.3. Model Architecture: SPAD-CFR ↔ models/conditional_denoising_model.py, lines 23 to 109 · score 0.62 · Linear Attention Transformer, fused, heads, MLPs, point cloud, embeddings · block
oscr:b:PEQYQ2BEGENFM-4· Report a mismatch - [8] § 2. Methods › 2.4. Forward Diffusion and Joint Training Objective ↔ metrics/loss_function.py, the whole file · a weak match · score 0.60 · Squared Error, feature loss, MSE, protein, predicted, Training · block
oscr:b:B3NYP5J9G6DJ9-9· Report a mismatch - [9] § 2. Methods › 2.2. Problem Formulation: A Structural Causal Model for Spatial Biology ↔ utils/counterfactual_prediction.py, lines 210 to 336 · score 0.56 · DDIM inversion, reconstruction, reproducible, encoding, inference, variable · block
oscr:b:YEC9PCZ2GC3XV-Q· Report a mismatch - [10] § 2. Methods › 2.1. Datasets and Data Preprocessing ↔ scripts/split_by_expression.py, lines 1 to 40 · score 0.55 · arcsinh transformed, gating, IMC, thresholds, Melanoma, tumor · block
oscr:b:W3F577DAR9YSA-A· Report a mismatch - [11] § 3. Results › 3.1. A Structural Causal Diffusion Framework for Spatial Counterfactual Inference ↔ models/node_encoder.py, the whole file · a weak match · score 0.54 · node encoder, linear attention, heads, branch, architecture, transformer · block
oscr:b:9BVZSM3G5KPVZ-L· Report a mismatch - [12] § 2. Methods › 2.1. Datasets and Data Preprocessing ↔ scripts/split_by_column.py, lines 1 to 55 · score 0.53 · Zurich, Triple, split, Basel, IMC, peripheral · block
oscr:b:9BVW4JGVPGFSH-O· Report a mismatch - [13] § 2. Methods › 2.1. Datasets and Data Preprocessing ↔ scripts/run_inference.py, lines 1 to 67 · score 0.51 · MERFISH Mouse, L6, L2, Cortex, slices, training · block
oscr:b:WSNREA2H0Q3HZ-E· Report a mismatch - [14] § 3. Results › 3.1. A Structural Causal Diffusion Framework for Spatial Counterfactual Inference ↔ utils/diffusion_model/diffusion/noise_model.py, lines 369 to 448 · score 0.50 · Denoising Diffusion Implicit, point cloud, DDIM, noise, prediction, node · block
oscr:b:51V89WAXG1VJ1-E· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 337 lines · 15 KB · MIT · 3 matches
- """
- Counterfactual prediction workflow
- """
- from typing import List, Optional, Union
- import torch
- import numpy as np
- import random
- from utils.data.dataholder import DataHolder
- from utils.data.load import remove_mean_with_mask
- from utils.diffusion_model.diffusion.noise_model import NoiseModel
- from utils.concept_discovery import apply_node_intervention
- def build_intervention_target(
- original_data: DataHolder,
- z_nodes: torch.Tensor,
- delta_c_node: torch.Tensor,
- alpha: float,
- target_cell_classes: Optional[List[Union[int, str]]],
- ) -> torch.Tensor:
- """
- Build the post-intervention node conditions z_nodes_target, supporting filtering by cell_class.
- """
- if target_cell_classes is not None and original_data.cell_class is not None:
- cls_tensor = original_data.cell_class
- if cls_tensor.dim() == 3 and cls_tensor.shape[-1] == 1:
- cls_tensor = cls_tensor.squeeze(-1)
- # Support string labels: requires cell_class_decoder to map int -> str
- cls_ids = []
- for cls in target_cell_classes:
- if isinstance(cls, str):
- if not hasattr(original_data, "cell_class_decoder"):
- raise ValueError("String label mapping is required, please ensure DataHolder carries cell_class_decoder.")
- decoder = original_data.cell_class_decoder
- inv_decoder = {v: k for k, v in decoder.items()}
- if cls not in inv_decoder:
- raise ValueError(f"Label {cls} is not in cell_class_decoder.")
- cls_ids.append(inv_decoder[cls])
- else:
- cls_ids.append(cls)
- target_mask = torch.zeros_like(cls_tensor, dtype=torch.bool)
- for cls_id in cls_ids:
- target_mask = target_mask | (cls_tensor == cls_id)
- if original_data.node_mask is not None:
- target_mask = target_mask & original_data.node_mask
- # # =================== USER SPECIFIC LOGIC ===================
- # # Filter TCF7+ PD1+ cells (can be commented out after running)
- # if hasattr(original_data, 'gene_names'):
- # gene_names = original_data.gene_names
- # if "TCF7" in gene_names and "PD1" in gene_names:
- # tcf7_idx = gene_names.index("TCF7")
- # pd1_idx = gene_names.index("PD1")
- # expr_matrix = original_data.node_features
- # # Apply inverse hyperbolic sine transformation np.arcsinh(expr_matrix / 1.0)
- # expr_arcsinh = torch.arcsinh(expr_matrix / 1.0)
- # # Apply threshold > 1.5
- # tcf7_mask = expr_arcsinh[..., tcf7_idx] > 1.5
- # pd1_mask = expr_arcsinh[..., pd1_idx] > 1.5
- # # target_mask = target_mask & tcf7_mask & pd1_mask
- # target_mask = target_mask & pd1_mask
- # # print(f"TCF7+ PD1+ filtering applied, current number of eligible cells: {target_mask.sum().item()}")
- # print(f"PD1+ filtering applied, current number of eligible cells: {target_mask.sum().item()}")
- # else:
- # print("Warning: TCF7 or PD1 gene not found in the data, cannot apply TCF7+ PD1+ filtering condition.")
- # # ===========================================================
- delta = delta_c_node.view(1, 1, -1) # [1,1,d]
- z_nodes_target = z_nodes.clone()
- z_nodes_target = z_nodes_target + alpha * delta * target_mask.unsqueeze(-1)
- return z_nodes_target
- else:
- # Apply intervention to all nodes by default
- return apply_node_intervention(z_nodes, delta_c_node, alpha)
- def run_ddim_inversion(
- model,
- noise_model: NoiseModel,
- data_start: DataHolder,
- target_t_int: int,
- cond_nodes: torch.Tensor,
- num_sampling_steps: int,
- ) -> DataHolder:
- """
- Use DDIM Inversion to reverse diffuse the original data to the specified time step target_t_int.
- """
- device = data_start.node_features.device
- batch_size = data_start.node_features.shape[0]
- if target_t_int == 0:
- z_t = data_start.copy()
- z_t.t_int = torch.zeros((batch_size, 1), device=device, dtype=torch.long)
- z_t.t = torch.zeros((batch_size, 1), device=device)
- z_t.diffusion_time = torch.zeros((batch_size, 1), device=device)
- return z_t
- inversion_step_size = 10
- # Engineering details: avoid the t=0 singularity, manually add a trace amount of noise to t=inversion_step_size (or target_t_int, whichever is smaller)
- start_t_int = min(inversion_step_size, target_t_int)
- t_int_array = torch.full((batch_size, 1), start_t_int, device=device, dtype=torch.long)
- t_float = t_int_array.float() / num_sampling_steps
- # Calculate the starting trace noise parameters
- a = noise_model.get_alpha_bar(t_int=t_int_array, key="p").unsqueeze(-1)
- s = noise_model.get_sigma_bar(t_int=t_int_array, key="p").unsqueeze(-1)
- # Add trace noise to coordinates
- noise_pos = torch.randn(data_start.positions.shape, device=device)
- noise_positions_masked = noise_pos * data_start.node_mask.unsqueeze(-1)
- pos_t = a * data_start.positions + s * noise_positions_masked
- # Add trace noise to protein expression
- noise_features = torch.randn(data_start.node_features.shape, device=device)
- noise_features_masked = noise_features * data_start.node_mask.unsqueeze(-1)
- features_t = a * data_start.node_features + s * noise_features_masked
- # Create the initial, slightly noised point cloud starting point
- z_t = DataHolder(
- node_features=features_t,
- positions=pos_t,
- cell_class=data_start.cell_class,
- cell_ID=data_start.cell_ID,
- node_mask=data_start.node_mask,
- t_int=t_int_array,
- t=t_float,
- diffusion_time=t_float,
- ).mask()
- # True DDIM Inversion: use the ODE solver to integrate backwards step-by-step from start_t_int to target_t_int
- for curr_t in range(start_t_int, target_t_int, inversion_step_size):
- next_t = min(curr_t + inversion_step_size, target_t_int)
- # Set the current time step
- curr_t_array = torch.full((batch_size, 1), curr_t, dtype=torch.long, device=device)
- curr_t_float = curr_t_array.float() / num_sampling_steps
- z_t.t_int = curr_t_array
- z_t.t = curr_t_float
- z_t.diffusion_time = curr_t_float
- # Predict x_0 (Note: use the original condition z_nodes to extract the most realistic diffusion trajectory)
- pred_x0 = model.denoising_model(z_t, cond_nodes)
- # Use the DDIM formula to calculate the next z_{t+\Delta t}
- next_t_array = torch.full((batch_size, 1), next_t, dtype=torch.long, device=device)
- z_t = noise_model.sample_zs_from_zt_and_pred(
- z_t=z_t,
- pred=pred_x0,
- s_int=next_t_array,
- )
- return z_t
- def run_ddim_denoising(
- model,
- noise_model: NoiseModel,
- z_t_init: DataHolder,
- cond_nodes: torch.Tensor,
- num_sampling_steps: int,
- ) -> DataHolder:
- """
- Start from the same noisy starting point z_t_init and run the complete denoising process under the given node conditions cond_nodes.
- """
- device = z_t_init.node_features.device
- batch_size = z_t_init.node_features.shape[0]
- z_t_run = z_t_init.copy()
- sample_interval = 10
- start_step = z_t_run.t_int[0, 0].item() # Start from the time step corresponding to the current noise level
- for s_int in reversed(range(0, int(start_step) + 1, sample_interval)):
- # The current model makes a prediction at time s_int
- t_array = torch.full((batch_size, 1), s_int, dtype=torch.long, device=device)
- t_float = t_array.float() / num_sampling_steps
- z_t_run.t_int = t_array
- z_t_run.t = t_float
- z_t_run.diffusion_time = t_float
- # Conditional denoising one step to predict x_0
- pred = model.denoising_model(z_t_run, cond_nodes)
- if s_int > 0:
- # According to the noise model, use the DDIM formula to go from the current time s_int to the next clearer time s_int - sample_interval
- next_s_int = max(0, s_int - sample_interval)
- next_s_array = torch.full((batch_size, 1), next_s_int, dtype=torch.long, device=device)
- z_t_run = noise_model.sample_zs_from_zt_and_pred(
- z_t=z_t_run,
- pred=pred,
- s_int=next_s_array,
- )
- else:
- # The final step (s_int == 0), directly use the predicted x_0
- z_t_run = pred
- return z_t_run
- def counterfactual_prediction(
- model,
- noise_model: NoiseModel,
- original_data: DataHolder,
- delta_c_node: torch.Tensor,
- alpha: float,
- num_sampling_steps: int = 1000,
- noise_level: float = None,
- target_cell_classes: Optional[List[Union[int, str]]] = None,
- seed: Optional[int] = 42,
- ) -> DataHolder:
- """
- Counterfactual prediction: Predict the point cloud after intervention
- Workflow:
- 1. Encoding: Z_nodes = Encoder_nodes(X). Get the latent variables of each cell's current state.
- 2. Intervention condition construction:
- - Based on the set target cell types (optional), intervene on the latent variables: Z_nodes_target = Z_nodes + α * Δc_node
- 3. True DDIM Inversion (forward reverse inference):
- - Avoid the t=0 singularity (trace noise addition), and integrate backwards step-by-step based on the original condition Z_nodes via the ODE solver.
- - Deterministically reach the target time step determined by noise_level, obtaining a high-fidelity noisy starting point z_t_init.
- 4. Two-stage denoising generation with "Reconstruction Error Correction":
- - Reconstruction: Starting from z_t_init, run denoising conditioned on Z_nodes to estimate the model's systematic bias in the observation space.
- - Intervention: Starting from z_t_init, run denoising conditioned on Z_nodes_target to generate the initial counterfactual results.
- - Calibration: Compensate the systematic bias into the initial counterfactual results to obtain the final counterfactual predicted point cloud X_counterfactual.
- Args:
- model: Trained diffusion model (includes node_encoder and denoising_model)
- noise_model: Noise model
- original_data: Original point cloud data
- delta_c_node: Node-level concept direction [d_node]
- alpha: Intervention strength
- num_sampling_steps: Sampling steps (default 1000, consistent with diffusion_steps during training)
- noise_level: Initial noise level (between 0-1)
- target_cell_classes: Apply intervention only to these cell_class, can be integer ID or string label; if None, apply to all nodes
- seed: Random seed to ensure reproducible noise addition. If None, no seed is set
- Returns:
- X_counterfactual: Counterfactual predicted point cloud
- """
- # Set random seed for reproducibility if provided
- if seed is not None:
- torch.manual_seed(seed)
- if torch.cuda.is_available():
- torch.cuda.manual_seed_all(seed)
- np.random.seed(seed)
- random.seed(seed)
- torch.backends.cudnn.deterministic = True
- torch.backends.cudnn.benchmark = False
- model.node_encoder.eval()
- model.denoising_model.eval()
- device = original_data.node_features.device
- batch_size = original_data.node_features.shape[0]
- num_nodes = original_data.node_features.shape[1]
- with torch.no_grad():
- # Step 1: Encode the original point cloud to get the latent variables of the current state of each cell
- z_nodes = model.node_encoder(original_data) # [B, N, d_node]
- # Step 2: Build intervention conditions (optional filtering by cell_class)
- z_nodes_target = build_intervention_target(
- original_data, z_nodes, delta_c_node, alpha, target_cell_classes
- )
- # Step 3: Conditional point cloud diffusion sampling
- if noise_level is None:
- raise ValueError("noise_level must be provided")
- # Map the noise level to the time step
- initial_t_int = int(noise_level * num_sampling_steps)
- initial_t_int = max(0, min(initial_t_int, num_sampling_steps)) # Ensure it is within the valid range
- z_t_init = run_ddim_inversion(
- model=model,
- noise_model=noise_model,
- data_start=original_data,
- target_t_int=initial_t_int,
- cond_nodes=z_nodes,
- num_sampling_steps=num_sampling_steps,
- )
- # ========= Two-stage denoising framework using "Reconstruction Error Correction" =========
- # Step 1: Reconstruction under α=0 condition, used to estimate the model's systematic bias in the observation space
- X_recon_0 = run_ddim_denoising(
- model=model,
- noise_model=noise_model,
- z_t_init=z_t_init,
- cond_nodes=z_nodes,
- num_sampling_steps=num_sampling_steps,
- )
- # Here, by default, we only correct the bias for protein expression (node_features);
- # If you want to correct coordinates as well in the future, you can similarly calculate and add bias to positions.
- bias_features = original_data.node_features - X_recon_0.node_features
- if original_data.node_mask is not None:
- bias_features = bias_features * original_data.node_mask.unsqueeze(-1)
- # Step 2: Generate counterfactual results under the intervention condition Z + αΔc
- X_cf_alpha = run_ddim_denoising(
- model=model,
- noise_model=noise_model,
- z_t_init=z_t_init,
- cond_nodes=z_nodes_target,
- num_sampling_steps=num_sampling_steps,
- )
- # Step 3: Apply translation calibration using the same bias as α=0
- X_cf_alpha.node_features = X_cf_alpha.node_features + bias_features
- z_t = X_cf_alpha
- # Keep cell class related information for subsequent visualization or filtering by type
- z_t.cell_class = original_data.cell_class
- if hasattr(original_data, "cell_class_decoder"):
- z_t.cell_class_decoder = original_data.cell_class_decoder
- # Keep cell_section information (if it exists), used for slice differentiation in batch mode
- if hasattr(original_data, "cell_section") and original_data.cell_section is not None:
- z_t.cell_section = original_data.cell_section
- if hasattr(original_data, "cell_section_decoder"):
- z_t.cell_section_decoder = original_data.cell_section_decoder
- # Return the counterfactual predicted point cloud
- return z_t
counterfactual_prediction.py at commit 3b034fa, under MIT · at the source
Overview
- Institute of Precision Medicine, The First Affiliated Hospital, Sun Yat-sen University, Guangzhou 510080, China
- Key Laboratory of Gene Engineering of the Ministry of Education, Institute of Healthy Aging Research, School of Life Sciences, Sun Yat-sen University, Guangzhou 510275, China
Abstract
Spatially resolved single-cell technologies can provide deep insights into cellular heterogeneity and tissue structural characteristics. However, the data obtained are purely observational and cannot reveal the specific mechanisms by which tissues respond to particular perturbations. Most computational models of single-cell perturbations either operate in a non-spatial latent space or fix tissue geometry within a static spatial structure, thereby limiting their ability to integrate molecular profiles with tissue topological remodeling. We propose SPAD-CFR (Spatial Point-cloud Attention-based Diffusion for CounterFactual Reprogramming). Each tissue is treated as a spatial point cloud containing cellular molecular profiles and physical coordinates. We implement Pearl’s three-step workflow for causal inference through deterministic diffusion inversion and sampling. This model can apply interventions to individual cells and generate counterfactual-style tissues in which molecular profiles and spatial coordinates change together. In validation across three datasets, SPAD-CFR reproduces the hierarchical structure of the mouse cerebral cortex, simulates phenotypic distribution differences across different histological grades of breast cancer, and reconstructs hypoxia-associated mesenchymal phenotypes at the invasion margins of triple-negative tumors. In melanoma, activation interventions targeting PD-1+ CD8+ T cells produce spatially confined, distance-dependent bystander cytotoxic effects. Based on these findings, we propose SPAD-CFR, a biologically informed generative framework for conducting counterfactual-style spatial simulations to validate hypotheses regarding microenvironment reprogramming.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 14 matches between paragraphs and lines of code.
WenhuiDing/SPAD-CFR
3b034fa1b929facb13453dccab46a388feccbdcc, 17 May 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
36 files
- configs/
__init__.py , Python, 1 line - datasets/
data_module.py , Python, 262 lines - diffusion_model.py, Python, 154 lines
- main.py, Python, 120 lines
- metrics/
__init__.py , Python, 1 line - metrics/
evaluation_statistics.py , Python, 112 lines - metrics/
loss_function.py , Python, 146 lines, 2 matches - models/
__init__.py , Python, 1 line - models/
conditional_denoising_mo , Python, 200 lines, 2 matchesdel.py - models/
node_encoder.py , Python, 125 lines, 2 matches - scripts/
run_inference.py , Python, 647 lines, 1 match - scripts/
split_by_column.py , Python, 337 lines, 1 match - scripts/
split_by_expression.py , Python, 220 lines, 1 match - scripts/
visualize_results.py , Python, 850 lines - utils/
__init__.py , Python, 1 line - utils/
concept_discovery.py , Python, 149 lines - utils/
counterfactual_predictio , Python, 337 lines, 3 matchesn.py - utils/
data/ , Python, 1 line__init__.py - utils/
data/ , Python, 63 linesabstract_datatype.py - utils/
data/ , Python, 128 linesdataholder.py - utils/
data/ , Python, 228 linesload.py - utils/
data/ , Python, 100 linesmisc.py - utils/
diffusion_model/ , Python, 246 linesdiffusion/ diffusion_utils.py - utils/
diffusion_model/ , Python, 448 lines, 2 matchesdiffusion/ noise_model.py - utils/
diffusion_model/ , Python, 1 linesample/ __init__.py - utils/
diffusion_model/ , Python, 118 linessample/ sample.py - utils/
diffusion_model/ , Python, 1 linesetup/ __init__.py - utils/
diffusion_model/ , Python, 193 linessetup/ setup.py - utils/
diffusion_model/ , Python, 1 linetest/ __init__.py - utils/
diffusion_model/ , Python, 84 linestest/ test.py - utils/
diffusion_model/ , Python, 1 linetrain/ __init__.py - utils/
diffusion_model/ , Python, 79 linestrain/ train.py - utils/
diffusion_model/ , Python, 1 linevalidation/ __init__.py - utils/
diffusion_model/ , Python, 100 linesvalidation/ val.py - LICENSE, License, 21 lines
- README.md, Text, 207 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 34 scripts, each with its path and the digest of its content;
- 14 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
- zenodo:3518284, at Zenodo; found in “Data Availability Statement”
- zenodo:5994136, at Zenodo; found in “Data Availability Statement”
- zenodo:6004986, at Zenodo; found in “Data Availability Statement”
Data Availability Statement
All datasets analyzed in this study are publicly available from their original publications. The MERFISH mouse primary motor cortex dataset [18] is accessible via the Brain Image Library at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 5 keywords, 2 funders, 35 references, 1 integrity notice.
Cite
This paper
Ding, W., Luo, Z., & Xiong, Y. (2026). Counterfactual Diffusion Modeling Enables Spatially Targeted Reprogramming of Tissue Microenvironments. Biology, 15(14), 1097. https://
BibTeX
@article{ding2026counter
author = {Ding, Wenhui and Luo, Zhenhua and Xiong, Yuanyan},
title = {{Counterfactual Diffusion Modeling Enables Spatially Targeted Reprogramming of Tissue Microenvironments}},
journal = {Biology},
year = {2026},
month = jul,
volume = {15},
number = {14},
pages = {1097},
publisher = {Multidisciplinary Digital Publishing Institute (MDPI)},
issn = {2079-7737},
doi = {10.3390/
url = {https://
pmid = {42510645},
pmcid = {PMC13406000}
}
RIS
TY - JOUR
AU - Ding, Wenhui
AU - Luo, Zhenhua
AU - Xiong, Yuanyan
TI - Counterfactual Diffusion Modeling Enables Spatially Targeted Reprogramming of Tissue Microenvironments
T2 - Biology
J2 - Biology (Basel)
PY - 2026
DA - 2026/
VL - 15
IS - 14
SP - 1097
SN - 2079-7737
PB - Multidisciplinary Digital Publishing Institute (MDPI)
DO - 10.3390/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.3390/
"type": "article-journal",
"title": "Counterfactual Diffusion Modeling Enables Spatially Targeted Reprogramming of Tissue Microenvironments",
"container-title": "Biology",
"author": [
{
"family": "Ding",
"given": "Wenhui"
},
{
"family": "Luo",
"given": "Zhenhua"
},
{
"family": "Xiong",
"given": "Yuanyan"
}
],
"container-title-short":
"volume": "15",
"issue": "14",
"page": "1097",
"DOI": "10.3390/
"PMID": "42510645",
"PMCID": "PMC13406000",
"ISSN": "2079-7737",
"publisher": "Multidisciplinary Digital Publishing Institute (MDPI)",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
8
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1016/j.patter.2023.100915 [code]
- Spaco: A comprehensive tool for coloring spatial data at single-cell resolution.Journal: Patterns (New York, N.Y.)In common: Scanpy, seaborn, pandas, 3 other tools, Zenodo 3518284, genetics / omics, 2 references
- [2] doi:10.1038/s41467-026-69856-5 [code]
- Celcomen: spatial causal disentanglement for single-cell and tissue perturbation modeling.Journal: Nature communicationsIn common: PyTorch Geometric, Scanpy, PyTorch, 5 other tools, genetics / omics, other condition, 2 references
- [3] doi:10.1016/j.xgen.2024.100739 [code]
- CSI-GEP: A GPU-based unsupervised machine learning approach for recovering gene expression programs in atlas-scale single-cell RNA-seq data.Journal: Cell genomicsIn common: PyTorch Geometric, PyTorch Lightning, Scanpy, 6 other tools, genetics / omics, 1 reference
- [4] doi:10.1038/s41588-025-02120-6 [code]
- Quantitative characterization of cell niches in spatially resolved omics data.Journal: Nature geneticsIn common: PyTorch Geometric, Scanpy, PyTorch, 5 other tools, genetics / omics, other condition, 2 references
- [5] doi:10.1038/s41592-026-03034-9 [code]
- 3d-OT: a deep geometry-aware framework for heterogeneous slices alignment of spatial multi-omics.Journal: Nature methodsIn common: PyTorch Geometric, Scanpy, PyTorch, 5 other tools, genetics / omics, 2 references
- [6] doi:10.1038/s41467-026-70090-2 [code]
- Reconstructing single-cell resolution from spatial transcriptomics with CellRefiner.Journal: Nature communicationsIn common: PyTorch Geometric, Scanpy, PyTorch, 5 other tools, genetics / omics, 2 references
- [7] doi:10.1038/s41467-026-71759-4 [code]
- CellNiche represents cellular microenvironments in atlas-scale spatial omics data with contrastive learning.Journal: Nature communicationsIn common: PyTorch Geometric, Scanpy, PyTorch, 5 other tools, other condition, 2 references
- [8] doi:10.1016/j.celrep.2024.115149 [code]
- Single-nucleus and spatial landscape of the sub-ventricular zone in human glioblastoma.Journal: Cell reportsIn common: PyTorch Lightning, Scanpy, PyTorch, 5 other tools, other condition, 2 references
- [9] doi:10.1038/s41467-023-44367-9 [code]
- MENDER: fast and scalable tissue structure identification in spatial omics data.Journal: Nature communicationsIn common: PyTorch Geometric, Scanpy, PyTorch, 5 other tools, genetics / omics, 2 references
- [10] doi:10.1101/2025.05.13.653495 [code]
- A spatiotemporal cancer cell trajectory underlies glioblastoma heterogeneityJournal: bioRxiv (preprint)In common: PyTorch Geometric, PyTorch Lightning, Scanpy, 6 other tools, genetics / omics, other condition
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 34 scripts, and 14 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:14cd7c90ac0589de…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.3390/biology15141097)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.3390/biology15141097.svg
:target: https://openscicode.org/badge/doi/10.3390/biology15141097
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.3390/biology15141097"><img src="https://openscicode.org/badge/doi/10.3390/biology15141097.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
