betaFeedback

WorksMathematics

CASPER: Discovering Spatially Resolved Causal Cell-Cell Communications

Abstract

Spatial transcriptomics can reveal where ligands and receptors are expressed together. A harder question is whether exposure to a ligand changes pathway activity in nearby cells, since the same tissue environment can influence both ligand expression and pathway activity. We introduce CASPER, a Bayesian structural equation model that adjusts for receptor expression and represents the shared tissue environment with a Gaussian Markov random field. We show that the ligand-exposure effect is identifiable when the spatial covariance is known and distinguishable from independent noise, the coefficients are constant, and the structural errors are independent and homoskedastic. In simulations, CASPER reduced the bias seen in ordinary regression and in a regression that accounted for spatial dependence only in the outcome. We compared CASPER with CellPhoneDB in four public Xenium datasets. In ovarian cancer, CellPhoneDB found evidence of ligand–receptor expression enrichment for both IL6 and VEGFA. CASPER found greater support for a positive effect of fibroblast IL6 on the inflammatory-response score of ciliated epithelial cells than for an effect of fibroblast VEGFA on the angiogenesis score of endothelial cells. Code accompanies the Supplementary Materials and is available at https://github.com/nySTAT/casperCCC.

Introduction

Cell-cell communication (CCC) is fundamental to tissue development, immune defense, and disease progression. A ligand released by a sender cell can bind a receptor on a nearby cell and activate a downstream signaling pathway (Figure 1A and B). Spatial transcriptomics measures the expression of the ligand, receptor, and downstream genes in the same tissue. The question is whether changing ligand exposure would change pathway activity in the receiver cell.

Cell-cell communication, downstream response, and spatial context

Figure 1. A sender cell releases a ligand that can bind a receptor on a nearby cell (A) and trigger a change in downstream gene expression (B). Nearby senders contribute more to a receiver’s exposure than distant senders do, and a shared tissue environment can influence both exposure and response (C). Generative AI was used in producing this illustration.

Single-cell RNA sequencing and spatial transcriptomics have given rise to tools that prioritize candidate interactions using ligand–receptor co-expression, enrichment, spatial proximity, or target-gene expression ([12, 16, 15, 9, 25, 10, 19] (Browaeys et al. 2020)). A shared tissue environment can produce the same patterns. For example, an inflammatory niche may induce cytokine expression in sender cells and independently activate an inflammatory program in nearby receiver cells (Figure 1C). Methods for inferring directional communication have also been proposed ([6, 11]). Our interest is in estimating the effect of ligand exposure when an unmeasured feature of the tissue can influence both exposure and response.

We propose CASPER, a Bayesian structural equation model (SEM) for this problem. For a specified ligand, receptor, and pathway, CASPER relates pathway activity to ligand exposure from neighboring senders while adjusting for receptor expression. A shared Gaussian Markov random field represents the influence of the local tissue environment on all three measurements.

The ligand–receptor mechanism suggests a direction of effect, from ligand exposure to pathway activity in the receiver cell. The difficulty is estimating the size of that effect when the same local environment influences both measurements. Work on spatial confounding has shown that the spatial scale and covariance of an unmeasured process can affect a regression estimate [21, 14, 18, 13].

CASPER uses the difference between the spatial covariance of the shared field and the independent variation in each measurement to identify the ligand-exposure effect. Irregular cell locations can provide this information through differences in marginal variances. Correlation between cells can also be informative when the marginal variances are constant. We examine these two sources of information in simulations and compare CASPER with CellPhoneDB across four tissue types. Two ovarian examples illustrate how the evidence for a pathway response can differ even when both ligand–receptor pairs show expression enrichment.

Method

For a given sender and receiver cell type, we use prior biological knowledge to specify a sender ligand, a receiver receptor, and a downstream pathway. For example, if fibroblasts are the senders and tumor cells are the receivers, one possible triplet is

fibroblast ligand IL6\mathit{IL6} — receptor IL6R\mathit{IL6R} — pathway inflammatory response

Here the hypothesis is that exposure to fibroblast IL6 changes inflammatory pathway activity in tumor cells expressing IL6R. For receiver i=1,…,ni = 1,\ldots,n, let XiX_i denote its ligand exposure, ZiZ_i its receptor expression, and YiY_i its pathway activity score. We center and scale each variable across receivers before fitting the model.

Ligand exposure via spatial kernel weighting. Let LkL_k be the expression of the ligand in sender cell k=1,…,mk = 1,\ldots,m, and let dikd_{ik} be the Euclidean distance between receiver cell ii and sender cell kk. Define a nonnegative spatial kernel K(⋅;h)K(\cdot;h) with bandwidth h>0h > 0. The kernel-weighted exposure of receiver ii to the ligand is

Ei=∑k=1mK(dik;h)Lk.E_i = \sum_{k=1}^{m} K(d_{ik};h)L_k.

In the applications, LkL_k is normalized ligand abundance on the linear scale. We use a Gaussian kernel restricted to nearby sender cells and center and scale log⁡(1+Ei)\log(1 + E_i) to obtain XiX_i. § 4 gives the neighborhood and bandwidth rules.

Pathway activity score. We summarize pathway activity by the mean log-normalized expression of its measured genes. Other possible scores include AUCell (Aibar et al., [5]) and UCell (Andreatta and Carmona, [7]).

The proposed SEM. Figure 2 shows how the proposed model links ligand exposure, receptor expression, and pathway activity in a receiver cell. Let UiU_i denote unmeasured conditions in the neighborhood of receiver ii. The structural equations are

Structural model for a receiver cell

Figure 2. Structural model for a receiver cell. Ligand exposure (XiX_i) and receptor expression (ZiZ_i) affect pathway activity (YiY_i). The shared spatial field (UiU_i) influences all three measurements.

Xi=UiβUX+ϵXi,Zi=UiβUZ+ϵZi,Yi=XiβXY+ZiβZY+UiβUY+ϵYi.(1)\begin{aligned} X_i &= U_i\beta_{UX} + \epsilon_{X_i},\\ Z_i &= U_i\beta_{UZ} + \epsilon_{Z_i},\\ Y_i &= X_i\beta_{XY} + Z_i\beta_{ZY} + U_i\beta_{UY} + \epsilon_{Y_i}. \tag*{(1)} \end{aligned}

The first two equations describe how ligand exposure and receptor expression vary across receivers with local tissue conditions. Exposure is calculated from ligand expression in nearby senders, and receptor expression is measured in the receiver itself. The third equation relates pathway activity to ligand exposure and receptor expression through βXY\beta_{XY} and βZY\beta_{ZY}, respectively. It also allows the same local conditions to influence pathway activity directly through βUY\beta_{UY}.

The errors are mutually independent across cells and equations and independent of the latent field. For each receiver, ϵXi∼N(0,σX2)\epsilon_{X_i} \sim N(0,\sigma_X^2), ϵZi∼N(0,σZ2)\epsilon_{Z_i} \sim N(0,\sigma_Z^2), and ϵYi∼N(0,σY2)\epsilon_{Y_i} \sim N(0,\sigma_Y^2).

Let Yi(x,z)Y_i(x,z) denote the pathway score that receiver ii would have if its exposure and receptor expression were set to xx and zz, with the tissue geometry and latent background held fixed. Under Equation (1), the expected change from increasing exposure by Δ\Delta at fixed zz is $\mathbb{E}{Y_i(x+\Delta,z) -】【。 Yi(x,z)=βXYΔY_i(x,z)=\beta_{XY}\Delta. To relate this contrast to a change in sender expression, write Xi=gi(L)X_i=g_i(\mathbf{L}), where L\mathbf{L} collects the ligand abundances of the senders. Changing L\mathbf{L} to L′\mathbf{L}' can alter the exposure of several receivers at once. If this change acts on receiver ii through its exposure summary alone, then at fixed receptor abundance and background conditions the expected change in its pathway score is βXY{gi(L′)−gi(L)}\beta_{XY}\{g_i(\mathbf{L}')-g_i(\mathbf{L})\}.

Let θ=(βUX,βUZ,βXY,βZY,βUY,σX2,σZ2,σY2)\theta=(\beta_{UX},\beta_{UZ},\beta_{XY},\beta_{ZY},\beta_{UY},\sigma_X^2,\sigma_Z^2,\sigma_Y^2) denote all the model parameters.

