Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Log Fold Change Bias In Selected Markers

Marker Genes and the Double-Dipping Problem · Tutorial 316 of 700

Log Fold Change Bias In Selected Markers

Understand how marker selection inflates estimated log fold changes, and why shrinking an effect estimate is not the same as correcting a test or confidence interval.

Advanced 12 min read

What You'll Learn

  • Define a log2 fold change in terms of normalized expression means.
  • Derive the expected exaggeration from threshold-based selection.
  • Explain how selecting the largest estimate creates winner’s-curse bias.
  • Calculate a shrinkage estimate and distinguish it from a valid p-value.
  • Identify diagnostics and alternative strategies for reporting selected effects.

Why Selected Log Fold Changes Look Too Large

A marker gene is often reported because its estimated expression difference between clusters is large. That selection rule creates a problem even when each gene’s estimate is unbiased before selection: estimates with unusually large errors are more likely to cross the selection threshold or rank first. Consequently, the selected log fold changes tend to exaggerate the underlying differences. This is the winner’s curse, considered here specifically for marker effect sizes.

The issue concerns the magnitude of the reported effect, not just whether a gene passes a test. A large estimated fold change can be useful for describing a contrast, but if the same noisy estimate helped select the gene, its magnitude is not an unbiased summary of the underlying effect. The distinction matters when ranking markers, planning follow-up experiments, or communicating how strongly a gene distinguishes two clusters.

Definition: For a gene \(g\), let \(\mu_{Ag}\) and \(\mu_{Bg}\) be the positive mean normalized expression levels in groups \(A\) and \(B\). Its log2 fold change is \(\beta_g=\log_2(\mu_{Ag}/\mu_{Bg})\). An estimate is \(\hat{\beta}_g=\log_2(\hat{\mu}_{Ag}/\hat{\mu}_{Bg})\), where \(\hat{\mu}_{Ag}\) and \(\hat{\mu}_{Bg}\) estimate the group means. A value of zero corresponds to equal means; a value of one corresponds to a twofold ratio. Log2 fold change is measured in log2-fold units.

In practice, expression means and their log ratios are estimated from normalized data, often using a model suited to the count structure. The argument below does not require one particular estimation procedure. It uses a local approximation in which an estimate has a roughly normal sampling distribution:

$$ \hat{\beta}_g \approx N(\beta_g, s_g^2), $$

where \(\beta_g\) is the underlying log2 fold change and \(s_g\) is the standard error. This approximation is useful when the estimate is sufficiently regular and its standard error is reasonably estimated. It is not an assertion that every log ratio of sample means is exactly normal, particularly with sparse expression or very small groups. Selection bias can also occur outside the normal approximation; the model makes its size transparent.

How Threshold Selection Creates Bias

Suppose a gene is reported only if its estimate exceeds a positive cutoff \(c\), so selection occurs when \(\hat{\beta}_g>c\). Under the approximate normal model, define \(Z=(\hat{\beta}_g-\beta_g)/s_g\), which has an approximate standard normal distribution before selection. The selection condition becomes \(Z>a\), where \(a=(c-\beta_g)/s_g\). Conditional on selection, the mean estimation error is no longer zero.

$$ E(\hat{\beta}_g-\beta_g\mid \hat{\beta}_g>c) = s_g E(Z\mid Z>a) = s_g\frac{\phi(a)}{1-\Phi(a)}, $$

