// apoptosis_biology.sy -- Programmed cell death pathways as native Scyla.
//
// The intrinsic and extrinsic apoptotic cascades, their caspase executioners,
// the Bcl-2 family gatekeepers, death receptor signaling complexes, and the
// regulatory nodes that decide whether a cell lives or dies. Every protein
// traces to UniProt. Every claim traces to a citation.
//
// Apoptosis is not destruction. It is governance. The cell dismantles itself
// in an orderly fashion, packages its contents into membrane-bound bodies,
// and flags itself for phagocytic clearance. No inflammation. No collateral
// damage. The most civilized form of death in biology.
//
// When apoptosis fails: cancer (cells that refuse to die), autoimmunity
// (self-reactive lymphocytes that escape deletion), neurodegeneration
// (neurons that die when they should not).
//
// Sources:
//   Alberts B et al. Molecular Biology of the Cell, 7th ed, 2022.
//   Nelson DL, Cox MM. Lehninger Principles of Biochemistry, 8th ed, 2021.
//   Kerr JF, Wyllie AH, Currie AR. Br J Cancer 26:239-257, 1972.
//   Green DR. Cell 163:1346-1358, 2015.
//   Galluzzi L et al. Cell Death Differ 25:486-541, 2018.
//
// Marjorie McCubbins + Aether, April 2026
// Patent pending: 64/034,536


// =====================================================================
// STRUCTS
// =====================================================================

struct Bcl2FamilyMember {
    name: String,
    gene: String,
    accession: String,
    family_class: String,
    bh_domains: String,
    function_desc: String,
    mechanism: String,
    clinical_relevance: String,
    citation: String,
}

struct DeathReceptor {
    name: String,
    alias: String,
    accession: String,
    ligand: String,
    ligand_accession: String,
    adaptor: String,
    initiator_caspase: String,
    death_domain: String,
    clinical_relevance: String,
    citation: String,
}

struct Caspase {
    name: String,
    gene: String,
    accession: String,
    caspase_class: String,
    activation_complex: String,
    substrates: String,
    cleavage_specificity: String,
    inhibited_by: String,
    clinical_relevance: String,
    citation: String,
}

struct ApoptoticEvent {
    name: String,
    event_type: String,
    key_proteins: String,
    key_accessions: String,
    mechanism: String,
    significance: String,
    detection_method: String,
    citation: String,
}

struct ApoptosisRegulator {
    name: String,
    gene: String,
    accession: String,
    regulator_class: String,
    target: String,
    mechanism: String,
    pro_or_anti: String,
    clinical_relevance: String,
    citation: String,
}

struct ClinicalContext {
    disease_category: String,
    disease_name: String,
    apoptotic_defect: String,
    key_genes: String,
    key_accessions: String,
    therapeutic_strategy: String,
    citation: String,
}


// =====================================================================
// HELPER CONSTRUCTORS
// =====================================================================

fn bcl2(n: String, g: String, a: String, fc: String, bh: String, fd: String, m: String, cr: String, ci: String) -> Bcl2FamilyMember {
    return Bcl2FamilyMember { name: n, gene: g, accession: a, family_class: fc, bh_domains: bh, function_desc: fd, mechanism: m, clinical_relevance: cr, citation: ci }
}

fn dreceptor(n: String, al: String, a: String, l: String, la: String, ad: String, ic: String, dd: String, cr: String, ci: String) -> DeathReceptor {
    return DeathReceptor { name: n, alias: al, accession: a, ligand: l, ligand_accession: la, adaptor: ad, initiator_caspase: ic, death_domain: dd, clinical_relevance: cr, citation: ci }
}

fn caspase(n: String, g: String, a: String, cc: String, ac: String, sub: String, cs: String, ib: String, cr: String, ci: String) -> Caspase {
    return Caspase { name: n, gene: g, accession: a, caspase_class: cc, activation_complex: ac, substrates: sub, cleavage_specificity: cs, inhibited_by: ib, clinical_relevance: cr, citation: ci }
}

fn aevent(n: String, et: String, kp: String, ka: String, m: String, s: String, dm: String, ci: String) -> ApoptoticEvent {
    return ApoptoticEvent { name: n, event_type: et, key_proteins: kp, key_accessions: ka, mechanism: m, significance: s, detection_method: dm, citation: ci }
}

fn regulator(n: String, g: String, a: String, rc: String, t: String, m: String, pa: String, cr: String, ci: String) -> ApoptosisRegulator {
    return ApoptosisRegulator { name: n, gene: g, accession: a, regulator_class: rc, target: t, mechanism: m, pro_or_anti: pa, clinical_relevance: cr, citation: ci }
}

fn clinical(dc: String, dn: String, ad: String, kg: String, ka: String, ts: String, ci: String) -> ClinicalContext {
    return ClinicalContext { disease_category: dc, disease_name: dn, apoptotic_defect: ad, key_genes: kg, key_accessions: ka, therapeutic_strategy: ts, citation: ci }
}


// =====================================================================
// BCL-2 FAMILY -- Gatekeepers of the Mitochondrial Pathway
// =====================================================================
//
// The Bcl-2 family controls mitochondrial outer membrane permeabilization
// (MOMP). Pro-apoptotic effectors (Bax, Bak) form pores that release
// cytochrome c. Anti-apoptotic members (Bcl-2, Bcl-xL, Mcl-1) sequester
// the effectors. BH3-only sensors (Bad, Bid, Bim, PUMA, NOXA) detect
// damage and tip the balance toward death.
//
// The decision is analog, not digital. The ratio of pro- to anti-apoptotic
// proteins at the mitochondrial surface determines outcome.
//
// CITATION: Czabotar PE et al. Nat Rev Mol Cell Biol 15:49-63, 2014.
// CITATION: Chipuk JE et al. Mol Cell 37:299-310, 2010.

