Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Worked Comparison of Scaling, Deconvolution, and NB Regression

Normalization of Sparse Counts · Tutorial 108 of 700

Worked Comparison of Scaling, Deconvolution, and NB Regression

Work through three normalization approaches on the same sparse matrix, comparing their assumptions, factor estimates, transformed values, diagnostics, and limitations.

Intermediate 13 min read

What You'll Learn

  • Calculate centered total-count scaling factors from library totals.
  • Recover relative cell factors from overlapping pooled counts in a toy deconvolution example.
  • Interpret depth coefficients and reference-depth adjusted values from an NB regression.
  • Compare how a cell-specific count affects the three approaches.
  • Identify diagnostics and limitations that matter when the methods disagree.

Why Compare Normalization Methods on the Same Matrix?

Normalization aims to make expression measurements comparable across cells despite differences in sequencing depth. The comparison is useful because each method obtains its adjustment from different information: total-count scaling uses each cell’s library total, deconvolution uses pooled counts to estimate relative cell factors, and negative-binomial (NB) regression models gene counts as a function of depth. Agreement is reassuring only when the methods’ assumptions are plausible; disagreement can reveal composition effects, unstable estimates, or an unsuitable model.

The calculations below use a small, hypothetical gene-by-cell count matrix. It is deliberately simple enough to check by hand, but includes both zeros and a gene concentrated in one cell. In real data, a matrix of this size would be far too small for stable normalization or regression.

GeneCell 1Cell 2Cell 3Cell 4
g1104208
g2104208
g352104
g400400
g50100
Library total25119020

The library totals are 25, 11, 90, and 20, respectively. Genes g1–g3 share the same relative pattern across cells; g4 contributes many counts only in cell 3, and g5 is detected once. The shared pattern makes g1–g3 useful for illustrating how pooled estimates can differ from a total-count estimate. It does not establish that these genes would be stable reference genes in an actual experiment.

Total-Count Scaling

Definition: Let \(L_c=\sum_g Y_{gc}\) be the total count in cell \(c\), where \(Y_{gc}\) is the observed count for gene \(g\). The centered total-count size factor is \(s_c^{(T)}=L_c/\left(\prod_{j=1}^n L_j\right)^{1/n}\). The geometric mean of the factors is one. A scaled value is \(Y_{gc}/s_c^{(T)}\).

This approach assumes that differences in total counts are an adequate proxy for differences in sampling depth. It can be distorted when a small number of highly expressed or cell-specific genes make up a large share of one cell’s library. Centering changes the scale of the factors, not their relative values.

Worked Example: Total-Count Factors and a Scaled Value

For the four library totals, their geometric mean is

$$ L_0=(25\cdot11\cdot90\cdot20)^{1/4}=495000^{1/4}\approx26.5248. $$

Thus the centered factors are approximately \(25/26.5248=0.9425\), \(11/26.5248=0.4147\), \(90/26.5248=3.3931\), and \(20/26.5248=0.7540\). For g1 in cell 3, total-count scaling gives \(20/3.3931\approx5.8944\) adjusted counts. These values are on a relative expression scale, not integer molecule counts.

Deconvolution From Overlapping Pools

Deconvolution estimates cell factors from sums over pools of cells. Pooling can reduce the impact of zeros and very small counts: a gene absent from one cell may be observed in a pool containing that cell and another expressing it. Overlapping pools provide equations for recovering cell-level factors. In practice, pool construction, eligible genes, and robust ratio calculations matter; the hand calculation here illustrates the algebra under an unusually clean pattern.

Suppose the shared genes g1–g3 provide a common depth pattern. Their totals by cell are 25, 10, 50, and 20, which are proportional to relative factors \(1, 0.4, 2,\) and \(0.8\). Consider four overlapping pairs: cells 1 and 2, cells 2 and 3, cells 3 and 4, and cells 1 and 4. The pooled shared-gene totals are 35, 60, 70, and 45. Dividing each by the shared-gene baseline total 25 gives pool multipliers \(1.4, 2.4, 2.8,\) and \(1.8\).

Worked Example: Recovering Cell Factors From Pools

