Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Offsets Versus Regression-Based Normalization

Normalization of Sparse Counts · Tutorial 105 of 700

Offsets Versus Regression-Based Normalization

Learn what a fixed offset estimates, how regression-based corrections define a different target, and how to choose and interpret each approach.

Intermediate 9 min read

What You'll Learn

  • Distinguish a fixed log-size-factor offset from an estimated depth coefficient.
  • Interpret the expression quantity targeted by each normalization approach.
  • Calculate offset-based expected counts and regression-based corrected values.
  • Compute and interpret Pearson residuals from a negative-binomial fit.
  • Diagnose when depth adjustment may distort biological differences.
  • Choose a normalized scale that matches the downstream analysis.

Two Adjustments, Two Targets

A cell with more observed RNA counts may have a larger library because it was sequenced more deeply, because it contains more RNA, or both. Normalization must specify what variation it aims to remove. A fixed offset and a regression-based correction both use library size, but they do not automatically estimate the same quantity: the offset treats the size factor as a known exposure, whereas regression can estimate how expression changes with size and then construct a corrected value or residual.

The distinction matters when comparing cells, retaining count-scale interpretation, or preparing a matrix for downstream analyses. The introductory material on negative-binomial mean models for depth normalization gives the general count-model setting; here the focus is the difference between the two adjustment targets and the consequences of choosing one.

Definition: Let \(Y_{ig}\) be the observed count for gene \(g\) in cell \(i\), and let \(s_i>0\) be that cell's size factor. A fixed log-size-factor offset is the known term \(\log(s_i)\) added to the linear predictor of a count model with its coefficient fixed at 1. A regression-based depth adjustment estimates a relationship with depth and uses fitted values, residuals, or another explicitly defined transformation as the adjusted expression value.

Fixed Offsets in a Count Model

A common model for a gene is \(Y_{ig}\mid s_i\sim NB(\mu_{ig},\phi_g)\), with \(E(Y_{ig}\mid s_i)=\mu_{ig}\) and \(\operatorname{Var}(Y_{ig}\mid s_i)=\mu_{ig}+\phi_g\mu_{ig}^{2}\). Here \(\phi_g\geq 0\) is a gene-specific dispersion parameter. With an intercept-only mean for the gene, the offset model is \(\log(\mu_{ig})=\log(s_i)+\beta_g\). Equivalently, \(\mu_{ig}=s_i\exp(\beta_g)\). The coefficient of \(\log(s_i)\) is fixed at 1; it is not estimated from the gene's counts.

This model assumes that, conditional on the size factor, the expected count scales proportionally with that factor. Its interpretation also relies on the size factors being positive and meaningfully comparable across the cells being analyzed. The negative-binomial variance describes conditional count variability; it does not itself guarantee that the size factors capture technical depth rather than biological differences.

The offset leaves the response as a count and adjusts its expected value. The gene-specific quantity \(\exp(\beta_g)\) is the model's expected count per unit of size factor. It is not a fitted count for every cell, and it is not a residual. A model can include additional covariates, but their meaning must be specified: the offset continues to fix the size-factor effect at one while other coefficients are estimated.

Worked Example: Comparing Expected Counts Under an Offset

Suppose a hypothetical gene is modeled with the fixed-offset mean \(\log(\mu_i)=\log(s_i)+\beta\), and the fitted value is \(\exp(\beta)=10\) counts per unit of size factor. Consider cells with size factors \(s_i=0.5,\ 1,\) and \(2\). Assume the factors are positive and comparable, and that proportional scaling with size factor is an appropriate mean assumption for this illustration.

For \(s_i=0.5\), \(\mu_i=0.5(10)=5\) expected counts. For \(s_i=1\), \(\mu_i=1(10)=10\) expected counts. For \(s_i=2\), \(\mu_i=2(10)=20\) expected counts.

The fitted expected counts differ because the cells have different exposures. The estimated per-unit quantity is 10 for all three cells. The model has not made the observed counts equal, nor has it produced a corrected expression matrix. It has specified a depth-adjusted count mean and a gene-level rate parameter.

Regression-Based Values and Residuals

