Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Propagating Uncertainty in Joint Representations

CITE-seq, ATAC and Multiome Data · Tutorial 620 of 700

Propagating Uncertainty in Joint Representations

You will learn to define and estimate neighborhood stability under feature, cell-sampling, and modality-weight perturbations while separating relationship persistence from whether a cell pair was eligible to be compared.

Advanced 12 min read

What You'll Learn

  • Define neighborhood-edge persistence under a specified distribution of analysis perturbations.
  • Distinguish conditional edge stability from the probability that both cells are represented.
  • Estimate persistence and its Monte Carlo error from repeated joint representations.
  • Diagnose instability caused by feature selection, cell resampling, or modality weights.
  • Compare perturbation-based stability with a single fixed embedding or a sensitivity analysis.
  • Report robust cell relationships without interpreting computational stability as biological certainty.

Why Propagate Uncertainty in a Joint Representation?

A joint representation places cells in a common space using information from multiple modalities, such as RNA and surface protein measurements. A neighborhood graph derived from that representation summarizes which cells are close under the chosen analysis. But that graph is not a fixed biological object: changing the selected features, the cells used to construct it, or the relative influence of modalities can alter which cells are neighbors.

The aim here is to measure how sensitive particular cell relationships are to such choices. This is a stability analysis, not a claim that the graph has a known probability of being biologically true. Its result depends on which perturbations are considered plausible and how they are sampled. The earlier material on weighted nearest neighbors supplies the basic setting: a joint neighborhood can reflect modality-specific information and cell-specific modality weights. This tutorial asks how much a stated neighborhood relationship persists when those inputs vary.

Definition: Fix a cell-pair relationship, such as an undirected edge in a graph formed by connecting cells that are neighbors under a prespecified rule. A perturbation is a specified change to the analysis, such as resampling features, resampling cells, or changing modality weights. The conditional edge persistence for a pair is the probability that the edge is present under a stated distribution of perturbations, conditional on both cells being eligible for comparison.

Eligibility matters. In a cell-resampling run, a cell may be absent, so an edge for that pair cannot be evaluated. A missing edge and an unevaluable pair are not the same outcome. We will therefore report both pair eligibility and edge persistence among eligible runs.

Define the Relationship and the Perturbation Distribution

Before calculating stability, specify the graph construction and keep its rules fixed across runs. For example, choose a value of \(k\), construct a \(k\)-nearest-neighbor graph from the joint representation, and define an undirected edge using the union rule: cells \(i\) and \(j\) are connected if either cell is among the other’s \(k\) nearest neighbors. A mutual-neighbor rule, which requires both directions, is also possible, but it answers a different question. Do not switch rules between perturbation runs.

Let \(Q\) denote a stated distribution over analysis perturbations. A draw \(q\sim Q\) might specify a feature subset, a cell resample, and a modality-weight setting. The full pipeline should be rerun as appropriate for that perturbation, including any preprocessing step whose result is meant to respond to the changed inputs. For a fixed pair \((i,j)\), define \(E_{ij}(q)=1\) if both cells are present and eligible for comparison, and \(E_{ij}(q)=0\) otherwise. When \(E_{ij}(q)=1\), let \(A_{ij}(q)=1\) if the specified edge is present and \(A_{ij}(q)=0\) if it is absent. \(A_{ij}(q)\) is not defined when the pair is ineligible.

Definition: Pair coverage is \(c_{ij}=P(E_{ij}=1)\). Conditional edge persistence is \(p_{ij}^{(Q)}=P(A_{ij}=1\mid E_{ij}=1)\), under the stated perturbation distribution. If \(c_{ij}=0\), conditional persistence is not defined. Coverage describes how often the pair can be assessed; persistence describes how often its relationship appears when it can be assessed.

When all cells are present in every run, coverage is 1 and persistence is simply the edge probability across perturbations. When cells are resampled, define the perturbation distribution for persistence conditional on both cells being eligible, or explicitly estimate persistence among the eligible runs. The conditioning convention must be stated because it changes the target being summarized.

Estimating Persistence and Its Simulation Error

Suppose \(B\) independent perturbations are drawn from a distribution in which the pair is eligible in every draw. Write \(A_{ij,b}\) for the edge indicator in run \(b\). Then the estimate of conditional persistence is the sample proportion of runs containing the edge. Independence of runs and a common perturbation distribution make the indicators identically distributed Bernoulli variables with success probability \(p_{ij}^{(Q)}\).

