Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Cross-Modal Cell-Type Label Transfer

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

Cross-Modal Cell-Type Label Transfer

Learn to construct cross-modal neighborhoods, calculate candidate-label support and uncertainty, and decide when a transferred label should be withheld.

Advanced 12 min read

What You'll Learn

  • Identify the assumptions required for RNA-reference to protein- or ATAC-query label transfer.
  • Define shared-space neighborhoods and calculate weighted support for each candidate label.
  • Interpret support margins, entropy, and effective neighbor counts without treating them as posterior probabilities.
  • Use held-out reference cells to calibrate confidence and distance-based abstention rules.
  • Diagnose poor mappings, missing reference cell types, and unstable neighborhood assignments.
  • Compare neighborhood transfer with centroid, supervised-classifier, and marker-rule approaches.

Why Transfer Labels Across Modalities?

A cell-type label may be available for an RNA reference even when the query cells are measured primarily by surface proteins or chromatin accessibility. Label transfer uses the relationship between modalities to find reference cells that resemble each query cell, then summarizes the labels in that neighborhood. The key statistical challenge is not merely finding nearby cells: it is deciding whether the neighborhood is comparable across modalities and whether its label evidence is decisive enough to report.

This tutorial focuses on transfer from a labeled RNA reference to a protein or ATAC query. The earlier material on predicting one modality from another motivates how paired cells can connect modalities, but predicting features and transferring labels are distinct tasks. Here, the object being predicted is a categorical cell-type label.

Definition: Cross-modal cell-type label transfer assigns a candidate label to a query cell by using labeled reference cells that are close to it in a representation shared across modalities. A transferred label is a prediction based on reference annotations and a cross-modal mapping; it is not an independent confirmation of the cell's biological identity.

Constructing a Neighborhood That Can Be Compared

Let \(r_i\), \(i=1,\ldots,n_R\), denote RNA reference cells with labels \(y_i\) in a candidate set \(\mathcal{C}\). Let \(q_j\), \(j=1,\ldots,n_Q\), denote query cells measured by protein or ATAC. The raw measurements do not generally have the same features or scale, so distances between raw RNA counts and raw protein counts, for example, are not meaningful by themselves.

Instead, a cross-modal mapping represents each reference and query cell in a shared coordinate system. This may be learned from cells measured in both modalities, using paired features or a paired-cell bridge, and then applied to the reference and query. The earlier material on canonical correlation and weighted nearest neighbors provides relevant ways to represent paired modalities; the label-transfer step uses the resulting comparable coordinates rather than assuming the raw measurements are interchangeable.

Write the shared coordinates as \(z_i^R\) for reference cell \(i\) and \(z_j^Q\) for query cell \(j\). For each query cell, select its \(k\) nearest reference cells under a specified distance in that space. Denote this neighbor set by \(\mathcal{N}_k(j)\), and let \(d_{ij}\) be the distance between query \(j\) and reference \(i\). The choice of distance and scaling must be consistent with the representation used to build the map.

Assumptions for a meaningful transfer: (1) the shared representation preserves relevant cell-type neighborhoods across modalities; (2) the query cell type is represented, or adequately approximated, in the reference; (3) the reference labels are sufficiently accurate for the intended use; and (4) technical or biological shifts have not made the query neighborhood incomparable to the reference. These assumptions are empirical and should be checked, not taken as guaranteed by the embedding.

From Neighbors to Label Support

A simple transfer gives each neighbor equal influence. A weighted transfer gives more influence to closer neighbors. For example, a nonnegative kernel weight can be defined as \(a_{ij}=\exp(-d_{ij}^2/(2h^2))\), where \(h>0\) controls how quickly influence decreases with distance. Normalize the weights within the selected neighborhood so that they sum to one.

$$ w_{ij}=\frac{a_{ij}}{\sum_{\ell\in\mathcal{N}_k(j)}a_{\ell j}}, \qquad S_{jc}=\sum_{i\in\mathcal{N}_k(j)}w_{ij}\,\mathbf{1}(y_i=c), \quad c\in\mathcal{C}. $$

Here \(S_{jc}\) is the weighted support for candidate label \(c\) for query cell \(j\), and \(\mathbf{1}(y_i=c)\) equals one when reference cell \(i\) has label \(c\), and zero otherwise. Because the weights sum to one, the supports across all candidate labels also sum to one. A basic prediction is the label with the largest support. The support is a local, weighted summary of reference labels; without additional calibration assumptions, it is not a posterior probability that the query truly has that label.

A useful measure of ambiguity is the margin between the largest and second-largest supports. If the two leading labels have nearly equal support, the neighborhood does not strongly distinguish them. Entropy summarizes the whole support distribution: \(H_j=-\sum_{c\in\mathcal{C}}S_{jc}\log S_{jc}\), with \(0\log 0\) defined as zero. Larger entropy indicates more diffuse support. The effective number of contributing neighbors, \(N_{\mathrm{eff},j}=1/\sum_i w_{ij}^2\), is also informative: it is near one when one neighbor dominates and equals \(k\) when all \(k\) weights are equal. These quantities describe different features of the evidence and should be considered together.