Modeling spatial confounding. Unmeasured neighborhood conditions are represented by a receiver-indexed latent field. Let A\mathbf{A} be the symmetrized, Gaussian-weighted adjacency matrix of the kk-nearest-neighbor graph on the receivers (k=8k=8), and let D\mathbf{D} be the diagonal matrix of weighted degrees. The edge bandwidth is the median positive distance from a receiver to one of its kk nearest receiver neighbors. Adding κ=0.01\kappa=0.01 to each diagonal entry of the graph Laplacian D−A\mathbf{D}-\mathbf{A} gives a positive definite precision matrix Q=D−A+κI\mathbf{Q}=\mathbf{D}-\mathbf{A}+\kappa\mathbf{I}. This defines a proper Gaussian Markov random field (GMRF) [23] with density

p(U)∝exp⁡{−UTQU/2},p(\mathbf{U})\propto\exp\{-\mathbf{U}^{\mathsf{T}}\mathbf{Q}\mathbf{U}/2\},

so U∼N(0,C)\mathbf{U}\sim N(\mathbf{0},\mathbf{C}) with C=Q−1\mathbf{C}=\mathbf{Q}^{-1}. The exposure kernel describes which senders contribute ligand to each receiver. The receiver graph describes how background conditions covary across receivers. The physical range of each therefore depends on the distances between the cells it connects.

The covariance scale is fixed because multiplying U\mathbf{U} and dividing its three loadings by the same constant leaves their products unchanged.

Identifiability. The known spatial covariance allows the model to distinguish variation shared across cells from variation due to independent errors. The following proposition makes this distinction precise.

Proposition 1 (Causal Identifiability). Suppose C\mathbf{C} is known and positive definite, C\mathbf{C} and I\mathbf{I} are linearly independent, βUX>0\beta_{UX}>0, and σX2,σZ2,σY2>0\sigma_X^2,\sigma_Z^2,\sigma_Y^2>0, with mutually independent homoskedastic errors independent of U\mathbf{U}. Then all SEM parameters θ\theta are identifiable from the joint distribution of (X,Z,Y)(\mathbf{X},\mathbf{Z},\mathbf{Y}).

Reversing the signs of U\mathbf{U} and all three of its loadings preserves their products in Equation (1). The condition βUX>0\beta_{UX}>0 selects one of these two equivalent representations. To see the source of identification, write a=βUXa=\beta_{UX}, b=βUZb=\beta_{UZ}, and d=βXYa+βZYb+βUYd=\beta_{XY}a+\beta_{ZY}b+\beta_{UY}. Then Cov⁡(X)=a2C+σX2I\operatorname{Cov}(\mathbf{X})=a^2\mathbf{C}+\sigma_X^2\mathbf{I} and Cov⁡(X,Y)=adC+βXYσX2I\operatorname{Cov}(\mathbf{X},\mathbf{Y})=ad\mathbf{C}+\beta_{XY}\sigma_X^2\mathbf{I}. Linear independence of C\mathbf{C} and I\mathbf{I} uniquely separates their coefficients, identifying a2a^2, σX2\sigma_X^2, adad, and βXYσX2\beta_{XY}\sigma_X^2. The remaining covariance blocks identify the other parameters, as shown in Appendix A.

On an irregular tissue graph, the marginal variance of the field, qi=Ciiq_i = C_{ii}, can differ across receivers. Two distinct values of qiq_i suffice for the linear independence in Proposition 1, because a scalar multiple of I\mathbf{I} has a constant diagonal. Differences in marginal variance can therefore identify the effect through heteroskedasticity [22]. Even when all receivers have the same marginal variance, any nonzero covariance between distinct receivers also gives linear independence.

Priors. We assign a spike-and-slab prior to the ligand-exposure coefficient βXY\beta_{XY},

γ∼Bernoulli⁡(π0),\gamma\sim\operatorname{Bernoulli}(\pi_0),
βXY∣γ∼γ⋅N(0,τ2)+(1−γ)⋅δ0,\beta_{XY} \mid\gamma\sim\gamma\cdot\mathcal{N}(0,\tau^2) + (1-\gamma)\cdot\delta_0,

where π0=0.5\pi_0 = 0.5, τ2=1\tau^2 = 1, and δ0\delta_0 is a point mass at zero. The posterior inclusion probability (PIP), Pr⁡(γ=1∣data)\Pr(\gamma= 1 \mid\text{data}), measures support for a nonzero exposure effect. Even a small effect can have a high PIP when it is precisely estimated. To assess magnitude, we report the model-averaged posterior mean and 95% credible interval and the posterior probability that ∣βXY∣|\beta_{XY}| exceeds 0.05, 0.10, or 0.20. An effect of 0.10 corresponds to a change of one-tenth of a pathway-score standard deviation per standard deviation of exposure. The remaining coefficients have independent normal priors,

βZY,βUX,βUZ,βUY∼N(0,σβ2),\beta_{ZY}, \beta_{UX}, \beta_{UZ}, \beta_{UY} \sim\mathcal{N}(0,\sigma_\beta^2),

with σβ2=1\sigma_\beta^2 = 1 by default. The error variances have independent inverse-gamma priors,

σX2,σZ2,σY2∼Inverse-Gamma⁡(0.01,0.01).\sigma_X^2, \sigma_Z^2, \sigma_Y^2 \sim\operatorname{Inverse\text{-}Gamma}(0.01, 0.01).

Posterior Computation and Diagnostics

We sample the coefficients, error variances, inclusion indicator, and latent field jointly using a blocked Gibbs sampler. Conditional on the coefficients and error variances, the three structural equations add only diagonal terms to the field precision matrix. The matrix therefore remains sparse, and hence we can sample the field for all receivers jointly by sparse Cholesky factorization. Appendix B gives the complete algorithm, including two Metropolis–Hastings moves used in the real-data fits.

The independent exposure variance σX2\sigma_X^2 measures how much exposure variation remains after accounting for the shared field. A posterior concentrated near zero, or a strong posterior association between βXY\beta_{XY} and the outcome loading βUY\beta_{UY}, can signal difficulty separating the exposure effect from the influence of the field. The sampler allows either sign for βUX\beta_{UX}. To assess this association after sampling, we pair βXY\beta_{XY} in each retained draw with sign⁡(βUX)⋅βUY\operatorname{sign}(\beta_{UX}) \cdot\beta_{UY}, the outcome loading under the sign convention of Proposition 1. Sensitivity to the coefficient priors and neighborhood choices provides a further check. We assess the constant-variance sufficient condition by examining squared standardized residuals across receivers grouped by qiq_i (Appendix § 8.3.§ 3).

Real Data Analysis

We compared CASPER and CellPhoneDB in four public 10x Genomics Xenium datasets, each representing one sample, from ovarian cancer (10x Genomics, 2024b), melanoma (10x Genomics, 2024c), breast cancer (10x Genomics, 2024a), and renal carcinoma (10x Genomics, 2025). We first asked how often the same candidates showed both ligand–receptor expression enrichment and evidence of an exposure effect on the receiver pathway. We then examined two examples in the ovarian tissue.

Data Preprocessing and Screening

We normalized raw counts to 10,000 per cell and applied the transformation log⁡(1+x)\log(1+x). Normalization used 5,101 genes in ovarian cancer and 405 in renal carcinoma. For melanoma and breast cancer it used 2,158 and 2,188 genes, respectively, drawn from Hallmark, ligand–receptor, and marker sets. We assigned broad cell types using dataset annotations and canonical markers. Each candidate specifies a ligand in the sender cell type, together with a receptor and a pathway in the receiver cell type. The ovarian examples use the Hallmark inflammatory-response and angiogenesis gene sets ([17]). Some renal pathway gene sets were adapted to the smaller panel (Appendix § 8.3.§ 1).

Receptor expression ZiZ_i is the log-normalized receptor abundance. Pathway activity YiY_i is the mean log-normalized abundance of measured pathway genes, excluding the ligand and receptor. Before centering and scaling, ligand exposure is

X~i=log⁡{1+∑k∈N32(i)exp⁡(−dik22hX2)Lk}.\tilde{X}_i=\log\left\{1+\sum_{k\in\mathcal{N}_{32}(i)}\exp\left(-\frac{d_{ik}^{2}}{2h_X^{2}}\right)L_k\right\}.

