Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Validating Markers In An Independent Dataset

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

Validating Markers In An Independent Dataset

Learn to design an independent marker validation that tests fixed gene and cluster claims without selecting candidates from the validation data.

Advanced 13 min read

What You'll Learn

  • Distinguish independent-dataset validation from reuse of discovery cells or samples.
  • Prespecify cluster correspondence, gene, contrast, effect scale, and test direction.
  • Form donor-level expression contrasts and state the assumptions for inference.
  • Calculate a paired t test, confidence interval, and contextual interpretation.
  • Diagnose mapping errors, pseudoreplication, and post hoc candidate selection.
  • Compare independent validation with sample splitting and selective-inference approaches.

Why Validate Markers in a Separate Dataset?

A marker discovered in a dataset may appear strongly different between clusters partly because the same expression values helped define those clusters. Testing that difference as if the clusters had been fixed in advance can understate uncertainty. An independent dataset offers another route: use the discovery data to choose a marker claim, then test that claim in data that played no role in choosing it.

Independence alone is not enough. A validation analysis must also specify what will be tested before examining validation expression: the gene, the cluster correspondence, the contrast, the effect scale, and the testing procedure. If the investigator searches validation results for the most favorable genes or cluster labels and reports only those, the validation data have become discovery data too.

Definition: An independent-data marker validation evaluates a marker claim selected using discovery data in a separate dataset whose expression measurements were not used to select the candidate, define the validation contrast, or tune the validation analysis. The claim must be expressed as a prespecified gene and contrast between clusters with a prespecified correspondence to the discovery clusters.

For example, a claim might be: “Gene G has higher mean log2 normalized expression in the population corresponding to discovery cluster A than in the population corresponding to discovery cluster B.” This is more specific than “Gene G is a marker.” It states the gene, the comparison, and the expected direction. A two-sided test can assess any difference; a one-sided test is appropriate only when the direction was chosen in advance and a difference in the opposite direction would not count as support.

Designing the Validation Before Looking at Expression

First define how cells in the validation dataset will be assigned to the populations being compared. A prespecified reference-based label transfer rule or a classifier fitted on discovery data can be applied without refitting it to maximize the validation contrast. The correspondence between discovery labels and validation labels must also be fixed using information other than the expression values for the gene being tested. Otherwise, choosing the mapping that makes the candidate look strongest is another form of selection.

Next specify the gene-level outcome and the biological unit of replication. In a typical design, cells from each biological sample are aggregated within each assigned cluster to form a pseudobulk expression summary. Let \(Y_{igA}\) and \(Y_{igB}\) denote the summaries for gene \(g\) from donor \(i\) in the populations corresponding to clusters A and B. A paired donor contrast is \(D_{ig}=Y_{igA}-Y_{igB}\). If the summaries are on a log2 scale, \(D_{ig}\) is a log2 expression difference; exponentiating it gives the corresponding ratio of expression summaries.

Cells from the same donor are not independent biological replicates. Treating hundreds of cells from a few donors as hundreds of independent observations generally makes standard errors too small. The analysis should reflect the sampling design, commonly by using donor-level pseudobulk summaries or an appropriate model that accounts for donor dependence. The examples below use donor-level contrasts so that the unit of analysis is explicit.

Prespecification checklist: Record (1) the candidate gene or candidate list, (2) the fixed cluster correspondence and assignment rule, (3) the contrast and its direction, (4) the expression scale and donor-level unit, and (5) the inferential procedure and any multiplicity adjustment. Do not change these choices after seeing which validation results are favorable.

Paired Inference for a Prespecified Contrast

For paired donors, suppose \(D_{ig}\) is the validation contrast for donor \(i\), and there are \(n\) independent donors with both cluster summaries available. The target is the population mean donor-level contrast \(\mu_D\). A one-sample t procedure assumes the donor contrasts are independent and identically distributed, and normally distributed when an exact small-sample t reference distribution is required. With a sufficiently large number of donors, approximate inference may be reasonable under less restrictive distributions, but strong skewness or influential donors still require attention.

For the two-sided null hypothesis \(H_0:\mu_D=0\) against \(H_a:\mu_D\ne0\), calculate the sample mean \(\bar{D}\), sample standard deviation \(s_D\), and standard error \(SE=s_D/\sqrt{n}\). Under the stated assumptions, the statistic has a t distribution with \(df=n-1\) when \(H_0\) holds. A confidence interval for the mean contrast is \(\bar{D}\) plus or minus the appropriate t critical value times \(SE\).

$$ t=\frac{\bar{D}-0}{s_D/\sqrt{n}}, \qquad df=n-1 $$
$$ \bar{D}\ \pm\ t_{1-\alpha/2,\,n-1}\frac{s_D}{\sqrt{n}} $$