fn lookup_bcl2(name: String) -> Bcl2FamilyMember {
    // --- PRO-APOPTOTIC EFFECTORS (multi-domain: BH1-BH3) ---

    if name == "Bax" { return bcl2("Bax", "BAX", "Q07812", "pro-apoptotic_effector", "BH1,BH2,BH3,BH4", "Pore-forming effector. Oligomerizes in the mitochondrial outer membrane to release cytochrome c.", "Cytosolic in healthy cells. Upon apoptotic signal, undergoes conformational change, translocates to mitochondria, inserts into outer membrane, oligomerizes into pores (MAC). Requires BH3-only activation (direct model: Bid/Bim activate; indirect model: BH3-only proteins displace Bax from anti-apoptotic sequestration).", "Bax knockout mice: lymphoid hyperplasia, male infertility. Bax mutations in microsatellite-unstable colon cancer.", "Wolter KG et al. J Cell Biol 139:1281-1292, 1997; Alberts 7th ed Ch 18") }

    if name == "Bak" { return bcl2("Bak", "BAK1", "Q16611", "pro-apoptotic_effector", "BH1,BH2,BH3", "Pore-forming effector constitutively resident on mitochondrial outer membrane.", "Already at the mitochondria (unlike Bax). Held inactive by Mcl-1 and Bcl-xL. Upon BH3-only activation, Mcl-1/Bcl-xL are neutralized, Bak oligomerizes into pores. Bax/Bak double knockout = complete resistance to intrinsic apoptosis.", "Bax/Bak DKO mice: severe developmental defects, interdigital webbing, imperforate vagina, accumulation of excess cells in CNS and hematopoietic system.", "Wei MC et al. Science 292:727-730, 2001; Lindsten T et al. Mol Cell 6:1389-1399, 2000") }

    // --- PRO-APOPTOTIC BH3-ONLY SENSORS ---

    if name == "Bad" { return bcl2("Bad", "BAD", "Q92934", "BH3-only_sensitizer", "BH3", "Sensitizer BH3-only. Neutralizes anti-apoptotic Bcl-2 and Bcl-xL by binding their hydrophobic groove.", "Phosphorylated by AKT at Ser-112, Ser-136, Ser-155, which sequesters Bad in cytosol bound to 14-3-3 proteins. Dephosphorylation frees Bad to antagonize Bcl-2/Bcl-xL at mitochondria. Does NOT directly activate Bax/Bak (sensitizer, not activator).", "Bad dephosphorylation contributes to apoptosis in growth factor withdrawal. Bad phosphorylation status reflects PI3K/AKT pathway activity.", "Datta SR et al. Cell 91:231-241, 1997; Danial NN. Oncogene 27:S53-S70, 2008") }

    if name == "Bid" { return bcl2("Bid", "BID", "P55957", "BH3-only_activator", "BH3", "Activator BH3-only. Links extrinsic (death receptor) to intrinsic (mitochondrial) pathway.", "Full-length Bid is inactive. Caspase-8 cleaves Bid to truncated tBid (at Asp-59). tBid translocates to mitochondria, directly activates Bax by inducing its conformational change and membrane insertion. This is the critical crosstalk node between extrinsic and intrinsic pathways.", "Bid cleavage amplifies death receptor signals in Type II cells (hepatocytes). Bid knockout mice are resistant to Fas-mediated liver destruction.", "Li H et al. Cell 94:491-501, 1998; Luo X et al. Cell 94:481-490, 1998; Alberts 7th ed Ch 18") }

    if name == "Bim" { return bcl2("Bim", "BCL2L11", "O43521", "BH3-only_activator", "BH3", "Most potent BH3-only activator. Binds and neutralizes ALL anti-apoptotic Bcl-2 members. Also directly activates Bax.", "Three major splice variants: BimEL (extra long), BimL (long), BimS (short). BimEL is phosphorylated by ERK1/2, targeting it for proteasomal degradation (survival signal). BimS is constitutively active. Bim is sequestered on microtubules by dynein light chain LC8; released upon apoptotic stimulus.", "Bim knockout: lymphoid and myeloid hyperplasia, autoimmune kidney disease, accelerated mortality. Essential for T-cell negative selection in thymus and B-cell tolerance.", "Bouillet P et al. Science 286:1735-1738, 1999; O'Connor L et al. EMBO J 17:384-395, 1998") }

    if name == "PUMA" { return bcl2("PUMA", "BBC3", "Q9BXH1", "BH3-only_activator", "BH3", "p53-upregulated modulator of apoptosis. Transcriptional target of p53. Binds all anti-apoptotic Bcl-2 proteins.", "Transcriptionally induced by p53 in response to DNA damage (genotoxic stress). Also induced by p53-independent pathways (p73, FOXO3a, E2F1). Binds and neutralizes Bcl-2, Bcl-xL, Mcl-1 simultaneously. Can directly activate Bax.", "PUMA knockout protects cells from p53-dependent apoptosis (radiation, chemotherapy). PUMA is the major mediator of p53-induced apoptosis in vivo.", "Nakano K, Vousden KH. Mol Cell 7:683-694, 2001; Yu J et al. Mol Cell 7:673-682, 2001") }

    if name == "NOXA" { return bcl2("NOXA", "PMAIP1", "Q13794", "BH3-only_sensitizer", "BH3", "p53-inducible BH3-only protein. Selective for Mcl-1 and A1 (does not bind Bcl-2 or Bcl-xL).", "Transcriptionally induced by p53. Binds specifically to Mcl-1, promoting Mcl-1 ubiquitination and proteasomal degradation via MARCH5/MULE E3 ligases. This selectivity means NOXA specifically frees Bak (which is held by Mcl-1) without affecting Bax (held by Bcl-2/Bcl-xL).", "NOXA cooperates with PUMA: PUMA neutralizes Bcl-2/Bcl-xL while NOXA neutralizes Mcl-1. Together they disarm all anti-apoptotic defenses.", "Oda E et al. Science 288:1053-1058, 2000; Chen L et al. Mol Cell 17:393-403, 2005") }

    // --- ANTI-APOPTOTIC MEMBERS ---

    if name == "Bcl-2" { return bcl2("Bcl-2", "BCL2", "P10415", "anti-apoptotic", "BH1,BH2,BH3,BH4", "Founding member of the family. Inhibits apoptosis by sequestering pro-apoptotic Bax and BH3-only proteins.", "Resides on mitochondrial outer membrane, ER, and nuclear envelope. Hydrophobic groove binds BH3 domains of Bax, Bak, and BH3-only proteins, preventing their pro-apoptotic activity. Does NOT prevent Bak activation as effectively as Bcl-xL or Mcl-1.", "First oncogene discovered by anti-apoptotic mechanism (not proliferative). t(14;18) translocation in follicular lymphoma places BCL2 under IgH enhancer control. Venetoclax (ABT-199) is a selective Bcl-2 inhibitor approved for CLL.", "Tsujimoto Y et al. Science 228:1440-1443, 1985; Vaux DL et al. Nature 335:440-442, 1988; Alberts 7th ed Ch 18") }

    if name == "Bcl-xL" { return bcl2("Bcl-xL", "BCL2L1", "Q07817", "anti-apoptotic", "BH1,BH2,BH3,BH4", "Potent anti-apoptotic. Major guardian of mitochondrial integrity in many cell types.", "Binds and sequesters both Bax and Bak. Binds BH3-only activators (Bid, Bim) to prevent them from activating effectors. Crystal structure of Bcl-xL with Bak BH3 peptide revealed the hydrophobic groove mechanism. Bcl-xL is essential for erythropoiesis and neuron survival.", "Overexpressed in many solid tumors. Bcl-xL knockout is embryonic lethal (massive neuronal and hepatocyte apoptosis by E13). Navitoclax (ABT-263) targets Bcl-xL and Bcl-2 but causes thrombocytopenia (platelets depend on Bcl-xL).", "Muchmore SW et al. Nature 381:335-341, 1996; Motoyama N et al. Science 267:1506-1510, 1995") }

    if name == "Mcl-1" { return bcl2("Mcl-1", "MCL1", "Q07820", "anti-apoptotic", "BH1,BH2,BH3", "Rapidly turned over anti-apoptotic protein. Primary guardian of Bak.", "Short half-life (under three hours) due to PEST sequences. Constitutively ubiquitinated by MULE/Marf and degraded by proteasome. Rapid turnover makes Mcl-1 levels exquisitely sensitive to translational and transcriptional changes. Stabilized by ERK-mediated phosphorylation, destabilized by GSK3B phosphorylation.", "Most frequently amplified gene in human cancers (chromosome 1q21). Essential for survival of hematopoietic stem cells, neutrophils, and B-cells. MCL1 amplification in breast, lung, and AML. S63845 is a selective Mcl-1 inhibitor in clinical trials.", "Kozopas KM et al. Proc Natl Acad Sci USA 90:3516-3520, 1993; Beroukhim R et al. Nature 463:899-905, 2010") }

    return bcl2("", "", "", "", "", "", "", "", "")
}


// =====================================================================
// EXTRINSIC PATHWAY -- Death Receptor Signaling
// =====================================================================
//
// Death ligands (FasL, TNF, TRAIL) bind death receptors on the cell
// surface. The receptors trimerize and recruit adaptor proteins (FADD)
// through death domain (DD) interactions. FADD recruits pro-caspase-8
// through death effector domain (DED) interactions, forming the DISC
// (Death-Inducing Signaling Complex). Caspase-8 auto-activates by
// proximity-induced dimerization.
//
// CITATION: Ashkenazi A, Dixit VM. Science 281:1305-1308, 1998.
// CITATION: Peter ME, Krammer PH. Cell Death Differ 10:26-35, 2003.

