// organelles.sy -- All cell organelles as native Scyla.
//
// Every major organelle with its function, key proteins (UniProt),
// membrane structure, diseases when dysfunctional, and citations.
//
// Sources:
//   Alberts B et al. Molecular Biology of the Cell, 7th ed, 2022.
//   Lehninger Principles of Biochemistry, 8th ed, 2021.
//   Lodish H et al. Molecular Cell Biology, 9th ed, 2021.
//
// Marjorie McCubbins + Aether, April 2026
// Patent pending: 64/034,536

struct Organelle {
    name: String,
    membrane_type: String,
    primary_function: String,
    key_processes: String,
    key_protein_1: String,
    key_protein_1_accession: String,
    key_protein_2: String,
    key_protein_2_accession: String,
    key_protein_3: String,
    key_protein_3_accession: String,
    size: String,
    disease_when_dysfunctional: String,
    citation: String,
}

fn org(n: String, mt: String, pf: String, kp: String, kp1: String, kp1a: String, kp2: String, kp2a: String, kp3: String, kp3a: String, sz: String, dw: String, ci: String) -> Organelle {
    return Organelle { name: n, membrane_type: mt, primary_function: pf, key_processes: kp, key_protein_1: kp1, key_protein_1_accession: kp1a, key_protein_2: kp2, key_protein_2_accession: kp2a, key_protein_3: kp3, key_protein_3_accession: kp3a, size: sz, disease_when_dysfunctional: dw, citation: ci }
}

