Tutorials › Statistical Genetics › Diagnostics and Sensitivity Analysis for Enrichment Results

Gene Prioritization and Pathway Tests · Tutorial 693 of 989

Diagnostics and Sensitivity Analysis for Enrichment Results

Use coordinated diagnostics and sensitivity checks to distinguish stable pathway evidence from results driven by gene properties, mapping choices, or fragile definitions.

Advanced 13 min read

What You'll Learn

  • Read gene-level score plots to locate concentration, outliers, and missing coverage within a pathway
  • Compare raw enrichment with analyses that adjust or match for gene size
  • Recompute gene scores under defensible alternative gene boundaries
  • Assess sensitivity to changes in pathway membership and gene-set definitions
  • Distinguish robustness checks from choosing the most favorable result
  • Check whether the null procedure is calibrated for the analysis being reported

Why Enrichment Results Need Diagnostics

A pathway-level result compresses information from many genes into a statistic and a p-value. That summary can conceal important differences: evidence may be spread across a set, concentrated in one gene, associated with gene size, or dependent on how variants were assigned to genes. A small p-value from one analysis therefore does not, by itself, show that the result is robust to reasonable analytic choices.

Diagnostics and sensitivity analysis examine those choices while keeping the scientific question visible. They do not replace a valid enrichment test, and they do not establish a biological mechanism. Their purpose is to show what contributes to the result, whether plausible alternatives materially change it, and whether the null procedure is appropriate for the data and design.

Definition: A diagnostic is a check on a feature that may affect an enrichment analysis, such as score concentration, gene-size dependence, or null calibration. A sensitivity analysis repeats the analysis after changing a defensible analytic choice, such as a gene boundary or gene-set definition, and compares the resulting estimates and evidence. A result is fragile when modest, scientifically reasonable changes materially alter its interpretation.

Inspect the Gene-Level Evidence

Let \(T_g\) denote the gene-level score for gene \(g\), with larger values representing stronger evidence under the chosen scoring scheme. The exact scale matters: a signed score retains direction, whereas a nonnegative score such as \(-\log_{10}(p_g)\) measures strength without retaining direction. A score plot should label its scale and show the genes in the set, rather than displaying only a pathway summary.

Useful plots show the gene scores in pathway order or as a ranked dot plot, with gene labels for the strongest contributors. If available, display scores for the full analysis universe in the same way or provide a reference distribution. Mark genes with missing scores separately: absence of an annotated or measurable score is not evidence of no association. A plot can reveal whether the result is broadly supported, whether a few genes dominate, and whether the pathway contains unusually large or well-covered genes.

A simple descriptive check is to calculate the pathway mean score and the mean after omitting each gene in turn. If \(A\) is a gene set with \(m\) genes, then \( \bar{T}_A = \frac{1}{m}\sum_{g\in A}T_g \). The leave-one-out value for gene \(j\) is \( \bar{T}_{A,-j} = \frac{m\bar{T}_A-T_j}{m-1} \). This identity follows by subtracting \(T_j\) from the sum of the \(m\) scores, leaving \(m\bar{T}_A-T_j\), and dividing by the \(m-1\) remaining genes. It is a diagnostic of concentration, not a replacement p-value: genes may be correlated, and removing a gene changes the set being tested.

Worked Example: Detecting a Dominant Gene

Suppose a hypothetical pathway contains five genes with gene scores \(T_g=-\log_{10}(p_g)\) equal to 8, 7, 1, 1, and 0. The pathway statistic for this diagnostic is the mean score.

Full-set mean. The sum is \(8+7+1+1+0=17\), so \( \bar{T}_A=17/5=3.4 \).

Omit the top-scoring gene. The remaining scores sum to \(17-8=9\), giving \(9/4=2.25\). The decrease is \(3.4-2.25=1.15\) score units.

Omit the second-highest gene. The remaining sum is \(17-7=10\), giving \(10/4=2.50\).

The mean drops noticeably when either leading gene is removed, so the set-level summary is concentrated in a small part of the pathway. This does not show that the genes are unimportant or that the enrichment test is invalid. It does show that a broad interpretation involving all five genes would not be supported by this score pattern alone. A valid pathway p-value must still come from the specified enrichment null, with dependence and other design features handled appropriately.

Check Dependence on Gene Size