Worked Example: Weighted Support With a Clear Leading Label

Hypothetical data. A protein query cell has five nearest RNA reference neighbors. Their normalized weights are \(0.30, 0.25, 0.20, 0.15,\) and \(0.10\); their reference labels, in that order, are A, A, B, A, and B. The weights are nonnegative and sum to one: \(0.30+0.25+0.20+0.15+0.10=1.00\).

The weighted support for A is the sum of the weights on A-labeled neighbors:

$$ S_{jA}=0.30+0.25+0.15=0.70. $$

The support for B is \(S_{jB}=0.20+0.10=0.30\). Thus A is the leading candidate, and the leading-label margin is \(0.70-0.30=0.40\). The calculation supports assigning A under a decision rule that permits transfer at this level of evidence; it does not establish a 70% probability that A is the true label.

Quantifying Ambiguous Support

A winning label is always available when the candidate set is nonempty, even if its support is only slightly larger than its competitor's. Therefore a label-transfer system should retain more than the winning label. At minimum, record the leading support, the margin, and a measure of neighborhood distance. For a larger set of candidate labels, entropy can help identify support spread across several possibilities rather than concentrated on one.

These are uncertainty indicators, not automatically calibrated error probabilities. A small margin often signals ambiguity, but the same margin can correspond to different error rates in different datasets. Calibration means checking the behavior of the uncertainty score on query-like cells whose labels are known. A practical approach is to hold out reference cells, treat them as unlabeled queries, transfer their labels from the remaining reference cells, and compare predictions with their known labels. When cells from the same donor or sample are highly similar, splitting by donor or sample is more informative than randomly splitting individual cells, which can make validation appear overly optimistic.

Worked Example: Similar Support for Two Candidate Labels

Hypothetical data. An ATAC query cell has four nearest reference neighbors with normalized weights \(0.27, 0.25, 0.25,\) and \(0.23\). Their labels are A, B, A, and B. The weights sum to \(1.00\).

The supports are \(S_{jA}=0.27+0.25=0.52\) and \(S_{jB}=0.25+0.23=0.48\). The margin is \(0.52-0.48=0.04\). A is the largest-support label, but the small margin indicates little separation from B.

For two labels, the entropy is \(H_j=-0.52\log(0.52)-0.48\log(0.48)\approx0.6923\) nats. The maximum possible binary entropy is \(\log(2)\approx0.6931\) nats, so the support is nearly maximally diffuse. The effective neighbor count is \(N_{\mathrm{eff},j}=1/(0.27^2+0.25^2+0.25^2+0.23^2)=1/0.2508\approx3.987\). Thus nearly all four neighbors contribute, but they split almost evenly between A and B. The appropriate conclusion is that A ranks first but the transfer is ambiguous; a pre-specified rule might report both candidates or abstain rather than present A as a confident assignment.

Why Weighted Support Has a Statistical Interpretation

The support formula is a local estimate of how labels are distributed around the query in the shared representation. To see this, define \(I_{ic}=\mathbf{1}(y_i=c)\). If reference labels are sampled from a population in which \(P(y_i=c\mid z_i^R)\) changes smoothly with the shared coordinates, then nearby reference cells tend to have similar conditional label frequencies. The weighted average of their indicators is a local estimate of that frequency near \(z_j^Q\).

In particular, conditional on the chosen neighbors and weights, if their label indicators have local means \(\pi_{ic}=P(y_i=c\mid z_i^R)\), then linearity of expectation gives:

$$ E(S_{jc})= E\left(\sum_{i\in\mathcal{N}_k(j)}w_{ij}I_{ic}\right) =\sum_{i\in\mathcal{N}_k(j)}w_{ij}\pi_{ic}. $$

If the \(\pi_{ic}\) values are similar across the neighborhood, this weighted average is close to the local conditional frequency for label \(c\). The argument depends on the neighborhood being local and meaningful. It does not imply that \(S_{jc}\) is calibrated for a particular query cell, especially if the query distribution differs from the reference or the mapping distorts neighborhoods.

Distance Checks, Abstention, and Failure Modes

Normalized support alone can conceal a query cell that is far from every reference cell. Even if every selected neighbor has label A, normalization will give A support of one. That number describes agreement among the chosen neighbors, not whether those neighbors are close enough to be relevant. Examine the nearest-neighbor distance and compare it with distances observed for held-out reference cells under the same transfer procedure. A large distance relative to the validation distribution is evidence that the query may be out of reference scope.

Worked Example: High Support but an Out-of-Range Query