fn lookup_death_receptor(name: String) -> DeathReceptor {
    if name == "Fas" { return dreceptor("Fas", "CD95/APO-1/TNFRSF6", "P25445", "FasL (CD95L/CD178)", "P48023", "FADD (via DD)", "Caspase-8", "Yes (intracellular death domain)", "Autoimmune lymphoproliferative syndrome (ALPS) Type Ia: germline FAS mutations cause failure to delete self-reactive lymphocytes. Fas/FasL system essential for activation-induced cell death (AICD) of T-cells.", "Itoh N et al. Cell 66:233-243, 1991; Nagata S. Cell 88:355-365, 1997; Alberts 7th ed Ch 18") }

    if name == "TNFR1" { return dreceptor("TNFR1", "TNFRSF1A/CD120a/p55", "P19438", "TNF-alpha", "P01375", "TRADD -> FADD (via DD)", "Caspase-8", "Yes (intracellular death domain)", "TNFR1 signals are context-dependent: NF-kB activation (survival) vs FADD recruitment (death). Complex I (TRADD+RIP1+TRAF2+cIAP1/2) forms first for NF-kB. If NF-kB activation fails, Complex II (TRADD+FADD+caspase-8) forms for apoptosis. TNF inhibitors (infliximab, adalimumab) used in autoimmune disease.", "Hsu H et al. Cell 81:495-504, 1995; Micheau O, Tschopp J. Cell 114:181-190, 2003") }

    if name == "TRAIL-R1" { return dreceptor("TRAIL-R1", "DR4/TNFRSF10A", "O00220", "TRAIL (APO2L/TNFSF10)", "P50591", "FADD (via DD)", "Caspase-8", "Yes (intracellular death domain)", "TRAIL selectively kills tumor cells while sparing normal cells (in most contexts). Recombinant TRAIL and DR4/DR5 agonist antibodies in clinical trials for cancer. Tumor cells can develop TRAIL resistance via decoy receptor upregulation or cFLIP overexpression.", "Pan G et al. Science 276:111-113, 1997; Ashkenazi A et al. J Clin Invest 104:155-162, 1999") }

    if name == "TRAIL-R2" { return dreceptor("TRAIL-R2", "DR5/TNFRSF10B/KILLER", "O14763", "TRAIL (APO2L/TNFSF10)", "P50591", "FADD (via DD)", "Caspase-8", "Yes (intracellular death domain)", "DR5 is transcriptionally induced by p53, linking DNA damage to TRAIL sensitivity. Some tumors upregulate decoy receptors (DcR1/TNFRSF10C, DcR2/TNFRSF10D) that compete for TRAIL binding but lack functional death domains. Mapatumumab, lexatumumab, conatumumab target this pathway in clinical trials.", "Wu GS et al. Nat Genet 17:141-143, 1997; Sheridan JP et al. Science 277:818-821, 1997") }

    return dreceptor("", "", "", "", "", "", "", "", "", "")
}


// =====================================================================
// DISC AND APOPTOSOME -- Activation Complexes
// =====================================================================
//
// Two key platforms for caspase activation:
//   DISC: Death receptor + FADD + caspase-8 (extrinsic)
//   Apoptosome: Apaf-1 + cytochrome c + caspase-9 (intrinsic)
//
// Both operate by proximity-induced dimerization:
// Inactive caspase monomers are brought close together on the platform,
// dimerize, and undergo mutual trans-cleavage to generate active enzyme.
//
// CITATION: Muzio M et al. Cell 85:817-827, 1996 (DISC).
// CITATION: Zou H et al. Cell 90:405-413, 1997 (apoptosome).

fn lookup_activation_complex(name: String) -> ApoptoticEvent {
    if name == "DISC" { return aevent("Death-Inducing Signaling Complex (DISC)", "activation_platform", "Death receptor (trimerized) + FADD + pro-caspase-8 (or pro-caspase-10)", "P25445 (Fas), Q13158 (FADD), Q14790 (caspase-8)", "Death ligand binds receptor, causing trimerization. Death domains (DD) on receptor recruit FADD. Death effector domains (DED) on FADD recruit pro-caspase-8. Proximity-induced dimerization activates caspase-8. cFLIP (P98170) competes with caspase-8 for DED binding and can inhibit DISC activation.", "Initiates extrinsic apoptosis. Type I cells (lymphocytes): DISC generates enough active caspase-8 to directly cleave caspase-3. Type II cells (hepatocytes): insufficient caspase-8, must amplify through Bid cleavage -> mitochondrial pathway.", "Immunoprecipitation of receptor complex, DISC reconstitution assays, DED interaction studies", "Kischkel FC et al. EMBO J 14:5579-5588, 1995; Scaffidi C et al. EMBO J 17:1675-1687, 1998; Alberts 7th ed Ch 18") }

    if name == "apoptosome" { return aevent("Apoptosome", "activation_platform", "Apaf-1 (apoptotic protease-activating factor 1) + cytochrome c + dATP + pro-caspase-9", "O14727 (Apaf-1), P99999 (cytochrome c, somatic), P55211 (caspase-9)", "Cytochrome c released from mitochondria binds WD40 repeats on Apaf-1, inducing conformational change. Apaf-1 binds dATP, oligomerizes into a heptameric (seven-subunit) wheel structure (the apoptosome). CARD domains on Apaf-1 hub recruit pro-caspase-9 via CARD-CARD interaction. Caspase-9 is activated by induced proximity (not by cleavage). Active caspase-9 cleaves and activates executioner caspases-3 and -7.", "Central activation platform of intrinsic pathway. The molecular timer: once cytochrome c is released, the apoptosome assembles within minutes. Point of no return for many cell types.", "Cryo-EM structure: Yuan S et al. Structure 18:571-583, 2010; TUNEL assay downstream", "Zou H et al. Cell 90:405-413, 1997; Li P et al. Cell 91:479-489, 1997; Acehan D et al. Mol Cell 9:423-432, 2002") }

    if name == "MOMP" { return aevent("Mitochondrial Outer Membrane Permeabilization (MOMP)", "commitment_event", "Bax (Q07812), Bak (Q16611) form oligomeric pores. Regulated by Bcl-2 family.", "Q07812 (Bax), Q16611 (Bak)", "Pro-apoptotic BH3-only proteins activate Bax/Bak directly (activator model) or by displacing them from anti-apoptotic sequestration (sensitizer/indirect model). Bax/Bak oligomerize into large pores in the outer mitochondrial membrane. Released factors: cytochrome c (apoptosome), Smac/DIABLO (IAP neutralization), Omi/HtrA2 (IAP neutralization), AIF (caspase-independent DNA fragmentation), EndoG (caspase-independent DNA fragmentation).", "The point of no return. Once MOMP occurs, the cell is committed to die even if caspases are inhibited (caspase-independent death via AIF). MOMP is the decisive event in the intrinsic pathway.", "Cytochrome c release assay (cell fractionation + western blot), Bax/Bak oligomerization (crosslinking), mitochondrial membrane potential (JC-1 or TMRM)", "Goldstein JC et al. Nat Cell Biol 2:156-162, 2000; Tait SW, Green DR. Nat Rev Mol Cell Biol 11:621-632, 2010") }

    return aevent("", "", "", "", "", "", "", "")
}


