---
title: "From a gene list to biology: enrichment tests and their backgrounds"
description: "Enrichment analysis tests for unusual patterns involving annotated gene categories in selected or ranked genes. Results depend on the eligible background, annotations, selection effects and test model"
canonical: https://lightmysky.com/learn/science/from-a-gene-list-to-biology-enrichment-tests-and-their-backgrounds-mt_M9eHEXq6iA
source: https://lightmysky.com/learn/science/from-a-gene-list-to-biology-enrichment-tests-and-their-backgrounds-mt_M9eHEXq6iA.md
retrieved: 2026-11-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# From a gene list to biology: enrichment tests and their backgrounds

Enrichment analysis tests for unusual patterns involving annotated gene categories in selected or ranked genes. Results depend on the eligible background, annotations, selection effects and test model. Over-representation and rank-based methods can assess different patterns.

Subject: Science · Area: Genetics & Evolution · Ages 23 to 24
Page: https://lightmysky.com/learn/science/from-a-gene-list-to-biology-enrichment-tests-and-their-backgrounds-mt_M9eHEXq6iA

## Ready when they can

- Run and interpret an over-representation test against a stated, defensible background set
- Explain how gene length and expression level bias enrichment results
- Compare an over-representation test with a rank-based method on the same data

## Lesson: Testing enrichment against an eligible background

An over-representation test asks whether a selected list contains unusually many members of a gene category. Let N be the number of eligible genes, K the number in the category, n the list size and k the number of category members in the list. A one-sided hypergeometric test gives the probability of k or more members when n genes are drawn without replacement, with equal selection chances under the null model.

The background contains genes eligible for selection. Exclude genes never measured or removed before selection. Match identifiers and annotations, and count each gene once. If 9,000 genes were measured and 1,500 excluded before testing, 7,500 remain eligible. The selected list is a subset of this background.

**Example.** Take 10 eligible genes, including 4 category members. Draw 2 and observe both in the category. There are 10 times 9 divided by 2 = 45 possible pairs, including 4 times 3 divided by 2 = 6 category-only pairs. Two is the maximum count, so the upper-tail p-value is 6/45, about 0.133. This exceeds a single-test cutoff of 0.05.

*(drawing: The category share rises from 40% to 100%, but the exact test still gives p about 0.133.)*

In read-count RNA sequencing, longer transcripts tend to yield more reads at equal transcript abundance. Higher counts can increase power to detect genuine changes. High expression can also aid detection. Category members may therefore have unequal selection chances. Examine these effects and use a suitable bias-aware model when needed. A pattern alone proves neither bias nor biology.

Differential-expression tests compare conditions gene by gene. A cutoff on results can select a list for over-representation. Rank-based methods order eligible genes by a stated statistic, often signed to show change direction for the stated comparison. They test whether category members cluster toward an end of the ranking under a suitable null model. Coordinated shifts below a shortlist cutoff can contribute evidence. Ranking does not automatically remove measurement bias.

An ineligible background cannot support the intended selection inference. Use the eligible set before interpreting significance. Correct for testing many categories and report the procedure. Non-significance does not prove no effect. Different tests can disagree. Check annotation quality and overlapping terms. A small category is not automatically an artefact. Enrichment suggests follow-up; it does not prove pathway activation or causation.

**Recap.** Define the background and test model. Check selection effects, annotations and multiple testing. Interpret support without claiming proof of mechanism.

*Lesson, questions and flashcards written for this dataset.*

## Practice

8 questions on this page, each with its working shown.

## Needs first

- [Annotation, orthologues and comparative genomics](https://lightmysky.com/learn/science/annotation-orthologues-and-comparative-genomics-mt_eBRge2bLeC)
- [Testing thousands of genes at once: false discovery rate and what q means](https://lightmysky.com/learn/science/testing-thousands-of-genes-at-once-false-discovery-rate-and-what-q-means-mt_mIQ27rphrC)

## Opens up

- [Single-cell analysis: normalisation, embedding and naming cell states](https://lightmysky.com/learn/science/single-cell-analysis-normalisation-embedding-and-naming-cell-states-mt_diYHLaLmij)
