> For the complete documentation index, see [llms.txt](https://docs.mithrl.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mithrl.com/getting-started/inference-algorithms/canonical-pathway-analysis.md).

# Canonical Pathway Analysis

{% hint style="info" %}
**Which curated pathways are over-represented in my selected genes?** Canonical Pathway Analysis (CPA) connects a molecular signature to Reactome pathways, reports the features responsible for each match, and keeps the knowledge sources behind pathway membership visible.
{% endhint %}

### How it works

1. **Provide the signal.** Upload the genes of interest and the background your assay could have detected. If the upload includes significance values, choose the cutoff for this run — a table carrying significance values is refused until a cutoff is declared. An upload without them is treated as already narrowed.
2. **Test pathways.** The inference finds candidate Reactome pathways and compares the signature overlap with each pathway's measured member set.
3. **Explore the result.** Review ranked pathways, statistical values, overlapping genes, available direction context, evidence, and a pathway network view.

### Example input and output

**Feature table**

```csv
entity,effect,adj_p_value
PCNA,1.20,0.004
MCM2,1.08,0.006
MCM4,0.93,0.011
CDK1,1.31,0.003
CCNB1,1.15,0.005
```

**Background and run settings**

```
Assayed background: 17,980 genes
Significance column: adj_p_value
Significance cutoff: ≤ 0.05
Effect column: effect
```

**Result**

| Pathway                | Overlapping genes | Pathway size | q-value | Direction context |
| ---------------------- | ----------------- | ------------ | ------- | ----------------- |
| DNA Replication        | PCNA, MCM2, MCM4  | 73 genes     | 0.002   | Activated         |
| Cell Cycle Checkpoints | CDK1, CCNB1, PCNA | 112 genes    | 0.018   | Inconclusive      |
| Mitotic G1–G1/S Phases | CDK1, CCNB1       | 84 genes     | 0.047   | not\_computable   |

> The first row means three selected genes occur together in a curated DNA-replication pathway more often than expected from the assayed background. The overlap members show exactly which submitted genes support that result.

{% hint style="warning" %}
Illustrative only — names and values above are simplified and fabricated to demonstrate the input and output shape. They are not a biological result.
{% endhint %}

### What the result contains

* **Pathway identity and name**, together with the distinct genes counted in the test.
* **p-value and q-value** for enrichment relative to the run's measured background and tested pathway family.
* **Overlap members** showing which submitted genes support the pathway result.
* **Direction context** — `Activated`, `Inhibited`, or `Inconclusive` when the submitted effects and signed pathway relationships provide enough information; `Biased` when dataset skew rules out a reliable call; `not_computable` when there is not enough signed evidence to say anything.
* **Knowledge sources and evidence status** for the gene–pathway memberships used.
* **A network artifact** linking the selected genes to ranked pathways.

### How statistical validity is protected

* **The query is not the background.** The test uses the selected signature as the query and a separate, experiment-appropriate background as the comparison population.
* **Members live in gene space.** Transcript and redundant isoform participation are projected carefully so one biological gene is not counted repeatedly simply because the knowledge graph stores several identifiers.
* **Incomplete pathways are handled explicitly.** A pathway with incomplete membership is named and withheld from correction, or the q-value is withheld for the family when completeness cannot be established.

### Reading the result responsibly

* Pathway enrichment indicates that the signature is consistent with a curated pathway; it does not prove that the pathway caused the observed state.
* p-values and q-values are specific to the run's signature, measured background, knowledge-graph build, and pathway family. Avoid direct comparisons across unlike experiments.
* A pathway name does not by itself identify who asserted every membership. The result keeps assertion sources separate from the pathway's naming source.
* Direction fields require additional signed evidence and measured effects. A `not_computable` direction does not weaken the enrichment result, which can still be statistically valid on its own.

{% hint style="success" %}
**In short:** CPA provides an evidence-linked pathway view of a molecular signature, with an explicit experimental background and guardrails against duplicated identifiers, incomplete membership, and misleading multiple-testing correction.
{% endhint %}

Next: [Upstream Regulator Analysis](/getting-started/inference-algorithms/upstream-regulator-analysis.md).
