Immunology sits at the intersection of molecular biology, evolutionary theory, and systems medicine. The immune system must solve a combinatorial problem of staggering scale: recognise an essentially unlimited universe of possible antigens using a finite genome, triggering responses against pathogens while remaining tolerant to 30 000 self-proteins. The solution involves stochastic gene rearrangement (generating >1018 unique receptors), clonal selection, and multilayer feedback control. Mathematical epidemiology then scales these molecular events to population level.
1. Innate Immunity
Innate immunity is the first line of defence, operating within seconds to minutes of pathogen encounter. It relies on a limited repertoire of pattern recognition receptors (PRRs) that detect conserved microbial structures — so-called pathogen-associated molecular patterns (PAMPs) — that are absent from host cells. Because PAMPs are essential for microbial survival and highly conserved across species, they cannot easily be mutated to evade detection.
Toll-Like Receptors, Complement System & Interferons
Toll-like receptors (TLRs) — membrane & endosomal:
TLR4: lipopolysaccharide (LPS) from gram-negative bacteria
TLR3/7/8: single-stranded and double-stranded RNA (viral)
TLR9: unmethylated CpG DNA (bacterial/viral)
Downstream signalling: MyD88 → NF-κB → pro-inflammatory cytokines
Trif pathway: IRF3 → IFN-β (anti-viral type I interferon)
cGAS-STING pathway (cytosolic DNA sensing):
cGAS detects dsDNA in cytoplasm → synthesises cGAMP
STING → IRF3+NF-κB → IFN-β + TNF + IL-6
Cancer immunotherapy target: STING agonists for tumour microenvironment
Complement cascade:
Classical: C1q binds antibody·antigen complex
Lectin: MBL binds mannose on pathogens
Alternative: spontaneous C3 hydrolysis (always active at low level)
All converge at C3 convertase: C3 → C3a (anaphylatoxin) + C3b (opsonin)
Terminal: C5–C9 → membrane attack complex (MAC) pore
Interferons (IFN):
Type I: IFN-α/β — antiviral state in neighbouring cells
Induce ~300 interferon-stimulated genes (ISGs) via JAK-STAT1/2-ISGF3
Upregulate MHC I for enhanced cytotoxic T-cell killing
Type II: IFN-γ — from NK cells and T-helper 1 cells
Activates macrophages: increased phagocytosis + ROS + nitric oxide
Natural killer (NK) cells:
"Missing self" rule: kill cells lacking MHC I (= stressed, infected, or tumour)
Activating: NKG2D (stress ligands MICA/MICB) + DNAM-1
Inhibitory: KIR/CD94-NKG2A → check MHC I expression
Balance determines kill/no-kill outcome (integration of signals)
2. Adaptive Immunity: T Cells
The adaptive immune system generates diversity through V(D)J recombination — a RAG1/2 endonuclease randomly cuts and rejoins gene segments from the Variable, Diversity, and Joining regions of T-cell receptor and immunoglobulin loci. The resulting receptor repertoire is estimated to encompass 1015–1018 unique specificities before any antigen exposure, then undergoes clonal selection when a cognate antigen is encountered.
TCR V(D)J Recombination, MHC Restriction & T-Cell Fates
V(D)J recombination diversity:
TCRα chain: ~50 Vα × 61 Jα = ~3 000 combinations
TCRβ chain: ~52 Vβ × 13 Dβ × 13 Jβ = ~8 800 combinations
Combinatorial: 3 000 × 8 800 = 2.6 × 10^7
Junctional diversity (P- and N-nucleotide addition at CDR3):
+10^9 additional → total TCR space >10^15 unique receptors
Compare: ~10^7 T cells per individual at time point
MHC antigen presentation:
MHC class I (HLA-A/B/C): presents intracellular peptides (8–10 aa)
→ to CD8⁺ cytotoxic T cells (CTL)
Peptide loaded in ER via TAP transporter, β₂-microglobulin assists folding
MHC class II (HLA-DR/DQ/DP): presents extracellular peptides (13–25 aa)
→ to CD4⁺ T-helper cells
Loading in endosome; CLIP peptide displaced by HLA-DM
T-cell differentiation from naive precursors:
Signal 1: TCR + pMHC (antigen)
Signal 2: CD28 + B7 (co-stimulation; absence → anergy)
Signal 3: cytokine milieu → fate
IL-12 + IFN-γ → Th1 (intracellular killers, macrophage activation)
IL-4 → Th2 (helminth; IgE)
IL-6 + TGF-β → Th17 (neutrophil recruitment; barrier defence)
TGF-β alone → T-reg (FoxP3⁺; peripheral tolerance)
CD8⁺ CTL killing mechanism:
Perforin (pore-forming) + Granzymes A/B (serine proteases) → caspase 3 apoptosis
FasL + Fas (death receptor) pathway
Kill efficiency: ~10 min per target cell; serial killing observed
3. Humoral Immunity: B Cells and Antibodies
B cells produce antibodies — soluble proteins that bind antigens with high specificity. After initial activation, B cells enter germinal centres in lymph nodes where they undergo somatic hypermutation at a rate 105-times higher than the genomic baseline, with selection for affinity to antigen. This iterative Darwinian process, affinity maturation, produces antibodies with Kd values in the picomolar range.
Antibody Classes, Somatic Hypermutation & Affinity Maturation
Immunoglobulin structure:
Basic unit: two heavy + two light chains (Y-shape)
Variable regions (VH + VL): antigen-binding site (paratope)
Complementarity-determining regions (CDR1/2/3): hypervariable loops contact antigen
Constant region (Fc): effector function (opsonisation, complement, ADCC)
Antibody classes (isotypes) — defined by heavy chain constant region:
IgM: pentamer (J-chain); first response; low affinity, high avidity; activates complement
IgG: monomer (IgG1–4); most abundant serum Ab; crosses placenta; ADCC
IgA: dimer (secretory J-chain + SC); mucosal immunity; breast milk
IgE: monomer; binds FcεRI on mast cells/basophils; allergy + anti-parasite
IgD: mainly BCR on naive B cells; signalling role
Class switch recombination (CSR):
AID (activation-induced cytidine deaminase) deaminates C→U in switch regions
Excises constant region → IgM→IgG/IgA/IgE depending on cytokine signal:
IL-4 → IgE; TGF-β → IgA; IFN-γ → IgG2a (mouse)/IgG1 (human)
Germinal centre affinity maturation:
Somatic hypermutation rate: ~10^-3 per bp per division (vs ~10^-9 genomic)
Selection: centrocytes with higher BCR affinity for FDC-displayed antigen survive
Affinity gain: 10–1000× over ~3 weeks of GC reaction
Outputs: long-lived plasma cells (Bone Marrow) + memory B cells
Monoclonal antibodies (mAb):
Therapeutic IgG: trastuzumab (HER2+), pembrolizumab (PD-1), rituximab (CD20)
Fc engineering: half-life extension (YTE mutation), ADCC optimisation
Bispecific: blinatumomab = anti-CD3 × anti-CD19 (T-cell engager)
4. Vaccines and Immune Memory
A vaccine pre-arms the immune system with the memory of an antigen it has never encountered as a live pathogen. The four main platforms differ in how they deliver antigen, the quality of the immune response they elicit, and their manufacturing complexity.
Vaccine Platforms & Herd Immunity
Inactivated vaccines (e.g. influenza, IPV):
Killed pathogen → preserves surface proteins
Innate adjuvant activity from PAMPs (flagellin, LPS) in preparation
Typically requires 2–3 doses + boosters; weaker cell-mediated response
Live-attenuated vaccines (MMR, yellow fever, varicella):
Passaged virus loses virulence but maintains immunogenicity
Single dose often sufficient; strongest and longest T-cell + B-cell response
Contraindicated in immunocompromised (risk of reversion to virulence)
Subunit / protein vaccines (HepB, HPV Gardasil):
Recombinant protein antigen + adjuvant (alum/AS04/AS01)
AS01 (shingrix): MPL + QS-21 → activates TLR4 + induces IL-12 → strong Th1
No risk of infection; requires adjuvant to overcome poor immunogenicity
mRNA vaccines (SARS-CoV-2 BNT162b2/mRNA-1273):
LNP-encapsulated modified mRNA (pseudouridine replaces U → evades TLR7/8)
Translated by host ribosomes → endogenous antigen → MHC I + II presentation
Generates both CD8⁺ CTL and CD4⁺ Tfh → germinal centres → neutralising IgG
Turnaround: sequence → first dose in 63 days (Moderna COVID-19 trial record)
Herd immunity threshold (SIR model):
h_c = 1 − 1/R₀
Examples:
Measles: R₀ ≈ 15 → h_c = 93%
COVID-19: R₀ ≈ 3–6 (original) → h_c = 67–83%
Influenza: R₀ ≈ 1.3 → h_c = 23%
Effective R₀ with vaccine coverage p_v and VE e:
R_eff = R₀ (1 − p_v · e) < 1 required to eliminate
5. SIR and SEIR Epidemic Models
Compartmental models partition a population into disease states and describe transitions by differential equations. The basic reproductive number R0 — the mean number of secondary infections caused by one infected individual in a fully susceptible population — determines epidemic fate: R0 > 1 leads to exponential growth, R0 = 1 is the endemic threshold, and R0 < 1 leads to extinction.
SIR, SEIR & Epidemic Parameters
SIR model (Kermack & McKendrick, 1927):
dS/dt = −β S I / N
dI/dt = β S I / N − γ I
dR/dt = γ I
N = S + I + R = const (closed population, no vital dynamics)
β = effective contact rate [contacts/day × P(transmission)]
γ = recovery rate = 1/infectious_period [day⁻¹]
R₀ = β/γ
Epidemic threshold:
Peak incidence when S = γN/β = N/R₀
Final attack rate solves: 1 − f = e^(−R₀·f) (transcendental equation)
Approximate final size: f ≈ 1 − e^(−R₀) for small R₀
Example R₀=3: f ≈ 94% of population eventually infected (no intervention)
SEIR model (adds exposed/latent compartment):
dS/dt = −β S I / N
dE/dt = β S I / N − σ E (σ = 1/latent_period)
dI/dt = σ E − γ I
dR/dt = γ I
R₀ = β/γ (unchanged; latency shifts timing, not final size)
Generation time: T_g = T_latent + T_infectious/2
Non-pharmaceutical interventions:
β is reduced by mask use, social distancing (contact reduction)
R_eff(t) = R₀ · S(t)/N · [1 − ε(t)] (ε = intervention efficacy)
Reproduction number estimated from rt.live or EpiNow2 (Bayesian Rt estimation)
Age-structured SIR:
Contact matrix C_ij (WHO POLYMOD data): contacts between age group i and j
β_ij = p_ij × C_ij (heterogeneous mixing → different R₀ estimates)
Younger: higher contact rates; older: higher IFR (infection fatality ratio)
6. Dysregulated Immunity: Autoimmunity and Immunotherapy
The same mechanisms that generate a vast repertoire of antigen-specific receptors can go wrong in two ways: self-reactive clones may evade deletion (autoimmunity), or the immune system may mount inappropriately strong responses to harmless antigens (allergy). Conversely, tumours exploit immune checkpoints to escape destruction. Modern immunotherapy drugs aim to restore or redirect the response.
Hypersensitivity, Autoimmunity & Checkpoint Blockade
Hypersensitivity types (Gell & Coombs classification):
Type I (IgE-mediated): allergen → IgE on mast cells → degranulation → histamine
Conditions: anaphylaxis, asthma, urticaria, allergic rhinitis
Desensitisation: sublingual/subcutaneous immunotherapy (build IgG4 blocking)
Type II (cytotoxic): IgG/IgM targets cell-surface antigen → CDC/ADCC/phagocytosis
Examples: autoimmune haemolytic anaemia, Goodpasture syndrome
Type III (immune complex): soluble IC deposits in vessel walls → complement + neutrophils
Examples: SLE, serum sickness, vasculitis
Type IV (cell-mediated, delayed 48–72h): Th1 + CD8 CTL; no antibody
Examples: contact dermatitis, TB PPD skin test, allograft rejection
Autoimmunity — central & peripheral tolerance failure:
Central (thymus): negative selection of high-affinity self-reactive T cells
AIRE transcription factor: expresses peripheral antigens in thymus
AIRE mutation → APECED (multi-organ autoimmunity)
Peripheral: T-reg suppression; CTLA-4 competing with CD28 for B7
Loss of T-reg → spontaneous autoimmunity (FoxP3 knockout = scurfy mouse)
Molecular mimicry: pathogen epitope resembles self (strep M protein → rheumatic fever)
Checkpoint inhibitors (cancer immunotherapy):
CTLA-4 blockade: ipilimumab (anti-CTLA-4) → removes co-inhibitory brake on T-cell priming
PD-1/PD-L1 blockade: pembrolizumab/nivolumab → restores exhausted TIL function
PD-L1 expressed by tumour cells → dampens CD8⁺ TIL killing → evades immune
Objective response rates:
Melanoma (ipilimumab): 20% vs 10% (prior therapy)
NSCLC (pembrolizumab + chemo): 60% vs 45%
irAE (immune-related adverse events): ~30% Grade 3–4, managed with corticosteroids
CAR-T cell therapy: anti-CD19 (tisagenlecleucel), anti-BCMA (idecabtagene)
Cytokine release syndrome (CRS) graded I–IV; tocilizumab (anti-IL-6R) rescue
COVID-19 vaccines and mRNA technology: The 2020–2021 COVID-19 mRNA vaccines achieved ~95% efficacy against infection and ~99% against hospitalisation in pivotal trials. They also established lipid-nanoparticle mRNA as a platform technology now being deployed for personalised cancer vaccines (e.g. Moderna mRNA-4157/V940 + pembrolizumab for high-risk melanoma — first randomised Phase IIb result showing 44% reduction in recurrence, 2023).
Try These Simulations
SIR Epidemic Model
Interactive SIR/SEIR compartmental model: adjust R₀, infectious period, vaccination rate, and watch epidemic curves with live Reff(t) tracking.
CRISPR-Cas9 Visualiser
guide-RNA target recognition, PAM sequence scanning, double-strand break, and NHEJ vs HDR repair pathway outcomes visualised at nucleotide resolution.
Protein Folding
2D HP lattice model: hydrophobic-polar chain folding on a square lattice, ground-state search by Monte Carlo, contact energy minimisation.
DNA Transcription & Translation
RNA polymerase progression along the template strand, codon-by-codon translation on the ribosome, and tRNA matching with codon table lookup.