// =====================================================================
// CASPASES -- The Executioners
// =====================================================================
//
// Caspases (cysteine-aspartate proteases) cleave after aspartate residues.
// Two classes:
//   Initiators (caspase-2, -8, -9, -10): long prodomains (CARD or DED),
//     activated on platforms by dimerization, cleave executioners.
//   Executioners (caspase-3, -6, -7): short prodomains, activated by
//     initiator cleavage, dismantle the cell.
//
// CITATION: Thornberry NA, Lazebnik Y. Science 281:1312-1316, 1998.
// CITATION: Riedl SJ, Shi Y. Nat Rev Mol Cell Biol 5:897-907, 2004.

fn lookup_caspase(name: String) -> Caspase {
    // --- INITIATOR CASPASES ---

    if name == "caspase-2" { return caspase("Caspase-2", "CASP2", "P42575", "initiator", "PIDDosome (PIDD1 + RAIDD/CRADD)", "Bid (cleavage to tBid), Golgin-160, MDM2", "VDVAD (after Asp in VDVAD motif)", "None known (not inhibited by XIAP)", "Most evolutionarily conserved caspase. Activated by DNA damage, heat shock, cytoskeletal disruption. PIDDosome assembly: PIDD1 senses DNA damage, recruits RAIDD, which recruits caspase-2 via CARD-CARD. Functions upstream of mitochondria.", "Tinel A, Tschopp J. Science 304:843-846, 2004; Lehninger 8th ed") }

    if name == "caspase-8" { return caspase("Caspase-8", "CASP8", "Q14790", "initiator", "DISC (death receptor + FADD)", "Bid (cleavage to tBid at Asp-59), pro-caspase-3, pro-caspase-7, RIP1 (cleavage prevents necroptosis)", "LETD (after Asp in IETD/LETD motif)", "cFLIP (P98170, cellular FLICE-inhibitory protein, DED competitor), CrmA (viral serpin)", "Master initiator of extrinsic pathway. Caspase-8 knockout is embryonic lethal (E11.5) due to uncontrolled necroptosis (RIPK3/MLKL pathway). Caspase-8 normally cleaves and inactivates RIPK1, preventing necroptotic death. Loss of caspase-8 in lymphocytes causes ALPS Type IIb.", "Boldin MP et al. Cell 85:803-815, 1996; Muzio M et al. Cell 85:817-827, 1996; Varfolomeev EE et al. Immunity 9:267-276, 1998") }

    if name == "caspase-9" { return caspase("Caspase-9", "CASP9", "P55211", "initiator", "Apoptosome (Apaf-1 heptamer + cytochrome c + dATP)", "Pro-caspase-3, pro-caspase-7", "LEHD (after Asp in LEHD motif)", "XIAP (P98170, BIR3 domain binds caspase-9 monomer and prevents dimerization)", "Master initiator of intrinsic pathway. Activated by induced proximity on apoptosome (not by cleavage). Caspase-9 is active ONLY when bound to apoptosome. Released caspase-9 monomers are inactive. AKT phosphorylates caspase-9 at Ser-196, inhibiting its activation (survival signal).", "Li P et al. Cell 91:479-489, 1997; Hakem R et al. Cell 94:339-352, 1998; Cardone MH et al. Science 282:1318-1321, 1998") }

    if name == "caspase-10" { return caspase("Caspase-10", "CASP10", "Q92851", "initiator", "DISC (death receptor + FADD)", "Bid, pro-caspase-3, pro-caspase-7", "IEAD (after Asp in IEAD motif)", "cFLIP (P98170)", "Paralog of caspase-8. Contains tandem DEDs. Recruited to DISC alongside caspase-8. Caspase-10 mutations cause ALPS Type IIa. Absent in mice (only in humans/primates). May have partially redundant function with caspase-8 at the DISC.", "Fernandes-Alnemri T et al. Proc Natl Acad Sci USA 93:7464-7469, 1996; Wang J et al. Cell 98:47-58, 1999") }

    // --- EXECUTIONER CASPASES ---

    if name == "caspase-3" { return caspase("Caspase-3", "CASP3", "P42574", "executioner", "Cleaved by caspase-8 or caspase-9 (at Asp-175)", "PARP (P09874, DNA repair, cleaved to inactivate), ICAD/DFF45 (O00273, releases CAD endonuclease for DNA fragmentation), lamin A (P02545, nuclear lamina disassembly), gelsolin (P06396, actin cytoskeleton destruction), ROCK1 (Q13464, membrane blebbing), alpha-fodrin (P11277, cortical cytoskeleton)", "DEVD (after Asp in DEVD motif)", "XIAP (P98170, BIR2 domain binds active caspase-3 and -7), Smac/DIABLO (Q9NR28) antagonizes XIAP", "Primary executioner caspase. The convergence point: both extrinsic and intrinsic pathways activate caspase-3. Caspase-3 knockout mice: perinatal lethality with brain hyperplasia (excess neurons from failed apoptosis). Caspase-3 activity is the standard apoptosis detection assay.", "Nicholson DW et al. Nature 376:37-43, 1995; Fernandes-Alnemri T et al. J Biol Chem 269:30761-30764, 1994; Alberts 7th ed Ch 18") }

    if name == "caspase-6" { return caspase("Caspase-6", "CASP6", "P55212", "executioner", "Cleaved by caspase-3 (downstream executioner cascade)", "Lamin A (P02545, nuclear lamina disassembly), lamin B1 (P20700), lamin C, SATB1 (chromatin organizer), huntingtin (P42858, fragment contributes to Huntington disease toxicity)", "VEHD (after Asp in VEHD motif)", "XIAP (weak), IAP family members", "Specialized executioner for nuclear disassembly. Cleaves nuclear lamins, causing nuclear shrinkage and chromatin condensation (morphological hallmarks of apoptosis). Caspase-6-mediated cleavage of huntingtin generates a toxic N-terminal fragment implicated in Huntington disease pathogenesis.", "Takahashi A et al. Proc Natl Acad Sci USA 93:8395-8400, 1996; Graham RK et al. Cell 125:1179-1191, 2006") }

    if name == "caspase-7" { return caspase("Caspase-7", "CASP7", "P55210", "executioner", "Cleaved by caspase-8 or caspase-9 (at Asp-198)", "PARP (P09874), ICAD/DFF45 (O00273), co-chaperone p23, KSRP (mRNA decay)", "DEVD (after Asp in DEVD motif, same as caspase-3)", "XIAP (P98170, BIR2 domain)", "Partially redundant with caspase-3 but with distinct substrate preferences. Caspase-7 is released from the ER membrane during apoptosis and processes ER-localized substrates. Important for ER stress-induced apoptosis.", "Fernandes-Alnemri T et al. Cancer Res 55:6045-6052, 1995; Bhatt AS et al. J Biol Chem 278:14514-14519, 2003") }

    return caspase("", "", "", "", "", "", "", "", "", "")
}


// =====================================================================
// KEY APOPTOTIC EVENTS -- What Happens When a Cell Dies
// =====================================================================
//
// Apoptosis is morphologically defined by:
//   (a) Cell shrinkage
//   (b) Chromatin condensation (pyknosis)
//   (c) DNA fragmentation (internucleosomal, 180 bp ladder)
//   (d) Membrane blebbing (no lysis)
//   (e) Phosphatidylserine externalization (eat-me signal)
//   (f) Apoptotic body formation (membrane-bound packages)
//   (g) Phagocytic clearance (no inflammation)
//
// CITATION: Kerr JF, Wyllie AH, Currie AR. Br J Cancer 26:239-257, 1972
//   (the paper that named and defined apoptosis).