where LkL_k is normalized ligand abundance on the linear scale and N32(i)\mathcal{N}_{32}(i) comprises the 32 nearest sender cells. The bandwidth hXh_X is the median positive distance among all retained sender–receiver neighbor distances for that candidate.

We considered pairs of distinct cell types with at least 100 cells of the sender type and 500 of the receiver type. We required log-normalized ligand and receptor expression above 0.1 in at least 5% of their respective cell types, a product of their mean expressions of at least 0.01, and at least five measured downstream pathway genes after excluding ligand and receptor. In total, 2,229 candidates met these criteria. For ovarian, melanoma, and breast tissue, we ranked candidates using marginal correlation, spatial variation, and prior knowledge about the cell types and pathway. We used a specified list of eligible candidates for the renal panel. Appendix § 8.3.§ 1 gives the selection rules.

Of the eligible candidates, 222 entered the comparison. We fitted CASPER using up to 3,000 receivers per candidate. For the two detailed ovarian analyses, we used all senders and receivers. The cancer-associated fibroblast VEGFA–FLT1 example belonged to the comparison set. The fibroblast IL6–IL6R example came from a separate exploratory search among other eligible ovarian candidates (Appendix § 8.3.§ 3).

We ran CellPhoneDB with 1,000 cell-label permutations, a 5% expression threshold, and up to 3,000 cells per relevant type (Appendix § 8.3.§ 2). We used PIP ≥0.7\ge0.7 to identify candidates with high posterior support for a pathway effect and a nominal permutation p<0.05p < 0.05 to identify expression enrichment. A candidate could be undetectable in CellPhoneDB if its interaction was missing from the database or a required gene product was absent from the input.

Results

Cross-dataset comparison. CellPhoneDB found expression enrichment for 151 of the 204 candidates it could test. CASPER gave high posterior support to a pathway effect for 14 of the 222 screened candidates (Table 1). Nine of those 14 also showed expression enrichment. Of the remaining five, three involved WNT5A from keratinocyte/epithelial senders and one of three receptors (LRP6, FZD3, or FZD6) on melanoma mast cells. CellPhoneDB tested these three interactions and found no enrichment. The other two high-PIP candidates involved VEGFB–KDR in melanoma, for which the matched CellPhoneDB complex required FLT1, a component absent from the processed input.

DatasetCandidatesCellPhoneDB testedCASPER highCellPhoneDB positiveBoth
Breast20202132
Melanoma89796551
Ovarian92923703
Renal21133133

Table 1. Comparison of CASPER and CellPhoneDB by tissue. CASPER-high denotes PIP ≥0.7\ge0.7 for an effect on the receiver pathway. CellPhoneDB-positive denotes ligand–receptor expression enrichment at a nominal permutation p<0.05p < 0.05. The final column counts candidates meeting both criteria.

Ovarian IL6–IL6R pathway response. We examined whether IL6 from 35,459 fibroblasts was associated with inflammation in 559 ciliated epithelial receivers. The score averaged 144 measured Hallmark inflammatory-response genes, and CASPER adjusted for receiver IL6R expression. The marginal correlation between exposure and pathway score was −0.077. CellPhoneDB found enrichment of fibroblast IL6 and the epithelial IL6R/IL6ST receptor complex, with no exceedances in 1,000 permutations.

CASPER assigned the IL6 effect a PIP of 0.924. A one-standard-deviation increase in exposure corresponded to an estimated increase of 0.708 standard deviations in pathway score under model averaging (95% credible interval [0, 1.443]). The interval includes zero because the posterior assigns 7.6% probability to an exactly zero effect. Among draws with a nonzero effect, the 95% interval was [0.205, 1.456]. The posterior probability that the absolute effect exceeded 0.10 was 0.917 (Table S2).

Posterior summaryIL6–IL6RVEGFA–FLT1
Inclusion probability0.9240.053
Model-averaged mean0.708−0.0007-0.0007
Model-averaged 95% CrI[0,1.443][0, 1.443][−0.018,0][-0.018, 0]
95% CrI given inclusion[0.205,1.456][0.205, 1.456][−0.116,0.087][-0.116, 0.087]
P0.05P_{0.05}0.9210.019
P0.10P_{0.10}0.9170.003
P0.20P_{0.20}0.9030.000

Table S2. Posterior summaries for the ovarian examples. Effects are in pathway-score standard deviations per exposure standard deviation. Model-averaged means and 95% credible intervals use all draws. Conditional intervals use draws with γ=1\gamma= 1. PδP_\delta is the posterior probability that ∣βXY∣>δ|\beta_{XY}| > \delta.

Expression of FOXJ1, CDHR4, and TEKT1 supported the ciliated epithelial annotation. IL6R has been localized to human fallopian-tube epithelial cilia (Shao et al., [24]), and IL6 exposure affects ciliary activity in human tubal explants (Papathanasiou et al., [20]). These observations make a response to IL6 plausible in this cell type. The score used here captures a broad inflammatory transcriptional response.

Ovarian VEGFA–FLT1 small-effect example. Our second example involved 33,990 cancer-associated fibroblasts and 2,794 angiogenic endothelial cells. We assessed exposure to fibroblast VEGFA and the activity of 21 measured angiogenesis genes in the receivers, adjusting for FLT1 expression. CellPhoneDB found enrichment for VEGFA–FLT1, with no exceedances in 1,000 permutations. The marginal exposure–pathway correlation was 0.010. CASPER assigned the effect a PIP of 0.053 and a model-averaged mean of −0.0007 (95% credible interval [−0.0181, 0]). The posterior probability of an absolute effect larger than 0.10 was 0.003. Thus the two pairs showed similar evidence of expression enrichment and markedly different evidence for a pathway response.

Diagnostics and sensitivity. Across the 36 receiver graphs used in the four-tissue comparison, the coefficient of variation of the marginal latent variances qiq_i ranged from 0.56 to 4.65 (Table S1). In the ovarian IL6 analysis, none of the three equations showed a clear linear trend in mean squared standardized residuals across ten groups of receivers ordered by qiq_i (Appendix § 8.3.§ 3). When we shuffled IL6 exposure across receivers, the five control PIPs ranged from 0.043 to 0.283, and all five model-averaged intervals included zero.

TissueReceiver cell typeMedian [Q1, Q3]CV
OvarianAngiogenic endothelial4.17 [2.58, 8.93]1.59
OvarianCAF0.93 [0.69, 1.34]3.61
OvarianCycling epithelial or unknown0.95 [0.73, 1.35]2.99
OvarianCycling tumor epithelial0.87 [0.72, 1.21]3.02
OvarianEndothelial0.88 [0.71, 1.18]3.23
OvarianFibroblast0.76 [0.52, 1.30]3.40
OvarianHypoxic tumor or stress1.43 [1.06, 2.23]2.92
OvarianInflammatory fibroblast1.13 [0.91, 1.70]3.27
OvarianMacrophage0.90 [0.68, 1.49]1.77
OvarianMesothelial2.13 [1.49, 4.07]2.43
OvarianMyeloid0.80 [0.59, 1.16]4.19
OvarianPericyte3.72 [2.17, 7.32]1.82
OvarianTumor epithelial0.96 [0.79, 1.29]3.40
MelanomaB cell1.06 [0.92, 1.50]1.59
MelanomaEndothelial1.59 [1.00, 2.81]1.89
MelanomaFibroblast CAF0.68 [0.56, 1.06]3.01
MelanomaKeratinocyte epithelial0.60 [0.55, 0.73]3.25
MelanomaMast cell0.75 [0.60, 1.24]2.83
MelanomaMelanoma melanocytic0.65 [0.55, 0.83]4.65
MelanomaMyeloid0.79 [0.61, 1.07]2.92
MelanomaPerivascular smooth muscle0.62 [0.54, 0.87]2.61
MelanomaPlasma cell0.89 [0.66, 2.05]2.34
MelanomaProliferating melanoma0.71 [0.60, 0.90]4.33
MelanomaT NK cell0.88 [0.59, 1.77]2.28
RenalB plasma1.37 [0.90, 4.13]2.42
RenalB plasma mixed1.20 [0.86, 2.12]2.74
RenalEndothelial0.69 [0.60, 0.82]0.56
RenalStromal0.67 [0.53, 1.06]1.39
RenalStromal mixed0.68 [0.51, 1.00]0.83
RenalT cell0.91 [0.70, 1.20]0.91
RenalT cell mixed0.73 [0.62, 0.89]1.15
BreastEndothelial0.68 [0.56, 0.90]2.68
BreastMast cell0.76 [0.61, 1.03]3.59
BreastPerivascular0.85 [0.71, 1.24]2.37
BreastPlasma cell0.92 [0.68, 1.36]3.35
BreastTumor epithelial1.17 [0.79, 1.96]2.60