Gene size can influence gene-level evidence because genes with more variants or greater genomic span may have more opportunities to produce an extreme statistic. Functional annotation coverage and linkage disequilibrium can also affect scores. Earlier material on gene-size bias and covariate-adjusted enrichment establishes why these properties may matter; here, the diagnostic question is whether the pathway conclusion changes after the relevant property is handled.

Compare the unadjusted result with a size-adjusted analysis using the same gene universe and a clearly stated adjustment. For example, one may compare pathway and non-pathway scores after fitting a prespecified model that includes a measure such as log variant count, or compare genes within size-matched strata. The adjustment must be appropriate to the score and the sampling or permutation design. A regression coefficient or residual is not automatically a calibrated enrichment p-value; inference still requires a valid standard error or null procedure that respects gene-score dependence and the analysis design.

Inspect overlap as well as the adjusted estimate. If pathway genes occupy a size range with few or no non-pathway genes, the data provide little basis for separating pathway membership from size. A model can still return a coefficient, but it may rely on extrapolation. Report that limitation rather than treating adjustment as a guarantee that bias has been removed.

Worked Example: Comparing Raw and Size-Adjusted Scores

Consider a hypothetical gene universe with a size measure \(x\), representing log variant count, and a gene score \(T_g\). Four genes belong to pathway \(A\), and five are outside it.

GenePathway member?\(x\)\(T_g\)
G1Yes02
G2Yes26
G3Yes38
G4Yes38
C1No01
C2No13
C3No13
C4No25
C5No37

Raw comparison. The pathway mean is \((2+6+8+8)/4=24/4=6\). The non-pathway mean is \((1+3+3+5+7)/5=19/5=3.8\). The raw difference is \(6-3.8=2.2\) score units.

Adjusted comparison. For illustration, fit the prespecified linear model \(T_g=\beta_0+\beta_1x_g+\beta_A I(g\in A)+\epsilon_g\), where \(I(g\in A)\) equals 1 for a pathway member and 0 otherwise. In this hypothetical data, every score satisfies \(T_g=1+2x_g+I(g\in A)\). For example, G2 has \(1+2(2)+1=6\), and C4 has \(1+2(2)+0=5\). Thus the fitted coefficients are \(\hat{\beta}_0=1\), \(\hat{\beta}_1=2\), and \(\hat{\beta}_A=1\). The pathway difference conditional on \(x\) is 1 score unit, smaller than the raw difference of 2.2.

This comparison indicates that the raw contrast partly reflects the different size distribution: pathway genes have mean \(x=(0+2+3+3)/4=2\), while non-pathway genes have mean \(x=(0+1+1+2+3)/5=1.4\). The example demonstrates a diagnostic contrast, not a universal correction. In an actual analysis, model form, overlap, residual dependence, and a valid inferential procedure must all be assessed.

Vary Gene Boundaries and Gene-Set Definitions

A gene score can depend on which variants are assigned to that gene. Alternative defensible boundaries might use the annotated gene body alone or extend it by a prespecified upstream or downstream window. If the variant-to-gene mapping changes, recompute gene scores using the same score construction and then rerun the pathway analysis. Merely changing labels while keeping scores fixed does not evaluate boundary sensitivity when the score itself depends on variant assignment.

Pathway membership also depends on the chosen gene-set definition. Relevant alternatives may include a different ontology release, a documented evidence tier, or a prespecified rule for including parent and child terms. Compare these definitions transparently: give the set size, shared and changed members, the gene-level scores of changed members, and the resulting pathway statistic and uncertainty or p-value. Keep the gene universe consistent where possible; if it changes, report that too, since the universe affects the interpretation and calibration of competitive tests.

A useful comparison separates changes in scores from changes in membership. First hold the set definition fixed and recompute scores under alternative boundaries. Then, where appropriate, hold the score pipeline fixed and vary the set definition. This helps identify whether sensitivity arises from variant-to-gene mapping, pathway annotation, or both. The alternatives should be scientifically defensible and described, not selected because they produce the smallest p-value.

Worked Example: Boundary and Membership Sensitivity

Suppose a hypothetical pathway initially contains genes G1, G2, and G3. Under boundary rule A their gene scores are 7, 5, and 1. Under a defensible alternative boundary rule B, the scores are 4, 5, and 1. The diagnostic pathway statistic is the mean score.

Under rule A, the mean is \((7+5+1)/3=13/3=4.333\). Under rule B, it is \((4+5+1)/3=10/3=3.333\). The decrease is exactly 1 score unit, reflecting the change in G1's score from 7 to 4 while the other two scores remain fixed.