The p-value is the probability, under \(H_0\) and the model assumptions, of obtaining a t statistic at least as extreme in absolute value as the observed statistic. It is not the probability that \(H_0\) is true. The confidence interval describes values of the population mean contrast compatible with the data and model at the stated confidence level; it is not a probability statement about the fixed parameter.

Worked Example: Testing a Prespecified Marker in Six Donors

Suppose discovery data selected Gene G as a candidate expected to be higher in cluster A than cluster B. In a separate dataset, six independent donors have both populations represented. The label correspondence and the A-minus-B contrast were fixed before the gene’s validation expression was examined. The donor-level log2 expression differences are 0.4, 0.6, 0.5, 0.7, 0.3, and 0.5.

The paired t assumptions are that the six donor contrasts are independent and arise from a common approximately normal distribution. Assume the donor, rather than the cell, is the independent sampling unit, and that the pseudobulk summaries were calculated consistently. The mean contrast is \(\bar{D}=(0.4+0.6+0.5+0.7+0.3+0.5)/6=3.0/6=0.500\) log2 units.

The squared deviations from 0.500 sum to \(0.01+0.01+0+0.04+0.04+0=0.100\). Thus \(s_D=\sqrt{0.100/(6-1)}=\sqrt{0.020}=0.1414\) log2 units, and \(SE=0.1414/\sqrt{6}=0.05774\) log2 units. The test statistic is \(t=0.500/0.05774=8.660\), with \(df=5\). The two-sided p-value is approximately 0.00034.

At the 95% confidence level, \(t_{0.975,5}=2.571\), so the interval is \(0.500\pm2.571(0.05774)=0.500\pm0.1484\), or approximately (0.352, 0.648) log2 units. This provides evidence of a positive mean validation contrast for Gene G in the specified populations. It does not establish that the gene causes cluster identity, nor does it show that every donor has a positive contrast.

Derivation and Interpretation of the Test

The t statistic follows by standardizing the sample mean contrast. Under the paired model, \(D_{ig}\) has mean \(\mu_D\) and variance \(\sigma_D^2\). If the contrasts are normally distributed, then \((\bar{D}-\mu_D)/(\sigma_D/\sqrt{n})\) is standard normal. Replacing the unknown \(\sigma_D\) with the sample standard deviation \(s_D\) adds uncertainty. Under normal sampling, \((n-1)s_D^2/\sigma_D^2\) has a chi-squared distribution with \(n-1\) degrees of freedom and is independent of the standardized mean. Their ratio therefore has a t distribution with \(n-1\) degrees of freedom. Under \(H_0:\mu_D=0\), this ratio is exactly the statistic used above.

The argument depends on the prespecified contrast and valid independent donor observations. It does not correct a wrong cluster mapping, a biased assignment rule, missingness related to expression, or a contrast selected after inspecting validation results. The inferential calculation cannot repair an invalid design.

Worked Example: A Validation Result That Is Inconclusive

A second candidate was also fixed in advance, with the same A-minus-B contrast and log2 scale. In a separate validation dataset, five independent donors have contrasts 0.2, -0.1, 0.3, 0.0, and -0.2. Assume paired observations, no donor overlap with discovery, and approximately normal independent donor contrasts.

The mean is \(\bar{D}=(0.2-0.1+0.3+0.0-0.2)/5=0.200/5=0.0400\) log2 units. The squared deviations from 0.0400 sum to 0.172, so \(s_D=\sqrt{0.172/4}=0.2074\) and \(SE=0.2074/\sqrt{5}=0.09275\). Therefore \(t=0.0400/0.09275=0.431\), with \(df=4\); the two-sided p-value is approximately 0.689.

Using \(t_{0.975,4}=2.776\), the 95% confidence interval is \(0.0400\pm2.776(0.09275)=0.0400\pm0.2575\), or (-0.218, 0.298) log2 units. The result does not provide clear evidence of a nonzero mean contrast, but it also does not establish that the contrast is zero. The interval includes both modest negative and positive effects, reflecting substantial uncertainty with only five donors.

Mapping, Multiplicity, and Failure Modes

A validation contrast only answers the intended question if the validation populations correspond to the intended discovery clusters. If the labels are reversed, the sign of the contrast reverses. If cells are assigned using the candidate gene’s validation expression and that assignment is then used to test the same gene, the analysis has reintroduced circularity. Freeze the assignment procedure and correspondence independently of the tested expression, and report how many donors contribute observations to each side of the contrast.

When several genes are prespecified, testing each at level \(\alpha\) does not keep the probability of at least one false positive among the whole list at \(\alpha\). The analysis must account for the declared family of tests, for example with a familywise-error or false-discovery-rate procedure appropriate to the inferential goal. Reporting only the genes that passed, while hiding the rest of the prespecified list, makes the validation appear stronger than it is. If only one candidate and one contrast were genuinely prespecified, the single-test p-value addresses that test; it does not license unplanned searches over alternative contrasts.