Table S1. Distribution of the marginal latent variance qiq_i within each of the 36 receiver graphs. Each graph contains up to 3,000 cells. Q1 and Q3 denote the 25th and 75th percentiles. The coefficient of variation (CV) is the standard deviation divided by the mean.

The estimated IL6 effect was larger under a wider coefficient prior. The VEGFA estimate remained close to zero across the priors examined. Appendix § 8.3.§ 3 reports the sensitivity analyses, and Table S2 summarizes the ovarian fits.

Simulations

We used simulations to examine how well CASPER estimates the ligand-exposure effect under different sources of spatial confounding. We compared CASPER with ordinary regression of YY on (X,Z)(X, Z), a spatial outcome-only regression with the same receiver graph and spike-and-slab prior, and an oracle regression that also observes the true confounder(s).

Design

We first examined how each method performed under the reference model as sample size and the true ligand-exposure effect varied. At each sample size (n=500n = 500, 3,000, or 10,000 receivers), we simulated a null effect (βXY=0\beta_{XY} = 0), a small effect (0.05), and a moderate effect (0.30). We generated the data from Equation (1) with all three confounder loadings set to 0.6, a receptor effect of 0.3, and independent errors of variance one. We sampled cell locations uniformly on a 10 ×\times 10 domain and scaled the precision of the proper GMRF so that the mean marginal variance of the latent field was one.

We then fixed n=500n = 500 and examined departures from the reference model. We weakened or strengthened confounding by multiplying all three loadings by 0.5 or 1.5, respectively. We also examined two independent spatial fields with different ranges and nonproportional loadings, a quadratic term in the outcome equation, and independent variance-matched Laplace errors. Three additional settings assessed the effect of error variances that change with qiq_i. The exposure error variance increased in one setting and decreased in another. In the third setting, all three error variances increased. The ratio of the larger to the smaller variance was 1.5 across the interquartile range of log⁡qi\log q_i. Finally, we compared the irregular cell locations of the reference model with regular and jittered grids. We studied each of these variations at βXY=0\beta_{XY} = 0 and 0.30. In each setting, we fitted all four methods to the same 100 independently generated datasets (Appendix § 9).

CASPER and the spatial regression select an effect at PIP ≥0.7\ge0.7. Ordinary and oracle regressions select it when the 95% confidence interval excludes zero. We evaluated how often each method selected the effect and how accurately it estimated its size. For bias and root mean squared error (RMSE), we transformed model-averaged Bayesian estimates back to the generating scale. For the posterior probabilities of exceeding an effect threshold, we used standardized coefficients.

Results

At n=500n = 500 under the reference model, CASPER selected a null effect in 3% of replicates, compared with 42% for spatial outcome-only regression, 93% for ordinary regression, and 6% for the oracle. For a true effect of 0.30, CASPER selected 97% of replicates and had RMSE 0.071. The corresponding RMSEs were 0.142 for the spatial regression, 0.185 for ordinary regression, and 0.045 for the oracle. As the sample size increased to 3,000 and 10,000, CASPER detected the moderate effect in every replicate, and its RMSE fell to 0.022 and 0.013. The null selection rate was zero at both larger sample sizes.

The smaller effect of 0.05 illustrates how sample size can increase support for inclusion even when the estimated effect remains small. CASPER selected this effect in 3%, 14%, and 62% of replicates at the three sample sizes. At n=10,000n = 10{,}000, the mean PIP was 0.727, while the mean posterior probability of an absolute standardized effect above 0.10 was 0.001.

At n=500n = 500, CASPER detected a true effect of 0.30 in 97–98% of replicates under the two-field, mildly nonlinear, and Laplace scenarios, with absolute bias at most 0.018. Bias was greater when all three error variances increased with qiq_i. In that setting, CASPER underestimated the effect by 0.049 on average, its RMSE rose to 0.109, and it selected the effect in 85% of replicates. Increasing the confounding multiplier from 0.5 to 1.5 also raised RMSE, from 0.056 to 0.098, and reduced selection from 100% to 88%.

On a regular periodic grid, the marginal latent variances were constant and the field still exhibited correlation between cells. CASPER selected the moderate effect in 91% of replicates on this grid, in 88% after jittering the locations, and in 97% on irregular locations. The corresponding RMSEs were 0.090, 0.086, and 0.071. Figure 3 shows selection rates under the reference model. Table S3 gives the results across simulation settings.

Figure 3. Selection rates across 100 replications under the reference model, with 95% Wilson intervals for Monte Carlo uncertainty. CASPER and spatial outcome-only regression select an effect when the PIP is at least 0.7. Ordinary and oracle regressions select it when the 95% confidence interval excludes zero.

SettingEffectMethodSelectionMean PIPBiasRMSE
Reference model
n=500n = 5000.00CASPER0.030.1010.0010.027
Spatial0.420.5400.0780.103
Ordinary0.93—0.1690.177
Oracle0.06—-0.0030.048
0.05CASPER0.030.147-0.0360.047
Spatial0.750.8220.0960.118
Ordinary1.00—0.1610.171
Oracle0.22—-0.0040.045
0.30CASPER0.970.968-0.0010.071
Spatial1.001.0000.1340.142
Ordinary1.00—0.1790.185
Oracle1.00—0.0090.045
n=3,000n = 3{,}0000.00CASPER0.000.0410.0000.004
Spatial1.001.0000.1370.138
Ordinary1.00—0.1980.199
Oracle0.03—0.0000.016
0.05CASPER0.140.284-0.0290.041
Spatial1.001.0000.1360.138
Ordinary1.00—0.2010.202
Oracle0.74—-0.0020.020
0.30CASPER1.001.000-0.0010.022
Spatial1.001.0000.1370.138
Ordinary1.00—0.2000.201
Oracle1.00—-0.0010.018
n=10,000n = 10{,}0000.00CASPER0.000.0280.0000.001
Spatial1.001.0000.1440.144
Ordinary1.00—0.2090.209
Oracle0.05—0.0010.010
SettingEffectMethodSelectionMean PIPBiasRMSE
0.05CASPER0.620.727-0.0100.026
Spatial1.001.0000.1420.142
Ordinary1.00—0.2070.207
Oracle1.00—0.0000.010
0.30CASPER1.001.0000.0020.013
Spatial1.001.0000.1440.144
Ordinary1.00—0.2080.208
Oracle1.00—0.0010.010
CASPER under perturbations at n=500n = 500
Weaker confounding0.00CASPER0.010.087-0.0010.015
0.301.000.993-0.0040.056
Stronger confounding0.000.000.0870.0000.010
0.300.880.906-0.0210.098
Two spatial fields0.000.000.0850.0020.011
0.300.980.9830.0010.057
Nonlinear outcome0.000.000.082-0.0010.015
0.300.970.971-0.0020.068
Laplace errors0.000.010.1110.0020.020
0.300.970.967-0.0170.066
Increasing XX error variance0.000.000.092-0.0020.015
0.300.920.939-0.0270.082
Decreasing XX error variance0.000.000.0760.0010.006
0.300.970.9790.0060.066
Increasing error variance in all three equations0.000.040.134-0.0040.040
0.300.850.886-0.0490.109
Regular grid0.000.000.122-0.0010.028
0.300.910.911-0.0200.090
Jittered grid0.000.020.1180.0050.031
0.300.880.911-0.0220.086

Table S3. Selection and estimation in 100 replicates per setting. CASPER and spatial outcome-only regression select effects at posterior inclusion probability (PIP) ≥0.7\ge0.7. Ordinary and oracle regression use a 95% confidence interval excluding zero. Bias and root mean squared error (RMSE) are on the generating scale.

Spatial-scale sensitivity. We refitted the same null and moderate-effect reference datasets at n=500n = 500 to examine sensitivity to the assumed spatial covariance. In separate fits we changed the number of receiver neighbors from eight to six or ten at the reference bandwidth, or we decreased or increased the bandwidth by 20% at eight neighbors. Each covariance was scaled to unit mean marginal variance. Null selection remained between 2% and 3%. For the moderate effect, selection ranged from 90% to 100%, compared with 97% at the reference settings, and the absolute shift in the mean effect estimate was at most 0.024 (Table S4).