fn lookup_organelle(name: String) -> Organelle {

    if name == "nucleus" { return org("Nucleus", "double membrane (nuclear envelope)", "Houses and protects DNA. Gene expression control. mRNA processing.", "DNA replication|transcription|mRNA splicing|ribosome assembly (nucleolus)|nuclear import/export", "Lamin A/C", "P02545", "RNA Polymerase II (RPB1)", "P24928", "Importin-beta1", "Q14974", "5-10 um diameter", "Laminopathies (progeria, muscular dystrophy). Emery-Dreifuss MD. Cancer (nuclear envelope breakdown defects).", "Alberts 7th ed, Ch 12") }

    if name == "mitochondria" { return org("Mitochondria", "double membrane (outer permeable, inner cristae)", "ATP production via oxidative phosphorylation. Apoptosis regulation.", "ETC (Complexes I-IV)|ATP synthase|TCA cycle|fatty acid beta-oxidation|apoptosis (cytochrome c release)|calcium buffering|ROS production", "ATP synthase alpha", "P25705", "Cytochrome c", "P99999", "VDAC1 (porin)", "P21796", "0.5-10 um, 1000-2000 per cell", "Mitochondrial myopathy, LHON, Leigh syndrome, MELAS, Parkinson disease, aging. Maternal inheritance.", "Mitchell P. Nature 191:144-148, 1961") }

    if name == "endoplasmic_reticulum_rough" { return org("Rough Endoplasmic Reticulum (RER)", "single membrane, continuous with nuclear envelope", "Protein synthesis for secretion, membrane insertion, and ER-resident proteins.", "Co-translational translocation|N-linked glycosylation|protein folding (chaperones)|quality control (ERAD)|disulfide bond formation", "Sec61 translocon alpha", "P61619", "BiP/GRP78 (chaperone)", "P11021", "Calnexin (quality control)", "P27824", "network of flattened cisternae", "Congenital disorders of glycosylation. Cystic fibrosis (CFTR misfolding). Unfolded protein response (UPR) diseases.", "Alberts 7th ed, Ch 12") }

    if name == "endoplasmic_reticulum_smooth" { return org("Smooth Endoplasmic Reticulum (SER)", "single membrane, no ribosomes", "Lipid synthesis, drug detoxification, calcium storage.", "Phospholipid synthesis|cholesterol synthesis|steroid hormone synthesis|drug metabolism (CYP450)|calcium storage and release (SERCA pump)", "SERCA2 (Ca2+ pump)", "P16615", "CYP3A4 (drug metabolism)", "P08684", "HMG-CoA reductase", "P04035", "tubular network", "Drug metabolism deficiency. Malignant hyperthermia (RyR1 Ca release). Familial hypercholesterolemia (HMG-CoA reductase).", "Lehninger 8th ed") }

    if name == "golgi" { return org("Golgi Apparatus", "single membrane, stacked cisternae (cis-medial-trans)", "Protein and lipid modification, sorting, and packaging for secretion.", "O-linked glycosylation|proteoglycan synthesis|sulfation|phosphorylation of mannose (lysosomal targeting)|vesicle sorting (TGN)|exocytosis packaging", "GM130 (cis-Golgi marker)", "Q13901", "Mannosidase II", "Q16706", "Clathrin heavy chain", "Q00722", "cis-medial-trans stacks, 3-8 cisternae", "Congenital disorders of glycosylation type II. I-cell disease (mannose-6-phosphate tagging failure). Golgi fragmentation in Alzheimer and ALS.", "Alberts 7th ed, Ch 13") }

    if name == "lysosome" { return org("Lysosome", "single membrane, acidic lumen (pH 4.5-5.0)", "Intracellular digestion. Recycling of macromolecules. Autophagy endpoint.", "Acid hydrolases (>60 enzymes)|autophagy (autolysosome)|phagocytosis (phagolysosome)|receptor recycling|cholesterol export (NPC1)|mTORC1 signaling platform", "LAMP1 (membrane marker)", "P11279", "Cathepsin D (protease)", "P07339", "NPC1 (cholesterol export)", "O15118", "0.1-1.2 um, 50-1000 per cell", "Lysosomal storage diseases: Gaucher (GBA), Tay-Sachs (HEXA), Niemann-Pick C (NPC1), Fabry (GLA), Pompe (GAA). ~70 known LSDs.", "de Duve C. Subcellular Particles, 1955 (Nobel 1974)") }

    if name == "peroxisome" { return org("Peroxisome", "single membrane", "Fatty acid beta-oxidation (very long chain). Hydrogen peroxide metabolism. Bile acid synthesis.", "Very long chain fatty acid oxidation|hydrogen peroxide detoxification (catalase)|plasmalogen synthesis (myelin)|bile acid synthesis|ROS metabolism", "Catalase", "P04040", "PEX5 (import receptor)", "P50542", "ACOX1 (fatty acid oxidase)", "Q15067", "0.1-1.0 um, 200-600 per hepatocyte", "Zellweger spectrum disorders (peroxisome biogenesis). X-linked adrenoleukodystrophy (VLCFA accumulation). Refsum disease.", "Alberts 7th ed, Ch 12") }

    if name == "ribosome" { return org("Ribosome", "no membrane (ribonucleoprotein complex)", "Protein synthesis. Translates mRNA codons into amino acid sequence.", "mRNA decoding|peptide bond formation (peptidyl transferase, 28S rRNA)|translocation|quality control (no-go decay, non-stop decay)", "RPS6 (40S subunit)", "P62753", "RPL5 (60S subunit)", "P46777", "eEF2 (translocation factor)", "P13639", "80S = 40S small + 60S large. 25 nm. 4 rRNAs + ~80 proteins", "Diamond-Blackfan anemia (RPS19, RPL5, RPL11 mutations). Ribosomopathies. Shwachman-Diamond syndrome. Treacher Collins.", "Ramakrishnan V. Cell 108:557-572, 2002 (Nobel 2009)") }

    if name == "centrosome" { return org("Centrosome", "no membrane (pericentriolar material around centriole pair)", "Microtubule organizing center (MTOC). Spindle pole body in mitosis.", "Microtubule nucleation (gamma-tubulin ring)|spindle assembly|cilia/flagella base (basal body)|cell polarity", "gamma-Tubulin", "P23258", "Pericentrin", "O95613", "CEP152", "Q6ZW49", "~1 um, 2 per cell (G2/M)", "Microcephaly (CEP152, ASPM, CDK5RAP2 mutations). Ciliopathies when centriole forms basal body: Joubert, Meckel-Gruber, Bardet-Biedl. Cancer (centrosome amplification).", "Nigg EA, Raff JW. Cell 139:663-678, 2009") }

    if name == "cytoskeleton_actin" { return org("Actin Cytoskeleton", "no membrane (filament network)", "Cell shape, movement, division, and intracellular transport.", "Cell migration (lamellipodia, filopodia)|contractile ring (cytokinesis)|cell-cell junctions|endocytosis|muscle contraction (with myosin)", "Beta-actin", "P60709", "Cofilin-1 (depolymerizer)", "P23528", "Arp2/3 complex (branching)", "O15143", "7 nm diameter filaments, dynamic polymerization", "Baraitser-Winter syndrome (ACTB mutations). Wiskott-Aldrich syndrome (WAS, actin regulation). Non-muscle myopathies.", "Pollard TD, Cooper JA. Science 302:1704-1709, 2003") }

    if name == "cytoskeleton_microtubule" { return org("Microtubule Cytoskeleton", "no membrane (hollow tube)", "Intracellular transport, cell division (mitotic spindle), cell shape, cilia/flagella.", "Mitotic spindle|vesicle transport (kinesin anterograde, dynein retrograde)|cilia and flagella motility|axonal transport|cell polarity", "alpha-Tubulin", "Q71U36", "beta-Tubulin", "P07437", "Kinesin-1 heavy chain", "P33176", "25 nm outer diameter, 13 protofilaments", "Lissencephaly (TUBA1A mutations). Taxol/vincristine target MTs for cancer therapy. Ciliopathies. Alzheimer (tau hyperphosphorylation destabilizes MTs).", "Desai A, Bhighe Mitchison TJ. Annu Rev Cell Dev Biol 13:83-117, 1997") }

    if name == "cytoskeleton_intermediate" { return org("Intermediate Filaments", "no membrane (rope-like filaments)", "Mechanical strength and stress resistance. Nuclear lamina.", "Mechanical integrity|nuclear lamina (lamins)|epithelial integrity (keratins)|neuronal structure (neurofilaments)|muscle (desmin)|mesenchymal (vimentin)", "Vimentin", "P08670", "Keratin 14", "P02533", "Desmin", "P17661", "10 nm diameter, most stable of the three cytoskeletal systems", "Epidermolysis bullosa simplex (KRT5/KRT14). ALS (neurofilament aggregation). Dilated cardiomyopathy (desmin). Progeria (lamin A).", "Herrmann H et al. J Clin Invest 119:1772-1783, 2009") }

    if name == "plasma_membrane" { return org("Plasma Membrane", "lipid bilayer (phospholipids + cholesterol + glycolipids)", "Barrier between cell and environment. Signal transduction. Transport.", "Selective permeability|receptor signaling (RTKs, GPCRs)|ion channels|transporters (ABC, SLC)|cell adhesion (cadherins, integrins)|endocytosis|exocytosis", "Na+/K+ ATPase alpha-1", "P05023", "EGFR (receptor tyrosine kinase)", "P00533", "Integrin beta-1", "P05556", "~7.5 nm thick bilayer", "Cystic fibrosis (CFTR). Familial hypercholesterolemia (LDLR). Hereditary spherocytosis (spectrin/ankyrin). Cancer (receptor overexpression).", "Singer SJ, Nicolson GL. Science 175:720-731, 1972 (fluid mosaic model)") }

    if name == "endosome" { return org("Endosome", "single membrane, progressively acidifying", "Sorting station for internalized cargo. Receptor recycling or lysosomal degradation.", "Early endosome (pH 6.5, sorting)|late endosome/MVB (pH 5.5, ESCRT pathway)|recycling endosome (receptor return to surface)|retromer (retrograde to Golgi)", "EEA1 (early endosome marker)", "Q15075", "RAB5 (early endosome GTPase)", "P20339", "RAB7 (late endosome GTPase)", "P51149", "early: 100-500 nm; late/MVB: 250-1000 nm", "Charcot-Marie-Tooth type 2B (RAB7 mutations). Hereditary spastic paraplegia. Alzheimer (endosomal dysfunction, APP processing).", "Alberts 7th ed, Ch 13") }

    if name == "autophagosome" { return org("Autophagosome", "double membrane (de novo formation)", "Bulk degradation of cytoplasmic contents. Cellular recycling under starvation.", "Phagophore nucleation (ULK1 complex)|membrane elongation (ATG5-ATG12-ATG16L1)|LC3 lipidation (ATG4, ATG7, ATG3)|cargo recognition (p62/SQSTM1)|fusion with lysosome", "LC3B (ATG8 homolog)", "Q9GZQ8", "p62/SQSTM1 (cargo receptor)", "Q13501", "ULK1 (initiation kinase)", "O75385", "0.5-1.5 um, induced by starvation or mTOR inhibition", "Neurodegeneration (Alzheimer, Parkinson, Huntington — failed autophagy of aggregates). Cancer (context-dependent: tumor suppressor early, tumor promoter late). Crohn disease (ATG16L1 variant).", "Ohsumi Y. Cell 163:P13-14, 2015 (Nobel Prize 2016)") }

    if name == "proteasome" { return org("Proteasome (26S)", "no membrane (barrel-shaped protease complex)", "Targeted degradation of ubiquitinated proteins. Quality control. Cell cycle regulation.", "Ubiquitin recognition (19S regulatory particle)|protein unfolding and threading|proteolysis (20S core, 3 catalytic activities: trypsin-like, chymotrypsin-like, caspase-like)|peptide release", "PSMA1 (20S alpha subunit)", "P25786", "PSMD1 (19S lid subunit)", "Q99460", "UBB (Ubiquitin)", "P0CG47", "20S core: 28 subunits in 4 rings. 19S cap: 19 subunits. Total 26S: ~2.5 MDa, 15 nm x 12 nm", "Bortezomib (proteasome inhibitor) for multiple myeloma. Parkinson (impaired proteasomal degradation of alpha-synuclein). Angelman syndrome (UBE3A ubiquitin ligase).", "Hershko A, Ciechanover A. Annu Rev Biochem 67:461-485, 1998 (Nobel 2004)") }

    return org("Unknown", "", "", "", "", "", "", "", "", "", "", "", "")
}

// ═══════════════════════════════════════════════════════
// QUICK ACCESS
// ═══════════════════════════════════════════════════════

fn organelle_count() -> Int {
    return 16
}

fn membrane_bound_organelle_count() -> Int {
    return 10
}

fn non_membrane_organelle_count() -> Int {
    return 6
}

fn all_organelle_names() -> String {
    return "nucleus|mitochondria|endoplasmic_reticulum_rough|endoplasmic_reticulum_smooth|golgi|lysosome|peroxisome|ribosome|centrosome|cytoskeleton_actin|cytoskeleton_microtubule|cytoskeleton_intermediate|plasma_membrane|endosome|autophagosome|proteasome"
}