A different model can estimate the depth relationship instead of fixing its coefficient. For example, a negative-binomial regression may use \(\log(\mu_{ig})=\alpha_g+\gamma_g\log(s_i)\), where \(\gamma_g\) is estimated. Under this model, the expected count need not be proportional to \(s_i\): proportional scaling corresponds specifically to \(\gamma_g=1\). The model requires an appropriate mean and variance specification, sufficient information to estimate the relationship, and a depth measure that is not confounded with the biological pattern one wants to retain.

A corrected fitted value requires choosing a target depth. At a reference factor \(s_0\), this model predicts \(\widehat{\mu}_{ig}(s_0)=\exp(\widehat{\alpha}_g+\widehat{\gamma}_g\log(s_0))\). It is a model-based expected count at the common reference depth, not the original count and not necessarily an estimate of the cell's complete biological expression. The choice of \(s_0\), the included covariates, and the model all help define its interpretation.

A residual answers another question: how far is an observed count from its fitted mean, relative to the model's expected variability? For the negative-binomial model above, the Pearson residual is \(R_{ig}=(Y_{ig}-\widehat{\mu}_{ig})/\sqrt{\widehat{\mu}_{ig}+\widehat{\phi}_g\widehat{\mu}_{ig}^{2}}\). Residuals are dimensionless. A positive value indicates a count above the fitted mean; a negative value indicates a count below it. They are not corrected counts, and a value of zero does not mean zero expression.

Key distinction: An offset specifies how the expected count scales with a supplied size factor, with coefficient fixed at 1. Regression-based corrected fitted values predict expression at a chosen reference depth; residuals measure departures from a fitted model. These are different estimands, even when they use the same counts and size factors.

Worked Example: Estimated Depth Slope and a Reference-Depth Value

For a hypothetical gene, suppose a negative-binomial regression has fitted mean \(\widehat{\mu}_i=8s_i^{0.7}\). The coefficient 0.7 is an illustrative fitted depth slope, not a value calculated from the three cells below. Assume the regression is suitable for the data and the reference depth \(s_0=1\) is within the range of observed factors.

At \(s_i=0.5\), the fitted mean is \(8(0.5^{0.7})\approx8(0.6156)=4.925\) counts. At \(s_i=2\), it is \(8(2^{0.7})\approx8(1.625)=13.00\) counts. Because the estimated slope is 0.7 rather than 1, these means are not the proportional-offset predictions of 4 and 16 counts.

At the reference depth \(s_0=1\), the corrected fitted value for either cell is \(8(1^{0.7})=8\) counts. This is a prediction at the selected common depth, not a claim that the cells had eight observed counts or identical underlying biology. The model's estimated relationship and the reference depth determine the value.

Worked Example: Calculating a Pearson Residual

Suppose a hypothetical cell has observed count \(Y_{ig}=12\). A negative-binomial model gives fitted mean \(\widehat{\mu}_{ig}=8\) and fitted dispersion \(\widehat{\phi}_g=0.10\). Assume the model's fitted mean and dispersion are appropriate for illustrating the residual calculation.

The fitted variance is \(8+0.10(8^2)=8+6.4=14.4\), so the fitted standard deviation is \(\sqrt{14.4}\approx3.795\). Therefore,

$$ R_{ig}=\frac{12-8}{\sqrt{8+0.10(8^2)}}=\frac{4}{\sqrt{14.4}}\approx1.054. $$

The observed count is about 1.054 fitted standard deviations above the model mean. This is a dimensionless, model-relative deviation. It is not an adjusted count of 1.054, and it does not establish that the cell has unusually high biological expression without considering model fit and the broader analysis.

Why the Offset Relationship Is a Substantive Assumption

The fixed-offset assumption can be justified by a simple exposure argument. If a gene has a stable expected abundance \(q_g\) per unit of effective sequencing exposure, then a cell with exposure \(s_i\) has expected count \(s_iq_g\). Taking logarithms gives \(\log(\mu_{ig})=\log(s_i)+\log(q_g)\). Thus the offset is appropriate when the size factor acts as exposure and the expected count is proportional to it. The derivation does not prove that a particular size factor has this meaning; that is a modeling and normalization assumption.

An estimated slope relaxes proportionality, but flexibility is not automatically better. If library size is associated with cell type or cell state, a regression may attribute real expression differences to depth. Conversely, a fixed offset can misrepresent the mean if counts do not scale proportionally with the supplied factor. Both methods can remove signal or leave technical structure when their assumptions are unsuitable.