Fitted graphβ=0\beta= 0 Selectionβ=0\beta= 0 Δ\Delta (MCSE)β=0.30\beta= 0.30 Selectionβ=0.30\beta= 0.30 Δ\Delta (MCSE)
k=6k = 60.030.003 (0.001)1.000.023 (0.001)
k=10k = 100.02-0.003 (0.001)0.90-0.018 (0.002)
h=0.8h0h = 0.8h_00.030.002 (0.000)1.000.017 (0.001)
h=1.2h0h = 1.2h_00.03-0.001 (0.000)0.93-0.011 (0.001)

Table S4. Table S4: Sensitivity to the fitted receiver graph in 100 datasets per generating effect. Selection is the proportion of fits with PIP ≥0.7\ge0.7. At eight neighbors and bandwidth h0h_0, the selection rates were 0.03 (β=0\beta= 0) and 0.97 (β=0.30\beta= 0.30). For each alternative, Δ\Delta is the average within-dataset change in the model-averaged exposure effect from this reference fit, on the generating scale. Parentheses give its Monte Carlo standard error.

Discussion

CASPER estimates how a change in ligand exposure affects a receiver-cell pathway score at fixed receptor abundance. Modeling exposure, receptor expression, and pathway activity jointly allows the shared spatial field to explain variation in all three measurements. Under the linear model, independent homoskedastic errors and a known spatial covariance distinguishable from independent noise identify the effect.

The simulations illustrate both the value and the limits of spatial adjustment. Under the reference model, CASPER reduced the bias that persisted in ordinary and spatial outcome-only regressions. The bias remained small when the data were generated with two fields, a mild nonlinear effect of the confounder, or Laplace errors. Stronger confounding and error variances that increased with the marginal latent variance made estimation more difficult. The regular-grid experiment shows how correlation between cells can carry information even when their marginal variances are equal.

The ovarian examples illustrate the distinction between ligand–receptor expression enrichment and a response in the receiver pathway. CellPhoneDB found enrichment for both IL6 and VEGFA. CASPER gave considerably greater support to an effect of fibroblast IL6 on the ciliated epithelial inflammatory-response score than to an effect of fibroblast VEGFA on the endothelial angiogenesis score.

The causal interpretation depends on how well a single spatial field captures shared neighborhood conditions within a receiver population. It also depends on the choice of exposure and pathway score. A negative coefficient means that greater exposure corresponds to a lower measured score after adjustment. The composition of the gene set or residual spatial confounding could contribute to such a result. Establishing that a particular receptor mediates a response would require additional biological evidence.

Future work could allow the ligand-exposure effect to vary across receiver subpopulations, with a hierarchical model borrowing information within a broader cell type. Joint models for exposures from several sender populations could help distinguish their contributions and examine competition or synergy through interaction terms. Propagating uncertainty in cell-type assignments through exposure construction and effect estimation would also address annotation error. These extensions raise further identification questions, particularly when sender exposures are strongly correlated or when effects vary across receivers.

References

Supplementary Material

A Proof of Proposition 1

The joint distribution of (X,Z,Y)(\mathbf{X},\mathbf{Z},\mathbf{Y}) determines all of their covariances. Whenever one of these covariances has the form uC+vIu\mathbf{C}+v\mathbf{I}, it determines uu and vv separately because C\mathbf{C} and I\mathbf{I} are known and linearly independent. Consider first the exposure and receptor equations. By independence of the field and the errors,

Var⁡(X)=βUX2C+σX2I,Var⁡(Z)=βUZ2C+σZ2I.\operatorname{Var}(\mathbf{X})=\beta_{UX}^{2}\mathbf{C}+\sigma_{X}^{2}\mathbf{I}, \qquad\operatorname{Var}(\mathbf{Z})=\beta_{UZ}^{2}\mathbf{C}+\sigma_{Z}^{2}\mathbf{I}.

The coefficients of I\mathbf{I} give the two error variances. By the sign assumption, βUX\beta_{UX} is the positive square root of the coefficient of C\mathbf{C} in Var⁡(X)\operatorname{Var}(\mathbf{X}). The cross-covariance Cov⁡(X,Z)=βUXβUZC\operatorname{Cov}(\mathbf{X},\mathbf{Z})=\beta_{UX}\beta_{UZ}\mathbf{C} then determines βUZ\beta_{UZ}, including its sign.

To recover the two direct effects on pathway activity, consider the residual R(b,c)=Y−bX−cZ\mathbf{R}(b,c)=\mathbf{Y}-b\mathbf{X}-c\mathbf{Z}. At b=βXYb=\beta_{XY} and c=βZYc=\beta_{ZY}, the outcome equation gives R(b,c)=βUYU+ϵY\mathbf{R}(b,c)=\beta_{UY}\mathbf{U}+\boldsymbol{\epsilon}_{Y}. Its covariances with exposure and receptor expression are therefore both proportional to C\mathbf{C}. Conversely, suppose both cross-covariances are proportional to C\mathbf{C} for some bb and cc. The outcome equation gives

R(b,c)=(βXY−b)X+(βZY−c)Z+βUYU+ϵY.\mathbf{R}(b,c)=(\beta_{XY}-b)\mathbf{X}+(\beta_{ZY}-c)\mathbf{Z}+\beta_{UY}\mathbf{U}+\boldsymbol{\epsilon}_{Y}.

In the cross-covariances of this residual with X\mathbf{X} and Z\mathbf{Z}, the coefficients of I\mathbf{I} are (βXY−b)σX2(\beta_{XY}-b)\sigma_X^2 and (βZY−c)σZ2(\beta_{ZY}-c)\sigma_Z^2, respectively. Both coefficients must vanish. Since the error variances are positive, this forces b=βXYb=\beta_{XY} and c=βZYc=\beta_{ZY}. Thus the joint law determines the two direct effects.

For the residual R=R(βXY,βZY)\mathbf{R}=\mathbf{R}(\beta_{XY},\beta_{ZY}), independence of the outcome error gives

Cov⁡(X,R)=βUXβUYC,Var⁡(R)=βUY2C+σY2I.\operatorname{Cov}(\mathbf{X},\mathbf{R})=\beta_{UX}\beta_{UY}\mathbf{C}, \qquad\operatorname{Var}(\mathbf{R})=\beta_{UY}^{2}\mathbf{C}+\sigma_Y^2\mathbf{I}.

The first identity gives βUY\beta_{UY} because βUX\beta_{UX} is known and positive. The only unknown in the second identity is then σY2\sigma_Y^2, which completes the proof. □\square

Variation in the diagonal entries qi=Ciiq_i=C_{ii} is sufficient for linear independence. With a constant diagonal, any nonzero off-diagonal covariance also gives linear independence. For the marginal variance Var⁡(Xi)=βUX2qi+σX2\operatorname{Var}(X_i)=\beta_{UX}^{2}q_i+\sigma_X^2, a narrow range of qiq_i makes the slope harder to distinguish from the intercept. The full likelihood also uses the off-diagonal entries of C\mathbf{C}. Appendix § 9 examines estimation on graphs with varying degrees of regularity.

B Posterior Computation

The sampler updates the shared spatial field, the regression coefficients, the inclusion indicator for the exposure effect, and the three error variances. The conditional distribution of the spatial field is Gaussian. We use sparse Cholesky factorization to draw from this distribution under the receiver-graph precision in § 2 or the simulation precisions in Appendix § 9.

Blocked outcome update. Conditional on U\mathbf{U} and σY2\sigma_Y^2, let W0=[Z,U]\mathbf{W}_0=[\mathbf{Z},\mathbf{U}] and W1=[X,Z,U]\mathbf{W}_1=[\mathbf{X},\mathbf{Z},\mathbf{U}], with p0=2p_0=2 and p1=3p_1=3. Included outcome coefficients have independent N(0,τ2)N(0,\tau^2) priors with τ2=1\tau^2=1 by default. Appendix § 8.3.§ 3 examines how the ovarian estimates change with this common variance. For g∈{0,1}g\in\{0,1\} define