Hypothetical data. A query cell's three nearest RNA reference neighbors all have label C, so their normalized weights, whatever their relative values, sum to \(S_{jC}=1.00\). Their distances are \(8.0, 9.0,\) and \(10.0\) shared-space units. In donor-held-out validation, the 95th percentile of the nearest-reference distance is \(3.2\) units.

The query's nearest-reference distance is \(8.0\), and \(8.0>3.2\). Therefore it lies beyond the stated validation threshold. The support is unanimous among the selected neighbors, but the distance check warns that those neighbors are poor analogues. A defensible output is to flag the cell as out of range or abstain from assigning C, rather than interpret support \(1.00\) as certainty. The threshold is a diagnostic rule learned from validation data, not a universal cutoff.

Other warning signs include a transferred label that changes substantially when \(k\), the distance metric, or the representation is modestly changed; a neighborhood dominated by one reference sample; and query cells that cluster in regions with no labeled reference cells. A useful stability check repeats transfer under reasonable analysis choices and records whether the leading label persists. Strong dependence on a single setting should lower confidence. Investigators should also inspect whether rare reference labels are systematically overwhelmed by common labels and whether the reference annotation scheme distinguishes the cell types relevant to the question.

A multi-step implementation can make these checks explicit:

1
Build the cross-modal map.
Use paired information and a representation appropriate to the modalities; do not compare incompatible raw feature vectors.
2
Select and summarize neighbors.
Choose \(k\), calculate distances and weights, then retain support for every candidate label rather than only the winner.
3
Assess ambiguity and range.
Review the margin, entropy or effective neighbor count, and distance from the query to its reference neighborhood.
4
Validate the decision rule.
Use held-out, query-like reference cells to estimate error and choose any support or distance thresholds; allow an unresolved outcome.

Alternatives and Limits

Nearest-neighbor transfer is local and can represent complex boundaries, but its result depends on the mapping, the distance, and the selected neighborhood size. A nearest-centroid approach instead assigns a query according to the closest label-specific average in shared space. It is computationally simple, but can be inaccurate when a cell type forms multiple clusters or has a broad, irregular distribution. A supervised classifier trained on paired cells can learn nonlinear or probabilistic boundaries, but requires representative paired training data and careful validation; a classifier's probability outputs also need calibration before being interpreted as probabilities. Marker-based rules can be transparent and biologically interpretable, but may be fragile when markers are missing, noisy, or modality-specific.

No transfer method can recover a biologically meaningful label absent from the reference label set without an explicit mechanism for detecting that mismatch. Nor does a confident transfer correct systematic errors in the RNA reference annotations. The result should be described as a transferred annotation, accompanied by uncertainty and out-of-range checks, and confirmed with appropriate biological evidence when the application requires it.

Common Mistakes

  • Comparing raw measurements across modalities. RNA counts and protein intensities or ATAC accessibility are not automatically on a common scale. Use a defensible shared representation before calculating cross-modal distances.
  • Calling support a probability. A support of \(0.70\) means 70% of the normalized neighbor weight falls on that label. It is not, by itself, a 70% chance that the query cell has that type.
  • Reporting only the winning label. A narrow lead, such as supports \(0.52\) and \(0.48\), is not decisive merely because one label is ranked first. Report ambiguity and apply a validated decision rule.
  • Ignoring absolute distance. A normalized support of one can occur when all neighbors are remote. Check whether the query is within the range represented in validation data.
  • Assuming every query type is in the reference. A closed candidate set forces a winner even for a novel or poorly represented cell. Provide an out-of-range or abstention option.
Key takeaway: Cross-modal label transfer is a neighborhood-based prediction, not a direct measurement of cell identity. Its credibility depends on a meaningful shared space, representative and reliable reference labels, and uncertainty checks that consider both label disagreement and distance from the reference.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. A query has normalized neighbor weights \(0.40, 0.35,\) and \(0.25\), with labels A, B, and A. Calculate both label supports and the leading-label margin. What does the result establish?
  2. Why can a query with support \(1.00\) for one label still be unsuitable for transfer?
  3. In a two-label problem, what does entropy near \(\log(2)\) indicate about the support distribution?
  4. Name one reason to split validation data by donor or sample rather than randomly by cell.

Solutions. (1) \(S_A=0.40+0.25=0.65\), \(S_B=0.35\), and the margin is \(0.65-0.35=0.30\). A leads among these neighbors, but support is not automatically a probability of true identity. (2) All selected reference cells could be far from the query, while normalized weights still sum to one; inspect distances against held-out validation cells and consider abstaining. (3) The two labels have nearly equal support, so the evidence is maximally diffuse for a binary distribution and does not distinguish the candidates well. (4) Cells from the same donor or sample can be highly similar; a random cell split may put close analogues in both training and validation sets and yield an overly optimistic error estimate.

Clinical Biostats