Tutorials › High-Dimensional Genomic Data Analysis › Pathway Size Filters and Enrichment Power

Gene Set and Pathway Enrichment · Tutorial 472 of 795

Pathway Size Filters and Enrichment Power

Learn to choose and assess pathway size filters by connecting set size to null variability, signal dilution, and the reliability of enrichment evidence.

Intermediate 11 min read

What You'll Learn

  • Define pathway size after mapping genes to the analysis universe.
  • Relate pathway size to expected overlap and variance under over-representation testing.
  • Explain why very small sets can yield unstable, single-gene-driven results.
  • Assess how broad sets can dilute a concentrated biological signal.
  • Compare size-filter implications for over-representation, ranked, and self-contained tests.
  • Diagnose filter sensitivity and state what size filtering cannot guarantee.

Why pathway size is an analysis decision

Pathway size affects what an enrichment test can detect and how much confidence to place in a result. A very small set may be driven by one or two selected genes; a very broad set may combine genes with different roles and dilute a signal concentrated in a subset. Neither small nor large pathways are automatically uninformative. Size filters are practical safeguards whose effects depend on the test, the gene universe, and the biological question.

The relevant size is not necessarily the number of genes listed in an annotation database. It is the number of distinct pathway genes that can actually be tested after mapping identifiers and restricting to the analysis universe. A pathway can therefore move below a minimum threshold or above a maximum threshold when the universe or mapping procedure changes.

Definition: Let \(N\) be the number of genes in the analysis universe, \(K\) the number of those genes in a pathway, and \(n\) the number of genes selected by a specified rule. The effective pathway size is \(K\), after mapping and restriction to the universe. In over-representation analysis, \(X\) is the number of selected genes in the pathway; under the null model of random selection of \(n\) genes from the \(N\)-gene universe, \(X\sim\text{Hypergeometric}(N,K,n)\).

For this null model, the expected overlap and variance are

$$ E(X)=\frac{nK}{N}, \qquad \operatorname{Var}(X)=n\frac{K}{N}\left(1-\frac{K}{N}\right)\frac{N-n}{N-1}. $$

These quantities help explain size effects, but they do not by themselves determine power. Power is the probability that a specified test rejects its null under a particular alternative, at a chosen significance level. It depends on how many pathway genes carry signal, the strength of that signal, the selection rule, and the test's calibration—not just \(K\).

What size filters can and cannot do

A minimum size filter can exclude sets for which evidence is especially fragile. When \(K\) is tiny, the possible overlap counts are few and a single gene can change the result sharply. If one selected gene is also a plausible pathway member, mapping choices, annotation updates, or a different selection threshold may determine whether the pathway appears enriched. In resampling-based analyses, very small sets can also produce coarse or unstable evidence because only a few genes contribute to the set-level statistic.

A maximum size filter can exclude sets so broad that a test result is difficult to interpret as evidence about a focused biological process. Under the hypergeometric null, the expected overlap \(nK/N\) rises with \(K\); a substantial raw overlap may therefore be unsurprising. If only a small fraction of a broad pathway responds, the remaining genes can dilute the contrast between pathway and background. A maximum filter is not a claim that large pathways are biologically invalid; it limits which kinds of sets the analysis treats as interpretable tests.

Filtering also changes the collection of hypotheses being tested. It does not make the retained pathways independent, guarantee useful power, or correct a misspecified gene universe. If size thresholds are chosen after inspecting which cutoffs produce appealing results, the reported analysis can be misleading. Set and report thresholds based on the analysis design, and include the effective size and universe definition so the decision is auditable.

Worked examples

Worked Example: Effective size after mapping

Suppose a hypothetical pathway annotation lists 24 genes. The analysis universe contains 1,200 tested genes, but only 15 of the pathway genes map unambiguously to that universe. The planned filter retains sets with effective sizes from 10 through 500, inclusive. Does this pathway pass?

The relevant size is \(K=15\), not the annotation's raw count of 24. Since \(10\leq15\leq500\), the pathway passes the stated filter. The nine unmapped or out-of-universe genes cannot contribute to the test and should not inflate its size.

Now suppose a different analysis universe contains only 800 tested genes and just 8 mapped pathway genes. Then \(K=8\), so the pathway fails the minimum-size rule. That does not establish that the biology is unimportant; it says that this analysis, with this universe and threshold, excludes the set. Comparisons between analyses require attention to both universe and effective size.

Worked Example: Sparse evidence in a tiny pathway

Consider a hypothetical over-representation analysis with \(N=100\) genes, \(n=10\) selected genes, and a pathway of effective size \(K=4\). Two selected genes belong to the pathway. Under the random-selection null, the exact one-sided enrichment p-value is

$$ P(X\geq2)= \frac{\binom{4}{2}\binom{96}{8}+\binom{4}{3}\binom{96}{7}+\binom{4}{4}\binom{96}{6}} {\binom{100}{10}} \approx 0.0488. $$

The expected overlap under the null is \(nK/N=10(4)/100=0.4\). The observed overlap of 2 is five times that expectation, and the exact upper-tail p-value is approximately 0.0488. The calculation assumes that the ten selected genes are drawn without replacement from the specified 100-gene universe under the null, and that pathway membership and selection are defined consistently.

This result is near a conventional 0.05 threshold, but the pathway contains only four genes. Each member contributes substantially to the evidence: changing the status of one selected gene changes the overlap from 2 to 1, and the test result can change sharply. The p-value is not a measure of biological importance, nor does it establish that the pathway is active.