Vg=(WgTWg/σY2+τ−2I)−1,hg=WgTY/σY2.\mathbf{V}_g=\left(\mathbf{W}_g^{\mathsf{T}}\mathbf{W}_g/\sigma_Y^2+\tau^{-2}\mathbf{I}\right)^{-1}, \qquad\mathbf{h}_g=\mathbf{W}_g^{\mathsf{T}}\mathbf{Y}/\sigma_Y^2.

Apart from constants common to both models, the integrated log likelihood is

ℓg=12{log⁡∣Vg∣−pglog⁡(τ2)+hgTVghg}.\ell_g = \frac{1}{2}\{\log|\mathbf{V}_g| - p_g \log(\tau^2) + \mathbf{h}_g^{\mathsf{T}}\mathbf{V}_g\mathbf{h}_g\}.

With prior inclusion probability 0.5, the posterior conditional probability of γ=1\gamma= 1 is {1+exp⁡(ℓ0−ℓ1)}−1\{1 + \exp(\ell_0 - \ell_1)\}^{-1}. Given the sampled value of γ\gamma, the included coefficients have distribution N(Vγhγ,Vγ)N(\mathbf{V}_\gamma\mathbf{h}_\gamma, \mathbf{V}_\gamma). When γ=0\gamma= 0, βXY=0\beta_{XY} = 0.

Remaining conjugate updates. For A∈{X,Z}A \in\{X, Z\}, the loading has a normal full conditional with variance VA=(UTU/σA2+σβ−2)−1V_A = (\mathbf{U}^{\mathsf{T}}\mathbf{U}/\sigma_A^2 + \sigma_\beta^{-2})^{-1} and mean VAUTA/σA2V_A\mathbf{U}^{\mathsf{T}}\mathbf{A}/\sigma_A^2, where A\mathbf{A} denotes the corresponding observed vector and σβ2=1\sigma_\beta^2 = 1 by default. Conditional on the other variables,

σA2∣rest∼Inverse-Gamma⁡(0.01+n2,0.01+12∥rA∥2),A∈{X,Z,Y},\sigma_A^2 \mid\mathrm{rest} \sim\operatorname{Inverse\text{-}Gamma}\left(0.01 + \frac{n}{2}, 0.01 + \frac{1}{2}\lVert\mathbf{r}_A\rVert^2\right), \qquad A \in\{X, Z, Y\},

where rX=X−βUXU\mathbf{r}_X = \mathbf{X} - \beta_{UX}\mathbf{U}, rZ=Z−βUZU\mathbf{r}_Z = \mathbf{Z} - \beta_{UZ}\mathbf{U}, and rY=Y−βXYX−βZYZ−βUYU\mathbf{r}_Y = \mathbf{Y} - \beta_{XY}\mathbf{X} - \beta_{ZY}\mathbf{Z} - \beta_{UY}\mathbf{U}. In the real-data analyses, we update the exposure variance after integrating out the field, as detailed below.

Additional updates for the real-data analyses. Two updates improve mixing when the data provide limited information about the scale of the field and its loadings. The first samples the exposure variance v=σX2v = \sigma_X^2 after integrating out U\mathbf{U}. Write y∗=Y−βXYX−βZYZ\mathbf{y}_* = \mathbf{Y} - \beta_{XY}\mathbf{X} - \beta_{ZY}\mathbf{Z}. Given the data and the equation parameters, the conditional distribution of the field has precision A(v)\mathbf{A}(v) and mean m(v)\mathbf{m}(v), where

A(v)=Q+(βUX2v+βUZ2σZ2+βUY2σY2)I,\mathbf{A}(v) = \mathbf{Q} + \left(\frac{\beta_{UX}^2}{v} + \frac{\beta_{UZ}^2}{\sigma_Z^2} + \frac{\beta_{UY}^2}{\sigma_Y^2}\right)\mathbf{I},
m(v)=A(v)−1(βUXXv+βUZZσZ2+βUYy∗σY2).\mathbf{m}(v) = \mathbf{A}(v)^{-1}\left(\frac{\beta_{UX}\mathbf{X}}{v} + \frac{\beta_{UZ}\mathbf{Z}}{\sigma_Z^2} + \frac{\beta_{UY}\mathbf{y}_*}{\sigma_Y^2}\right).

For t=log⁡vt = \log v, the marginal log conditional density, up to an additive constant, is

−12{nt+log⁡∣A(et)∣+J(et)}−0.01t−0.01e−t,-\frac{1}{2}\{nt + \log|\mathbf{A}(e^t)| + J(e^t)\} - 0.01t - 0.01e^{-t},

where, writing m=m(v)\mathbf{m} = \mathbf{m}(v),

J(v)=∥X−βUXm∥2/v+∥Z−βUZm∥2/σZ2+∥y∗−βUYm∥2/σY2+mTQm.J(v) = \lVert\mathbf{X} - \beta_{UX}\mathbf{m}\rVert^2/v + \lVert\mathbf{Z} - \beta_{UZ}\mathbf{m}\rVert^2/\sigma_Z^2 + \lVert\mathbf{y}_* - \beta_{UY}\mathbf{m}\rVert^2/\sigma_Y^2 + \mathbf{m}^{\mathsf{T}}\mathbf{Q}\mathbf{m}.

A Metropolis–Hastings step uses a symmetric normal random-walk proposal for tt, with the proposal scale adapted during warm-up. We then draw U\mathbf{U} from its conditional distribution at the resulting value of vv.

The second update rescales the field and all three loadings together. For a proposed log-scale change s∼N(0,1.52/n)s \sim N(0, 1.5^2/n), the field is multiplied by ese^s and each loading by e−se^{-s}. These changes preserve their products in the likelihood. Writing βU\boldsymbol{\beta}_U for the vector of three loadings, the log acceptance ratio is

−12(e2s−1)UTQU−12σβ2(e−2s−1)∥βU∥2+(n−3)s,-\frac{1}{2}(e^{2s} - 1)\mathbf{U}^{\mathsf{T}}\mathbf{Q}\mathbf{U} - \frac{1}{2\sigma_\beta^2}(e^{-2s} - 1)\lVert\boldsymbol{\beta}_U\rVert^2 + (n - 3)s,

where the last term is the log Jacobian.

Posterior summaries. Simulation fits used one chain with 1,000 warm-up iterations and 2,000 retained draws, saving every second draw. The four-tissue comparison used one chain per candidate with 1,500 warm-up iterations and 2,000 retained draws without thinning. Each detailed ovarian fit used four independent chains and 3,000 warm-up iterations per chain. We retained 16,000 subsequent draws per chain for IL6–IL6R and 4,000 for VEGFA–FLT1.

The posterior inclusion probability (PIP) is the fraction of draws with γ=1\gamma= 1. Model-averaged 95% credible intervals use the empirical 2.5th and 97.5th percentiles of all draws, including the zeros. Conditional intervals use only draws with γ=1\gamma= 1. At each threshold δ\delta, we estimate Pr⁡(∣βXY∣>δ∣data)\Pr(\lvert\beta_{XY}\rvert> \delta\mid\mathrm{data}) by the fraction of all draws whose absolute value exceeds δ\delta. Before computing convergence diagnostics for the field loadings, we multiply all three loadings in each retained draw by sign⁡(βUX)\operatorname{sign}(\beta_{UX}).

Real-Data Methods

Candidate Screening

We first identified ligand–receptor pairs for which both genes and a downstream pathway could be measured in the relevant cell types. A candidate linked two distinct cell types with at least 100 sender cells and 500 receiver cells. Log-normalized abundance had to exceed 0.1 in at least 5% of the respective cells for both the ligand and the receptor. The product SexprS_{\mathrm{expr}} of mean sender ligand abundance and mean receiver receptor abundance had to reach 0.01, and at least five measured pathway genes had to remain after excluding the ligand and receptor.

Of the 2,229 eligible candidates, we ranked the 300 ovarian candidates with the largest SexprS_{\mathrm{expr}} (breaking ties by pathway size) and all eligible melanoma and breast candidates. We calculated the screening scores from the transformed measurements before standardizing them for model fitting. Four rankings allowed us to include candidates with strong marginal association, substantial spatial variation, prior biological support, or a spatial pattern despite weak marginal association. Write rr for the marginal exposure–pathway correlation, GG for the number of measured pathway genes, and IXI_X, IZI_Z, IYI_Y for Moran’s II of exposure, receptor abundance, and pathway activity among receivers. With u+=max⁡(u,0)u_+ = \max(u, 0), the rankings use

