From Locus Results to a Pathway Test
A pathway analysis is only as interpretable as the chain of decisions that produces it. A locus association is evidence about variants, not automatically evidence about a particular gene or pathway. Variants may map to several plausible genes; gene scores can be affected by how many variants are tested and how correlated those variants are; and pathway membership is tested relative to a defined background. A defensible analysis makes these steps explicit and checks whether the result survives reasonable alternatives.
This tutorial follows a hypothetical analysis from locus-level variant statistics to a competitive pathway test. The example is deliberately small enough to calculate by hand. In a real study, the gene universe, LD reference, pathway collection, and resampling scheme would be much larger, but the logic is the same.
The mapping weights need not be mutually exclusive: one variant can have nonzero weights for multiple genes. They are not automatically causal probabilities. Their meaning depends on how the mapping procedure constructed them, and uncertainty in those weights should be reflected in sensitivity analysis or in the gene-score calculation.
Map Variants and Construct Gene Scores
Suppose a locus has variant-level association statistics \(z_v\). One simple evidence score uses \(z_v^2\), so evidence in either association direction contributes positively. For a gene \(g\), a weighted sum is
This score is a summary, not by itself a calibrated gene-level test statistic. In particular, the sum can increase with the number of mapped variants, and correlated variants can contribute redundant evidence. A gene with a large \(Q_g\) should not be compared with another gene as if the two scores had the same null distribution unless that comparability has been justified.
Worked Example: Mapping Locus Evidence to Two Genes
In a hypothetical locus, two variants have association statistics \(z_1=3\) and \(z_2=2\). Mapping evidence assigns weights \(w_{1A}=0.7\), \(w_{1B}=0.3\), \(w_{2A}=0.2\), and \(w_{2B}=0.8\) to genes A and B. Using \(Q_g=\sum_v w_{vg}z_v^2\), the scores are:
Gene A has the larger weighted score in this calculation. The difference is not proof that A is causal: the scores depend on the mapping weights, the choice of variant statistic, and how correlated variants are handled. Because each variant contributes to both genes, the two gene scores are also not independent.
A practical analysis can calibrate each raw gene score against a null distribution that reflects the gene’s variant count, LD, and the scoring procedure. For example, generate null variant statistics using an appropriate LD reference, apply the same variant-to-gene mapping and scoring steps, and record the resulting scores for each gene. If the null mean and standard deviation for gene \(g\) are \(\mu_{0g}\) and \(\sigma_{0g}\), respectively, a standardized score is
This standardization expresses a gene’s observed score relative to its own null distribution. It does not remove every possible source of bias: the null simulations, mapping, and gene universe must still be appropriate. In particular, an LD reference that poorly represents the study population can yield misleading calibration.
Worked Example: Standardizing a Gene Score Under an LD-Aware Null
For gene A in the preceding hypothetical calculation, suppose simulations using a suitable LD reference and the same scoring procedure give a null mean of \(\mu_{0A}=2.4\) and a null standard deviation of \(\sigma_{0A}=1.8\). Then:
The observed score is about 2.61 null standard deviations above the simulated mean for gene A. This is a standardized score, not a p-value. A p-value would require the gene’s null distribution, including its tail behavior, to be used directly or shown to support an appropriate approximation.
Define the Gene Universe and Control Technical Differences
Before testing a pathway, define the gene universe: the genes eligible to appear in the analysis. It should reflect the genes that could have received a score under the study’s variant coverage, annotation, and mapping rules. Comparing pathway genes with all annotated genes when many of those genes could not have been scored creates an inappropriate reference group.
Gene size and variant count matter because larger genes tend to contain more assayed variants and may have more opportunities to accumulate association evidence. LD matters because correlated variants do not provide the same amount of independent information as equally numerous uncorrelated variants. Functional annotation coverage can also differ across genes. A pathway test that ignores these features can mistake technical differences for pathway enrichment.
There are several possible controls, including a covariate-adjusted regression, matched-gene comparisons, or a permutation scheme that preserves relevant features and LD structure. The method should match the test’s estimand and data structure. The example below uses matched comparisons so that the adjustment and its assumptions are visible.
Test a Pathway and Correct for Multiplicity
Consider five matched pairs of genes. In each pair, one gene belongs to a prespecified pathway and the other is a matched nonmember. Suppose the pairs lie in independent LD blocks, and the matching has made pathway membership exchangeable within each pair under the null. Let \(U_{i,\mathrm{in}}\) and \(U_{i,\mathrm{out}}\) denote the standardized scores for the pathway member and matched nonmember in pair \(i\). A simple one-sided competitive statistic is the average paired difference:
where \(m\) is the number of matched pairs. Large positive values indicate stronger scores among pathway members. Under the matched null, the member and nonmember labels can be swapped within each pair. With \(m\) independent pairs, there are \(2^m\) label assignments. The permutation p-value is the proportion of assignments whose statistic is at least as large as the observed statistic. If the test is two-sided, the comparison instead uses the absolute statistic; the direction should be chosen before examining the results.
Worked Example: A Matched Competitive Test
Suppose five pathway genes and five matched nonmembers have the following hypothetical standardized scores. The pairs are matched on gene size, effective variant count, and annotation coverage; their LD blocks are treated as independent for this toy example.
| Pair | Pathway-member score | Matched nonmember score | Difference |
|---|---|---|---|
| 1 | 4.2 | 1.2 | 3 |
| 2 | 3.8 | 0.8 | 3 |
| 3 | 2.7 | 0.7 | 2 |
| 4 | 1.9 | 0.9 | 1 |
| 5 | 1.5 | 0.5 | 1 |
The observed mean difference is
There are \(2^5=32\) possible within-pair label assignments. The observed statistic is the largest possible one-sided statistic: every observed difference is positive, so no reassignment can make the sum of differences exceed \(10\). Exactly one of the 32 assignments places the higher score on the pathway-member side in all five pairs. Therefore,
For this single prespecified pathway, the matched test gives one-sided evidence that its genes have higher scores than comparable nonmembers. The p-value is not the probability that the pathway is biologically relevant, nor is it the probability that the null hypothesis is true.
Usually, many pathways are tested. Their p-values require a multiplicity procedure appropriate to the testing family and dependence among pathways. For example, the Benjamini–Hochberg procedure controls the false discovery rate under its standard conditions: sort the \(K\) p-values from smallest to largest, then compare the \(i\)th value with \(i\alpha/K\), applying the procedure’s step-up rule. Overlapping pathways can yield dependent tests, so the dependence and the chosen correction should be considered rather than assumed away.
In the toy example, suppose three pathway tests yield p-values \(0.03125\), \(0.125\), and \(0.500\). Applying Benjamini–Hochberg to these three values gives adjusted values \(0.09375\), \(0.1875\), and \(0.500\), respectively. For the smallest p-value, the unadjusted calculation is \(0.03125 \times 3/1=0.09375\); the other two are \(0.125 \times 3/2=0.1875\) and \(0.500 \times 3/3=0.500\). Thus, the smallest adjusted value is \(0.09375\), not below \(0.05\). The pathway is suggestive in this hypothetical analysis, but it does not meet a 5% false-discovery-rate threshold under this correction.
Check Sensitivity Before Drawing a Conclusion
A pathway result can depend on uncertain mapping, score construction, the gene universe, matching, the LD reference, and pathway definitions. Sensitivity analysis asks whether the main conclusion is stable under plausible alternatives. It does not mean selecting whichever analysis gives the smallest p-value. The alternatives and the reason for considering them should be reported clearly.
Compare the primary weights with credible alternative mapping rules, or resample mapping assignments when the weights represent uncertainty. Recompute gene scores and pathway tests rather than changing pathway membership alone.
Check whether a result depends on one aggregation rule, such as a weighted sum rather than a maximum or another prespecified score. Recalibrate each choice under a null procedure that uses the same rule.
Check matching or covariate adjustment for gene size, variant count, annotation coverage, and LD. Use an LD-aware resampling scheme when genes or variants remain correlated.
Verify that eligible genes are defined consistently and assess whether reasonable pathway membership or background choices change the result. Keep the full testing family in view when applying multiplicity correction.
Worked Example: Interpreting a Mapping Sensitivity Check
Return to the five-pair example, whose baseline one-sided permutation p-value was \(1/32=0.03125\). Suppose a prespecified alternative mapping scheme changes the gene scores. On rerunning all 32 within-pair assignments, four assignments have statistics at least as large as the alternative observed statistic. The alternative p-value is therefore
The pathway’s evidence is not stable to this mapping choice: the unadjusted p-value changes from \(0.03125\) to \(0.125\), and neither value meets a 5% Benjamini–Hochberg threshold in the three-pathway example. This does not show that either mapping is correct. It shows that the enrichment claim depends materially on the mapping specification and should be interpreted with that uncertainty in view.
Common Mistakes and the Full Analysis Logic
- Treating mapped genes as certain. A variant near a gene, or assigned a nonzero mapping weight, does not establish that the gene mediates the association. Retain mapping uncertainty in the score or check plausible alternatives.
- Counting correlated variants as independent evidence. A sum of variant statistics can be inflated or miscalibrated when LD is ignored. Use an LD-aware null or resampling procedure that reflects the correlations in the data.
- Ignoring the gene universe. A pathway comparison is defined relative to eligible genes, not an arbitrary list of all annotated genes. Specify how coverage and mapping determine eligibility.
- Assuming gene-size correction is automatic. A standardized gene score or a pathway p-value does not, by itself, prove that gene size and variant count have been controlled. State how those features enter the null, matching, or model.
- Calling an unadjusted result significant after testing many pathways. The relevant evidence must account for the testing family and the dependence structure. A small raw p-value can fail the multiplicity-adjusted criterion.
The end-to-end logic is therefore: define the locus evidence and gene universe; map variants to genes while retaining uncertainty; construct and calibrate gene scores using LD-aware information; compare pathway members with a suitable competitive reference that controls technical differences; adjust for the full set of pathways tested; and check whether the conclusion survives reasonable analytic alternatives. Each step limits a different source of misleading enrichment. A stable pathway result is evidence of a pattern in the association data, not proof of a causal mechanism.
Check Your Understanding
Use the definitions and calculations in this tutorial to answer the following questions.
- Why can a variant contribute to the scores of more than one gene, and what does that imply for interpreting those scores?
- For a gene with \(Q_g=6.0\), null mean \(2.0\), and null standard deviation \(2.0\), calculate \(U_g\) and explain what it does and does not represent.
- What assumption makes within-pair label swaps appropriate in the matched competitive test? Give two features that the matching should address.
- In the five-pair example, why is the one-sided permutation p-value \(1/32\) rather than \(1/16\)?
- Why can a pathway with a small unadjusted p-value fail to meet the multiplicity-adjusted threshold?
- If changing a defensible mapping rule substantially changes the pathway p-value, what does that indicate about the result?