Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 46 ยท T Cells and Cellular Immunity

Development in the thymus: how T cells are made and tested

Follow a thymocyte through V(D)J recombination, positive selection and negative selection, and see why most developing T cells never leave the thymus.

Every T cell begins as a blood-forming stem cell in the bone marrow. It leaves long before it is useful, travels in the blood to a small organ above the heart called the thymus, and spends a few weeks there being built and examined. Only a small minority of the cells that enter the thymus ever leave it. The rest are removed on purpose. The thymus is best understood as a school with two hard exams, and a failing grade means death.

This lesson explains why the exams exist, how each one works, and what goes wrong when they fail. The ideas here explain a surprising amount of medicine, from inherited immune deficiencies to autoimmune disease.

A thymus lobule drawn as an oval with an outer cortex and an inner medulla, and a dotted path from the entry point through the cortex into the medulla.
A thymus lobule: cells enter at the junction, are tested in the cortex, then in the medulla.

What you will learn

  • How a thymocyte builds a unique T cell receptor by gene rearrangement.
  • What positive selection and negative selection test, and where each takes place.
  • How the thymus decides between the CD4 and CD8 fates.
  • Why the thymus matters for tolerance, and what AIRE does.

Key terms

Thymocyte: a developing T cell inside the thymus.

TCR (T cell receptor): the antigen receptor of a T cell, made of an alpha chain and a beta chain in most T cells.

V(D)J recombination: random cutting and joining of gene segments to make a unique receptor gene.

Positive selection: survival of thymocytes whose receptors can bind self-MHC at all.

Negative selection: deletion of thymocytes whose receptors bind self-peptide on MHC too strongly.

AIRE: a protein that lets thymic cells display peptides normally found only in other tissues.

The problem the thymus solves

The immune system faces a design puzzle. To catch any microbe, including ones that have not been invented yet, it needs a huge diversity of receptors. The way to get diversity is to build each receptor at random. But random receptors have two bad outcomes:

  • Many will be useless, because they cannot work with your MHC molecules, which is what T cells must recognize in order to see a peptide at all.
  • Some will bind your own tissues strongly and start an attack.

Both are checked in the thymus. The first check, positive selection, keeps cells that are useful. The second, negative selection, removes cells that are dangerous.

Step 1: building a receptor

Developing T cells arrive in the thymus with neither CD4 nor CD8, so they are called double negative. Inside, they rearrange the genes that encode the TCR. Each receptor gene is stored as separate segments: variable (V), diversity (D) and joining (J) segments for the beta chain, and V and J segments for the alpha chain. The enzymes RAG1 and RAG2 cut the DNA and the cell joins one randomly chosen V, D and J together. At the joints, extra random nucleotides are added or removed, which increases diversity even further.

The beta chain is built first. If it forms a functional protein, it pairs with a stand-in chain and signals the cell to stop rearranging the beta gene, to switch on both CD4 and CD8, and to divide. The cell is now double positive (CD4+CD8+). Only then is the alpha chain rearranged, and the finished alpha-beta receptor appears on the surface.

The number of possible receptors is enormous. Simple multiplication of segment counts already gives millions of combinations, and the random junction changes multiply that many times over. Estimates of the theoretical diversity of the human TCR repertoire run to far more than a hundred trillion. Any single person carries only a fraction of that, but it is still hundreds of millions of different receptors or more.

A thought experiment: if each of 40 variable segments can pair with each of 13 joining segments, that is 520 combinations before any junctional changes. Add the second chain and the numbers multiply again.

Step 2: positive selection in the cortex

Double positive thymocytes sit in the outer cortex, where cortical thymic epithelial cells display a wide range of self-peptides on MHC molecules. Each thymocyte tests its freshly made receptor against these. There are three outcomes:

Result What the receptor does Fate
No binding at all Cannot engage self-MHC Dies by neglect
Weak to moderate binding Can work with self-MHC Survives
Very strong binding Too reactive Dies, which is part of negative selection

The logic is that a receptor which cannot grip any self-MHC will also be unable to grip MHC carrying a foreign peptide, so it is of no use. Most thymocytes fail here, simply because random receptors rarely fit.