A=log⁡(1+Sexpr)log⁡(1+G),B=log⁡{1+Var⁡(X)+Var⁡(Z)+Var⁡(Y)},C=1+(IX)++(IZ)++(IY)+,S=AC(1+B).\begin{aligned} A &= \log(1 + S_{\mathrm{expr}})\log(1 + G), \qquad B = \log\{1 + \operatorname{Var}(X) + \operatorname{Var}(Z) + \operatorname{Var}(Y)\},\\ C &= 1 + (I_X)_+ + (I_Z)_+ + (I_Y)_+, \qquad S = AC(1 + B). \end{aligned}

The four scores, in order, were ∣r∣AC\lvert r\rvert AC, SS, SwbioS w_{\mathrm{bio}}, and S/(1+10∣r∣)S/(1 + 10\lvert r\rvert). The screening code specifies the biological weights wbiow_{\mathrm{bio}} by pathway, genes, and sender–receiver pairing. The fourth ranking was restricted to ∣r∣≤0.10\lvert r\rvert\le0.10. The union of the top 50 candidates per ranking in ovarian tissue and melanoma and the top 10 in breast tissue gave 92, 89, and 20 distinct candidates, respectively. A specified list of 21 eligible renal candidates brought the total to 222. The analysis code provides the genes defining each pathway outcome, including panel-adapted gene sets for the renal tissue.

Table S1 summarizes the quartiles and the coefficient of variation of the marginal latent variances qi=(Q−1)iiq_i = (\mathbf{Q}^{-1})_{ii} for each of the 36 receiver graphs used in the comparison. The coefficients of variation ranged from 0.56 to 4.65.

CellPhoneDB Comparison

CellPhoneDB compares expression of a ligand–receptor interaction in a cell-type pair with its expression under permuted cell-type labels [12]. We used version 5.0.1 with database v5.0.0, 1,000 label permutations, and a 5% expression prevalence threshold. Each tissue analysis used all retained RNA genes and up to 3,000 cells per relevant annotated type.

We matched ligand and receptor genes to opposite sides of a database interaction in either orientation. Matches could involve an exact pair or a complex containing a candidate gene. A complex could be tested only if all required components were present. Among multiple matches, we gave priority to tested interactions, then to exact pairs, breaking ties by database identifier. We recorded missing components and absent database matches separately. Candidates with the same ligand, receptor, and cell types share a CellPhoneDB result across pathways. We used a nominal permutation p<0.05p < 0.05 for enrichment. The comparison describes candidates selected using expression and spatial information from the same tissues.

Ovarian Follow-up

The two ovarian examples had different origins. VEGFA–FLT1 was part of the four-tissue comparison. IL6–IL6R arose in a separate exploratory search among expression-eligible ovarian cytokines. For that search, we profiled the exposure covariance Cov⁡(X)=βUX2Q−1+σX2I\operatorname{Cov}(\mathbf{X}) = \beta_{UX}^{2}\mathbf{Q}^{-1} + \sigma_{X}^{2}\mathbf{I}. We fitted the joint model for candidates whose profile had an interior maximum and whose estimated independent exposure variance was at least 0.05 on the standardized scale.

Both follow-ups used all cells of the designated sender and receiver types. The sender-exposure and receiver-graph bandwidths were 111 and 134 micrometers, respectively, for IL6 and 49 and 47 micrometers for VEGFA. We standardized exposure, receptor abundance, and pathway score within each receiver population. Only 94 of 559 ciliated epithelial receivers had positive fibroblast IL6 exposure before centering. Across all 559 IL6 receivers, the median qiq_i was 2.60 (interquartile range 2.06–4.80), compared with 4.17 (2.58–8.93) for the VEGFA receivers. Table S2 gives the posterior summaries. Across the two fits, the largest rank-normalized split R^\hat{R} for continuous parameters was 1.008. The smallest bulk and tail effective sample sizes were 473 and 1,047. The Monte Carlo standard errors of the PIPs were 0.0039 for IL6 and 0.0019 for VEGFA.

Residual variance in the IL6 analysis. We examined whether residual variance changed with qiq_i in any of the three equations. At each of the 64,000 retained draws, let μi\mu_i and ViiV_{ii} be the conditional mean and variance of UiU_i given the data and parameters, as in Appendix B. Write tXi=Xit_{X_i} = X_i, tZi=Zit_{Z_i} = Z_i, and tYi=Yi−βXYXi−βZYZit_{Y_i} = Y_i - \beta_{XY}X_i - \beta_{ZY}Z_i. The conditional expected squared standardized residual for equation A∈{X,Z,Y}A \in\{X,Z,Y\} was

(tAi−βUAμi)2+βUA2ViiσA2.\frac{\left(t_{A_i} - \beta_{UA}\mu_i\right)^2 + \beta_{UA}^{2}V_{ii}}{\sigma_A^{2}}.

We averaged this quantity over draws for each receiver, then within ten groups of nearly equal size ordered by qiq_i (55 or 56 cells, with ties resolved by receiver order). For each equation we regressed the ten group averages on group mean qiq_i with an intercept. Per receiver-level standard deviation of qiq_i (9.05), the estimated slopes were −0.029 for IL6 exposure (p=0.808p = 0.808), 0.154 for IL6R expression (p=0.252p = 0.252), and 0.003 for the inflammatory-response score (p=0.978p = 0.978).

Exposure-permutation controls. We randomly reassigned the standardized IL6 exposures across the 559 receivers five times, holding receptor abundance, pathway scores, coordinates, and the receiver graph fixed. Each fit used the original priors and chain lengths. All five model-averaged 95% intervals included zero, and the PIPs ranged from 0.043 to 0.283. These controls assess how the result for this candidate depends on the spatial alignment of exposure with receiver cells.

Sensitivity to coefficient priors. We refitted both examples with common normal coefficient variance 0.25 or 4 in place of 1, including the slab variance for βXY\beta_{XY}. Each alternative used four chains with 16,000 retained draws per chain. As the variance increased from 0.25 to 4, the IL6 PIP rose from 0.823 to 0.951 and the posterior mean conditional on inclusion rose from 0.453 to 1.136. Across all three priors the conditional intervals were positive and the model-averaged intervals included zero. For VEGFA the PIP ranged from 0.027 to 0.098 and the conditional intervals remained close to [−0.12,0.09-0.12, 0.09].

Simulation Generators

Simulation Design

The reference experiment asks how well the methods recover a known exposure effect when exposure, receptor expression, and pathway activity share a spatial cause. The remaining experiments change the strength or form of that confounding, the error variances, or the geometry of the tissue. Under the reference model, X=0.6U+ϵXX = 0.6U + \epsilon_X, Z=0.6U+ϵZZ = 0.6U + \epsilon_Z, and Y=βX+0.3Z+0.6U+ϵYY = \beta X + 0.3Z + 0.6U + \epsilon_Y, with independent unit-variance Gaussian errors. The weak- and strong-confounding settings multiply the three latent loadings by 0.5 and 1.5, respectively. Table S3 summarizes the simulations.

The reference locations were sampled uniformly from a square. To set the scale of the Gaussian field, we started with the receiver-graph precision Q0=D−W+0.01IQ_0 = D - W + 0.01I, where WW is the weighted adjacency matrix and DD the diagonal matrix of weighted degrees. The scaled precision is Q=cQ0Q = cQ_0, with c=n−1tr⁡(Q0−1)c = n^{-1}\operatorname{tr}(Q_0^{-1}). This gives mean marginal variance one. We calculated cc from the exact diagonal for n≤3,000n \le3{,}000 and estimated it at n=10,000n = 10{,}000 using the mean squared norm of 64 draws from N(0,Q0−1)N(0,Q_0^{-1}), divided by nn. Below, q=(q1,…,qn)⊤q = (q_1,\ldots,q_n)^\top collects the marginal variances qi=(Q−1)iiq_i = (Q^{-1})_{ii}.

In the two-field experiment, independent U1U_1 and U2U_2 have unit average marginal variance. The first graph uses the reference Gaussian bandwidth hUh_U, the median positive distance among receiver-neighbor pairs, and the second uses 2hU2h_U. Their contributions to XX, ZZ, and YY are respectively