1
State the target.
Decide whether the analysis needs a count model with depth as exposure, a prediction at a common depth, or a model-scaled deviation from expected counts.
2
Specify the depth relationship.
Use a fixed offset when proportional mean scaling is defensible. If estimating a depth slope, state the regression model, its covariates, and the reference depth if corrected predictions are needed.
3
Check what remains.
Examine whether adjusted values still vary systematically with size factor and whether known biological groups have been flattened in ways that conflict with the scientific target.
4
Match the output to its use.
Retain counts and the offset for count-model analyses; use corrected predictions or residuals only when their defined scale is appropriate for the intended downstream method.

Diagnostics, Alternatives, and Limitations

A useful diagnostic is to examine the relationship between adjusted values and size factor. A remaining trend can signal inadequate depth adjustment, a misspecified mean relationship, or biology associated with depth. A strong absence of trend is not sufficient evidence of success: a correction could have removed biological structure along with technical variation. Compare patterns across biologically meaningful groups and check whether the chosen reference depth lies in a region supported by the data.

The main alternatives differ in what they provide. A fixed offset is natural when counts remain the response in a count model and exposure scaling is the intended assumption. Regression-based fitted values offer predictions at a specified common depth, while residuals express departures from fitted means on a model-dependent scale. Simple division of counts by size factors instead creates a rate-like quantity; it is not identical to fitting an overdispersed count model or to forming Pearson residuals.

ApproachWhat is fixed or estimated?Output and interpretation
Fixed offsetSize-factor slope fixed at 1Count model; gene coefficient represents expected count per unit factor
Regression at reference depthDepth relationship estimated; target depth specifiedPredicted count at that common depth under the fitted model
Pearson residualMean and variance estimated by the modelDimensionless observed-minus-fitted deviation, scaled by fitted standard deviation
Count divided by size factorNo count-model depth slope is estimatedRate-like value; does not account for model-based count variance

Each approach has limits. Estimated slopes may be unstable with few informative observations or very sparse counts. A reference-depth prediction can be misleading if it requires extrapolation. Residuals depend on both the fitted mean and variance, so model misspecification affects their scale. An offset does not correct errors in the size factors or biological confounding. No adjusted matrix should be interpreted without naming its scale and target.

Common Mistake

A common mistake is to say, “The offset normalizes every cell to the same expression value,” or to treat a regression residual as a corrected count. An offset changes the modeled mean through a specified exposure; it does not equalize observed counts. A residual is an observed-minus-fitted difference scaled by model variability, not expression on the count scale. The correction is to identify the output explicitly: a rate parameter, a reference-depth prediction, a residual, or a divided count. Then interpret only that quantity.

Key takeaway: Choose normalization by its estimand, not by the word “correction.” A fixed offset encodes proportional exposure scaling; a regression-based prediction targets a chosen depth; a residual measures model-relative deviation. Their outputs are not interchangeable.

Check Your Understanding

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

  1. A fixed-offset model has \(\exp(\beta_g)=6\) and a cell's size factor is 1.5. What is its fitted expected count?
  2. A fitted depth regression is \(\widehat{\mu}=5s^{0.8}\). Calculate the fitted mean at \(s=2\), to three significant figures. Is this the same as a fixed-offset prediction?
  3. For an observed count of 10, fitted mean 7, and fitted dispersion 0.20, calculate the Pearson residual using the negative-binomial variance.
  4. Why is a residual of 0.5 not an adjusted count of 0.5?
  5. Give one reason that a regression-based correction could remove biological signal, even if the fitted adjusted values show little remaining association with size factor.

Solutions. (1) \(\widehat{\mu}=s_i\exp(\beta_g)=1.5(6)=9\) expected counts. (2) \(\widehat{\mu}=5(2^{0.8})\approx5(1.741)=8.71\) counts. A fixed-offset prediction would be \(5(2)=10\), because it fixes the depth slope at 1. (3) The fitted variance is \(7+0.20(7^2)=7+9.8=16.8\). Thus \(R=(10-7)/\sqrt{16.8}=3/4.099\approx0.732\). (4) The residual is dimensionless and expresses a difference from the fitted mean in fitted standard-deviation units; it is not on the count scale. (5) If size factor is associated with cell type or state, regression can attribute some genuine group-related expression variation to depth and remove it during correction.

Clinical Biostats