fn lookup_apoptotic_event(name: String) -> ApoptoticEvent {
    if name == "DNA_fragmentation" { return aevent("DNA Fragmentation", "execution", "CAD (caspase-activated DNase, DFF40) and ICAD (inhibitor of CAD, DFF45)", "O76075 (CAD/DFF40), O00273 (ICAD/DFF45)", "ICAD binds and inhibits CAD in healthy cells. Caspase-3 cleaves ICAD at Asp-117 and Asp-224, releasing active CAD. Free CAD translocates to nucleus, cleaves DNA between nucleosomes (at linker regions), producing the characteristic 180 bp internucleosomal DNA ladder. CAD cleaves both strands simultaneously (not nicking).", "The DNA ladder is the classic biochemical hallmark of apoptosis. Distinguishes apoptosis from necrosis (which produces random DNA smearing). The 180 bp periodicity corresponds to the nucleosome repeat length.", "TUNEL assay (labels 3'-OH DNA ends), DNA gel electrophoresis (180 bp ladder), comet assay", "Enari M et al. Nature 391:43-50, 1998; Sakahira H et al. Nature 391:96-99, 1998") }

    if name == "PS_exposure" { return aevent("Phosphatidylserine Exposure", "eat-me_signal", "Xkr8 (scramblase, activated by caspase-3), TMEM16F/ANO6 (calcium-activated scramblase), ATP11C (flippase, inactivated by caspase-3)", "Q9H6D3 (Xkr8), Q4KMQ2 (TMEM16F), Q9NQ11 (ATP11C)", "In healthy cells, phosphatidylserine (PS) is kept on the inner leaflet by ATP11C (aminophospholipid flippase). Caspase-3 cleaves and inactivates ATP11C (flippase dies) AND cleaves and activates Xkr8 (scramblase activates). PS floods to the outer leaflet. Exposed PS is recognized by phagocyte receptors: Tim-4 (Q96H15), BAI1 (Q9UKV8), Stabilin-2 (Q8WWQ8), MerTK (Q12866).", "The primary eat-me signal. PS exposure flags the dying cell for phagocytic engulfment WITHOUT releasing inflammatory contents. This is why apoptosis is immunologically silent (unlike necrosis). Annexin V binds exposed PS and is the standard flow cytometry marker for apoptosis.", "Annexin V-FITC + propidium iodide (flow cytometry), fluorescent PS probes (live imaging)", "Suzuki J et al. Nature 468:834-838, 2010; Segawa K et al. Science 344:1164-1168, 2014; Alberts 7th ed Ch 18") }

    if name == "membrane_blebbing" { return aevent("Membrane Blebbing", "morphological", "ROCK1 (Rho-associated kinase 1), activated by caspase-3 cleavage", "Q13464 (ROCK1)", "Caspase-3 cleaves ROCK1, removing its autoinhibitory C-terminal domain. Constitutively active ROCK1 phosphorylates myosin light chain (MLC), causing actin-myosin contraction of the cortical cytoskeleton. The contracted cytoskeleton pushes the plasma membrane outward in localized bulges (blebs). Blebs are dynamic: they extend, retract, and eventually pinch off as apoptotic bodies.", "Membrane blebbing is a morphological hallmark of apoptosis visible under light microscopy. The blebbing is not random membrane damage but an active, energy-requiring process driven by actomyosin contraction.", "Phase contrast microscopy, time-lapse imaging, phospho-MLC immunostaining", "Coleman ML et al. Nat Cell Biol 3:339-345, 2001; Sebbagh M et al. Nat Cell Biol 3:346-352, 2001") }

    if name == "apoptotic_bodies" { return aevent("Apoptotic Body Formation", "terminal", "Products of membrane blebbing: small (one to five micrometer) membrane-bound vesicles containing condensed chromatin, organelle fragments, and cytoplasmic material", "N/A (structural event, not single protein)", "As blebbing progresses, the cell fragments into discrete, membrane-enclosed apoptotic bodies. Each body retains membrane integrity (no content leakage). Surface PS flags each body for phagocytic recognition. Phagocytes (macrophages, dendritic cells, neighboring epithelial cells) engulf and digest apoptotic bodies in lysosomes. The process is complete within hours in vivo.", "Critical for preventing inflammation. If apoptotic bodies are not cleared promptly, they undergo secondary necrosis (membrane rupture, content release, inflammation). Defective clearance is implicated in systemic lupus erythematosus (SLE): anti-dsDNA antibodies arise from uncleared apoptotic material.", "Time-lapse microscopy, flow cytometry (size gating + Annexin V), electron microscopy", "Kerr JF et al. Br J Cancer 26:239-257, 1972; Savill J, Fadok V. Nature 407:784-788, 2000; Alberts 7th ed Ch 18") }

    if name == "cytochrome_c_release" { return aevent("Cytochrome c Release", "commitment_event", "Cytochrome c (somatic), released through Bax/Bak pores", "P99999 (CYCS, somatic cytochrome c)", "Bax/Bak oligomeric pores in the mitochondrial outer membrane allow cytochrome c (12.3 kDa, normally in intermembrane space as electron carrier between Complex III and IV) to escape to the cytosol. Release is rapid and complete (all-or-none per mitochondrion) but can propagate wave-like through the mitochondrial network. Cytosolic cytochrome c binds Apaf-1 WD40 repeats, triggering apoptosome assembly.", "Cytochrome c release is the trigger for apoptosome formation and caspase-9 activation. It represents the commitment point because once released, the apoptosome assembles within minutes.", "Cell fractionation + western blot, GFP-cytochrome c live imaging, immunofluorescence", "Liu X et al. Cell 86:147-157, 1996; Goldstein JC et al. Nat Cell Biol 2:156-162, 2000") }

    return aevent("", "", "", "", "", "", "", "")
}


// =====================================================================
// REGULATORS -- The Decision Network
// =====================================================================
//
// Apoptosis is not a simple on/off switch. It is a finely balanced
// regulatory network. IAPs inhibit caspases. Smac/DIABLO inhibits IAPs.
// p53 transcribes pro-apoptotic genes. AKT phosphorylates and
// inactivates pro-apoptotic proteins. The cell integrates competing
// survival and death signals continuously.
//
// CITATION: Salvesen GS, Duckett CS. Nat Rev Mol Cell Biol 3:401-410, 2002.