Positive selection also decides the cell's identity. A cell whose receptor engages MHC class I will turn off CD4 and keep CD8, becoming a cytotoxic T cell. A cell whose receptor engages MHC class II will keep CD4 and turn off CD8, becoming a helper. This is why the co-receptor matches the MHC class that the cell will later read.

Step 3: negative selection in the medulla

Surviving cells move inward into the medulla. There they meet medullary thymic epithelial cells and dendritic cells that display self-peptides again. Cells whose receptors bind these self-peptides strongly are told to commit apoptosis, programmed cell death. This is negative selection, or clonal deletion, and it removes cells that would attack the body's own tissues.

One puzzle: how can the thymus show peptides from the pancreas or the thyroid? Medullary thymic epithelial cells use a protein called AIRE (autoimmune regulator) to switch on genes that are normally active only in other organs, such as insulin. Thus the thymus can test T cells against a sample of the whole body. People with a mutation in the AIRE gene develop a condition in which several organs are attacked by the immune system, which is direct evidence for how much work negative selection does.

Some strongly self-reactive cells are not killed but diverted. They become regulatory T cells that carry the transcription factor Foxp3 and suppress other T cells. You will meet them in Chapter 6.

How many survive?

A common textbook figure is that only a few percent of thymocytes complete the journey. Most die in the cortex because they fail positive selection, and some more die in the medulla. This sounds wasteful, but the price is worth it: the system buys diversity by producing far more cells than it needs, and then discards the useless and the dangerous. Real numbers vary between studies and species, so the interactive model below uses made-up thresholds to illustrate the principle.

The thymus through life

The thymus is biggest in childhood and shrinks, a process called involution, after puberty. It is gradually replaced by fat, so fewer new T cells are produced. Adults rely mostly on long-lived T cells that divide in the body. People born without a thymus, or whose thymus fails to form, as in DiGeorge syndrome (caused by a small deletion on chromosome 22), have a severe shortage of T cells. Newborn screening programs in many countries test for a marker of new T cell production, called TREC, to find infants with severe combined immunodeficiency early.

Common misconceptions

"The thymus teaches T cells what pathogens look like." It does not. The thymus teaches T cells what self looks like. Receptors that recognize self too strongly are removed, and the rest are left to meet foreign peptides later.

"Selection is about the receptor being good at fighting infections." Selection in the thymus tests the receptor only against self molecules. A receptor's usefulness against a particular microbe is never tested there.

Try it

The first TryIt is a simplified simulation. It gives 10,000 thymocytes a random "affinity for self" score and applies two thresholds. The thresholds and the distribution are invented for illustration. Real affinities cannot be summarized by one number.

Python A toy model of thymic selection

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

This second example is a calculator for the combinatorial diversity of the beta chain. The segment numbers are approximate round figures used for teaching, not a catalog of the real genes.

JS Combinatorial diversity calculator

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What does positive selection test?

    Positive selection keeps cells whose receptors can engage self-MHC, because they will later need to read peptides on MHC.
  2. 2. A thymocyte binds self-peptide on MHC extremely strongly in the medulla. What is its most likely fate?

    Strong self-reactivity triggers negative selection, which usually kills the cell. Some are diverted to the regulatory T cell fate.
  3. 3. Which enzymes cut DNA to start V(D)J recombination?

    RAG1 and RAG2 introduce the breaks that allow gene segments to be joined.
  4. 4. What role does AIRE play?

    AIRE switches on genes normally active in other tissues, so developing T cells can be tested against them.
  5. 5. A thymocyte whose receptor engages MHC class II during positive selection usually becomes:

    Engagement of MHC class II selects for CD4 and the cell turns off CD8.

Summary

  • Thymocytes build a random alpha-beta receptor using V(D)J recombination driven by RAG1 and RAG2.
  • Positive selection in the cortex keeps cells that can engage self-MHC and decides CD4 versus CD8.
  • Negative selection in the medulla removes or redirects cells that bind self too strongly, helped by AIRE.
  • Most thymocytes die; this is how the system trades waste for diversity and safety.
  • The thymus shrinks with age, and defects in it cause serious immunodeficiency.

Next: MHC and the T cell receptor