Tutorials › High-Dimensional Genomic Data Analysis › Competitive Gene-Set Tests and Their Null Hypothesis

Gene Set and Pathway Enrichment · Tutorial 467 of 795

Competitive Gene-Set Tests and Their Null Hypothesis

Learn to state and interpret the competitive null, compare pathway genes with the measured-gene background, and recognize what a competitive result does—and does not—establish.

Intermediate 10 min read

What You'll Learn

  • Define the tested-gene universe and the pathway-versus-background comparison.
  • State a distributional competitive null and a mean-difference version of that null.
  • Distinguish pathway enrichment from the claim that no pathway genes are affected.
  • Work through continuous-score and threshold-based competitive comparisons.
  • Identify assumptions, diagnostics, and limits of interpreting competitive results.

What Does “Competitive” Mean?

A pathway can appear important because its genes show evidence of a condition effect. But a competitive test asks a more specific question: do genes in this pathway show stronger or more frequent evidence of an effect than genes outside it? The reference is the measured transcriptome, not a hypothetical world in which no gene responds.

This distinction matters when many genes respond to a condition. A pathway may contain genes with clear changes and still fail to stand out if genes elsewhere in the measured transcriptome show changes of similar magnitude. Conversely, a pathway can be enriched relative to the background even when most of its genes show little evidence of change.

Definition: Let \(U\) be the tested-gene universe, the genes measured and eligible for the analysis, and let \(S\subset U\) be a pathway or gene set. A competitive gene-set test compares a gene-level measure of association or change among genes in \(S\) with the corresponding measure among genes in \(U\setminus S\). Its competitive null hypothesis is that the distribution of that measure is the same in the pathway and in the rest of the tested-gene universe. A competitive alternative says that the pathway genes tend to show stronger or more frequent evidence of association, in a specified direction if the test is directional.

The measure being compared depends on the analysis. It may be a signed statistic, such as a gene-level statistic that increases for up-regulation and decreases for down-regulation; an unsigned measure, such as an absolute statistic; or a binary indicator that marks genes passing a selection threshold. A test sensitive to positive signed values addresses a different alternative from one sensitive to large absolute values in either direction.

The tested-gene universe is essential to the interpretation. Genes that were not measured or were excluded from testing are not automatically appropriate background genes. As established in the earlier material on defining gene sets and the tested-gene universe, both the set and its background must correspond to the actual analysis.

State the Null Before Choosing a Statistic

Write \(T_i\) for the gene-level measure for gene \(i\). One general form of the competitive null is equality of the distributions of \(T_i\) for pathway and non-pathway genes:

$$ H_0: F_S(t)=F_{U\setminus S}(t)\ \text{for all }t $$

Here, \(F_S\) and \(F_{U\setminus S}\) are the distributions of \(T_i\) among the genes in the pathway and outside it. For a test based on mean gene-level measures, a narrower null is

$$ H_0: E(T_i\mid i\in S)=E(T_i\mid i\in U\setminus S). $$

Equality of means is not, in general, equality of distributions. A mean-based test can miss differences in variability or shape, while a test based on ranks, tails, or a threshold can respond to other features. Therefore, the test statistic and alternative should match the scientific question. A one-sided test might target a larger mean signed statistic in the pathway; a two-sided test might target a difference in either direction. An unsigned statistic can target stronger effects in either direction, but it cannot by itself establish that the pathway changes predominantly upward or downward.

The competitive null does not say that every pathway gene has no condition effect. It also does not say that no genes outside the pathway have an effect. It states that the selected pathway does not differ from the rest of the tested genes according to the specified comparison. A separate type of gene-set question concerns whether there is evidence of any effect within the set; that is not the comparison defined here.

A Mean-Comparison Justification

A simple model shows why a difference between pathway and background means is a natural competitive statistic. Suppose, for illustration, that the gene-level measures in the pathway and outside it are independent observations with a common variance \(\sigma_T^2\), and that their means are \(\mu_S\) and \(\mu_{U\setminus S}\). Let \(n_S\) and \(n_{U\setminus S}\) denote the numbers of genes in the two groups. Under the mean null, the expected difference in sample means is zero:

$$ E(\bar{T}_S-\bar{T}_{U\setminus S}) =\mu_S-\mu_{U\setminus S}=0. $$

Independence makes the variance of a difference the sum of the variances. Because the variance of a sample mean of \(n\) independent observations is \(\sigma_T^2/n\), the variance of the difference is

$$ \operatorname{Var}(\bar{T}_S-\bar{T}_{U\setminus S}) =\frac{\sigma_T^2}{n_S}+\frac{\sigma_T^2}{n_{U\setminus S}}. $$

If a common variance is estimated by a pooled sample variance \(s_T^2\), the corresponding standard error is \(s_T\sqrt{1/n_S+1/n_{U\setminus S}}\). Dividing the observed difference by that standard error gives a standardized comparison. This justification depends on the stated sampling model. In expression data, gene-level measures need not be independent or identically distributed, so the calculation is a useful model-based illustration rather than a universal guarantee of valid inference. The earlier material on gene-set permutations and their limitations also motivates checking carefully what a proposed null-generating procedure holds fixed.

Worked Example: Comparing Mean Gene-Level Scores

Suppose a hypothetical analysis has 1,000 tested genes. A pathway contains 40 genes, and the other 960 genes form the background. For a signed gene-level score, the pathway mean is 1.10 and the background mean is 0.10. Assume for this illustrative calculation that the scores are independent and normally distributed with a common known standard deviation of 1.00.

The competitive comparison is the difference in means:

$$ \bar{T}_S-\bar{T}_{U\setminus S}=1.10-0.10=1.00. $$

Under the stated equal-mean null, the standard error of the difference is

$$ SE=1.00\sqrt{\frac{1}{40}+\frac{1}{960}} =1.00\sqrt{0.02604} \approx 0.1614. $$

Thus the standardized statistic is \(z=1.00/0.1614\approx 6.20\). Under the assumed normal model, this is strong evidence against equal means; the pathway’s average signed score is higher than the background’s. This supports a relative positive shift in this pathway, not the claim that every pathway gene is up-regulated. The independence and common-variance assumptions are simplifying assumptions for this example and would need justification for an actual analysis.

Threshold-Based Comparisons

A competitive comparison can also use a binary gene-level indicator. For example, define a gene as selected if it passes a prespecified differential-expression threshold, then compare the selected proportion in the pathway with that outside it. Under this formulation, the mean of the binary indicator is a proportion. The null is equal selection probabilities in the two groups, not an assertion that the unselected genes have exactly zero effect.

Worked Example: Comparing Selected-Gene Proportions

In a hypothetical tested universe of 1,000 genes, a pathway contains 100 genes. Of these, 35 pass the specified differential-expression threshold. Among the 900 genes outside the pathway, 165 pass it. Assume for this illustrative calculation that selection indicators are independent Bernoulli observations within and between the groups.

The pathway and background proportions are \(35/100=0.3500\) and \(165/900=0.1833\), respectively. Their observed difference is \(0.3500-0.1833=0.1667\), or 16.67 percentage points. Under the equal-proportions null, the pooled estimate is \(200/1000=0.2000\). The null standard error for the difference is

$$ SE=\sqrt{0.2000(1-0.2000) \left(\frac{1}{100}+\frac{1}{900}\right)} =\sqrt{0.001778} \approx 0.04216. $$

The standardized statistic is \(z=0.1667/0.04216\approx 3.95\). The two-sided standard-normal p-value is approximately 0.00008. Under the independence and normal-approximation assumptions, the data provide evidence that a larger proportion of pathway genes passed the threshold than of genes outside it. The conclusion is relative to this tested universe and this threshold; it does not show that all selected pathway genes share a direction or that unselected genes have no effect.

When Effects Are Widespread

A competitive null can hold even when a pathway has a substantial effect. If pathway genes and background genes shift to a similar degree, the comparison can show little difference. This is not a contradiction: the test asks whether the pathway stands out, not whether its genes change at all.

Worked Example: A Pathway Can Change Without Enrichment