fn lookup_regulator(name: String) -> ApoptosisRegulator {
    // --- INHIBITORS OF APOPTOSIS (IAPs) ---

    if name == "XIAP" { return regulator("XIAP", "XIAP", "P98170", "IAP (inhibitor of apoptosis protein)", "Caspase-3, caspase-7 (BIR2 domain), caspase-9 (BIR3 domain)", "BIR2 domain binds the active site of caspase-3 and caspase-7, directly blocking substrate access. BIR3 domain binds caspase-9 monomer and prevents dimerization on the apoptosome. XIAP also has a RING domain (E3 ubiquitin ligase) that ubiquitinates caspases for proteasomal degradation. XIAP is the ONLY IAP that directly inhibits caspase enzymatic activity.", "anti-apoptotic", "XIAP is overexpressed in many cancers. XIAP antisense oligonucleotides (AEG35156) and Smac mimetics (birinapant, LCL161) in clinical trials. Loss-of-function XIAP mutations cause X-linked lymphoproliferative syndrome type 2 (XLP2).", "Deveraux QL et al. Nature 388:300-304, 1997; Eckelman BP et al. EMBO Rep 7:988-994, 2006") }

    if name == "survivin" { return regulator("Survivin", "BIRC5", "O15392", "IAP (inhibitor of apoptosis protein)", "Disputed direct caspase inhibition; primarily functions in mitosis", "Survivin is a chromosomal passenger protein (CPC) with BIR domain. Functions at kinetochores during mitosis to ensure proper chromosome segregation. Anti-apoptotic role may be indirect: survivin stabilizes XIAP by forming a survivin-XIAP complex that prevents XIAP degradation. Also sequesters Smac/DIABLO.", "anti-apoptotic", "Highly expressed in fetal tissues and virtually all human cancers. Absent in most normal adult tissues. Attractive cancer drug target. YM155 (survivin suppressant) in clinical trials. Survivin expression is a negative prognostic marker in many tumor types.", "Ambrosini G et al. Nat Med 3:917-921, 1997; Altieri DC. Nat Rev Cancer 8:61-70, 2008") }

    // --- IAP ANTAGONISTS ---

    if name == "Smac" { return regulator("Smac/DIABLO", "DIABLO", "Q9NR28", "IAP_antagonist", "XIAP (primary), cIAP1, cIAP2", "Smac is released from mitochondrial intermembrane space during MOMP (along with cytochrome c). N-terminal AVPI tetrapeptide motif binds the BIR domains of XIAP, competitively displacing caspase-3, -7, and -9 from XIAP inhibition. Also promotes auto-ubiquitination and degradation of cIAP1/cIAP2. Smac exists as a dimer in the cytosol.", "pro-apoptotic", "Smac mimetics (birinapant, LCL161, Debio 1143) are a major class of cancer therapeutics in clinical trials. They mimic the AVPI motif, bind IAPs, and unleash caspase activity. Also sensitize tumors to TNF-mediated killing.", "Du C et al. Cell 102:33-42, 2000; Verhagen AM et al. Cell 102:43-53, 2000") }

    if name == "Omi" { return regulator("Omi/HtrA2", "HTRA2", "O43464", "IAP_antagonist_and_protease", "XIAP, cIAP1", "Released from mitochondria during MOMP. N-terminal AVPS motif (after cleavage of mitochondrial targeting sequence) binds IAP BIR domains like Smac. Additionally, Omi is a serine protease that cleaves and degrades IAPs irreversibly. Dual mechanism: competitive binding AND enzymatic destruction of IAPs.", "pro-apoptotic", "Omi/HtrA2 loss-of-function mutations linked to Parkinson disease (PARK13 locus). Omi-null mice develop parkinsonian neurodegeneration with motor neuron loss. This connects mitochondrial apoptotic machinery to neurodegeneration.", "Suzuki Y et al. Mol Cell 8:613-621, 2001; Strauss KM et al. Hum Mol Genet 14:2099-2111, 2005") }

    // --- p53: THE GUARDIAN OF THE GENOME ---

    if name == "p53" { return regulator("p53", "TP53", "P04637", "transcription_factor_and_direct_activator", "PUMA (BBC3), NOXA (PMAIP1), Bax, Apaf-1, Fas, DR5 (transcriptional targets); Bcl-2, Bcl-xL (direct binding at mitochondria)", "Dual mechanism. Transcriptional: p53 activates transcription of PUMA, NOXA, Bax, Apaf-1, Fas, DR5. These shift the Bcl-2 family balance toward death and sensitize to death receptor signaling. Transcription-independent: p53 translocates to mitochondria, directly binds and neutralizes Bcl-2 and Bcl-xL (acting as a BH3-only protein), and directly activates Bax. p53 is stabilized by DNA damage (via ATM/ATR -> Chk1/Chk2 -> p53 phosphorylation, blocking MDM2 binding). MDM2 (Q00987) is the primary negative regulator: E3 ubiquitin ligase that ubiquitinates p53 for proteasomal degradation.", "pro-apoptotic", "TP53 is the most frequently mutated gene in human cancer (mutated in over half of all cancers). Most mutations are missense in the DNA-binding domain (hotspots: R175H, G245S, R248W, R249S, R273H, R282W). Mutant p53 often gains oncogenic functions (gain-of-function mutations). Li-Fraumeni syndrome: germline TP53 mutations, cancer predisposition. MDM2 amplification achieves the same effect (p53 degradation) without TP53 mutation.", "Vogelstein B et al. Nature 408:307-310, 2000; Vousden KH, Lane DP. Nat Rev Mol Cell Biol 8:275-283, 2007; Alberts 7th ed Ch 17 and 18") }

    // --- AKT SURVIVAL SIGNALING ---

    if name == "AKT" { return regulator("AKT/PKB", "AKT1", "P31749", "kinase_survival_signaling", "Bad (Ser-136 phosphorylation), caspase-9 (Ser-196), FOXO3a (Ser-253), MDM2 (Ser-166/186)", "AKT is activated by PI3K -> PIP3 -> PDK1 phosphorylation. Active AKT phosphorylates and inactivates multiple pro-apoptotic targets: (a) Bad: phospho-Bad binds 14-3-3, sequestered away from mitochondria, cannot antagonize Bcl-2/Bcl-xL. (b) Caspase-9: phospho-caspase-9 cannot be activated on apoptosome. (c) FOXO3a: phospho-FOXO excluded from nucleus, cannot transcribe Bim and PUMA. (d) MDM2: phospho-MDM2 enters nucleus more efficiently, degrades p53 faster. Net effect: AKT simultaneously blocks four independent pro-apoptotic pathways.", "anti-apoptotic", "PI3K/AKT pathway is constitutively active in many cancers (PTEN loss, PIK3CA activating mutations, AKT amplification). AKT inhibitors (capivasertib/AZD5363, ipatasertib) approved or in clinical trials. PTEN (P60484) is the negative regulator: lipid phosphatase that dephosphorylates PIP3.", "Datta SR et al. Cell 91:231-241, 1997; Manning BD, Cantley LC. Cell 129:1261-1274, 2007; Lehninger 8th ed") }

    // --- NF-kB SURVIVAL PATHWAY ---

    if name == "NF-kB" { return regulator("NF-kB", "RELA/p65", "Q04206", "transcription_factor_survival", "Bcl-2, Bcl-xL, cFLIP, cIAP1, cIAP2, A1/BFL1 (transcriptional targets)", "NF-kB (p65/p50 heterodimer) is held inactive in cytosol by IkB-alpha (P25963). TNFR1 signaling activates IKK complex (IKK-alpha/IKK-beta/NEMO), which phosphorylates IkB-alpha for proteasomal degradation. Freed NF-kB translocates to nucleus and transcribes anti-apoptotic genes: Bcl-2, Bcl-xL, cFLIP (blocks DISC), cIAP1/2 (block caspases), and A1/BFL1. NF-kB activation explains why TNF usually does NOT kill cells despite activating a death receptor.", "anti-apoptotic", "Constitutive NF-kB activation in many cancers and inflammatory diseases. NF-kB inhibition sensitizes tumor cells to TNF/TRAIL-mediated apoptosis. Bortezomib (proteasome inhibitor) indirectly blocks NF-kB by preventing IkB degradation.", "Karin M, Lin A. Nat Immunol 3:221-227, 2002; Alberts 7th ed Ch 15") }

    return regulator("", "", "", "", "", "", "", "", "")
}


// =====================================================================
// CLINICAL CONTEXTS -- When Apoptosis Goes Wrong
// =====================================================================
//
// Apoptosis dysregulation underpins three major disease categories:
//   Too little apoptosis: CANCER (cells refuse to die)
//   Too much apoptosis: NEURODEGENERATION (neurons die prematurely)
//   Wrong target apoptosis: AUTOIMMUNITY (immune cells kill self)
//
// Evasion of apoptosis is one of Hanahan and Weinberg's Hallmarks of Cancer.
//
// CITATION: Hanahan D, Weinberg RA. Cell 144:646-674, 2011.
// CITATION: Thompson CB. Science 267:1456-1462, 1995.