Now keep boundary rule B fixed but consider an alternative gene-set definition that adds G4 and G5, with scores 2 and 0. The new mean is \((4+5+1+2+0)/5=12/5=2.4\). This change combines two additions to the set, so it should not be described as a boundary effect.

For illustration, suppose the same valid, dependence-aware null procedure uses 999 resamples for each analysis. If 12 resampled statistics equal or exceed the observed statistic under boundary A, the empirical p-value is \((12+1)/(999+1)=13/1000=0.013\). If the corresponding exceedance counts are 48 under boundary B and 83 under the five-gene definition, the p-values are \(49/1000=0.049\) and \(84/1000=0.084\), respectively. These hypothetical results show that both the observed mean and the null-relative evidence change. They do not establish that one definition is correct; interpretation should reflect the prespecified primary definition and the range of reasonable alternatives.

Assess Calibration and Report Robustness

Sensitivity and calibration answer related but different questions. Sensitivity asks whether a finding changes under reasonable analytic choices. Calibration asks whether the inferential procedure produces appropriate error rates under its null. For a continuous exact null p-value, the p-value is uniform on 0 to 1 under the null; discrete procedures may instead be conservative. In pathway analyses, dependence among genes and overlap among sets mean that many reported pathway p-values are not independent. A collection of small p-values therefore cannot be interpreted as though each pathway were an unrelated test.

Calibration checks should use a null procedure that reflects the actual analysis, including relevant gene-score dependence, gene properties, and any design restrictions. Where appropriate, inspect the empirical distribution of null statistics or p-values across repeated null data sets, and compare observed tail rates with the rates expected under the stated null. A permutation scheme that breaks linkage disequilibrium or ignores size-related structure may generate an unsuitable reference distribution even if it produces many resamples. Earlier material on permutation nulls and LD-aware analysis describes these design concerns; the diagnostic task is to verify that the chosen null matches the present analysis.

Summarize robustness with a compact comparison: primary definition, boundary alternatives, set-definition alternatives, size-adjusted analysis, and the relevant statistic and p-value for each. Also report set size, the universe, the score scale, and notable gene-level contributors. A pathway that remains directionally and materially similar across credible choices is more robust to those choices, but this is not proof of causation or of biological function. A result that changes substantially should be described as sensitive, with the source of sensitivity made explicit.

1
Plot and summarize gene scores.
Show the scale, coverage, leading genes, and whether the pathway signal is distributed or concentrated.
2
Check relevant gene properties.
Compare raw results with a justified size- or coverage-adjusted analysis, and inspect overlap before interpreting the adjustment.
3
Recompute under alternatives.
Change gene boundaries and gene-set definitions separately where possible, rerunning the full affected scoring and testing steps.
4
Evaluate inference and report the range.
Use a null procedure that respects the analysis structure, then report both stable features and choices that materially change the result.

Common Mistake: Treating the Best Result as the Robust Result

A common mistake is to try several gene boundaries, ontology releases, and adjustment models, then report only the version with the smallest p-value as evidence that the pathway is enriched. This reasoning confuses a favorable result among many choices with stability across choices. Searching over alternatives can increase false-positive risk, and the alternatives may not be independent.

The correction is to identify a primary analysis on scientific grounds, state which alternatives were examined, and compare the full set of results. Sensitivity checks are evidence about dependence on assumptions; they are not a menu from which to select the most attractive answer. If alternatives were explored extensively, that exploration should be disclosed and the inferential claims should account for the selection process or be treated as exploratory.

Key takeaway: A credible enrichment interpretation combines a valid null-based test with visible gene-level evidence and checks of size dependence, mapping boundaries, and set definitions. Robustness is not the smallest p-value; it is the degree to which the substantive conclusion survives reasonable, transparently reported choices.

Check Your Understanding

Use these questions to test whether you can distinguish a pathway summary from the diagnostics needed to interpret it.

  1. A pathway mean is high, but omitting its top-scoring gene reduces the mean by half. What does this say about concentration, and what does it not establish?
  2. Why can a size-adjusted pathway coefficient be difficult to interpret when pathway and non-pathway genes have little overlap in size?
  3. If changing a gene boundary changes variant assignments, which parts of the analysis should be recomputed to assess sensitivity?
  4. Why should pathway membership alternatives be selected and reported transparently rather than chosen according to their p-values?
  5. What is the difference between checking sensitivity to analysis choices and checking calibration of the null procedure?
Clinical Biostats