Consider a hypothetical signed effect estimate in which the mean log fold change is 0.80 in a pathway of 20 genes and 0.80 among 180 genes outside it. For a simplified comparison, assume independent estimates with a common standard deviation of 0.50. The estimated competitive contrast is \(0.80-0.80=0\), and its standard error is

$$ SE=0.50\sqrt{\frac{1}{20}+\frac{1}{180}} =0.50\sqrt{0.05556} \approx 0.1179. $$

The standardized statistic is \(0/0.1179=0\), giving a two-sided normal-model p-value of 1.00. There is no evidence in this comparison that the pathway mean differs from the background mean. Both means are positive, however: this example illustrates why a non-significant competitive comparison is not evidence that the pathway has no change. It says only that this analysis does not distinguish its mean from the background mean.

Assumptions, Diagnostics, and Alternatives

A sound competitive analysis requires a well-defined gene universe, a pathway mapped to that universe, and gene-level measures that are comparable across genes. If gene statistics were produced from differential-expression models, the design and modeling assumptions used to obtain those statistics still matter. A flawed gene-level analysis cannot be repaired by aggregating its results into a pathway test.

The assumptions also depend on the chosen test. The worked mean comparison used independent, normally distributed measures with common variance. The threshold example used independent binary observations and a normal approximation. Those assumptions may be poor descriptions of expression data. Gene-level measures can differ in precision, and genes can be correlated; a method’s standard error or null calculation must account appropriately for the assumptions it actually makes. The specific consequences of intergene correlation require separate consideration.

Useful diagnostics include checking the number of tested genes in the pathway and background, confirming that the intended genes were mapped, and examining whether the result is driven by a few extreme scores or by a broad shift. For a threshold-based result, inspect how much the conclusion depends on the chosen cutoff. For a directional result, check whether the contributing gene-level measures have the reported direction. A small p-value does not replace these checks: it quantifies incompatibility with a specified null under a specified test, not the size, uniformity, or biological importance of the pathway effect.

Different enrichment approaches answer different questions. Over-representation analysis compares selected-gene counts with the background and is sensitive to the selection threshold. Ranked approaches compare the placement or distribution of pathway genes in a gene-level ranking and can use more information than a hard selected/not-selected label. These can be competitive when their reference is the rest of the tested genes. A test asking whether any genes within the pathway show association poses a different null question. Results from these approaches need not agree because their statistics, alternatives, and assumptions differ.

A common mistake is to interpret “not significant” as “the pathway has no effect.” That reasoning replaces a relative null with a within-pathway no-effect claim. The correction is to state the comparison explicitly: a competitive result addresses whether the pathway differs from the rest of the measured transcriptome on the chosen gene-level measure. Failure to reject its null may reflect a similar background shift, limited precision, pathway size, or other features of the analysis; it does not establish absence of change.

Key takeaway: A competitive test is defined by its reference group. Its null compares pathway genes with genes outside the pathway but still inside the tested-gene universe. Interpret the result as relative enrichment or depletion on the chosen measure, not as a direct verdict that pathway genes do or do not change.

Check Your Understanding

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

  1. A pathway has a mean signed statistic of 0.7, and the rest of the tested genes also have a mean of 0.7. What is the competitive contrast, and what does it establish?
  2. Why must the tested-gene universe be specified when interpreting a competitive result?
  3. A test finds a higher selected-gene proportion in a pathway than outside it. Does this show that every pathway gene is affected? Explain.
  4. Give one reason a threshold-based comparison and a ranked-statistic comparison might produce different results.

Solutions. (1) The contrast is \(0.7-0.7=0\). It provides no evidence of a difference in mean signed statistic; it does not establish that neither group changes. (2) The background defines the comparison, and excluded or unmeasured genes are not necessarily valid members of that reference group. (3) No. It compares proportions; some pathway genes may not pass the threshold, and the test does not assert that every gene is affected. (4) A threshold discards information about the magnitude and ordering of scores beyond the cutoff, whereas a ranked comparison can use that information; the two methods therefore target different features of the data.

Clinical Biostats