> 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/deprecated/inference-algorithms/upstream-regulator-analysis.md). Agents can also search and read this documentation through its [MCP server](https://docs.mithrl.com/~gitbook/mcp).

# Upstream Regulator Analysis

{% hint style="info" %}
**Which upstream regulators have an unexpectedly large number of known targets in my molecular signature?** Upstream Regulator Analysis (URA) moves from a list of changed genes or molecular features to the regulators that may best explain the observed pattern — highlighting transcription factors, signaling regulators, drugs, and other regulatory entities connected to the submitted features.
{% endhint %}

### How it works

1. **Provide the signal.** Upload the features you want to investigate and the background your assay could have detected. If the upload includes significance values, choose the cutoff for this run.
2. **Test regulators.** The inference compares each regulator's known targets with your signature, relative to the measured background.
3. **Review evidence.** Explore ranked regulators, overlapping targets, statistical values, direction fields where supported, knowledge sources, publications, and a network view.

### Example input and output

**Feature table**

```csv
entity,effect,adj_p_value
IL1B,1.42,0.003
CXCL8,1.18,0.006
NFKBIA,0.91,0.012
JUN,-0.76,0.018
HMOX1,0.72,0.021
```

**Background and run settings**

```
Assayed background: 18,432 genes
Significance column: adj_p_value
Significance cutoff: ≤ 0.05
Effect column: effect (fixed by the workflow)
```

**Result**

| Regulator     | Result group | Overlapping targets      | q-value | Direction       |
| ------------- | ------------ | ------------------------ | ------- | --------------- |
| RELA          | gene         | IL1B, CXCL8, NFKBIA, JUN | 0.008   | Activated       |
| MAPK14        | gene         | IL1B, JUN, HMOX1         | 0.031   | Inconclusive    |
| Dexamethasone | drug         | IL1B, CXCL8, NFKBIA      | 0.044   | not\_computable |

> RELA has four known targets in the submitted signature and is significant within the gene-regulator family. The drug row belongs to a separately corrected family and should not be globally ranked against the gene rows.

{% 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 %}

### How the result is organized

URA tests and delivers gene, complex and drug candidate regulators. Each group receives its own multiple-testing correction, which makes gene results easier to interpret and prevents growth in a drug knowledge source from silently changing gene q-values. A drug is a regulator carrying the `Drug` category specifically; a plain small molecule, chemical mixture or any other category is not fetched as a candidate at all.

Gene regulators are delivered in two groups:

* **`gene`:** curated regulons from CollecTRI, SIGNOR, DoRothEA, CTD, DrugMechDB, Open Targets, PubChem and ChEMBL. A regulator–target pair is kept only when at least two distinct publications or two distinct knowledge sources assert it.
* **`gene_perturbseq`:** Perturb-seq regulons, the genes whose expression changed when the regulator was knocked down in a pooled CRISPRi screen. Every such pair is kept. A knockdown regulon holds everything downstream of the perturbation in one cell line, so large complexes such as Mediator rank high on broad queries. Keeping it apart stops those complexes crowding the curated regulators out of the `gene` group.

A regulator can appear in both groups, each time on its own evidence. Transcription-factor perturbation experiments from Enrichr's TF\_Perturbations\_Followed\_by\_Expression library are delivered in `signature_gene`: each experiment's up or down genes are one signature, and a gene is ranked by its best signature. Drug regulators are delivered in `drug`, and CREEDS drug perturbation signatures in `signature_drug`.

Protein complexes and transcription-factor families such as NF-kB, AP-1 and the SIGNOR complexes are delivered in `gene_complex`. A regulator joins this group when the graph categorizes it as a macromolecular complex and lists at least one gene or gene product as its part. Its pairs pass the same two-publication or two-source rule as `gene`. Each row carries `complex_members`, the CURIEs of the genes the regulator is made of, and `complex_member_names`, their names in the same order.

Read a `gene_complex` row this way:

* Rank the group by p, like every other group.
* The member list says which genes make up the regulator. It is not evidence that any one member is the active one. NF-kB points to its members about as well as RELA points to RELA; AP-1 points to no particular member, as JUN does in `gene`.
* Family regulators pass the p-value gate in 41 to 59% of unrelated knockdowns, which is typical of gene regulators of similar size (median 44%). A large regulon passing is not by itself specific.
* A SIGNOR complex's membership can span species: SIGNOR curates the same complex once per organism, so its human, mouse and rat orthologs can all be curated parts of one complex CURIE. `complex_members` narrows to one species so a row never repeats a symbol across species: to the `organism` parameter's species when one is set, to the complex's own species when the graph gives it one (every CollecTRI family, and a SIGNOR complex curated in only one organism), and otherwise to whichever species has the most curated members, ties going to human.

Each delivered group also ships as its own file (`ranked_gene.csv`, `ranked_gene_perturbseq.csv`, `ranked_signature_gene.csv`, `ranked_drug.csv`, `ranked_signature_drug.csv`, `ranked_gene_complex.csv`), ranked and cut within the group it was corrected inside, so one group never loses a regulator because another had more significant ones. `ranked.csv` holds every group interleaved, with `term_class` and `rank_in_class` on every row; `rank_in_class` is the ranking.

`ranked.csv` and each group's file also carry two columns about how often a regulator ranked near the top across the 33,503 LINCS knockdown signatures of the benchmark on the 978-landmark readout:

* `promiscuity_share`: the share, from 0 to 1, of a fixed benchmark population (33,503 LINCS knockdown signatures on the 978-landmark readout, build `v1-20260927-ea76bd-academic`) whose results put this regulator in its group's top 10. It is measured once on that population, not on your run. The benchmark's list holds only regulators at or above 0.10, so 0.0 means below that share or never ranked in the benchmark.
* `promiscuous`: `True` when `promiscuity_share` is at least 0.10. From preset 2.45.0 this marks 10 `signature_gene` and 13 `signature_drug` regulators and none in the other groups.

Neither column changes a rank, p-value or q-value. A promiscuous regulator at the top of your result is weaker evidence about your signature than its rank alone suggests on that benchmark, because it reached the top for many unrelated signatures there.

* **Term size:** no regulator is excluded for target-set size. A raw member-count ceiling could not separate a true regulator from a nonspecific exposure term of comparable size, which is what the gene/drug split addresses instead.
* **p-value:** how surprising the observed overlap is under the run's measured background.
* **q-value:** the p-value adjusted for the regulator family in that result group.
* **Overlap:** the submitted features that are known targets of the regulator.
* **Direction:** an activation-oriented call per regulator, made from the submitted effects and the curated sign of each regulator–target edge. Each row delivers `n_signed`, the number of overlapping members that carry both a usable edge sign and a measured direction and that feed the z-score. The bias estimate (`mu`) is computed from every signed edge the regulator has in the background, not only the overlapping members. The state is one of:

  * `Activated` or `Inhibited`: the bias-corrected z-score is at least 2 in magnitude, positive or negative, with at least one signed member and no bias flag.
  * `Inconclusive`: the signed members were scored, but |z| is below 2.
  * `Biased`: the dataset's direction skew and the regulator's edge-sign skew together exceed the bias limit (|mu| > 0.25), so no z-score is used for a call, whatever its size.
  * `not_computable`: no z-score could be formed. The direction step uses the default `min_signed` of 1, so this means `n_signed` is 0. When the bias estimate is unavailable the uncorrected z-score is used and the row still receives one of the states above. This is a refusal, not a neutral result.

  A regulator without a direction call keeps its enrichment result. Direction on a small query is limited by the readout: with few signed members a z-score rarely reaches 2, and relaxing the thresholds does not recover a correct call without admitting a wrong one. From preset 2.44.0, when the median `n_signed` across all ranked rows is below 3, the result carries a `direction.readout_limited` warning stating the median, the share of rows below 3, and the count of each state. Read `n_signed` beside the state before relying on a call.
* **Evidence:** the knowledge sources and available publications behind the regulator–target relationships.

### What makes the statistics trustworthy

* **The query is explicit.** The inference tests the narrowed signature, not an entire measurement table by accident.
* **The background is experiment-aware.** Only entities that the assay could observe and the tested regulatory network could contain contribute to the statistical universe.
* **Incomplete families are visible.** If the system cannot establish the full hypothesis family, it withholds q-values instead of presenting an overconfident correction.

### Reading the result responsibly

* Compare q-values within a regulator group. Do not merge the gene and drug tables and treat the union as one jointly controlled 5% result, and read a row's `rank_in_class` rather than its position in the interleaved `ranked.csv`.
* A regulator can rank even when the regulator itself was not measured. URA is designed to find upstream explanations, including regulators activated after transcription.
* Results describe consistency with curated regulatory knowledge; they do not prove causality.
* p-values and q-values are conditioned on this run's measured background and build. They should not be compared directly across different datasets or knowledge-graph builds.

{% hint style="success" %}
**In short:** URA provides a ranked, evidence-linked set of upstream explanations for a molecular signature, while making the tested population, background, multiple-testing scope, and any statistical limitations visible in the result.
{% endhint %}

Next: [Biological Effects Analysis](https://docs.mithrl.com/deprecated/inference-algorithms/biological-effects-analysis.md).