0.6(0.75U1+0.25U2),0.6(0.25U1+0.75U2),0.6(0.5U1+0.5U2).0.6(\sqrt{0.75}U_1+\sqrt{0.25}U_2),\quad0.6(\sqrt{0.25}U_1+\sqrt{0.75}U_2),\quad0.6(\sqrt{0.5}U_1+\sqrt{0.5}U_2).

CASPER fits a single field using the first precision. The oracle observes both fields. The mild nonlinear experiment changes only the direct confounding contribution to YY, to

0.6{U+0.1(U2−q)/2q2‾}/1.01,0.6\{U+0.1(U^2-q)/\sqrt{2\overline{q^2}}\}/\sqrt{1.01},

where the square is elementwise and q2‾=n−1∑iqi2\overline{q^2}=n^{-1}\sum_i q_i^2. The oracle includes both UU and the quadratic term. The Laplace experiment replaces each error by an independent random sign times an exponential variable with rate 2\sqrt{2}, preserving variance one.

For heteroskedasticity, define

ti=log⁡qi−median⁡(log⁡q)IQR⁡(log⁡q),vi=exp⁡{±log⁡(1.5)ti},t_i=\frac{\log q_i-\operatorname{median}(\log q)}{\operatorname{IQR}(\log q)},\qquad v_i=\exp\{\pm\log(1.5)t_i\},

and normalize the resulting viv_i to have mean one. Multiplying the corresponding errors by vi\sqrt{v_i} scales their variances by viv_i. In two settings, the variance in the exposure equation increased or decreased with qiq_i. In a third, the error variance in all three equations increased with qiq_i. CASPER assumed constant error variances in each fit.

The regular graph has 500 cells on a periodic 20×2520 \times25 lattice, with eight neighbors and symmetrized Gaussian weights. Its marginal variances are constant to numerical precision. Jitter adds independent uniform coordinate offsets up to 20% of the corresponding lattice spacing and wraps coordinates periodically. The irregular comparator is the reference random point pattern. The periodic graph retains off-diagonal spatial covariance even when the diagonal is constant. Regression estimates include an intercept. Bayesian fits use centered, standardized variables, and we back-transform effect estimates to the generating scale to calculate bias and root mean squared error.

Sensitivity to the fitted spatial covariance

We varied the receiver graph used to fit CASPER while holding each dataset, including its exposure, fixed. For each generating effect (β=0\beta= 0 or 0.30), we refitted 100 reference datasets at n=500n = 500. At the reference bandwidth h0h_0 we changed the number of neighbors from eight to six or ten. With eight neighbors we used 0.8h00.8h_0 or 1.2h01.2h_0. Each fitted covariance had mean marginal variance one. Table S4 shows how these changes affected selection and the estimated exposure effect.

Table S3: Selection and estimation in 100 replicates per setting. CASPER and spatial outcome-only regression select effects at posterior inclusion probability (PIP) ≥0.7\ge0.7. Ordinary and oracle regression use a 95% confidence interval excluding zero. Bias and root mean squared error (RMSE) are on the generating scale.

References

  1. [5]S. Aibar, C. B. González-Blas, T. Moerman, V. A. Huynh-Thu, H. Imrichova, G. Hulselmans, F. Rambow, J.-C. Marine, P. Geurts, J. Aerts, et al. SCENIC: single-cell regulatory network inference and clustering. Nature Methods, 14:1083–1086, 2017.DOI
  2. [6]A. A. Almet, Y.-C. Tsai, M. Watanabe, and Q. Nie. Inferring pattern-driving intercellular flows from single-cell and spatial transcriptomics. Nature Methods, 21(10):1806–1817, 2024.DOI
  3. [7]M. Andreatta and S. J. Carmona. UCell: Robust and scalable single-cell gene signature scoring. Computational and Structural Biotechnology Journal, 19:3796–3798, 2021.DOI
  4. [9]S. Cabello-Aguilar, M. Alame, F. Kon-Sun-Tack, C. Fau, M. Lacroix, and J. Colinge. SingleCellSignalR: inference of intercellular networks from single-cell transcriptomics. Nucleic Acids Research, 48(10):e55–e55, 2020.
  5. [10]R. Dries, Q. Zhu, R. Dong, C.-H. L. Eng, H. Li, K. Liu, Y. Fu, T. Zhao, A. Sarkar, F. Bao, et al. Giotto: a toolbox for integrative analysis and visualization of spatial expression data. Genome Biology, 22(1):78, 2021.
  6. [11]L. Dupuis, O. Debeaupuis, F. Simon, and H. Isambert. CausalCCC: a web server to explore intracellular causal pathways enabling cell–cell communication. Nucleic Acids Research, 53(W1):W125–W131, 2025.DOI
  7. [12]M. Efremova, M. Vento-Tormo, S. A. Teichmann, and R. Vento-Tormo. CellPhoneDB: inferring cell–cell communication from combined expression of multi-subunit ligand–receptor complexes. Nature Protocols, 15(4):1484–1506, 2020.DOI
  8. [13]E. M. Hanks, E. M. Schliep, M. B. Hooten, and J. A. Hoeting. Restricted spatial regression in practice: Geostatistical models, confounding, and robustness under model misspecification. Environmetrics, 26(4):243–254, 2015.DOI
  9. [14]J. S. Hodges and B. J. Reich. Adding spatially-correlated errors can mess up the fixed effect you love. The American Statistician, 64(4):325–334, 2010.DOI
  10. [15]R. Hou, E. Denisenko, H. T. Ong, J. A. Ramilowski, and A. R. Forrest. Predicting cell-to-cell communication networks using NATMI. Nature Communications, 11(1):5011, 2020.DOI
  11. [16]S. Jin, C. F. Guerrero-Juarez, L. Zhang, I. Chang, R. Ramos, C.-H. Kuan, P. Myung, M. V. Plikus, and Q. Nie. Inference and analysis of cell-cell communication using CellChat. Nature Communications, 12(1):1088, 2021.DOI
  12. [17]A. Liberzon, C. Birger, H. Thorvaldsdóttir, M. Ghandi, J. P. Mesirov, and P. Tamayo. The molecular signatures database hallmark gene set collection. Cell Systems, 1(6):417–425, 2015.pubmed.ncbi.nlm.nih.gov/26771021
  13. [18]C. J. Paciorek. The importance of scale for spatial-confounding bias and precision of spatial regression estimators. Statistical Science, 25(1):107–125, 2010.DOI
  14. [19]G. Palla, H. Spitzer, M. Klein, D. Fischer, A. C. Schaar, L. B. Kuemmerle, S. Rybakov, I. L. Ibarra, O. Holmberg, I. Virshup, et al. Squidpy: a scalable framework for spatial omics analysis. Nature Methods, 19(2):171–178, 2022.DOI
  15. [20]A. Papathanasiou, O. Djahanbakhch, E. Saridogan, and R. A. Lyons. The effect of interleukin-6 on ciliary beat frequency in the human fallopian tube. Fertility and Sterility, 90(2):391–394, 2008. doi: 10.1016/j.fertnstert.2007.07.1379.DOI
  16. [21]B. J. Reich, J. S. Hodges, and V. Zadnik. Effects of residual smoothing on the posterior of the fixed effects in disease-mapping models. Biometrics, 62(4):1197–1206, 2006.pubmed.ncbi.nlm.nih.gov/17156295
  17. [22]R. Rigobon. Identification through heteroskedasticity. Review of Economics and Statistics, 85(4):777–792, 2003.
  18. [23]H. Rue and L. Held. Gaussian Markov random fields: theory and applications. Chapman and Hall/CRC, 2005.
  19. [24]R. Shao, M. Nutu, L. Karlsson-Lindahl, A. Benrick, B. Weijdegård, S. Lager, E. Egecioglu, J. Fernandez-Rodriguez, K. Gemzell-Danielsson, C. Ohlsson, J.-O. Jansson, and H. Billig. Down-regulation of cilia-localized IL-6Rα by 17β-estradiol in mouse and human fallopian tubes. American Journal of Physiology-Cell Physiology, 297(1):C140–C151, 2009. doi: 10.1152/ajpcell.00047.2009.DOI
  20. [25]Y. Wang, R. Wang, S. Zhang, S. Song, C. Jiang, G. Han, M. Wang, J. Ajani, A. Futreal, and L. Wang. iTALK: an R package to characterize and illustrate intercellular communication. bioRxiv, page 507871, 2019.DOI

Paper details

vlnc:W_84wvxuhm
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents