Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Residuals as Directional Evidence

RNA Velocity · Tutorial 392 of 700

Residuals as Directional Evidence

Use the sign of a phase-portrait residual to assess directional evidence while checking whether its size is meaningful relative to noise and model fit.

Advanced 12 min read

What You'll Learn

  • Define a signed residual in the spliced–unspliced phase portrait.
  • Derive how the residual sign relates to the rate of change of spliced RNA under steady-state kinetics.
  • Explain when positive and negative residuals are consistent with induction and repression.
  • Compare raw residual size with residual size relative to measurement noise.
  • Diagnose offsets, mixed cell states, and other reasons a residual may mislead.
  • Apply these checks to hypothetical phase-portrait data.

Why the Sign of a Residual Can Matter

A steady-state phase portrait describes the expected relationship between unspliced and spliced RNA for a gene. A cell that lies above or below this fitted relationship has a signed residual. In the RNA velocity setting, that sign can be directional evidence: under specific kinetic assumptions, it indicates whether spliced RNA is increasing or decreasing at that moment. It is not, by itself, proof that transcription has changed, nor does a large residual automatically mean strong evidence.

The distinction is important because phase-portrait data are noisy. A cell may lie far from a fitted curve because its RNA state is changing, because counts are imprecise, or because the fitted curve does not describe that cell’s state. Interpretation therefore requires both a kinetic argument for the residual’s direction and a check on how large it is relative to the noise and model limitations.

Definition and Kinetic Interpretation

Use \(s\) for spliced RNA abundance and \(u\) for unspliced RNA abundance. In a phase portrait, put \(s\) on the horizontal axis and \(u\) on the vertical axis. Under the two-compartment kinetic model, spliced RNA changes according to \(ds/dt=\beta u-\gamma s\), where \(\beta>0\) is the splicing rate and \(\gamma>0\) is the degradation rate of spliced RNA. At steady state, the rate of change is zero, so the expected relationship is \(u=(\gamma/\beta)s\).

Definition: Let \(\hat{f}(s)\) be the fitted steady-state phase-portrait relationship, with predicted unspliced abundance \(\hat{f}(s)\) at spliced abundance \(s\). The signed residual for a cell with observed values \((s,u)\) is \(r=u-\hat{f}(s)\). A positive residual places the cell above the fitted curve; a negative residual places it below. For the kinetic interpretation below, the fitted relationship must represent the steady-state line through the origin, \(\hat{f}(s)=(\gamma/\beta)s\).

A positive residual means that the cell has more unspliced RNA than the steady-state relationship predicts for its observed spliced RNA. A negative residual means it has less. The reason this can carry directional information follows directly from the spliced-RNA equation.

Derivation: If the fitted steady-state slope is \(\gamma/\beta\), then \(u=(\gamma/\beta)s+r\). Substituting this expression into the spliced-RNA equation gives
$$ \frac{ds}{dt} =\beta u-\gamma s =\beta\left(\frac{\gamma}{\beta}s+r\right)-\gamma s =\beta r. $$

Because \(\beta\) is positive, \(ds/dt\) has the same sign as \(r\) under this model: a positive residual corresponds to increasing spliced RNA, and a negative residual to decreasing spliced RNA. This result concerns the instantaneous change in spliced RNA. It does not say that the residual is the transcription rate, or that every positive residual proves transcription is increasing.

The usual biological interpretation is that a cell above the steady-state curve is consistent with an induction phase: increased transcription can raise unspliced RNA before spliced RNA catches up. A cell below the curve is consistent with a repression phase: unspliced RNA can decline while spliced RNA remains relatively abundant. These are interpretations of a kinetic pattern, not conclusions guaranteed by residual sign alone. They rely on the fitted line and the kinetic assumptions being reasonable for the cells being interpreted.

Assumptions Before Interpreting Direction

The sign-to-direction argument is useful only when its conditions are made explicit. In particular, the fitted curve must be a suitable estimate of the gene’s steady-state relationship for the cell population under study. A line fitted to a mixture of biologically distinct states may not be a meaningful reference for any one state.

  • Valid two-compartment kinetics. Spliced RNA changes through splicing from the unspliced pool and degradation of the spliced pool, as represented by \(ds/dt=\beta u-\gamma s\). Both rates are positive.
  • A steady-state reference through the origin. The reference is \(u=(\gamma/\beta)s\), not an arbitrary curve with an unaccounted-for intercept. A technical offset or a fitted nonzero intercept changes the residual’s relation to \(ds/dt\).
  • Comparable units and processing. Spliced and unspliced values must be on scales that make their fitted relationship interpretable. Differences in scaling or technical biases can move points relative to the curve.
  • Meaningful cell-level measurements. Residuals are calculated from observed counts or normalized abundances, which contain sampling and measurement noise. The calculation does not remove that noise.
  • Reasonable model fit in the relevant range. A fitted slope may describe some cells well and others poorly. The sign is harder to interpret where the curve is unsupported by data or systematic deviations remain.

These assumptions do not require every cell to be exactly at steady state; departures from steady state are the signal of interest. Rather, they require the steady-state relationship to be an appropriate reference against which departures can be interpreted. The introductory material on steady-state phase-portrait fitting covers the construction of that reference; here the focus is what its residuals can and cannot establish.

Worked Example: A Positive Residual and an Increasing Spliced-RNA Rate

Suppose a hypothetical gene has fitted steady-state line \(\hat{f}(s)=0.50s\), with both abundances expressed in normalized count units. For one cell, \(s=20\) normalized count units and \(u=13\) normalized count units. Assume, for this calculation, that the fitted slope equals \(\gamma/\beta\) and that \(\beta=0.40\) per hour.

First calculate the fitted unspliced abundance and residual:

$$ \hat{f}(20)=0.50(20)=10,\qquad r=13-10=+3 $$

The cell is 3 normalized count units above the fitted line. Under the assumed kinetic model, the rate of change of spliced RNA is

$$ \frac{ds}{dt}=\beta r=(0.40\ \text{per hour})(3\ \text{normalized count units}) =1.20\ \text{normalized count units per hour}. $$

The positive value is consistent with increasing spliced RNA at that moment. It is not a direct estimate of a change in transcription rate: it is the model-implied spliced-RNA rate given the stated \(\beta\) and residual. Without a reliable rate parameter, the residual sign gives the directional implication, but this numeric rate cannot be calculated.

Residual Sign Is Not Residual Strength

The sign and the magnitude answer different questions. The sign says which side of the reference curve a cell occupies. The raw magnitude \(|r|\) gives its vertical distance from that curve in unspliced-abundance units. It does not account for how variable or noisy those measurements are. A residual of 4 units may be conspicuous when the typical measurement error is 1 unit, but unremarkable when it is 10 units.

A useful descriptive check is to compare a residual with an estimate of the residual spread for cells at a similar abundance. For example, if the residual standard deviation in that range is \(\sigma_r\), the standardized displacement \(r/\sigma_r\) expresses the residual in residual-standard-deviation units. This can help compare relative departures, but it is not automatically a formal test statistic: that would require a specified error model and appropriate treatment of how the curve was fitted.

Worked Example: The Same Residual Can Have Different Relative Size

Consider two hypothetical cells, each with residual \(r=+4\) normalized count units. In the first cell’s abundance range, suppose the estimated residual standard deviation is 2 units. In the second range, suppose it is 8 units. Calculate the standardized displacements.

$$ \frac{r}{\sigma_r}\text{ for cell 1}=\frac{4}{2}=2, \qquad \frac{r}{\sigma_r}\text{ for cell 2}=\frac{4}{8}=0.50. $$

Both residuals are positive, so both cells are above their fitted steady-state values. The first displacement is 2 residual-standard-deviation units, while the second is only 0.50. Thus the raw distances are equal, but the first is larger relative to the stated noise level. These calculations describe relative displacement; without a justified probability model, they do not establish a p-value or a probability that either cell is truly changing state.

Noise can also change the sign, especially when the true displacement from the curve is small. With sparse counts, a modest difference between observed and fitted abundance may reflect sampling variation. Consequently, an isolated positive residual should not be treated as decisive evidence of induction, and an isolated negative one should not be treated as decisive evidence of repression. Directional patterns that recur across relevant cells are more persuasive than a single large-looking deviation, but consistency does not by itself eliminate model misspecification.

Worked Interpretation Across Cells

Worked Example: Mixed Residual Signs in a Small Hypothetical Set

Suppose the fitted line is \(\hat{f}(s)=0.50s\). Four hypothetical cells have the following abundances, in normalized count units: \((s,u)=(10,9),(12,9),(8,3),(14,3)\). Calculate each residual and the mean residual.

$$ \begin{aligned} r_1&=9-0.50(10)=+4,\\ r_2&=9-0.50(12)=+3,\\ r_3&=3-0.50(8)=-1,\\ r_4&=3-0.50(14)=-4. \end{aligned} $$

The mean residual is

$$ \bar{r}=\frac{4+3-1-4}{4}=\frac{2}{4}=+0.50 \quad\text{normalized count units.} $$

The positive mean does not describe every cell: two cells are above the line and two are below. It also conceals the larger positive and negative departures. In this set, reporting only the mean would lose the mixed directional pattern. A useful inspection retains cell-level signs and checks whether departures form coherent groups or instead look like scattered noise. The arithmetic alone cannot determine which explanation is correct.

Diagnostics, Alternatives, and Common Pitfalls

Before assigning biological meaning, inspect whether residuals behave plausibly in the phase-portrait range being interpreted. Look for systematic departures, such as residuals tending to become more positive with abundance, or a cluster of cells on one side of the line associated with a particular cell state. Such patterns can indicate that one steady-state relationship is inadequate for the data. Also check whether the conclusion depends on a few extreme cells, on cells near the edge of the fitted range, or on a small number of nonzero observations.

An offset deserves special attention. If the fitted curve is \(\hat{f}(s)=as+c\), with \(a=\gamma/\beta\), then \(r=u-as-c\) and

$$ \frac{ds}{dt}=\beta u-\gamma s =\beta(as+c+r)-\gamma s =\beta(c+r). $$

Thus the sign of \(r\) alone need not match the sign of \(ds/dt\) when \(c\ne0\). A nonzero intercept may have a practical statistical explanation, but it changes the simple directional interpretation. Do not silently apply the through-origin result to an offset fit.

Residuals are one way to assess departure from a fitted phase portrait, not the only description of the data. Raw unspliced abundance answers how much unspliced RNA was observed, not whether it is high relative to the amount of spliced RNA. Comparing residuals with their local spread adds context about noise, but depends on how that spread is estimated. Inspecting the phase portrait and residual pattern can expose poor fit that a single summary hides. These approaches complement one another; none makes the kinetic assumptions unnecessary.

Common mistake: “This cell has the largest positive residual, so it has the strongest transcriptional induction.” That conclusion confuses raw distance with relative evidence and treats a model-based directional implication as a direct measurement of transcription. The correction is to state only that the cell lies above the fitted reference; then assess the residual relative to noise, check fit and scaling, and describe induction as a kinetic interpretation consistent with the assumptions—not as a proven cause.

Key takeaway: With a valid steady-state line through the origin and positive splicing rate, the residual sign matches the sign of the instantaneous spliced-RNA change. The residual magnitude is a vertical distance, not a noise-adjusted measure of evidence, and neither sign nor size alone proves a transcriptional change.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A cell has \(s=16\), \(u=11\), and the fitted line is \(\hat{f}(s)=0.60s\). Calculate the residual and state the model-implied direction of change in spliced RNA.
  2. Why does a positive residual not, by itself, prove that transcription is increasing?
  3. Two cells each have residual \(+3\). Their local residual standard deviations are 1.5 and 6. Calculate both standardized displacements and compare them.
  4. For a fitted reference \(\hat{f}(s)=0.40s+2\), explain why the residual sign alone does not determine the sign of \(ds/dt\).
  5. A group has both positive and negative residuals but a mean residual near zero. What information would be lost by reporting only the mean?

Solutions. (1) The fitted value is \(0.60(16)=9.6\), so \(r=11-9.6=+1.4\). Under the stated steady-state kinetic assumptions, the positive residual implies increasing spliced RNA. (2) The sign gives a model-based direction for spliced RNA change; measurement noise, poor fit, or other kinetic departures can also produce a positive residual, and it is not a direct transcription-rate measurement. (3) The displacements are \(3/1.5=2\) and \(3/6=0.50\) residual-standard-deviation units. Both signs are positive, but the first is larger relative to its stated residual spread. (4) The intercept changes the relation to \(ds/dt=\beta(c+r)=\beta(2+r)\), so the sign depends on \(2+r\), not \(r\) alone. (5) The mean can hide opposing cell-level directions and the size or grouping of departures on each side of the fitted curve.

Clinical Biostats