fn lookup_clinical(name: String) -> ClinicalContext {
    // --- CANCER ---

    if name == "follicular_lymphoma" { return clinical("cancer", "Follicular Lymphoma", "Bcl-2 overexpression via t(14;18) translocation. IgH enhancer drives constitutive BCL2 transcription. B-cells accumulate because they cannot die, not because they proliferate excessively.", "BCL2", "P10415", "Venetoclax (ABT-199): selective BH3 mimetic that binds Bcl-2 hydrophobic groove, displacing pro-apoptotic proteins. FDA approved for CLL (2016) and AML (2018). Obinutuzumab + venetoclax = standard of care.", "Tsujimoto Y et al. Science 228:1440-1443, 1985; Roberts AW et al. N Engl J Med 374:311-322, 2016") }

    if name == "p53_cancer" { return clinical("cancer", "TP53-mutant cancers (pan-cancer)", "Loss of p53 function eliminates transcriptional activation of PUMA, NOXA, Bax, and DR5. Cells with DNA damage survive instead of undergoing apoptosis, accumulating mutations. Gain-of-function p53 mutants actively promote invasion and metastasis.", "TP53", "P04637", "Nutlins (idasanutlin): MDM2 inhibitors that stabilize wild-type p53 in tumors retaining WT TP53. APR-246/eprenetapopt: reactivates mutant p53 by restoring DNA-binding conformation (covalent modification of mutant p53 cysteine residues). Gene therapy approaches to restore p53 function.", "Kandoth C et al. Nature 502:333-339, 2013; Bykov VJN et al. Nat Med 8:282-288, 2002") }

    if name == "iap_cancer" { return clinical("cancer", "IAP-overexpressing cancers", "XIAP and survivin overexpression blocks caspase activity downstream of cytochrome c release. Cells that should die from chemotherapy-induced apoptosis survive. Survivin also promotes aberrant mitosis.", "XIAP, BIRC5 (survivin)", "P98170, O15392", "Smac mimetics (birinapant, LCL161, Debio 1143) bind IAP BIR domains, releasing caspases and triggering IAP auto-degradation. YM155 (survivin suppressant). Embelin (XIAP inhibitor, natural product). Combination with death receptor agonists (TRAIL) is synergistic.", "Fulda S, Vucic D. Nat Rev Drug Discov 11:109-124, 2012; Altieri DC. Nat Rev Cancer 8:61-70, 2008") }

    if name == "mcl1_cancer" { return clinical("cancer", "MCL1-amplified cancers (breast, lung, AML)", "MCL1 is the most frequently amplified gene in human cancers (1q21 amplification). High Mcl-1 sequesters Bak, preventing MOMP. Mcl-1 overexpression confers resistance to Bcl-2/Bcl-xL inhibitors (venetoclax, navitoclax).", "MCL1", "Q07820", "S63845, AMG 176, AZD5991: selective Mcl-1 BH3 mimetics that bind Mcl-1 hydrophobic groove, releasing Bak. Combinations with venetoclax (Bcl-2) or navitoclax (Bcl-xL) to block all anti-apoptotic escape routes simultaneously.", "Beroukhim R et al. Nature 463:899-905, 2010; Kotschy A et al. Nature 538:477-482, 2016") }

    // --- AUTOIMMUNE DISEASE ---

    if name == "alps" { return clinical("autoimmune", "Autoimmune Lymphoproliferative Syndrome (ALPS)", "Defective Fas-mediated apoptosis. Self-reactive T-cells and B-cells that should be deleted by activation-induced cell death (AICD) survive and accumulate. Massive lymphadenopathy, splenomegaly, autoimmune cytopenias.", "FAS (TNFRSF6), FASL, CASP8, CASP10", "P25445, P48023, Q14790, Q92851", "Mycophenolate mofetil and sirolimus (rapamycin) reduce lymphoproliferation. The disease demonstrates that Fas-mediated apoptosis is essential for peripheral immune tolerance. ALPS Type 0: homozygous FAS, severe. Type Ia: heterozygous FAS (dominant negative), most common. Type IIa: CASP10 mutations. Type IIb: CASP8 mutations.", "Rieux-Laucat F et al. Science 268:1347-1349, 1995; Fisher GH et al. Cell 81:935-946, 1995") }

    if name == "sle" { return clinical("autoimmune", "Systemic Lupus Erythematosus (SLE)", "Defective clearance of apoptotic bodies. When apoptotic cells are not phagocytosed promptly, they undergo secondary necrosis, releasing nuclear antigens (dsDNA, histones, snRNPs). These trigger autoantibodies (anti-dsDNA, anti-Smith). Complement deficiencies (C1q, C4) impair apoptotic body opsonization and clearance.", "C1QA, C1QB, C1QC, DNASE1L3, MFG-E8", "P02745, P02746, P02747, Q13609, Q08431", "Belimumab (anti-BAFF/BLyS): reduces B-cell survival, decreasing autoantibody production. Anifrolumab (anti-IFNAR1): blocks type I interferon signaling amplified by uncleared nucleic acids. DNASE1L3 therapy (experimental) to degrade extracellular chromatin from necrotic cells.", "Munoz LE et al. Nat Rev Rheumatol 6:280-289, 2010; Casciola-Rosen LA et al. J Exp Med 179:1317-1330, 1994") }

    // --- NEURODEGENERATION ---

    if name == "alzheimer" { return clinical("neurodegeneration", "Alzheimer Disease", "Excessive neuronal apoptosis. Amyloid-beta oligomers activate the intrinsic pathway: Bax translocation, cytochrome c release, caspase-9/caspase-3 activation. Caspase-3 cleaves tau protein, generating fragments that are more prone to aggregation (neurofibrillary tangles). Caspase-6 cleaves APP, generating amyloidogenic fragments. Positive feedback loop: amyloid triggers apoptosis, apoptotic caspases generate more amyloidogenic fragments.", "APP, PSEN1, PSEN2, BAX, CASP3, CASP6, MAPT (tau)", "P05067, P49768, P49810, Q07812, P42574, P55212, P10636", "Caspase inhibitors (experimental): Z-VAD-FMK (pan-caspase) reduces neurodegeneration in animal models but impractical for chronic dosing. Emricasan (IDN-6556): oral pan-caspase inhibitor tested in liver disease, potential CNS application. Focus shifted to preventing upstream amyloid/tau aggregation rather than blocking downstream caspases.", "Rohn TT et al. J Neurosci 21:3302-3312, 2001; Bhatt AS et al. J Biol Chem 278:14514-14519, 2003; Gamblin TC et al. Proc Natl Acad Sci USA 100:10032-10037, 2003") }

    if name == "parkinson" { return clinical("neurodegeneration", "Parkinson Disease", "Dopaminergic neuron death in substantia nigra. Mitochondrial Complex I dysfunction increases ROS, triggers intrinsic apoptosis. Alpha-synuclein aggregates (Lewy bodies) activate Bax. Omi/HtrA2 mutations (PARK13) impair mitochondrial quality control. PINK1/Parkin pathway normally removes damaged mitochondria by mitophagy; loss-of-function mutations allow damaged mitochondria to accumulate and trigger apoptosis.", "SNCA, PINK1, PARK2 (Parkin), HTRA2 (Omi), LRRK2", "P37840, Q9BXM7, O60260, O43464, Q5S007", "Rasagiline (MAO-B inhibitor): may have neuroprotective anti-apoptotic effects beyond dopamine preservation. LRRK2 kinase inhibitors (DNL201, BIIB122) in clinical trials. Gene therapy to deliver GDNF (glial cell-derived neurotrophic factor, P39905) for trophic support preventing apoptosis.", "Dawson TM, Dawson VL. Science 302:819-822, 2003; Strauss KM et al. Hum Mol Genet 14:2099-2111, 2005") }

    if name == "huntington" { return clinical("neurodegeneration", "Huntington Disease", "Caspase-6-mediated cleavage of huntingtin at Asp-586 generates a toxic N-terminal fragment containing the expanded polyglutamine tract. This fragment aggregates in the nucleus, disrupts transcription (including BDNF), and triggers further apoptosis. Blocking the Asp-586 cleavage site (D586A mutation) prevents neurodegeneration in YAC128 mouse model.", "HTT (huntingtin), CASP6, BDNF", "P42858, P55212, P23560", "HTT-lowering therapies: Tominersen (antisense oligonucleotide, Roche, Phase III halted but mechanism validated), branaplam (splicing modifier). Caspase-6-resistant huntingtin (D586A): proof of concept that blocking caspase cleavage prevents disease. Pridopidine (dopamine stabilizer, potential neuroprotective).", "Graham RK et al. Cell 125:1179-1191, 2006; Wellington CL et al. J Biol Chem 277:9466-9475, 2002") }

    return clinical("", "", "", "", "", "", "")
}