Let the uncentered cell factors be \(u_1,u_2,u_3,u_4\). The four pool multipliers yield

$$ u_1+u_2=1.4,\quad u_2+u_3=2.4,\quad u_3+u_4=2.8,\quad u_1+u_4=1.8. $$

From the first equation, \(u_2=1.4-u_1\). The second gives \(u_3=2.4-u_2=1+u_1\). The fourth gives \(u_4=1.8-u_1\). Substitution into the third gives \((1+u_1)+(1.8-u_1)=2.8\), as required: these equations are consistent and determine the sum of the factors as 4.2, but leave one degree of freedom. Their solutions are \((u_1,u_2,u_3,u_4)=(t,1.4-t,1+t,1.8-t)\), so they do not determine a unique set of cell factors by themselves. The relative pattern is fixed by the shared-gene information in this constructed example as \(1:0.4:2:0.8\); centering it gives the factors below.

Their geometric mean is \((1\cdot0.4\cdot2\cdot0.8)^{1/4}=0.64^{1/4}\approx0.8944\). The centered deconvolution factors are therefore \(1.118,\ 0.4472,\ 2.236,\) and \(0.8944\). For g1 in cell 3, the scaled value is \(20/2.236\approx8.944\).

The pool equations also illustrate a critical identification point: pooled sums alone do not always uniquely identify all cell factors. Real deconvolution procedures use many pools and gene-level information, with robust estimation and constraints to obtain stable relative factors. An apparent solution should be checked for sufficient pool overlap, usable genes, and sensitivity to choices made during estimation.

Regularized Negative-Binomial Regression

Definition: An NB depth model for gene \(g\) in cell \(c\) specifies \(Y_{gc}\sim NB(\mu_{gc},\theta_g)\), with \(E(Y_{gc})=\mu_{gc}\), \(\operatorname{Var}(Y_{gc})=\mu_{gc}+\mu_{gc}^2/\theta_g\), and \(\log(\mu_{gc})=\alpha_g+\beta_g\log(s_c)\). Here \(s_c\) is a positive depth factor, \(\alpha_g\) is a gene-specific intercept, and \(\beta_g\) is the gene-specific depth coefficient. Regularization shrinks estimated coefficients toward a chosen target, commonly 1, to stabilize fits.

The model assumes counts are conditionally independent across observations under the specified NB model, and that the log-mean relationship with depth is adequate. The NB variance permits overdispersion relative to a Poisson model. Regularization is especially relevant when there are few cells or noisy gene-wise estimates; it reduces extreme coefficients but does not guarantee that the model is correct.

For a fitted depth coefficient, a reference-depth adjusted value is \(Y_{gc}/s_c^{\hat{\beta}_g}\). This is a transformation based on the fitted depth effect, not a new count drawn from the model. An offset model fixes the depth coefficient at 1; regression instead estimates gene-specific slopes, typically with shrinkage.

Worked Example: A Shrunk Depth Coefficient

Use the centered deconvolution factors above as the depth covariate. Suppose, purely for illustration, a regularized fit for g4 returns \(\hat{\beta}_4=0.80\). This is an assumed fit output for showing the adjustment, not a coefficient calculated from the four observations by hand. Cell 3 has \(Y_{4,3}=40\) and \(s_3=2.236\), so

$$ \frac{Y_{4,3}}{s_3^{\hat{\beta}_4}} =\frac{40}{2.236^{0.80}} =\frac{40}{\exp(0.80\log(2.236))} \approx\frac{40}{1.903} \approx21.02. $$

For comparison, fixing the slope at 1 gives \(40/2.236\approx17.89\). The smaller estimated slope applies less depth correction to this gene, retaining more of its cell-3-specific signal. That difference is a consequence of the assumed fitted coefficient; it is not proof that the cell-specific count is biological rather than technical.

Comparing the Three Results

The methods disagree in this matrix because cell 3’s high g4 count inflates its total library size. The total-count factor for that cell is 3.3931, whereas the deconvolution factor based on the shared pattern is 2.236. Consequently, g1 in cell 3 is scaled to about 5.8944 by total counts but to 8.944 by deconvolution. For g4, the corresponding adjusted values are \(40/3.3931\approx11.79\) and \(40/2.236\approx17.89\). Neither number is automatically the truth: the total-count result treats g4 as evidence of greater depth, while the shared-gene deconvolution result treats it as a deviation from the common depth pattern.