Useful diagnostics include inspecting donor-level contrasts, checking for influential donors, verifying that each donor has adequate representation in both populations, and confirming that the cluster assignment rule was applied as specified. Large between-donor differences, an outlying donor that drives the mean, or a striking imbalance in cell counts may make a simple t analysis questionable. With few donors, distributional assumptions are difficult to assess from a plot; sensitivity analyses and transparent uncertainty are preferable to treating cell counts as a substitute for biological replication.

Worked Example: Harmonizing a Prespecified Cluster Correspondence

Suppose the discovery analysis calls two populations A and B, while a frozen validation classifier calls its corresponding populations V1 and V2. Before examining Gene H in the validation data, an external reference-based rule specifies that A corresponds to V2 and B corresponds to V1. The planned contrast is therefore V2 minus V1, not V1 minus V2.

For four independent paired donors, the prespecified Gene H contrasts on the log2 scale are 0.3, 0.2, 0.4, and 0.1. The mean is \(\bar{D}=1.0/4=0.250\). Deviations from the mean are 0.05, -0.05, 0.15, and -0.15; their squared values sum to 0.050. Thus \(s_D=\sqrt{0.050/3}=0.1291\), \(SE=0.1291/\sqrt{4}=0.06455\), and \(t=0.250/0.06455=3.873\) with \(df=3\). The two-sided p-value is approximately 0.0305.

The 95% confidence interval uses \(t_{0.975,3}=3.182\): \(0.250\pm3.182(0.06455)=0.250\pm0.2054\), giving (0.0446, 0.455) log2 units. This supports a positive mean contrast in the prespecified A-corresponding population. Reversing the mapping after seeing the expression values would not be a harmless relabeling: it would change the tested claim and make the analysis data-adaptive.

How Independent Validation Differs From Other Approaches

Independent-dataset validation and sample splitting both separate selection from testing, but they do so differently. Sample splitting reserves part of one study for testing and may reduce the sample size available for both stages. Independent validation uses a separate cohort, which can provide a stronger check of reproducibility across samples, but it requires compatible assays, populations, and cluster definitions. The earlier material on sample splitting addresses the separate discovery and testing portions of a single dataset.

Holding out genes used for clustering can reduce direct reuse of the tested gene’s expression in forming clusters, but it does not by itself establish replication in a new cohort. Conversely, an independent cohort does not remove every source of bias: candidate choice, outcome definition, and reporting decisions still need to be controlled. Selective-inference methods address a different problem by adjusting inference for selection using the same data; they are not a substitute for a correctly designed external validation.

Independent validation has limits. Different sequencing protocols, sample handling, cell composition, or disease mix can change measured expression or the populations represented. A failure to replicate may reflect low power or a genuine lack of transportability, not necessarily a false discovery in every setting. A positive result supports the specific gene, contrast, and target population tested; it does not automatically validate all markers, all cluster comparisons, or a causal interpretation.

Common Mistake

Common mistake: “The validation cohort is independent, so I can inspect all its genes, choose the strongest one, and report an ordinary p-value as confirmation.”

Correction: Independence protects a fixed claim from selection based on validation expression; it does not protect a claim chosen by searching validation results. Freeze the candidate list, cluster correspondence, contrast, and testing plan before examining the relevant validation expression, and account for multiplicity when testing several candidates.

A second frequent error is to count cells as independent replicates when cells are nested within a small number of donors. The number of cells can improve the precision of a donor’s expression summary, but it does not create additional independent donors. Inference should match the biological sampling unit and the study design.

Check Your Understanding

Answer each question using the specified validation design. Brief solutions follow.

  1. A marker was selected in discovery data. What must be fixed before its independent validation expression is examined?
  2. Why is a study with 1,000 cells from two donors not automatically a study with 1,000 independent replicates for a donor-level marker contrast?
  3. For paired donor contrasts, \(n=9\), \(\bar{D}=0.30\), and \(s_D=0.45\) log2 units. Calculate the standard error and t statistic for testing a zero mean contrast.
  4. Why can reversing the validation cluster correspondence after inspecting the candidate gene invalidate the confirmatory interpretation?

Solutions. (1) Fix the candidate gene or list, cluster assignment rule and correspondence, contrast and direction, effect scale, biological replication unit, and inferential procedure, including multiplicity handling where needed. (2) Cells from the same donor share biological and technical influences, so they are clustered observations rather than independent donor-level replicates; treating them as independent can understate uncertainty. (3) \(SE=0.45/\sqrt{9}=0.150\) log2 units, and \(t=0.30/0.150=2.00\), with \(df=8\). (4) Choosing the mapping that produces the more favorable contrast uses validation expression to select the claim; the resulting ordinary test no longer evaluates a fixed, independent hypothesis.

Clinical Biostats