Here \(\phi\) and \(\Phi\) are the standard normal density and cumulative distribution functions. To justify the last equality, the conditional mean is the ratio of the tail first moment to the tail probability. Since \(\phi'(z)=-z\phi(z)\),

$$ E(Z\mid Z>a) =\frac{\int_a^\infty z\phi(z)\,dz}{1-\Phi(a)} =\frac{\phi(a)}{1-\Phi(a)}. $$

The quantity \(\phi(a)/(1-\Phi(a))\) is positive, so selecting on a positive estimate makes the expected selected estimate exceed the true effect. When the true effect is zero and the cutoff is two standard errors, the selected estimates average more than two standard errors above zero. Selection does not make every selected estimate wrong by the same amount; it shifts the average among selected estimates upward.

Worked Example: A Two-Standard-Error Selection Threshold

Suppose a hypothetical gene has true log2 fold change \(\beta_g=0\) and standard error \(s_g=0.30\). A marker list includes it only when \(\hat{\beta}_g>0.60\), which is two standard errors above zero. Under the normal approximation, \(a=(0.60-0)/0.30=2\).

The probability of selection is \(1-\Phi(2)\approx0.02275\). Among estimates that pass the threshold, the expected estimation error is

$$ 0.30\frac{\phi(2)}{1-\Phi(2)} =0.30\frac{0.05399}{0.02275} \approx 0.712. $$

Thus, conditional on this gene passing the one-sided threshold, its expected reported estimate is about \(0.712\) log2-fold units even though its true effect is zero. The corresponding ratio is \(2^{0.712}\approx1.64\). This is a conditional expectation across repeated datasets, not a prediction that any particular selected estimate equals \(0.712\).

A rule that selects large effects in either direction has the same issue for absolute magnitude. For a gene with true effect zero, selecting when \(|\hat{\beta}_g|>c\) makes the selected absolute estimates large on average, and the sign of the reported estimate is the sign of the noise. If true effects are nonzero, selection still tends to favor estimates whose errors point away from zero. The size of the bias depends on the true effect, the standard error, and the selection rule.

Selecting the Largest Marker

Thresholding is not the only selection mechanism. If a researcher ranks many genes and reports the largest estimated fold change, the winner is selected partly because it had a favorable estimation error. Even if every gene has the same true effect, the maximum estimate will generally exceed that common effect.

For a simple calculation, suppose \(m\) genes have the same true effect \(\beta\), independent estimates, and the same known standard error \(s\), with \(\hat{\beta}_g=\beta+sZ_g\) and independent \(Z_g\sim N(0,1)\). Then the largest estimate has expectation

$$ E\left(\max_{1\leq g\leq m}\hat{\beta}_g\right) =\beta+sE\left(\max_{1\leq g\leq m}Z_g\right). $$

The expected maximum standardized error is positive when \(m>1\). Its value grows with the number of candidates. In a real marker analysis, genes may have different standard errors, different true effects, and correlated estimates; this simple expression then does not give the exact bias. It still shows why ranking and reporting only the winner is not equivalent to reporting a gene specified before observing the data.

Worked Example: The Largest of Five Noisy Estimates

Consider five hypothetical genes with true log2 fold change zero and standard error \(0.20\) for each. Suppose their observed estimates are \(0.08,-0.12,0.31,0.04,-0.05\). The selected gene is the third, with the largest estimate, \(0.31\) log2-fold units; its estimated expression ratio is \(2^{0.31}\approx1.24\).

Under the simplifying model of five independent, equally variable normal estimates, the expected maximum of five standard normal variables is about \(1.163\). Therefore the expected largest estimate under this all-null example is

$$ 0+0.20(1.163)=0.233 $$

log2-fold units, corresponding to a ratio of \(2^{0.233}\approx1.18\). The observed winner, \(0.31\), is above that expected maximum, but the comparison does not estimate its true effect. It illustrates that a positive maximum is expected even when all five true effects are zero. Dependence between genes or unequal standard errors would change the relevant maximum distribution.

Effect-Size Correction Is Not Test Validation

A correction to an estimated magnitude and a valid hypothesis test answer different questions. Shrinkage can pull noisy estimates toward a reference value, often zero, reducing the expected exaggeration of selected effects under a suitable model. It does not, by itself, produce a p-value with its advertised null distribution after selection, nor does it automatically give a confidence interval with its advertised coverage for selected genes.

For example, under a normal sampling model \(\hat{\beta}_g\mid\beta_g\sim N(\beta_g,s_g^2)\) and a normal prior \(\beta_g\sim N(0,\tau^2)\), the posterior mean is a shrinkage estimate:

$$ E(\beta_g\mid\hat{\beta}_g) =\frac{\tau^2}{\tau^2+s_g^2}\hat{\beta}_g. $$

This formula relies on the stated prior and sampling model; in practice, \(\tau\) must be chosen or estimated. Shrinkage is a model-based effect estimate, not a universal subtraction from every selected log fold change. A valid test must separately account for how the gene was chosen, or use data and a design that make the test independent of that selection. The earlier material on selective inference and independent validation addresses those testing strategies.

Worked Example: Shrinking an Estimate Does Not Validate Its Test

Suppose a hypothetical selected marker has estimated log2 fold change \(\hat{\beta}_g=0.80\) with standard error \(s_g=0.20\). For illustration, use the normal prior above with \(\tau=0.30\). The shrinkage factor is

$$ \frac{\tau^2}{\tau^2+s_g^2} =\frac{0.30^2}{0.30^2+0.20^2} =\frac{0.09}{0.13} \approx0.6923. $$

The posterior mean is \(0.6923(0.80)\approx0.554\) log2-fold units, corresponding to an estimated ratio of \(2^{0.554}\approx1.47\). This is smaller than the unshrunk estimate, whose ratio is \(2^{0.80}\approx1.74\).

If one instead tests the unadjusted estimate against zero using a standard normal statistic, \(z=0.80/0.20=4.00\), giving a two-sided normal-reference p-value of about \(0.0000633\). That calculation describes a fixed, prespecified test under its null assumptions. If the same data were searched to select this marker, the unadjusted p-value does not account for that search. Replacing \(0.80\) by the shrunken value \(0.554\) does not repair the p-value’s selection problem; the estimate correction and the test calibration are distinct operations.

Diagnostics, Comparisons, and Limitations

The selection rule should be made explicit before interpreting a reported magnitude. Ask whether genes were chosen by a fold-change cutoff, a test statistic, a ranking, or a combination of expression filtering and statistical criteria. Also establish whether the estimate and selection used the same cells and measurements. When they did, an unqualified statement that the selected estimate is the marker’s expected effect is generally too strong.

Useful checks include comparing selected estimates with estimates from an independent dataset, examining how reported magnitudes change under a prespecified split of the data, and reporting both the selection criterion and the effect-size estimator. Large changes across independent samples or splits are consistent with substantial sampling variability, though they do not alone diagnose its cause. Dependence among genes, unequal standard errors, sparse counts, and uncertain normalization can all make simple normal calculations poor quantitative approximations.

The main approaches have different targets and assumptions:

ApproachWhat it addressesImportant limitation
Unadjusted selected estimateDescribes the observed contrast in the data used for selectionTypically exaggerates magnitude when chosen for being large
Shrinkage estimateReduces noisy effect estimates under a specified modelDoes not automatically calibrate a post-selection test or interval
Selective inferenceConditions inference on a specified selection eventRequires a correctly represented selection procedure and model
Independent validationEstimates or tests effects using data not used to select the markersNeeds suitable independent data and may have lower precision

No single correction is uniformly best. Shrinkage depends on the model for effects and estimation uncertainty. Selective inference depends on describing the selection event adequately. Independent validation avoids reusing the same random fluctuation for selection and evaluation, but a validation dataset can still be small or differ from the discovery population. In all cases, the reported log fold change should be tied to its group contrast, normalization, and units.

Common Pitfall

Wrong reasoning: “The marker passed a stringent significance threshold, so its estimated fold change is an unbiased measure of how strongly it distinguishes the clusters.” A small p-value and a large estimated effect do not make the selection-dependent magnitude unbiased. A test statistic can be large because the estimate is large, because its standard error is small, or both; choosing genes based on the result affects what can be inferred from the same data.

Correction: Report the estimate as an observed, selected effect unless a justified correction or independent estimate is used. State how markers were selected, distinguish the effect-size procedure from the testing procedure, and avoid interpreting a shrinkage estimate as proof that the p-value or interval has been selection-adjusted.

Key takeaway: Selecting genes for large estimated log fold changes preferentially selects positive estimation errors in the reported direction. Shrinkage can address magnitude exaggeration under a model, but valid post-selection testing requires its own justification.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. A gene with true log2 fold change zero and standard error \(0.25\) is reported only when its estimate exceeds \(0.50\). What is \(a\), and what is the expected selected estimation error using the normal model?
  2. Why is the maximum of several unbiased gene estimates generally not an unbiased estimate of the common true effect?
  3. In one sentence, distinguish what shrinkage can address from what it does not automatically address.
  4. A marker is selected in one dataset and has an estimated log2 fold change of \(0.40\) in an independent dataset. Why is the second estimate useful, and what does independence not guarantee?

Solutions. (1) \(a=(0.50-0)/0.25=2\). The expected selected error is \(0.25\phi(2)/(1-\Phi(2))\approx0.25(2.373)=0.593\) log2-fold units. (2) Taking a maximum favors genes with unusually positive estimation errors, so the selected maximum has a positive expected error when the candidates share the same true effect. (3) Shrinkage can reduce magnitude exaggeration under a specified model; it does not automatically calibrate a test or interval after selection. (4) The independent estimate is not reusing the same random fluctuation that selected the marker, making it useful for evaluating the effect in new data; independence does not ensure adequate precision or identical biological conditions.

Clinical Biostats