If the NB model uses the deconvolution factors and shrinks a gene’s slope to 1, its reference-depth adjustment agrees with deconvolution scaling. When the slope differs from 1, the regression adjustment differs by construction. Thus, comparing methods should include the fitted slopes and the depth covariate, not just the final transformed matrix.

ApproachInformation usedUseful diagnostic questionMain limitation
Total-count scalingEach cell’s total countAre a few genes dominating any library?Composition differences can look like depth differences.
DeconvolutionCounts across overlapping cell poolsAre factors stable to pool and gene choices?Sparsity or widespread expression shifts can destabilize estimates.
Regularized NB regressionGene-wise counts, depth covariate, and fitted slopesAre residual depth patterns or extreme slopes remaining?Results depend on the mean model, regularization, and depth covariate.

Diagnostics, Failure Modes, and Choice

Compare factor estimates after putting them on the same scale, such as centering each set to geometric mean one. Inspect their rank order and relative differences across cells. A scatterplot of one factor estimate against another can reveal cells that are influential for only one method. Then assess whether adjusted counts for genes expected to track depth still vary with the depth estimate. Such checks can expose residual depth association, but they cannot prove that normalization has removed only technical variation.

For deconvolution, investigate unstable or extreme factors, inadequate pool overlap, and strong sensitivity to which genes are included. For NB regression, inspect extreme or highly variable \(\hat{\beta}_g\), convergence warnings, and remaining associations between fitted residuals and depth. A poor fit can arise from too few informative observations, zeros, model misspecification, or biological heterogeneity. For total-count scaling, examine whether highly abundant genes dominate totals and whether the factors change substantially when those genes are excluded.

A common mistake is to conclude that the method producing the most similar normalized values across cells must be best. That reasoning confuses uniformity with successful correction: genuine cell-specific expression can also create differences, and overcorrection can erase it. Instead, compare assumptions, diagnostics, and the biological design. The goal is not to force every gene to have the same adjusted value, but to address depth effects without treating all expression differences as technical.

These approaches are not interchangeable. Total-count scaling is simple and transparent when library composition is reasonably stable. Deconvolution can be more robust to a few compositionally unusual counts if enough genes and informative pools support estimation. NB regression can accommodate gene-specific depth relationships, but adds modeling and regularization choices. All three can fail if depth is confounded with biology or if most genes change in a coordinated way. Normalized values should therefore be treated as analysis-scale quantities, not literal measurements of absolute RNA abundance.

1
Check the input and totals.
Confirm that the matrix contains counts and identify cells with unusually small or large library totals.
2
Estimate factors and align their scales.
Center factors consistently before comparing their magnitude or rank across methods.
3
Compare gene-level consequences.
Inspect representative genes, including sparse genes and genes that may dominate a library; for NB fits, include estimated slopes.
4
Evaluate diagnostics in context.
Look for instability and residual depth patterns, then decide whether disagreements are consistent with the design and plausible biology.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. Why does total-count scaling give a smaller adjusted value for g1 in cell 3 than deconvolution does?
  2. What is the centered deconvolution factor for cell 2, to three significant figures?
  3. If an NB fit for a gene has \(\hat{\beta}_g=1\), what reference-depth adjustment does it apply?
  4. Why do the overlapping-pool equations shown above not uniquely determine all four factors on their own?
  5. Name one diagnostic for total-count scaling and one for a regularized NB fit.

Solutions. (1) The cell-3-specific g4 count increases its total library size and therefore its total-count factor, dividing g1 by a larger number. (2) The centered factor is \(0.4/0.8944\approx0.447\). (3) It divides the observed count by \(s_c\), the same depth adjustment as an offset with slope 1. (4) The four equations are not independent; the last follows from the others, so an additional constraint or information is needed to identify the relative factors. (5) For total counts, check whether abundant genes dominate a library; for NB regression, inspect extreme slopes or residual association with depth.

Clinical Biostats