$$ \hat{p}_{ij}=\frac{1}{B}\sum_{b=1}^{B} A_{ij,b}, \qquad E(\hat{p}_{ij})=p_{ij}^{(Q)}, \qquad SE(\hat{p}_{ij})\approx \sqrt{\frac{\hat{p}_{ij}(1-\hat{p}_{ij})}{B}}. $$

The expectation follows by linearity: each indicator has expectation \(p_{ij}^{(Q)}\), so the mean of \(B\) such indicators has expectation \(B^{-1}B p_{ij}^{(Q)}=p_{ij}^{(Q)}\). The displayed standard error estimates Monte Carlo variability from drawing a finite number of perturbations. It does not quantify every source of uncertainty in the data or establish a probability that the edge is biologically real. A normal-approximation interval based on this standard error is most credible when the number of runs and the expected counts of edge and non-edge outcomes are not small; otherwise, use a suitable binomial interval or report the counts directly.

If the \(B\) runs are sampled without conditioning on eligibility, let \(M_{ij}=\sum_{b=1}^{B}E_{ij,b}\). Estimate coverage by \(M_{ij}/B\), and estimate persistence among eligible runs by \(\sum_b E_{ij,b}A_{ij,b}/M_{ij}\), provided \(M_{ij}>0\). This ratio estimates the conditional probability, but with a random denominator it is not generally exactly unbiased in a finite sample. It is consistent as the number of independent runs grows when pair eligibility has positive probability. Do not code an ineligible run as an absent edge and average over all \(B\): that would estimate the joint probability \(P(E_{ij}=1,A_{ij}=1)=c_{ij}p_{ij}^{(Q)}\), not conditional persistence.

Worked Example: Feature Perturbations With Every Cell Present

In a hypothetical analysis, investigators keep all cells and the graph rule fixed, but repeatedly draw feature sets from a prespecified feature-sampling scheme and rerun the joint representation. For two cells, the edge appears in 72 of 100 independent runs. Since both cells are eligible in every run, \(B=100\) and the observed persistence is

$$ \hat{p}_{ij}=\frac{72}{100}=0.720. $$

The estimated Monte Carlo standard error is

$$ SE(\hat{p}_{ij})\approx \sqrt{\frac{0.720(1-0.720)}{100}} =\sqrt{0.002016} =0.0449. $$

Thus, under this feature-perturbation scheme, the edge occurred in 72% of runs, with an estimated Monte Carlo standard error of about 0.045. A rough normal-approximation interval is \(0.720\pm1.96(0.0449)\), or approximately \(0.632\) to \(0.808\). This describes simulation precision for the specified perturbation distribution; it is not a 95% probability statement about whether the cells are truly related.

Resampling Cells: Keep Coverage Separate

Cell resampling changes the set of cells available to construct the representation and graph. If the pair is absent in a run, its edge status is undefined, not zero. Two summaries are informative: pair coverage and conditional edge persistence. Low coverage means the relationship is assessed in relatively few runs, so its persistence estimate may be imprecise and may describe a selected subset of runs.

One clean design is to draw cell-resampling runs from the original resampling procedure conditional on both cells being retained. If these eligible runs are independently sampled from that conditional distribution, the mean edge indicator is unbiased for persistence under that conditional distribution, by the calculation above. Alternatively, use all runs and calculate the edge fraction among eligible runs. In either case, state whether the resampling scheme is with or without replacement and whether the graph is constructed on the resampled cells or on a fixed reference set.

Worked Example: Edge Persistence After Cell Resampling

In a hypothetical resampling analysis, a pair of cells is jointly eligible in 80 of 100 runs. The edge appears in 52 of those 80 eligible runs. The estimated coverage is \(80/100=0.800\), while conditional persistence is

$$ \hat{p}_{ij}=\frac{52}{80}=0.650. $$

The estimated conditional Monte Carlo standard error is

$$ SE(\hat{p}_{ij})\approx \sqrt{\frac{0.650(1-0.650)}{80}} =\sqrt{0.002844} =0.0533. $$

The pair was assessable in 80% of runs, and among those runs the edge appeared 65% of the time. If ineligible runs were incorrectly coded as edge absences, the reported proportion would instead be \(52/100=0.520\), which estimates the joint probability of eligibility and edge presence in this experiment. It would not answer the conditional persistence question.

Varying Modality Weights and Comparing Perturbations

Modality-weight perturbations ask whether a relationship depends on the relative contribution of modalities. Specify the weight settings or a distribution over weights before examining the results. If the goal is to summarize an average over plausible settings, the weights in \(Q\) should reflect that goal; an arbitrary collection of settings does not automatically represent a meaningful probability distribution. It is often useful to report persistence separately by setting as well as the average, so that a high overall value does not hide a relationship that disappears under a scientifically plausible weighting.