// =====================================================================
// PATHWAY INTEGRATION -- How the Pieces Connect
// =====================================================================

fn intrinsic_pathway_summary() -> String {
    return "INTRINSIC (mitochondrial) pathway: DNA damage / growth factor withdrawal / ER stress / oxidative stress -> p53 activation -> transcription of PUMA, NOXA, Bax -> BH3-only proteins neutralize anti-apoptotic Bcl-2/Bcl-xL/Mcl-1 AND directly activate Bax/Bak -> Bax/Bak oligomerize into pores (MOMP) -> cytochrome c + Smac/DIABLO + Omi/HtrA2 released -> cytochrome c + Apaf-1 + dATP form apoptosome (heptamer) -> caspase-9 activated by induced proximity -> caspase-9 cleaves caspase-3 and caspase-7 -> executioners cleave PARP, ICAD, lamins, ROCK1 -> DNA fragmentation, nuclear collapse, membrane blebbing -> PS exposure -> phagocytic clearance. Cited: Green DR. Cell 163:1346-1358, 2015; Alberts 7th ed Ch 18."
}

fn extrinsic_pathway_summary() -> String {
    return "EXTRINSIC (death receptor) pathway: FasL/TNF/TRAIL binds Fas/TNFR1/DR4/DR5 -> receptor trimerization -> death domain (DD) recruits FADD -> death effector domain (DED) recruits pro-caspase-8 -> DISC formation -> caspase-8 activated by proximity-induced dimerization -> Type I cells: caspase-8 directly cleaves caspase-3 (sufficient DISC activity) -> Type II cells: caspase-8 cleaves Bid to tBid -> tBid activates intrinsic pathway (amplification loop) -> caspase-3 activation -> execution. Crosstalk: Bid cleavage connects extrinsic to intrinsic. NF-kB activation by TNFR1 Complex I provides survival signal that opposes apoptotic Complex II. Cited: Ashkenazi A, Dixit VM. Science 281:1305-1308, 1998; Scaffidi C et al. EMBO J 17:1675-1687, 1998."
}

fn type_I_vs_type_II() -> String {
    return "Type I cells (lymphocytes, thymocytes): High DISC activity. Caspase-8 directly activates caspase-3 without mitochondrial amplification. Bcl-2 overexpression does NOT protect. Type II cells (hepatocytes, pancreatic beta cells): Low DISC activity. Caspase-8 must cleave Bid to tBid, which activates mitochondrial pathway for amplification. Bcl-2 overexpression DOES protect. Bid knockout mice are resistant to Fas-mediated liver failure but not Fas-mediated thymic apoptosis. This distinction is clinically critical: Fas agonists kill Type I tumors directly but require mitochondrial pathway competence for Type II tumors. Cited: Scaffidi C et al. EMBO J 17:1675-1687, 1998; Yin XM et al. Nature 400:886-891, 1999."
}

fn apoptosis_vs_necroptosis() -> String {
    return "When caspase-8 is inhibited (viral CrmA, chemical Z-VAD-FMK, or genetic loss), death receptor signaling switches from apoptosis to necroptosis. RIPK1 (Q13546) is normally cleaved and inactivated by caspase-8. Without caspase-8, RIPK1 kinase activity persists, phosphorylates RIPK3 (Q9Y572), which phosphorylates MLKL (Q8NB16). Phospho-MLKL oligomerizes and forms pores in the plasma membrane, causing necrotic cell death (membrane rupture, content release, inflammation). This is why caspase-8 knockout is embryonic lethal unless RIPK3 or MLKL is also knocked out. Necroptosis is a backup death mechanism when apoptosis is blocked. Cited: Cho YS et al. Cell 137:1112-1123, 2009; Sun L et al. Cell 148:213-227, 2012."
}


// =====================================================================
// QUICK-ACCESS COUNT FUNCTIONS
// =====================================================================

fn bcl2_family_count() -> Int {
    // Ten members cataloged: Bax, Bak, Bad, Bid, Bim, PUMA, NOXA, Bcl-2, Bcl-xL, Mcl-1
    return 10
}

fn death_receptor_count() -> Int {
    // Four receptors cataloged: Fas, TNFR1, TRAIL-R1, TRAIL-R2
    return 4
}

fn caspase_count() -> Int {
    // Seven caspases cataloged: initiators (caspase-2, -8, -9, -10) + executioners (caspase-3, -6, -7)
    return 7
}

fn initiator_caspase_count() -> Int {
    return 4
}

fn executioner_caspase_count() -> Int {
    return 3
}

fn apoptotic_event_count() -> Int {
    // Five events: DNA_fragmentation, PS_exposure, membrane_blebbing, apoptotic_bodies, cytochrome_c_release
    return 5
}

fn activation_complex_count() -> Int {
    // Three complexes: DISC, apoptosome, MOMP
    return 3
}

fn regulator_count() -> Int {
    // Seven regulators: XIAP, survivin, Smac, Omi, p53, AKT, NF-kB
    return 7
}

fn clinical_context_count() -> Int {
    // Eight clinical contexts: follicular_lymphoma, p53_cancer, iap_cancer, mcl1_cancer, alps, sle, alzheimer, parkinson, huntington
    return 9
}

fn total_protein_entries() -> Int {
    // Total distinct protein entries with UniProt accessions across all sections
    // Bcl-2 family: ten, death receptors: four receptors + four ligands + FADD = nine,
    // caspases: seven, events: ~eight key proteins, regulators: seven,
    // plus substrates and interactors referenced inline
    return 45
}

fn total_unique_accessions() -> String {
    return "Q07812 (Bax), Q16611 (Bak), Q92934 (Bad), P55957 (Bid), O43521 (Bim), Q9BXH1 (PUMA), Q13794 (NOXA), P10415 (Bcl-2), Q07817 (Bcl-xL), Q07820 (Mcl-1), P25445 (Fas), P19438 (TNFR1), O00220 (TRAIL-R1), O14763 (TRAIL-R2), P48023 (FasL), P01375 (TNF-alpha), P50591 (TRAIL), Q13158 (FADD), P42575 (caspase-2), Q14790 (caspase-8), P55211 (caspase-9), Q92851 (caspase-10), P42574 (caspase-3), P55212 (caspase-6), P55210 (caspase-7), O76075 (CAD), O00273 (ICAD), Q9H6D3 (Xkr8), Q4KMQ2 (TMEM16F), Q9NQ11 (ATP11C), Q13464 (ROCK1), P99999 (cytochrome c), O14727 (Apaf-1), P98170 (XIAP), O15392 (survivin), Q9NR28 (Smac/DIABLO), O43464 (Omi/HtrA2), P04637 (p53), Q00987 (MDM2), P31749 (AKT1), Q04206 (NF-kB/RELA), P25963 (IkB-alpha), P98170 (cFLIP), P09874 (PARP), P02545 (lamin A)"
}