Worked Example: Signal diluted in a broad pathway

Consider a hypothetical study with \(N=1{,}000\) tested genes and \(n=50\) selected genes. A broad pathway has \(K=300\) members, of which 18 are selected. Under the hypergeometric null, the expected overlap is

$$ E(X)=\frac{50(300)}{1{,}000}=15. $$

Its null variance is

$$ \operatorname{Var}(X)=50(0.3)(0.7)\frac{950}{999}\approx9.98, \qquad SD(X)\approx\sqrt{9.98}=3.16. $$

The observed overlap is \(18\), only \(3\) above expectation, or about \(3/3.16=0.95\) null standard deviations above the mean. This standardized distance is a diagnostic summary, not an exact p-value; a formal analysis would calculate the appropriate hypergeometric tail probability. The example shows why 18 selected pathway genes may not be striking when the pathway contains 300 of the 1,000 tested genes.

A broad set can also contain a genuinely responsive subgroup alongside many genes without a comparable response. In that situation, the overall overlap or set-level contrast may be modest even though a narrower, prespecified biological process carries signal. The appropriate conclusion is not to trim the pathway after seeing the data, but to recognize the test's scope and assess whether the broad set answers the scientific question.

Worked Example: Why a size rule does not guarantee power

Use a simple illustrative selection model. Suppose each gene outside a pathway has probability \(p_0=0.05\) of being selected, while each truly responsive pathway gene has probability \(p_1=0.50\). Assume selections are independent for this calculation. For a tiny pathway with \(K=4\), two genes are responsive and two are not. The number selected is the sum of \(Y\sim\operatorname{Binomial}(2,0.50)\) and \(Z\sim\operatorname{Binomial}(2,0.05)\).

If the test rejects for at least two selected pathway genes, the probability of rejection under this alternative is

$$ P(Y+Z\geq2) =P(Y=2)+P(Y=1)P(Z\geq1)+P(Y=0)P(Z=2) $$
$$ =0.25+(0.50)(1-0.95^2)+(0.25)(0.05^2) =0.299375. $$

Thus this rule has about 29.9% rejection probability under the specified alternative. The model is deliberately simplified: it assumes independent gene selections and fixed selection probabilities, which real genomic data may not satisfy. Its lesson is conditional, not universal: a size threshold alone does not ensure high power, even when some pathway genes carry signal. Changing the number of responsive genes, their selection probabilities, or the test changes the power.

Choosing and checking the filter

There is no universally correct minimum or maximum size. A defensible rule reflects the analysis purpose, the test's behavior, and the available universe. Report the thresholds and the number of pathways excluded at each end. When conclusions depend on one borderline set, a sensitivity analysis using a small number of reasonable, prespecified thresholds can show whether the conclusion is robust to filtering. This is not permission to choose whichever result looks strongest.

Different enrichment procedures give size different roles. In over-representation analysis, the hypergeometric null explicitly uses \(K\), so the expected overlap and tail probability change with pathway size. For ranked enrichment, set size affects how many genes contribute to the running-sum statistic and can affect its stability and interpretation. For self-contained tests, the question is whether genes in the set show evidence of association, rather than whether the set is more associated than genes outside it; size still affects information and test behavior, but the competitive overlap calculation is not the null model. A filter appropriate for one test should not be assumed appropriate for another.

Check for practical warning signs before interpreting results:

  • Effective sizes were computed before, rather than after, restricting to the tested gene universe.
  • Small-set findings disappear when one mapped gene or one selection decision changes.
  • Broad-set results are described as specific evidence even though the set covers a large fraction of the universe.
  • Different universes, identifier mappings, or thresholds are used across comparisons without being reported.
  • Only pathways passing a chosen filter are presented, with no record of how many were excluded.

A common mistake is to reason that a larger pathway must have greater power because it contains more genes. More genes can provide more information when many carry a coherent signal, but can also increase the expected null overlap and dilute a signal concentrated in a small subset. The correction is to define the alternative of interest—how many genes are affected and how strongly—and evaluate the test under that alternative, rather than infer power from \(K\) alone.

Key takeaway: Apply size filters to effective pathway sizes within a clearly defined gene universe. Treat minimum and maximum thresholds as choices about stability and interpretability, not as guarantees of power or biological relevance.

Check Your Understanding

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

  1. A pathway annotation contains 40 genes, but only 12 are in the tested universe. Which size should be used for filtering, and why?
  2. For \(N=500\), \(n=25\), and \(K=100\), calculate the expected null overlap.
  3. Why can a pathway with four genes produce a fragile enrichment result even if its p-value is below 0.05?
  4. Does raising the maximum pathway-size threshold necessarily increase power? Explain.
  5. Give one reason a size filter appropriate for over-representation analysis may not transfer directly to a self-contained test.

Solutions. (1) Use effective size \(K=12\), because genes outside the tested universe cannot be selected or contribute to the test. (2) \(E(X)=nK/N=25(100)/500=5\) genes. (3) Each member has a large influence on the overlap, so mapping, annotation, or selection changes can alter the result substantially; a small p-value does not remove that sensitivity. (4) No. A larger threshold retains broader sets, which may help when many members carry signal but may also include diluted or hard-to-interpret sets; power depends on the alternative and test. (5) Over-representation tests compare selected genes in a pathway with a universe-based random-selection null, whereas a self-contained test asks whether genes in the set show evidence of association. Set size therefore enters different null questions and may affect their behavior differently.

Clinical Biostats