Worked Example: Stability Across Three Weight Settings

In a hypothetical analysis, the same pair is eligible in every run. Investigators define three modality-weight settings and run 30 independent perturbations at each setting. The edge occurs 27 times under setting 1, 15 times under setting 2, and 6 times under setting 3. The setting-specific persistence estimates are \(27/30=0.900\), \(15/30=0.500\), and \(6/30=0.200\). If the target summary weights the three settings equally, the estimated average persistence is

$$ \hat{p}_{ij}^{(Q)} =\frac{1}{3}(0.900+0.500+0.200) =\frac{1.600}{3} =0.533. $$

For the equally weighted average, an estimated Monte Carlo standard error, assuming independent runs within and across settings, is

$$ SE(\hat{p}_{ij}^{(Q)}) \approx \sqrt{\frac{1}{9} \left[ \frac{0.900(0.100)}{30} +\frac{0.500(0.500)}{30} +\frac{0.200(0.800)}{30} \right]} =0.0430. $$

The average is 0.533 under the stated equal weighting, but the setting-specific values reveal substantial sensitivity: the edge is common under setting 1 and uncommon under setting 3. The difference across settings is a substantive sensitivity pattern, not merely Monte Carlo error. Reporting only the pooled average would conceal it.

Diagnostics, Comparisons, and Limitations

Stability summaries are most useful when they expose failure modes rather than compress them into one score. Check whether conclusions change when the feature-perturbation scheme, cell-resampling design, or plausible modality-weight range changes. Examine the number of eligible runs for every reported pair; small denominators make persistence estimates noisy. Also check whether results depend on the graph’s \(k\), distance metric, directed-to-undirected conversion, or tie handling. Those are analysis choices and should either be held fixed or included explicitly in the perturbation design.

A single fixed embedding provides a concise graph but no direct measure of sensitivity to analysis choices. Repeated perturbation provides that sensitivity assessment, at the cost of computation and dependence on the chosen perturbation distribution. A comparison of several hand-selected settings can be easier to interpret, but does not estimate an average probability unless a sampling distribution and weighting scheme are specified. Neither approach replaces biological validation or a statistical model for a separate scientific outcome.

The binomial standard-error calculation assumes independent perturbation runs. Runs that reuse random seeds, share resampled cells, or are generated in correlated batches may not provide \(B\) independent pieces of Monte Carlo information. In that case, the displayed standard error can be too small; use independent batches or a variance estimate that respects the dependence. Edge indicators for different cell pairs within a run are also dependent, so do not treat all pairwise edges as independent observations when making a broader inferential claim.

Key takeaway: Report the perturbation distribution, graph rule, eligible-run count, edge count, and conditional persistence. For cell resampling, report coverage separately. Stability means robustness to the specified computational perturbations, not certainty about cell identity, biological interaction, or causation.

A useful report might say: “Under the prespecified feature and weight perturbations, this edge was present in 68 of 100 eligible runs (persistence 0.68); both cells were eligible in all 100 runs.” For resampling, add the eligibility count and make clear that the persistence denominator contains only runs in which both cells could be compared. Avoid calling a low persistence value proof that the relationship is absent: it can instead indicate sensitivity to the chosen analysis pipeline.

Check Your Understanding

Answer each question using the conditioning and reporting distinctions developed above.

  1. A cell pair is eligible in 90 of 120 runs, and its edge appears in 54 eligible runs. What are estimated coverage and conditional persistence?
  2. Why is coding an ineligible pair as an absent edge inappropriate when estimating conditional persistence?
  3. For a pair eligible in every run, an edge appears in 40 of 50 independent runs. Calculate persistence and its estimated Monte Carlo standard error.
  4. What additional information should accompany a persistence estimate when results are summarized across modality-weight settings?

Solutions. (1) Coverage is \(90/120=0.750\); conditional persistence is \(54/90=0.600\). (2) An ineligible pair has no defined edge status. Coding it as absent makes the overall fraction estimate the joint probability of eligibility and edge presence, rather than edge probability conditional on eligibility. (3) Persistence is \(40/50=0.800\), and \(SE\approx\sqrt{0.800(0.200)/50}=\sqrt{0.0032}=0.0566\). (4) State the settings or their distribution and weighting, report setting-specific persistence when possible, and distinguish variation across settings from Monte Carlo error within settings.

Clinical Biostats