Make a pdf for presentation in class on topic hyperammonemia 1 disorder . Explain proper mechanism about its biochemistry and treatment plan make it much more simpler than earlier to understand and present and add a clinical case to it also keep it short
mkdir -p /home/daytona/workspace/hyperammonemia-pdf && ls /home/daytona/workspace/
~/hyperammonemia-pdf/build_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, ListFlowable, ListItem
)
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import os
OUTPUT = "/home/daytona/workspace/hyperammonemia-pdf/Hyperammonemia_Disorder.pdf"
# ── Colour palette ──────────────────────────────────────────────────────────
TEAL = colors.HexColor("#0E7C7B")
TEAL_DARK = colors.HexColor("#065A59")
TEAL_LITE = colors.HexColor("#D4EDED")
AMBER = colors.HexColor("#E07B00")
AMBER_LITE= colors.HexColor("#FFF3DC")
WHITE = colors.white
GREY_TXT = colors.HexColor("#333333")
GREY_LITE = colors.HexColor("#F5F5F5")
RED_LITE = colors.HexColor("#FDE8E8")
RED_DARK = colors.HexColor("#C0392B")
GREEN_LITE= colors.HexColor("#E8F8EF")
GREEN_DARK= colors.HexColor("#1A7A4A")
W, H = A4
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
topMargin=1.8*cm, bottomMargin=1.8*cm,
leftMargin=2*cm, rightMargin=2*cm
)
styles = getSampleStyleSheet()
def S(name, **kw):
"""Quick ParagraphStyle factory."""
base = styles["Normal"]
return ParagraphStyle(name, parent=base, **kw)
# ── Custom styles ────────────────────────────────────────────────────────────
TITLE = S("title_slide", fontSize=30, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_CENTER, leading=38)
SUB = S("subtitle", fontSize=14, textColor=TEAL_LITE,
fontName="Helvetica-Oblique", alignment=TA_CENTER, leading=20)
TAG = S("tag", fontSize=10, textColor=TEAL_LITE,
fontName="Helvetica", alignment=TA_CENTER, leading=14)
SH = S("section_h", fontSize=17, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_LEFT, leading=22,
spaceAfter=4)
SH2 = S("subhead", fontSize=13, textColor=TEAL_DARK,
fontName="Helvetica-Bold", spaceAfter=4, spaceBefore=6, leading=18)
BODY = S("body", fontSize=10.5, textColor=GREY_TXT,
leading=16, spaceAfter=4, alignment=TA_JUSTIFY)
BULLET = S("bullet", fontSize=10.5, textColor=GREY_TXT,
leading=16, leftIndent=14, spaceAfter=3,
bulletIndent=4)
SMALL = S("small", fontSize=9, textColor=colors.HexColor("#666666"),
leading=13)
CITE = S("cite", fontSize=8.5, textColor=colors.HexColor("#888888"),
fontName="Helvetica-Oblique", leading=12)
CASE_H = S("case_h", fontSize=11, textColor=AMBER,
fontName="Helvetica-Bold", leading=16, spaceAfter=2)
CASE_B = S("case_b", fontSize=10, textColor=GREY_TXT,
leading=15, spaceAfter=3, alignment=TA_JUSTIFY)
EMPH = S("emph", fontSize=10.5, textColor=RED_DARK,
fontName="Helvetica-Bold", leading=16)
# ────────────────────────────────────────────────────────────────────────────
# Helper: section header bar
def sec_header(text):
tbl = Table([[Paragraph(text, SH)]], colWidths=[W - 4*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL_DARK),
("ROUNDEDCORNERS", [6,6,6,6]),
("TOPPADDING", (0,0),(-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("LEFTPADDING", (0,0),(-1,-1), 14),
]))
return tbl
# Helper: coloured info box
def info_box(text, bg=TEAL_LITE, border=TEAL):
p = Paragraph(text, S("ib", parent=BODY, textColor=GREY_TXT, alignment=TA_JUSTIFY))
t = Table([[p]], colWidths=[W - 4*cm])
t.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), bg),
("BOX",(0,0),(-1,-1), 1.2, border),
("TOPPADDING",(0,0),(-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("LEFTPADDING",(0,0),(-1,-1), 12),
("RIGHTPADDING",(0,0),(-1,-1), 8),
]))
return t
# Helper: two-col table
def two_col(left_text, right_text, l_bg=TEAL_LITE, r_bg=AMBER_LITE,
l_border=TEAL, r_border=AMBER):
half = (W - 4*cm - 0.4*cm) / 2
lp = Paragraph(left_text, S("lp", parent=BODY))
rp = Paragraph(right_text, S("rp", parent=BODY))
t = Table([[lp, rp]], colWidths=[half, half], spaceBefore=0)
t.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0), l_bg),
("BACKGROUND",(1,0),(1,0), r_bg),
("BOX",(0,0),(0,0), 1, l_border),
("BOX",(1,0),(1,0), 1, r_border),
("TOPPADDING",(0,0),(-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("LEFTPADDING",(0,0),(-1,-1), 10),
("RIGHTPADDING",(0,0),(-1,-1), 10),
("VALIGN",(0,0),(-1,-1),"TOP"),
]))
return t
def b(txt): return f"<b>{txt}</b>"
def i(txt): return f"<i>{txt}</i>"
def br(): return Spacer(1, 8)
def hr(): return HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#CCCCCC"), spaceAfter=6, spaceBefore=6)
# ============================================================================
story = []
# ══════════════════════════════════════════════════════════════════
# PAGE 1 — TITLE SLIDE
# ══════════════════════════════════════════════════════════════════
# Full-width colour banner using a Table
title_tbl = Table(
[[Paragraph("HYPERAMMONEMIA", TITLE)],
[Paragraph("Urea Cycle Disorder — Biochemistry & Clinical Management", SUB)],
[Spacer(1, 6)],
[Paragraph("Biochemistry Presentation • Class Module", TAG)]],
colWidths=[W - 4*cm]
)
title_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), TEAL_DARK),
("TOPPADDING",(0,0),(-1,-1), 16),
("BOTTOMPADDING",(0,0),(-1,-1), 14),
("LEFTPADDING",(0,0),(-1,-1), 24),
("ROUNDEDCORNERS",[10,10,10,10]),
]))
story += [title_tbl, Spacer(1, 16)]
# Quick overview box
story += [
info_box(
"<b>What is Hyperammonemia?</b> Ammonia (NH₃) is a by-product of amino acid "
"breakdown. In health, the liver converts it to <b>urea</b> via the <b>Urea Cycle</b> and "
"excretes it in urine. When this pathway fails — due to a genetic enzyme defect or liver "
"disease — ammonia accumulates in blood, crosses the blood-brain barrier, and becomes "
"<b>directly neurotoxic</b>. Normal blood NH₃ = <b>5–35 µmol/L</b>; toxic levels can exceed "
"<b>1,000 µmol/L</b>."
),
Spacer(1, 10),
]
# Key facts row
kf_data = [
[Paragraph("<b>Normal NH₃</b>\n5–35 µmol/L", BODY),
Paragraph("<b>Danger Level</b>\n> 100 µmol/L", S("kf2", parent=BODY, textColor=RED_DARK, fontName="Helvetica-Bold")),
Paragraph("<b>Emergency</b>\n> 200 µmol/L coma risk", S("kf3", parent=BODY, textColor=RED_DARK, fontName="Helvetica-Bold")),
Paragraph("<b>Incidence</b>\n~1 : 25,000 births", BODY)],
]
kf_tbl = Table(kf_data, colWidths=[(W-4*cm)/4]*4)
kf_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0), TEAL_LITE),
("BACKGROUND",(1,0),(1,0), RED_LITE),
("BACKGROUND",(2,0),(2,0), RED_LITE),
("BACKGROUND",(3,0),(3,0), TEAL_LITE),
("BOX",(0,0),(-1,-1), 0.8, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.5, colors.HexColor("#CCCCCC")),
("ALIGN",(0,0),(-1,-1),"CENTER"),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("TOPPADDING",(0,0),(-1,-1), 10),
("BOTTOMPADDING",(0,0),(-1,-1), 10),
]))
story += [kf_tbl, PageBreak()]
# ══════════════════════════════════════════════════════════════════
# PAGE 2 — THE UREA CYCLE (Simple)
# ══════════════════════════════════════════════════════════════════
story += [sec_header("🔬 The Urea Cycle — How Ammonia Becomes Urea"), br()]
story += [
Paragraph("Think of the Urea Cycle as a <b>5-step waste-processing factory</b> inside the liver. "
"Its job: grab toxic NH₃ and package it as harmless urea (peed out in urine).", BODY),
br(),
]
# Step-by-step cycle table
steps = [
["Step", "Location", "Enzyme", "What Happens", "Key Substrate → Product"],
["1", "Mitochondria", "CPS-I\n(needs NAGS as activator)", "NH₃ + CO₂ → Carbamoyl phosphate", "NH₃ → Carbamoyl-P"],
["2", "Mitochondria", "OTC\n(X-linked!)", "Carbamoyl-P + Ornithine → Citrulline", "Carbamoyl-P → Citrulline"],
["3", "Cytoplasm", "ASS", "Citrulline + Aspartate → Argininosuccinate", "Citrulline → Argininosuccinate"],
["4", "Cytoplasm", "ASL", "Argininosuccinate → Arginine + Fumarate", "Argininosuccinate → Arginine"],
["5", "Cytoplasm", "Arginase-I", "Arginine → Urea + Ornithine (cycle restarts!)", "Arginine → Urea"],
]
s_col = [1.2*cm, 2.2*cm, 3.5*cm, 5.5*cm, 4.5*cm]
s_tbl = Table(steps, colWidths=s_col)
s_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), TEAL_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]),
("ALIGN",(0,0),(-1,-1),"LEFT"),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 5),
("BOX",(0,0),(-1,-1), 1, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
]))
story += [s_tbl, br()]
story += [
info_box(
"💡 <b>Key memory hook:</b> <i>\"Ordinarily, Careless Cows Aren't Agitated\"</i> → "
"Ornithine → Carbamoyl-P → Citrulline → Argininosuccinate → Arginine → (back to Ornithine). "
"Two waste nitrogens enter per cycle (one from NH₃, one from Aspartate) → one urea exits.",
bg=GREEN_LITE, border=GREEN_DARK
),
PageBreak()
]
# ══════════════════════════════════════════════════════════════════
# PAGE 3 — BIOCHEMISTRY OF TOXICITY
# ══════════════════════════════════════════════════════════════════
story += [sec_header("⚠️ How Ammonia Damages the Brain"), br()]
story += [
Paragraph(b("Mechanism of neurotoxicity — 3 key pathways:"), SH2), br(),
]
mech = [
["Mechanism", "What happens", "Clinical result"],
["α-Ketoglutarate\nDepletion",
"NH₃ + α-KG → Glutamate (via GDH)\nGlutamate + NH₃ → Glutamine (via GS)\nDrains TCA cycle intermediates",
"↓ ATP production\nBrain energy failure"],
["Glutamine\nAccumulation",
"Glutamine builds up inside astrocytes.\nOsmotic swelling of glial cells",
"Cerebral oedema\nRaised intracranial pressure"],
["Neurotransmitter\nDisruption",
"Excess glutamate → excitotoxicity.\nAltered GABA signalling",
"Seizures, altered consciousness"],
]
m_tbl = Table(mech, colWidths=[3*cm, 7.5*cm, 5.5*cm])
m_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), AMBER),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 9),
("ROWBACKGROUNDS",(0,1),(-1,-1), [AMBER_LITE, WHITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("ALIGN",(0,0),(-1,-1),"LEFT"),
("TOPPADDING",(0,0),(-1,-1), 6),
("BOTTOMPADDING",(0,0),(-1,-1), 6),
("LEFTPADDING",(0,0),(-1,-1), 6),
("BOX",(0,0),(-1,-1), 1, AMBER),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#E0C080")),
]))
story += [m_tbl, br()]
story += [
Paragraph(b("Ammonia transport in blood (non-toxic carriers):"), SH2),
Paragraph(
"Peripheral tissues cannot excrete NH₃ directly. They attach it to safe "
"transport molecules:", BODY),
br(),
]
transport = [
[Paragraph(b("Glutamine") + " (main carrier)\n\nGlutamate + NH₃ → Glutamine\n(enzyme: Glutamine Synthetase)\n\n"
"Glutamine travels to liver → Glutaminase releases NH₃ → fed into urea cycle.",
S("tc", parent=BODY, fontSize=9.5)),
Paragraph(b("Alanine") + " (glucose–alanine cycle)\n\nMuscle catabolises BCAAs → pyruvate + glutamate → "
"Alanine (via ALT transaminase)\n\nAlanine → liver → transaminated back to pyruvate "
"(used in gluconeogenesis) + glutamate → NH₃ → urea cycle.",
S("tc2", parent=BODY, fontSize=9.5))],
]
tr_tbl = Table(transport, colWidths=[(W-4*cm)/2]*2)
tr_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0), TEAL_LITE),
("BACKGROUND",(1,0),(1,0), GREEN_LITE),
("BOX",(0,0),(0,0), 1, TEAL),
("BOX",(1,0),(1,0), 1, GREEN_DARK),
("TOPPADDING",(0,0),(-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("LEFTPADDING",(0,0),(-1,-1), 10),
("RIGHTPADDING",(0,0),(-1,-1), 10),
("VALIGN",(0,0),(-1,-1),"TOP"),
]))
story += [tr_tbl, PageBreak()]
# ══════════════════════════════════════════════════════════════════
# PAGE 4 — TYPES / ENZYME DEFECTS
# ══════════════════════════════════════════════════════════════════
story += [sec_header("🧬 Urea Cycle Enzyme Defects"), br()]
story += [
Paragraph("Each enzyme in the cycle can be deficient. Below is a quick reference:", BODY), br(),
]
defects = [
["Enzyme Deficiency", "Also called", "Key Lab Finding", "Notes"],
["CPS-I deficiency", "—", "Low citrulline & arginine;\nNo orotic acid ↑", "Rare; neonatal crisis"],
["OTC deficiency\n(Most common!)", "OTC deficiency", "Low citrulline; orotic acid ↑↑ in urine", "X-linked; mainly males affected; female carriers can be symptomatic"],
["ASS deficiency", "Citrullinemia Type 1", "Citrulline ↑↑ in blood & urine", "Detected on newborn screen"],
["ASL deficiency", "Argininosuccinic aciduria", "Argininosuccinate ↑↑ in urine", "Neurological delays in severe forms"],
["Arginase-I deficiency", "Argininemia", "Arginine ↑↑; milder hyperammonemia", "Normal birth; symptoms after 1–3 yrs"],
["NAGS deficiency", "—", "Similar to CPS-I; responds to carglumic acid", "Very rare; treatable!"],
]
d_tbl = Table(defects, colWidths=[3.5*cm, 2.8*cm, 4.2*cm, 6.5*cm])
d_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), TEAL_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("ALIGN",(0,0),(-1,-1),"LEFT"),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 5),
("BOX",(0,0),(-1,-1), 1, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
("BACKGROUND",(0,2),(-1,2), colors.HexColor("#FFF0D0")), # Highlight OTC
("FONTNAME",(0,2),(0,2),"Helvetica-Bold"),
]))
story += [d_tbl, br()]
story += [
info_box(
"<b>OTC Deficiency — Remember:</b> Only X-linked urea cycle disorder. "
"Carbamoyl-P overflows into cytosol → used for pyrimidine synthesis → "
"orotic acid ↑↑ in urine. This distinguishes OTC from CPS-I (no orotic acid rise).",
bg=AMBER_LITE, border=AMBER
),
PageBreak()
]
# ══════════════════════════════════════════════════════════════════
# PAGE 5 — SYMPTOMS & DIAGNOSIS
# ══════════════════════════════════════════════════════════════════
story += [sec_header("🩺 Clinical Features & Diagnosis"), br()]
story += [Paragraph(b("Symptoms — depend on severity and age of onset:"), SH2)]
sym_data = [
["Neonatal (Severe)", "Late-onset / Partial Defect"],
["• Refusal to feed (within 24–48 h of protein feeds)\n"
"• Vomiting, lethargy\n"
"• Rapid breathing (hyperventilation → respiratory alkalosis)\n"
"• Hypotonia (floppy baby)\n"
"• Seizures\n"
"• Coma → death if untreated",
"• Episodes triggered by illness, fasting, high protein meals, stress\n"
"• Headache, confusion, irritability\n"
"• Tremors, slurred speech\n"
"• Intellectual disability over time\n"
"• Developmental delay"],
]
sym_tbl = Table(sym_data, colWidths=[(W-4*cm)/2]*2)
sym_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0), RED_LITE),
("BACKGROUND",(1,0),(1,0), AMBER_LITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 9.5),
("VALIGN",(0,0),(-1,-1),"TOP"),
("BOX",(0,0),(0,0), 1, RED_DARK),
("BOX",(1,0),(1,0), 1, AMBER),
("TOPPADDING",(0,0),(-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("LEFTPADDING",(0,0),(-1,-1), 8),
]))
story += [sym_tbl, br()]
story += [Paragraph(b("Diagnostic Work-up:"), SH2)]
diag_data = [
["Test", "Finding", "Tells you"],
["Plasma ammonia", "> 100–200 µmol/L", "Confirms hyperammonemia"],
["Plasma amino acids", "↑ Glutamine, ↑ Alanine;\nSpecific AA changes per defect", "Pinpoints cycle block"],
["Urine orotic acid", "↑ in OTC deficiency", "Differentiates OTC from CPS-I"],
["Urine organic acids / amino acids", "Argininosuccinate ↑ → ASL\nCitrulline ↑ → ASS", "Specific enzyme defect"],
["ABG (blood gas)", "Respiratory alkalosis (↑ pH, ↓ pCO₂)", "NH₃ stimulates respiration"],
["Liver function tests", "Can be normal in congenital forms", "Rules out liver disease"],
["Genetic testing", "Confirms exact mutation", "Definitive diagnosis"],
]
diag_tbl = Table(diag_data, colWidths=[4*cm, 4.5*cm, 8.5*cm])
diag_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), TEAL_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 5),
("BOX",(0,0),(-1,-1), 1, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
]))
story += [diag_tbl, PageBreak()]
# ══════════════════════════════════════════════════════════════════
# PAGE 6 — TREATMENT
# ══════════════════════════════════════════════════════════════════
story += [sec_header("💊 Treatment Plan"), br()]
story += [
info_box(
"<b>Goal:</b> 1️⃣ Reduce ammonia production • 2️⃣ Enhance ammonia removal "
"• 3️⃣ Prevent brain damage • 4️⃣ Long-term metabolic control",
bg=TEAL_LITE, border=TEAL_DARK
), br(),
]
# Acute treatment
story += [Paragraph(b("ACUTE / Emergency Management (ICU):"), SH2)]
acute = [
["Intervention", "How it works"],
["Stop protein intake\n(48–72 h)", "Eliminates NH₃ source from amino acid catabolism"],
["High-calorie IV glucose\n(+/- lipids)", "Prevents body from breaking down own muscle (catabolism)"],
["IV Sodium Benzoate +\nSodium Phenylacetate\n(Ammonul®)", "Nitrogen scavengers:\n• Benzoate + Glycine → Hippurate (excreted in urine)\n• Phenylacetate + Glutamine → Phenylacetylglutamine (excreted)\n→ Each molecule excreted carries waste nitrogen out of body"],
["IV Arginine\n(or Citrulline)", "Replenishes urea cycle intermediates; promotes cycle activity;\nArginine → Urea + Ornithine (Arginase reaction)"],
["Dialysis\n(Haemodialysis preferred)", "Fastest method to clear ammonia when levels > 500 µmol/L or coma"],
["Carglumic acid\n(for NAGS deficiency)", "Synthetic NAG analogue → activates CPS-I → restores cycle"],
]
a_tbl = Table(acute, colWidths=[4.5*cm, 12.5*cm])
a_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), RED_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [RED_LITE, WHITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 6),
("BOTTOMPADDING",(0,0),(-1,-1), 6),
("LEFTPADDING",(0,0),(-1,-1), 6),
("BOX",(0,0),(-1,-1), 1, RED_DARK),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
]))
story += [a_tbl, br()]
# Chronic treatment
story += [Paragraph(b("CHRONIC / Long-term Management:"), SH2)]
chronic = [
["Strategy", "Detail"],
["Low-protein diet", "Tailored to age/weight; enough protein for growth, minimal excess"],
["Special medical formula", "Essential amino acids without excess nitrogen load"],
["Oral sodium phenylbutyrate\n(Buphenyl®) / Glycerol\nphenylbutyrate (Ravicti®)", "Oral nitrogen scavenger — daily long-term use"],
["Arginine / Citrulline\nsupplementation", "Replenishes depleted cycle intermediates"],
["Liver transplantation", "Curative — replaces defective enzyme in hepatocytes.\nAmmonia normalises, but neurological damage already present is not reversed"],
["Gene therapy\n(investigational)", "Emerging — AAV-mediated OTC/ASS gene correction in trials"],
]
c_tbl = Table(chronic, colWidths=[4.5*cm, 12.5*cm])
c_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), GREEN_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [GREEN_LITE, WHITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 6),
("BOTTOMPADDING",(0,0),(-1,-1), 6),
("LEFTPADDING",(0,0),(-1,-1), 6),
("BOX",(0,0),(-1,-1), 1, GREEN_DARK),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#AADDBB")),
]))
story += [c_tbl, PageBreak()]
# ══════════════════════════════════════════════════════════════════
# PAGE 7 — CLINICAL CASE
# ══════════════════════════════════════════════════════════════════
story += [sec_header("📋 Clinical Case — OTC Deficiency"), br()]
case_box_data = [[
Paragraph(
"<b>PRESENTING COMPLAINT</b>\n\n"
"Baby <i>Hamza</i>, a 5-day-old male infant, born at term via normal delivery. "
"Birth weight 3.2 kg. Breastfeeding started on day 1.\n\n"
"On day 4, mother notices baby is <b>feeding poorly, vomiting</b>, and becoming "
"<b>increasingly lethargic</b>. By day 5 he is <b>hypotonic, unresponsive</b>, "
"and breathing very fast. Rushed to emergency.",
CASE_B
)
]]
case_tbl_1 = Table(case_box_data, colWidths=[W-4*cm])
case_tbl_1.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), AMBER_LITE),
("BOX",(0,0),(-1,-1), 1.5, AMBER),
("TOPPADDING",(0,0),(-1,-1), 10),
("BOTTOMPADDING",(0,0),(-1,-1), 10),
("LEFTPADDING",(0,0),(-1,-1), 14),
("RIGHTPADDING",(0,0),(-1,-1), 14),
]))
story += [case_tbl_1, br()]
# Investigations
story += [Paragraph(b("Investigations:"), SH2)]
inv_data = [
["Investigation", "Result", "Interpretation"],
["Plasma Ammonia", "780 µmol/L (N: 5–35)", "Severely elevated → hyperammonemia"],
["Blood Gas (ABG)", "pH 7.55, pCO₂ 28 mmHg", "Respiratory alkalosis (NH₃ drives hyperventilation)"],
["Plasma Amino Acids", "Glutamine ↑↑, Alanine ↑↑\nCitrulline very low", "Consistent with early urea cycle block"],
["Urine Orotic Acid", "Markedly elevated", "KEY finding → OTC deficiency (not CPS-I)"],
["Plasma Arginine", "Low", "Confirms downstream cycle product depleted"],
["Liver enzymes / LFTs", "Normal", "Excludes liver disease as cause"],
["Genetic testing", "Hemizygous OTC mutation confirmed", "Definitive: OTC deficiency"],
]
inv_tbl = Table(inv_data, colWidths=[4*cm, 4.5*cm, 8.5*cm])
inv_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), TEAL_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 5),
("BOX",(0,0),(-1,-1), 1, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
("BACKGROUND",(0,4),(-1,4), colors.HexColor("#FFF0D0")),
]))
story += [inv_tbl, br()]
# Diagnosis box
diag_final = Table([[
Paragraph(
"<b>DIAGNOSIS: OTC Deficiency</b>\n\n"
"Ornithine Transcarbamylase (OTC) is step 2 of the urea cycle. "
"Without it, carbamoyl phosphate overflows into the cytoplasm, enters "
"the pyrimidine synthesis pathway, and produces excess <b>orotic acid</b>. "
"This is the diagnostic hallmark distinguishing OTC from CPS-I deficiency.",
CASE_B
)
]], colWidths=[W-4*cm])
diag_final.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), RED_LITE),
("BOX",(0,0),(-1,-1), 2, RED_DARK),
("TOPPADDING",(0,0),(-1,-1), 10),
("BOTTOMPADDING",(0,0),(-1,-1), 10),
("LEFTPADDING",(0,0),(-1,-1), 14),
("RIGHTPADDING",(0,0),(-1,-1), 14),
]))
story += [diag_final, PageBreak()]
# ══════════════════════════════════════════════════════════════════
# PAGE 8 — CASE MANAGEMENT & KEY TAKEAWAYS
# ══════════════════════════════════════════════════════════════════
story += [sec_header("💉 Case Management & Key Takeaways"), br()]
story += [Paragraph(b("Management of Baby Hamza (OTC Deficiency):"), SH2)]
mgmt = [
["Phase", "Action", "Rationale"],
["Immediate", "Stop breastfeeding (stop protein)",
"Remove NH₃ source immediately"],
["Immediate", "IV 10% Dextrose + Intralipid",
"High calorie → suppress catabolism"],
["Acute", "IV Ammonul® (Na Benzoate + Na Phenylacetate)",
"Nitrogen scavengers → excrete NH₃ as hippurate & phenylacetylglutamine"],
["Acute", "IV Arginine infusion",
"Replenish depleted cycle intermediates"],
["Acute", "Haemodialysis",
"Ammonia 780 µmol/L → dialysis needed urgently"],
["Once stable", "Reintroduce protein gradually with formula",
"Minimum protein for growth; monitor NH₃"],
["Long-term", "Oral sodium phenylbutyrate daily",
"Chronic nitrogen scavenging"],
["Long-term", "Liver transplant evaluation",
"Curative option for severe OTC deficiency"],
]
mgmt_tbl = Table(mgmt, colWidths=[2.5*cm, 5.5*cm, 9*cm])
mgmt_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), TEAL_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 5),
("BOX",(0,0),(-1,-1), 1, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
]))
story += [mgmt_tbl, br()]
# Key takeaways
story += [Paragraph(b("Key Takeaways — Remember These for the Exam:"), SH2)]
takeaways = [
["✅ Urea cycle is the ONLY way liver clears NH₃ → 5 enzymes, 6 steps (including NAGS activation)"],
["✅ OTC deficiency = most common, X-linked, OROTIC ACID ↑ in urine (distinguishes from CPS-I)"],
["✅ NH₃ neurotoxicity: depletes α-KG → TCA failure; glutamine in astrocytes → cerebral oedema"],
["✅ Neonates present 24–72 h after protein feeds: feeding refusal, vomiting, coma"],
["✅ Diagnosis: plasma NH₃, plasma amino acids, URINE OROTIC ACID, genetic testing"],
["✅ Treatment: STOP protein → high-cal IV → nitrogen scavengers (benzoate/phenylacetate) → arginine → dialysis if severe"],
["✅ Liver transplant = curative (but does NOT reverse existing brain damage)"],
]
for row in takeaways:
tk_tbl = Table(row, colWidths=[W-4*cm])
tk_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), GREEN_LITE),
("BOX",(0,0),(-1,-1), 0.8, GREEN_DARK),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 10),
("FONTSIZE",(0,0),(-1,-1), 9.5),
]))
story += [tk_tbl, Spacer(1, 4)]
story += [
br(),
hr(),
Paragraph(
"Source: Biochemistry, 8th ed — Lippincott Illustrated Reviews (Ferrier, 2019), pp. 722–728 "
"• Bradley & Daroff's Neurology in Clinical Practice • Basic Medical Biochemistry 6e",
CITE
),
]
# ── Build ────────────────────────────────────────────────────────────────────
doc.build(story)
print("PDF created:", OUTPUT)
~/hyperammonemia-pdf/build_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/hyperammonemia-pdf/build_pdf.py'
~/hyperammonemia-pdf/build_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak
)
OUTPUT = "/home/daytona/workspace/hyperammonemia-pdf/Hyperammonemia_Disorder.pdf"
# Colour palette
TEAL = colors.HexColor("#0E7C7B")
TEAL_DARK = colors.HexColor("#065A59")
TEAL_LITE = colors.HexColor("#D4EDED")
AMBER = colors.HexColor("#E07B00")
AMBER_LITE= colors.HexColor("#FFF3DC")
WHITE = colors.white
GREY_TXT = colors.HexColor("#333333")
GREY_LITE = colors.HexColor("#F5F5F5")
RED_LITE = colors.HexColor("#FDE8E8")
RED_DARK = colors.HexColor("#C0392B")
GREEN_LITE= colors.HexColor("#E8F8EF")
GREEN_DARK= colors.HexColor("#1A7A4A")
W, H = A4
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
topMargin=1.8*cm, bottomMargin=1.8*cm,
leftMargin=2*cm, rightMargin=2*cm
)
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, parent=styles["Normal"], **kw)
TITLE = S("title_slide", fontSize=30, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_CENTER, leading=38)
SUB = S("subtitle", fontSize=14, textColor=TEAL_LITE,
fontName="Helvetica-Oblique", alignment=TA_CENTER, leading=20)
TAG = S("tag", fontSize=10, textColor=TEAL_LITE,
fontName="Helvetica", alignment=TA_CENTER, leading=14)
SH = S("section_h", fontSize=17, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_LEFT, leading=22)
SH2 = S("subhead", fontSize=13, textColor=TEAL_DARK,
fontName="Helvetica-Bold", spaceAfter=4, spaceBefore=6, leading=18)
BODY = S("body", fontSize=10.5, textColor=GREY_TXT,
leading=16, spaceAfter=4, alignment=TA_JUSTIFY)
CITE = S("cite", fontSize=8.5, textColor=colors.HexColor("#888888"),
fontName="Helvetica-Oblique", leading=12)
CASE_B= S("case_b", fontSize=10, textColor=GREY_TXT,
leading=15, spaceAfter=3, alignment=TA_JUSTIFY)
def sec_header(text):
tbl = Table([[Paragraph(text, SH)]], colWidths=[W - 4*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL_DARK),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 14),
]))
return tbl
def info_box(text, bg=TEAL_LITE, border=TEAL):
p = Paragraph(text, S("ib", parent=BODY))
t = Table([[p]], colWidths=[W - 4*cm])
t.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), bg),
("BOX",(0,0),(-1,-1), 1.2, border),
("TOPPADDING",(0,0),(-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("LEFTPADDING",(0,0),(-1,-1), 12),
("RIGHTPADDING",(0,0),(-1,-1), 8),
]))
return t
def make_table(data, col_widths, header_bg=TEAL_DARK, row_colors=None):
if row_colors is None:
row_colors = [WHITE, GREY_LITE]
tbl = Table(data, colWidths=col_widths)
tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), header_bg),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), row_colors),
("VALIGN",(0,0),(-1,-1),"TOP"),
("ALIGN",(0,0),(-1,-1),"LEFT"),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 5),
("BOX",(0,0),(-1,-1), 1, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
]))
return tbl
def br(n=8): return Spacer(1, n)
def hr(): return HRFlowable(width="100%", thickness=0.5,
color=colors.HexColor("#CCCCCC"),
spaceAfter=6, spaceBefore=6)
def b(t): return f"<b>{t}</b>"
story = []
# ── PAGE 1: TITLE ──────────────────────────────────────────────────────────
title_tbl = Table(
[[Paragraph("HYPERAMMONEMIA", TITLE)],
[Paragraph("Urea Cycle Disorder — Biochemistry & Clinical Management", SUB)],
[Spacer(1, 6)],
[Paragraph("Biochemistry Presentation • Class Module", TAG)]],
colWidths=[W - 4*cm]
)
title_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), TEAL_DARK),
("TOPPADDING",(0,0),(-1,-1), 16),
("BOTTOMPADDING",(0,0),(-1,-1), 14),
("LEFTPADDING",(0,0),(-1,-1), 24),
]))
story += [title_tbl, br(16)]
story += [
info_box(
b("What is Hyperammonemia?") + " Ammonia (NH3) is a by-product of amino acid "
"breakdown. In health, the liver converts it to <b>urea</b> via the <b>Urea Cycle</b> and "
"excretes it in urine. When this pathway fails — due to a genetic enzyme defect or liver "
"disease — ammonia accumulates in blood, crosses the blood-brain barrier, and becomes "
"<b>directly neurotoxic</b>. Normal blood NH3 = <b>5-35 umol/L</b>; toxic levels can exceed "
"<b>1,000 umol/L</b>."
),
br(10),
]
kf_data = [[
Paragraph(b("Normal NH3") + "\n5-35 umol/L", BODY),
Paragraph(b("Danger Level") + "\n> 100 umol/L",
S("kf2", parent=BODY, textColor=RED_DARK, fontName="Helvetica-Bold")),
Paragraph(b("Emergency") + "\n> 200 umol/L\ncoma risk",
S("kf3", parent=BODY, textColor=RED_DARK, fontName="Helvetica-Bold")),
Paragraph(b("Incidence") + "\n~1 : 25,000 births", BODY),
]]
kf_tbl = Table(kf_data, colWidths=[(W-4*cm)/4]*4)
kf_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0), TEAL_LITE),
("BACKGROUND",(1,0),(1,0), RED_LITE),
("BACKGROUND",(2,0),(2,0), RED_LITE),
("BACKGROUND",(3,0),(3,0), TEAL_LITE),
("BOX",(0,0),(-1,-1), 0.8, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.5, colors.HexColor("#CCCCCC")),
("ALIGN",(0,0),(-1,-1),"CENTER"),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("TOPPADDING",(0,0),(-1,-1), 10),
("BOTTOMPADDING",(0,0),(-1,-1), 10),
]))
story += [kf_tbl, PageBreak()]
# ── PAGE 2: UREA CYCLE ────────────────────────────────────────────────────
story += [sec_header("The Urea Cycle — How Ammonia Becomes Urea"), br()]
story += [
Paragraph(
"Think of the Urea Cycle as a <b>5-step waste-processing factory</b> inside the liver. "
"Its job: grab toxic NH3 and package it as harmless urea (peed out in urine).", BODY),
br(),
]
steps = [
["Step", "Location", "Enzyme", "What Happens", "Key Change"],
["1", "Mitochondria", "CPS-I\n(needs NAGS)", "NH3 + CO2 form Carbamoyl phosphate", "NH3 captured"],
["2", "Mitochondria", "OTC\n(X-linked!)", "Carbamoyl-P + Ornithine form Citrulline", "Citrulline made"],
["3", "Cytoplasm", "ASS", "Citrulline + Aspartate form Argininosuccinate", "2nd N enters"],
["4", "Cytoplasm", "ASL", "Argininosuccinate splits to Arginine + Fumarate", "Arginine released"],
["5", "Cytoplasm", "Arginase-I", "Arginine splits to Urea + Ornithine (cycle restarts)", "Urea out!"],
]
story += [make_table(steps, [1.2*cm, 2.2*cm, 3.5*cm, 5.8*cm, 4.3*cm]), br()]
story += [
info_box(
b("Memory trick:") + " <i>\"Ordinarily, Careless Cows Aren't Agitated\"</i> "
"= Ornithine > Carbamoyl-P > Citrulline > Argininosuccinate > Arginine > back to Ornithine. "
"Two waste nitrogens enter per turn (one from NH3, one from Aspartate) and one urea exits.",
bg=GREEN_LITE, border=GREEN_DARK
),
PageBreak()
]
# ── PAGE 3: HOW AMMONIA DAMAGES THE BRAIN ────────────────────────────────
story += [sec_header("How Ammonia Damages the Brain"), br()]
story += [Paragraph(b("3 Key Mechanisms of Neurotoxicity:"), SH2), br()]
mech = [
["Mechanism", "What happens inside", "Clinical result"],
["Alpha-KG Depletion",
"NH3 + alpha-KG form Glutamate (enzyme: GDH)\n"
"Glutamate + NH3 form Glutamine (enzyme: GS)\n"
"This drains the TCA cycle of alpha-KG",
"Less ATP produced\nBrain energy failure"],
["Glutamine Accumulation",
"Glutamine builds up inside astrocytes\n"
"Osmotic water follows into glial cells",
"Cerebral oedema\nRaised intracranial pressure"],
["Neurotransmitter Disruption",
"Excess glutamate causes excitotoxicity\n"
"Altered GABA signalling",
"Seizures\nAltered consciousness"],
]
mech_tbl = Table(mech, colWidths=[3.5*cm, 8*cm, 5.5*cm])
mech_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), AMBER),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 9),
("ROWBACKGROUNDS",(0,1),(-1,-1), [AMBER_LITE, WHITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 6),
("BOTTOMPADDING",(0,0),(-1,-1), 6),
("LEFTPADDING",(0,0),(-1,-1), 6),
("BOX",(0,0),(-1,-1), 1, AMBER),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#E0C080")),
]))
story += [mech_tbl, br()]
story += [Paragraph(b("How Ammonia Travels Safely in Blood:"), SH2)]
half = (W - 4*cm - 0.4*cm) / 2
tr_data = [[
Paragraph(
b("Glutamine (main carrier)") + "\n\n"
"Glutamate + NH3 > Glutamine\n(enzyme: Glutamine Synthetase)\n\n"
"Glutamine travels safely to liver.\nIn liver: Glutaminase releases NH3 "
"which enters urea cycle.",
S("tc", parent=BODY, fontSize=9.5)
),
Paragraph(
b("Alanine (Glucose-Alanine Cycle)") + "\n\n"
"Muscle breaks down amino acids > pyruvate + glutamate > Alanine\n(via ALT)\n\n"
"Alanine > liver > transaminated back to pyruvate (for gluconeogenesis) "
"+ glutamate > NH3 > urea cycle.",
S("tc2", parent=BODY, fontSize=9.5)
),
]]
tr_tbl = Table(tr_data, colWidths=[half, half])
tr_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0), TEAL_LITE),
("BACKGROUND",(1,0),(1,0), GREEN_LITE),
("BOX",(0,0),(0,0), 1, TEAL),
("BOX",(1,0),(1,0), 1, GREEN_DARK),
("TOPPADDING",(0,0),(-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("LEFTPADDING",(0,0),(-1,-1), 10),
("RIGHTPADDING",(0,0),(-1,-1), 10),
("VALIGN",(0,0),(-1,-1),"TOP"),
]))
story += [tr_tbl, PageBreak()]
# ── PAGE 4: ENZYME DEFECTS ───────────────────────────────────────────────
story += [sec_header("Urea Cycle Enzyme Defects"), br()]
story += [Paragraph("Each enzyme in the cycle can be deficient. Quick reference:", BODY), br()]
defects = [
["Deficiency", "Other Name", "Key Lab Finding", "Notes"],
["CPS-I", "—", "Low citrulline & arginine\nNo orotic acid rise", "Rare; severe neonatal crisis"],
["OTC\n(MOST COMMON)", "OTC deficiency", "Low citrulline\nOrotic acid HIGH in urine", "X-linked; mainly males; female carriers can be symptomatic"],
["ASS", "Citrullinemia Type 1", "Citrulline very HIGH in blood & urine", "Detected on newborn screening"],
["ASL", "Argininosuccinic aciduria", "Argininosuccinate HIGH in urine", "Neuro delays in severe forms"],
["Arginase-I", "Argininemia / Hyperargininemia", "Arginine HIGH; milder hyperammonemia", "Normal birth; symptoms after 1-3 yrs"],
["NAGS", "—", "Same as CPS-I; responds to carglumic acid", "Very rare; specifically treatable!"],
]
def_tbl = make_table(defects, [2.5*cm, 3*cm, 4.5*cm, 7*cm])
# Highlight OTC row
def_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), TEAL_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]),
("BACKGROUND",(0,2),(-1,2), colors.HexColor("#FFF0D0")),
("FONTNAME",(0,2),(0,2),"Helvetica-Bold"),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 5),
("BOX",(0,0),(-1,-1), 1, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
]))
story += [def_tbl, br()]
story += [
info_box(
b("OTC vs CPS-I — How to tell them apart:") +
" Both give low citrulline and arginine, BUT only OTC deficiency raises "
"urinary orotic acid. Why? When OTC is blocked, carbamoyl phosphate overflows "
"into the cytoplasm and gets used to make pyrimidines, producing excess orotic acid.",
bg=AMBER_LITE, border=AMBER
),
PageBreak()
]
# ── PAGE 5: SYMPTOMS & DIAGNOSIS ──────────────────────────────────────────
story += [sec_header("Clinical Features and Diagnosis"), br()]
story += [Paragraph(b("Symptoms — depend on severity and age:"), SH2)]
sym_data = [[
Paragraph(
b("Neonatal (Severe)\n\n") +
"- Refusal to feed (24-48 h after protein)\n"
"- Vomiting, lethargy\n"
"- Rapid breathing (hyperventilation)\n"
"- Floppy baby (hypotonia)\n"
"- Seizures\n"
"- Coma and death if untreated",
S("sl", parent=BODY, fontSize=9.5)
),
Paragraph(
b("Late-onset / Partial Defect\n\n") +
"- Episodes triggered by illness, fasting,\n high protein meals, or stress\n"
"- Headache, confusion, irritability\n"
"- Tremors, slurred speech\n"
"- Intellectual disability over time\n"
"- Developmental delay",
S("sr", parent=BODY, fontSize=9.5)
),
]]
sym_tbl = Table(sym_data, colWidths=[(W-4*cm)/2]*2)
sym_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0), RED_LITE),
("BACKGROUND",(1,0),(1,0), AMBER_LITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 9.5),
("VALIGN",(0,0),(-1,-1),"TOP"),
("BOX",(0,0),(0,0), 1, RED_DARK),
("BOX",(1,0),(1,0), 1, AMBER),
("TOPPADDING",(0,0),(-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("LEFTPADDING",(0,0),(-1,-1), 8),
]))
story += [sym_tbl, br()]
story += [Paragraph(b("Diagnostic Tests:"), SH2)]
diag_rows = [
["Test", "Finding", "Tells You"],
["Plasma Ammonia", "> 100-200 umol/L", "Confirms hyperammonemia"],
["Plasma Amino Acids", "Glutamine up, Alanine up;\nSpecific AAs per defect", "Locates cycle block"],
["Urine Orotic Acid", "HIGH in OTC deficiency", "Tells OTC from CPS-I"],
["Urine Amino Acids", "Argininosuccinate up > ASL\nCitrulline up > ASS", "Specific enzyme defect"],
["Blood Gas (ABG)", "Respiratory alkalosis\n(high pH, low pCO2)", "NH3 drives hyperventilation"],
["LFTs", "Often normal in congenital forms", "Excludes liver disease"],
["Genetic Testing", "Confirms exact mutation", "Definitive diagnosis"],
]
story += [make_table(diag_rows, [4*cm, 4.5*cm, 8.5*cm]), PageBreak()]
# ── PAGE 6: TREATMENT ──────────────────────────────────────────────────────
story += [sec_header("Treatment Plan"), br()]
story += [
info_box(
b("4 Goals of Treatment: ") +
"1) Reduce NH3 production "
"2) Enhance NH3 removal "
"3) Prevent brain damage "
"4) Long-term metabolic control"
), br(),
]
story += [Paragraph(b("ACUTE Emergency Management (ICU):"), SH2)]
acute = [
["Intervention", "How it works"],
["Stop protein intake (48-72 h)", "Removes NH3 source immediately"],
["IV 10% Glucose + Lipid infusion", "High-calorie — stops body breaking down own muscle"],
["IV Sodium Benzoate +\nSodium Phenylacetate (Ammonul)", "Nitrogen scavengers:\nBenzoate + Glycine > Hippurate (urine)\nPhenylacetate + Glutamine > Phenylacetylglutamine (urine)\nEach molecule excreted carries waste nitrogen out"],
["IV Arginine (or Citrulline)", "Replenishes urea cycle intermediates; drives cycle forward"],
["Haemodialysis", "Fastest NH3 clearance; needed when NH3 > 500 umol/L or coma"],
["Carglumic acid\n(NAGS deficiency only)", "Synthetic NAG analogue > activates CPS-I > restores cycle"],
]
a_tbl = Table(acute, colWidths=[4.5*cm, 12.5*cm])
a_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), RED_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [RED_LITE, WHITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 6),
("BOTTOMPADDING",(0,0),(-1,-1), 6),
("LEFTPADDING",(0,0),(-1,-1), 6),
("BOX",(0,0),(-1,-1), 1, RED_DARK),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
]))
story += [a_tbl, br()]
story += [Paragraph(b("LONG-TERM Chronic Management:"), SH2)]
chronic = [
["Strategy", "Detail"],
["Low-protein diet", "Tailored to age and weight; enough for growth, minimal excess"],
["Medical formula / special foods", "Essential amino acids without excess nitrogen load"],
["Oral sodium phenylbutyrate\n(Buphenyl / Ravicti)", "Daily nitrogen scavenger — taken long-term"],
["Arginine / Citrulline supplementation", "Replenishes depleted urea cycle intermediates"],
["Liver transplantation", "CURATIVE — replaces the defective enzyme.\nNote: brain damage already present is NOT reversed"],
["Gene therapy (investigational)", "AAV-mediated OTC/ASS gene correction — in clinical trials"],
]
c_tbl = Table(chronic, colWidths=[4.5*cm, 12.5*cm])
c_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), GREEN_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [GREEN_LITE, WHITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 6),
("BOTTOMPADDING",(0,0),(-1,-1), 6),
("LEFTPADDING",(0,0),(-1,-1), 6),
("BOX",(0,0),(-1,-1), 1, GREEN_DARK),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#AADDBB")),
]))
story += [c_tbl, PageBreak()]
# ── PAGE 7: CLINICAL CASE ─────────────────────────────────────────────────
story += [sec_header("Clinical Case — OTC Deficiency"), br()]
case1 = Table([[
Paragraph(
b("PRESENTING COMPLAINT") + "\n\n"
"Baby Hamza, a 5-day-old male, born at full term. Birth weight 3.2 kg. "
"Breastfeeding started on day 1.\n\n"
"On day 4, mother notices he is <b>feeding poorly and vomiting</b>. "
"By day 5 he is <b>hypotonic, unresponsive</b>, and breathing very fast. "
"Rushed to emergency department.",
CASE_B
)
]], colWidths=[W-4*cm])
case1.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), AMBER_LITE),
("BOX",(0,0),(-1,-1), 1.5, AMBER),
("TOPPADDING",(0,0),(-1,-1), 10),
("BOTTOMPADDING",(0,0),(-1,-1), 10),
("LEFTPADDING",(0,0),(-1,-1), 14),
("RIGHTPADDING",(0,0),(-1,-1), 14),
]))
story += [case1, br()]
story += [Paragraph(b("Investigations:"), SH2)]
inv = [
["Test", "Result", "Interpretation"],
["Plasma Ammonia", "780 umol/L (N: 5-35)", "SEVERELY elevated"],
["Blood Gas (ABG)", "pH 7.55, pCO2 28 mmHg", "Respiratory alkalosis (NH3 drives hyperventilation)"],
["Plasma Amino Acids", "Glutamine HIGH, Alanine HIGH\nCitrulline very LOW", "Block early in urea cycle"],
["Urine Orotic Acid", "MARKEDLY elevated", "KEY finding > OTC deficiency (not CPS-I)"],
["Plasma Arginine", "Low", "Downstream product depleted"],
["LFTs", "Normal", "Excludes liver disease"],
["Genetic Testing", "Hemizygous OTC mutation", "DEFINITIVE: OTC deficiency"],
]
inv_tbl = make_table(inv, [4*cm, 4.5*cm, 8.5*cm])
inv_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), TEAL_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]),
("BACKGROUND",(0,4),(-1,4), colors.HexColor("#FFF0D0")),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 5),
("BOX",(0,0),(-1,-1), 1, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
]))
story += [inv_tbl, br()]
diag_box = Table([[
Paragraph(
b("DIAGNOSIS: OTC Deficiency") + "\n\n"
"OTC (step 2 of urea cycle) is blocked. Carbamoyl phosphate cannot proceed and "
"overflows into the cytoplasm > enters pyrimidine synthesis > produces excess orotic acid. "
"This is the DIAGNOSTIC HALLMARK that differentiates OTC from CPS-I deficiency.",
CASE_B
)
]], colWidths=[W-4*cm])
diag_box.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), RED_LITE),
("BOX",(0,0),(-1,-1), 2, RED_DARK),
("TOPPADDING",(0,0),(-1,-1), 10),
("BOTTOMPADDING",(0,0),(-1,-1), 10),
("LEFTPADDING",(0,0),(-1,-1), 14),
("RIGHTPADDING",(0,0),(-1,-1), 14),
]))
story += [diag_box, PageBreak()]
# ── PAGE 8: CASE MANAGEMENT & TAKEAWAYS ──────────────────────────────────
story += [sec_header("Case Management and Key Takeaways"), br()]
story += [Paragraph(b("Management of Baby Hamza (OTC Deficiency):"), SH2)]
mgmt = [
["Phase", "Action", "Rationale"],
["Immediate", "Stop breastfeeding (stop protein)", "Removes NH3 source immediately"],
["Immediate", "IV 10% Dextrose + Intralipid", "High calorie input suppresses catabolism"],
["Acute", "IV Ammonul (Na Benzoate + Na Phenylacetate)", "Nitrogen scavengers; excrete NH3 as hippurate and phenylacetylglutamine"],
["Acute", "IV Arginine infusion", "Replenish depleted urea cycle intermediates"],
["Acute", "Haemodialysis", "NH3 at 780 umol/L — urgent dialysis required"],
["Stabilised", "Reintroduce protein gradually with formula", "Minimum protein for growth; monitor NH3 closely"],
["Long-term", "Oral sodium phenylbutyrate daily", "Chronic nitrogen scavenging"],
["Long-term", "Liver transplant evaluation", "Curative option for severe OTC deficiency"],
]
mgmt_tbl = Table(mgmt, colWidths=[2.5*cm, 5.5*cm, 9*cm])
mgmt_tbl.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0), TEAL_DARK),
("TEXTCOLOR",(0,0),(-1,0), WHITE),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,-1), 8.5),
("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]),
("VALIGN",(0,0),(-1,-1),"TOP"),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 5),
("BOX",(0,0),(-1,-1), 1, TEAL),
("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")),
]))
story += [mgmt_tbl, br()]
story += [Paragraph(b("Key Takeaways to Remember:"), SH2)]
points = [
"Urea cycle is the ONLY pathway to clear NH3 from blood — 5 enzymes, 6 steps (NAGS activates CPS-I)",
"OTC deficiency = most common urea cycle disorder; X-linked; OROTIC ACID rises in urine (unlike CPS-I)",
"NH3 toxicity: depletes alpha-KG from TCA cycle; glutamine swells astrocytes causing cerebral oedema",
"Neonates present 24-72 h after protein feeds: feeding refusal, vomiting, rapid breathing, coma",
"Diagnosis: plasma NH3 + plasma amino acids + URINE OROTIC ACID + genetic testing",
"Treatment: STOP protein > IV glucose/lipid > nitrogen scavengers (benzoate/phenylacetate) > arginine > dialysis if severe",
"Liver transplant = curative — BUT does NOT reverse existing neurological damage",
]
for pt in points:
row = Table([[Paragraph(" " + pt, S("pt", parent=BODY, fontSize=9.5))]], colWidths=[W-4*cm])
row.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1), GREEN_LITE),
("BOX",(0,0),(-1,-1), 0.8, GREEN_DARK),
("TOPPADDING",(0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING",(0,0),(-1,-1), 10),
]))
story += [row, Spacer(1, 4)]
story += [
br(),
hr(),
Paragraph(
"Sources: Biochemistry 8th ed — Lippincott Illustrated Reviews (Ferrier, 2019) pp. 722-728 "
"| Bradley & Daroff's Neurology in Clinical Practice "
"| Basic Medical Biochemistry 6e",
CITE
),
]
doc.build(story)
print("PDF created:", OUTPUT)
cat > /home/daytona/workspace/hyperammonemia-pdf/build_pdf.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from reportlab.platypus import ( SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak ) OUTPUT = "/home/daytona/workspace/hyperammonemia-pdf/Hyperammonemia_Disorder.pdf" TEAL = colors.HexColor("#0E7C7B") TEAL_DARK = colors.HexColor("#065A59") TEAL_LITE = colors.HexColor("#D4EDED") AMBER = colors.HexColor("#E07B00") AMBER_LITE= colors.HexColor("#FFF3DC") WHITE = colors.white GREY_TXT = colors.HexColor("#333333") GREY_LITE = colors.HexColor("#F5F5F5") RED_LITE = colors.HexColor("#FDE8E8") RED_DARK = colors.HexColor("#C0392B") GREEN_LITE= colors.HexColor("#E8F8EF") GREEN_DARK= colors.HexColor("#1A7A4A") W, H = A4 doc = SimpleDocTemplate(OUTPUT, pagesize=A4, topMargin=1.8*cm, bottomMargin=1.8*cm, leftMargin=2*cm, rightMargin=2*cm) styles = getSampleStyleSheet() def S(name, **kw): return ParagraphStyle(name, parent=styles["Normal"], **kw) TITLE = S("title_slide", fontSize=30, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_CENTER, leading=38) SUB = S("subtitle", fontSize=14, textColor=TEAL_LITE, fontName="Helvetica-Oblique", alignment=TA_CENTER, leading=20) TAG = S("tag", fontSize=10, textColor=TEAL_LITE, fontName="Helvetica", alignment=TA_CENTER, leading=14) SH = S("section_h", fontSize=17, textColor=WHITE, fontName="Helvetica-Bold", alignment=TA_LEFT, leading=22) SH2 = S("subhead", fontSize=13, textColor=TEAL_DARK, fontName="Helvetica-Bold", spaceAfter=4, spaceBefore=6, leading=18) BODY = S("body", fontSize=10.5, textColor=GREY_TXT, leading=16, spaceAfter=4, alignment=TA_JUSTIFY) CITE = S("cite", fontSize=8.5, textColor=colors.HexColor("#888888"), fontName="Helvetica-Oblique", leading=12) CASE_B= S("case_b", fontSize=10, textColor=GREY_TXT, leading=15, spaceAfter=3, alignment=TA_JUSTIFY) def sec_header(text): tbl = Table([[Paragraph(text, SH)]], colWidths=[W - 4*cm]) tbl.setStyle(TableStyle([ ("BACKGROUND", (0,0), (-1,-1), TEAL_DARK), ("TOPPADDING", (0,0), (-1,-1), 8), ("BOTTOMPADDING",(0,0),(-1,-1), 8), ("LEFTPADDING", (0,0), (-1,-1), 14), ])) return tbl def info_box(text, bg=TEAL_LITE, border=TEAL): p = Paragraph(text, S("ib", parent=BODY)) t = Table([[p]], colWidths=[W - 4*cm]) t.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), bg), ("BOX",(0,0),(-1,-1), 1.2, border), ("TOPPADDING",(0,0),(-1,-1), 8), ("BOTTOMPADDING",(0,0),(-1,-1), 8), ("LEFTPADDING",(0,0),(-1,-1), 12), ("RIGHTPADDING",(0,0),(-1,-1), 8), ])) return t def make_table(data, col_widths, header_bg=TEAL_DARK): tbl = Table(data, colWidths=col_widths) tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0), header_bg), ("TEXTCOLOR",(0,0),(-1,0), WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"), ("FONTSIZE",(0,0),(-1,-1), 8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]), ("VALIGN",(0,0),(-1,-1),"TOP"), ("ALIGN",(0,0),(-1,-1),"LEFT"), ("TOPPADDING",(0,0),(-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1), 5), ("LEFTPADDING",(0,0),(-1,-1), 5), ("BOX",(0,0),(-1,-1), 1, TEAL), ("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")), ])) return tbl def br(n=8): return Spacer(1, n) def hr(): return HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#CCCCCC"), spaceAfter=6, spaceBefore=6) def b(t): return "<b>%s</b>" % t story = [] # PAGE 1 TITLE title_tbl = Table( [[Paragraph("HYPERAMMONEMIA", TITLE)], [Paragraph("Urea Cycle Disorder — Biochemistry and Clinical Management", SUB)], [Spacer(1, 6)], [Paragraph("Biochemistry Presentation | Class Module", TAG)]], colWidths=[W - 4*cm]) title_tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), TEAL_DARK), ("TOPPADDING",(0,0),(-1,-1), 16), ("BOTTOMPADDING",(0,0),(-1,-1), 14), ("LEFTPADDING",(0,0),(-1,-1), 24), ])) story += [title_tbl, br(16)] story += [info_box( b("What is Hyperammonemia?") + " Ammonia (NH3) is a waste product of amino acid breakdown. " "In health, the liver converts it to <b>urea</b> via the <b>Urea Cycle</b> and excretes it in urine. " "When this pathway fails — due to a genetic enzyme defect or liver disease — ammonia accumulates in blood, " "crosses the blood-brain barrier, and becomes <b>directly neurotoxic</b>. " "Normal blood NH3 = <b>5-35 umol/L</b>; toxic levels can exceed <b>1,000 umol/L</b>." ), br(10)] kf = [[ Paragraph(b("Normal NH3") + "\n5-35 umol/L", BODY), Paragraph(b("Danger Level") + "\n> 100 umol/L", S("kf2", parent=BODY, textColor=RED_DARK, fontName="Helvetica-Bold")), Paragraph(b("Emergency") + "\n> 200 umol/L\ncoma risk", S("kf3", parent=BODY, textColor=RED_DARK, fontName="Helvetica-Bold")), Paragraph(b("Incidence") + "\n~1 : 25,000 births", BODY), ]] kft = Table(kf, colWidths=[(W-4*cm)/4]*4) kft.setStyle(TableStyle([ ("BACKGROUND",(0,0),(0,0), TEAL_LITE), ("BACKGROUND",(1,0),(1,0), RED_LITE), ("BACKGROUND",(2,0),(2,0), RED_LITE), ("BACKGROUND",(3,0),(3,0), TEAL_LITE), ("BOX",(0,0),(-1,-1), 0.8, TEAL), ("INNERGRID",(0,0),(-1,-1), 0.5, colors.HexColor("#CCCCCC")), ("ALIGN",(0,0),(-1,-1),"CENTER"), ("VALIGN",(0,0),(-1,-1),"MIDDLE"), ("TOPPADDING",(0,0),(-1,-1), 10), ("BOTTOMPADDING",(0,0),(-1,-1), 10), ])) story += [kft, PageBreak()] # PAGE 2 UREA CYCLE story += [sec_header("The Urea Cycle — How Ammonia Becomes Urea"), br()] story += [Paragraph("Think of it as a <b>5-step factory inside the liver</b>: grab toxic NH3 and package it as harmless urea.", BODY), br()] steps = [ ["Step", "Location", "Enzyme", "What Happens", "Key Change"], ["1", "Mitochondria", "CPS-I (needs NAGS)", "NH3 + CO2 form Carbamoyl phosphate", "NH3 captured"], ["2", "Mitochondria", "OTC (X-linked!)", "Carbamoyl-P + Ornithine form Citrulline", "Citrulline made"], ["3", "Cytoplasm", "ASS", "Citrulline + Aspartate form Argininosuccinate", "2nd nitrogen enters"], ["4", "Cytoplasm", "ASL", "Argininosuccinate splits to Arginine + Fumarate", "Arginine released"], ["5", "Cytoplasm", "Arginase-I", "Arginine splits to Urea + Ornithine (cycle restarts)", "UREA out!"], ] story += [make_table(steps, [1.2*cm, 2.2*cm, 3.5*cm, 5.8*cm, 4.3*cm]), br()] story += [info_box( b("Memory trick:") + " <i>Ordinarily, Careless Cows Aren't Agitated</i> " "= Ornithine > Carbamoyl-P > Citrulline > Argininosuccinate > Arginine > Ornithine. " "Two waste nitrogens enter per turn, one urea exits.", bg=GREEN_LITE, border=GREEN_DARK ), PageBreak()] # PAGE 3 BRAIN DAMAGE story += [sec_header("How Ammonia Damages the Brain"), br()] story += [Paragraph(b("3 Key Mechanisms:"), SH2), br()] mech = [ ["Mechanism", "What happens inside", "Clinical result"], ["Alpha-KG Depletion", "NH3 + alpha-KG form Glutamate (GDH)\nGlutamate + NH3 form Glutamine (GS)\nDrains TCA cycle", "Less ATP produced\nBrain energy failure"], ["Glutamine Accumulation", "Glutamine builds up inside astrocytes\nOsmotic water follows into glial cells", "Cerebral oedema\nRaised intracranial pressure"], ["Neurotransmitter Disruption", "Excess glutamate causes excitotoxicity\nAltered GABA signalling", "Seizures\nAltered consciousness"], ] mt = Table(mech, colWidths=[3.5*cm, 8*cm, 5.5*cm]) mt.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0), AMBER), ("TEXTCOLOR",(0,0),(-1,0), WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"), ("FONTSIZE",(0,0),(-1,-1), 9), ("ROWBACKGROUNDS",(0,1),(-1,-1), [AMBER_LITE, WHITE]), ("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1), 6), ("BOTTOMPADDING",(0,0),(-1,-1), 6), ("LEFTPADDING",(0,0),(-1,-1), 6), ("BOX",(0,0),(-1,-1), 1, AMBER), ("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#E0C080")), ])) story += [mt, br()] story += [Paragraph(b("How Ammonia Travels Safely in Blood:"), SH2)] half = (W - 4*cm - 0.4*cm) / 2 tr = [[ Paragraph(b("Glutamine (main carrier)") + "\n\nGlutamate + NH3 > Glutamine (Glutamine Synthetase)\nTravels to liver. Glutaminase releases NH3 > urea cycle.", S("tc", parent=BODY, fontSize=9.5)), Paragraph(b("Alanine (Glucose-Alanine Cycle)") + "\n\nMuscle: amino acids > pyruvate + glutamate > Alanine (ALT)\nLiver: Alanine > pyruvate (gluconeogenesis) + NH3 > urea cycle.", S("tc2", parent=BODY, fontSize=9.5)), ]] trt = Table(tr, colWidths=[half, half]) trt.setStyle(TableStyle([ ("BACKGROUND",(0,0),(0,0), TEAL_LITE), ("BACKGROUND",(1,0),(1,0), GREEN_LITE), ("BOX",(0,0),(0,0), 1, TEAL), ("BOX",(1,0),(1,0), 1, GREEN_DARK), ("TOPPADDING",(0,0),(-1,-1), 8), ("BOTTOMPADDING",(0,0),(-1,-1), 8), ("LEFTPADDING",(0,0),(-1,-1), 10), ("RIGHTPADDING",(0,0),(-1,-1), 10), ("VALIGN",(0,0),(-1,-1),"TOP"), ])) story += [trt, PageBreak()] # PAGE 4 ENZYME DEFECTS story += [sec_header("Urea Cycle Enzyme Defects"), br()] story += [Paragraph("Each enzyme in the cycle can be deficient. Quick reference:", BODY), br()] defects = [ ["Deficiency", "Other Name", "Key Lab Finding", "Notes"], ["CPS-I", "—", "Low citrulline and arginine\nNo orotic acid rise", "Rare; severe neonatal crisis"], ["OTC (MOST COMMON)", "OTC deficiency", "Low citrulline\nOrotic acid HIGH in urine", "X-linked; mainly males; female carriers can be symptomatic"], ["ASS", "Citrullinemia Type 1", "Citrulline HIGH in blood and urine", "Detected on newborn screening"], ["ASL", "Argininosuccinic aciduria", "Argininosuccinate HIGH in urine", "Neurological delays in severe forms"], ["Arginase-I", "Argininemia", "Arginine HIGH; milder hyperammonemia", "Normal birth; symptoms after 1-3 years"], ["NAGS", "—", "Same as CPS-I; responds to carglumic acid", "Very rare; specifically treatable"], ] dt = make_table(defects, [2.5*cm, 3*cm, 4.5*cm, 7*cm]) dt.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0), TEAL_DARK), ("TEXTCOLOR",(0,0),(-1,0), WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"), ("FONTSIZE",(0,0),(-1,-1), 8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]), ("BACKGROUND",(0,2),(-1,2), colors.HexColor("#FFF0D0")), ("FONTNAME",(0,2),(0,2),"Helvetica-Bold"), ("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1), 5), ("LEFTPADDING",(0,0),(-1,-1), 5), ("BOX",(0,0),(-1,-1), 1, TEAL), ("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")), ])) story += [dt, br()] story += [info_box( b("OTC vs CPS-I — How to tell them apart:") + " Both give low citrulline and arginine. BUT only OTC raises urinary orotic acid. " "Why? Blocked OTC means carbamoyl phosphate overflows into cytoplasm, enters pyrimidine synthesis, producing excess orotic acid.", bg=AMBER_LITE, border=AMBER ), PageBreak()] # PAGE 5 SYMPTOMS AND DIAGNOSIS story += [sec_header("Clinical Features and Diagnosis"), br()] story += [Paragraph(b("Symptoms — depend on severity and age:"), SH2)] sym = [[ Paragraph(b("Neonatal (Severe)\n\n") + "- Refusal to feed (24-48 h after protein)\n- Vomiting, lethargy\n" "- Rapid breathing (hyperventilation)\n- Floppy baby (hypotonia)\n" "- Seizures\n- Coma and death if untreated", S("sl", parent=BODY, fontSize=9.5)), Paragraph(b("Late-onset / Partial Defect\n\n") + "- Episodes triggered by illness, fasting,\n high protein, or stress\n" "- Headache, confusion, irritability\n- Tremors, slurred speech\n" "- Intellectual disability over time\n- Developmental delay", S("sr", parent=BODY, fontSize=9.5)), ]] symt = Table(sym, colWidths=[(W-4*cm)/2]*2) symt.setStyle(TableStyle([ ("BACKGROUND",(0,0),(0,0), RED_LITE), ("BACKGROUND",(1,0),(1,0), AMBER_LITE), ("BOX",(0,0),(0,0), 1, RED_DARK), ("BOX",(1,0),(1,0), 1, AMBER), ("FONTSIZE",(0,0),(-1,-1), 9.5), ("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1), 8), ("BOTTOMPADDING",(0,0),(-1,-1), 8), ("LEFTPADDING",(0,0),(-1,-1), 8), ])) story += [symt, br()] story += [Paragraph(b("Diagnostic Tests:"), SH2)] diag_rows = [ ["Test", "Finding", "Tells You"], ["Plasma Ammonia", "> 100-200 umol/L", "Confirms hyperammonemia"], ["Plasma Amino Acids", "Glutamine up, Alanine up\nSpecific AAs per defect", "Locates cycle block"], ["Urine Orotic Acid", "HIGH in OTC deficiency", "Distinguishes OTC from CPS-I"], ["Urine Amino Acids", "Argininosuccinate up > ASL\nCitrulline up > ASS", "Identifies specific defect"], ["Blood Gas (ABG)", "Respiratory alkalosis (high pH, low pCO2)", "NH3 drives hyperventilation"], ["LFTs", "Often normal in congenital forms", "Excludes liver disease"], ["Genetic Testing", "Confirms exact mutation", "Definitive diagnosis"], ] story += [make_table(diag_rows, [4*cm, 4.5*cm, 8.5*cm]), PageBreak()] # PAGE 6 TREATMENT story += [sec_header("Treatment Plan"), br()] story += [info_box( b("4 Goals: ") + "1) Reduce NH3 production 2) Enhance NH3 removal 3) Prevent brain damage 4) Long-term metabolic control" ), br()] story += [Paragraph(b("ACUTE Emergency Management (ICU):"), SH2)] acute = [ ["Intervention", "How it works"], ["Stop protein intake (48-72 h)", "Removes NH3 source immediately"], ["IV 10% Glucose + Lipid infusion", "High-calorie — stops body breaking down muscle"], ["IV Sodium Benzoate +\nSodium Phenylacetate (Ammonul)", "Nitrogen scavengers:\nBenzoate + Glycine > Hippurate (excreted in urine)\nPhenylacetate + Glutamine > Phenylacetylglutamine (excreted)\nEach carries waste nitrogen out of body"], ["IV Arginine (or Citrulline)", "Replenishes urea cycle intermediates; drives cycle forward"], ["Haemodialysis", "Fastest NH3 clearance; use when NH3 > 500 umol/L or coma"], ["Carglumic acid (NAGS only)", "Synthetic NAG analogue > activates CPS-I > restores cycle"], ] at = Table(acute, colWidths=[4.5*cm, 12.5*cm]) at.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0), RED_DARK), ("TEXTCOLOR",(0,0),(-1,0), WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"), ("FONTSIZE",(0,0),(-1,-1), 8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1), [RED_LITE, WHITE]), ("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1), 6), ("BOTTOMPADDING",(0,0),(-1,-1), 6), ("LEFTPADDING",(0,0),(-1,-1), 6), ("BOX",(0,0),(-1,-1), 1, RED_DARK), ("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")), ])) story += [at, br()] story += [Paragraph(b("LONG-TERM Chronic Management:"), SH2)] chronic = [ ["Strategy", "Detail"], ["Low-protein diet", "Tailored to age and weight; enough for growth, minimal excess"], ["Medical formula / special foods", "Essential amino acids without excess nitrogen load"], ["Oral sodium phenylbutyrate (Buphenyl / Ravicti)", "Daily nitrogen scavenger"], ["Arginine / Citrulline supplementation", "Replenishes depleted urea cycle intermediates"], ["Liver transplantation", "CURATIVE — replaces defective enzyme. Existing brain damage is NOT reversed"], ["Gene therapy (investigational)", "AAV-mediated gene correction — in clinical trials"], ] ct = Table(chronic, colWidths=[4.5*cm, 12.5*cm]) ct.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0), GREEN_DARK), ("TEXTCOLOR",(0,0),(-1,0), WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"), ("FONTSIZE",(0,0),(-1,-1), 8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1), [GREEN_LITE, WHITE]), ("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1), 6), ("BOTTOMPADDING",(0,0),(-1,-1), 6), ("LEFTPADDING",(0,0),(-1,-1), 6), ("BOX",(0,0),(-1,-1), 1, GREEN_DARK), ("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#AADDBB")), ])) story += [ct, PageBreak()] # PAGE 7 CLINICAL CASE story += [sec_header("Clinical Case — OTC Deficiency"), br()] c1 = Table([[Paragraph( b("PRESENTING COMPLAINT") + "\n\n" "Baby Hamza, a 5-day-old male, born at full term. Birth weight 3.2 kg. " "Breastfeeding started on day 1.\n\n" "On day 4, mother notices he is <b>feeding poorly and vomiting</b>. " "By day 5 he is <b>hypotonic, unresponsive</b>, and breathing very fast. " "Rushed to emergency department.", CASE_B)]], colWidths=[W-4*cm]) c1.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), AMBER_LITE), ("BOX",(0,0),(-1,-1), 1.5, AMBER), ("TOPPADDING",(0,0),(-1,-1), 10), ("BOTTOMPADDING",(0,0),(-1,-1), 10), ("LEFTPADDING",(0,0),(-1,-1), 14), ("RIGHTPADDING",(0,0),(-1,-1), 14), ])) story += [c1, br()] story += [Paragraph(b("Investigations:"), SH2)] inv = [ ["Test", "Result", "Interpretation"], ["Plasma Ammonia", "780 umol/L (Normal: 5-35)", "SEVERELY elevated — hyperammonemia crisis"], ["Blood Gas", "pH 7.55, pCO2 28 mmHg", "Respiratory alkalosis (NH3 drives hyperventilation)"], ["Plasma Amino Acids", "Glutamine HIGH, Alanine HIGH\nCitrulline very LOW", "Early urea cycle block"], ["Urine Orotic Acid", "MARKEDLY elevated", "KEY finding > OTC deficiency (not CPS-I)"], ["Plasma Arginine", "Low", "Downstream product depleted"], ["LFTs", "Normal", "Excludes liver disease as cause"], ["Genetic Testing", "Hemizygous OTC mutation", "DEFINITIVE: OTC deficiency confirmed"], ] it = make_table(inv, [4*cm, 4.5*cm, 8.5*cm]) it.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0), TEAL_DARK), ("TEXTCOLOR",(0,0),(-1,0), WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"), ("FONTSIZE",(0,0),(-1,-1), 8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]), ("BACKGROUND",(0,4),(-1,4), colors.HexColor("#FFF0D0")), ("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1), 5), ("LEFTPADDING",(0,0),(-1,-1), 5), ("BOX",(0,0),(-1,-1), 1, TEAL), ("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")), ])) story += [it, br()] db = Table([[Paragraph( b("DIAGNOSIS: OTC Deficiency") + "\n\n" "OTC (step 2 of urea cycle) is blocked. Carbamoyl phosphate cannot proceed and overflows " "into the cytoplasm, enters pyrimidine synthesis, and produces excess orotic acid. " "This is the DIAGNOSTIC HALLMARK that differentiates OTC from CPS-I deficiency.", CASE_B )]], colWidths=[W-4*cm]) db.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), RED_LITE), ("BOX",(0,0),(-1,-1), 2, RED_DARK), ("TOPPADDING",(0,0),(-1,-1), 10), ("BOTTOMPADDING",(0,0),(-1,-1), 10), ("LEFTPADDING",(0,0),(-1,-1), 14), ("RIGHTPADDING",(0,0),(-1,-1), 14), ])) story += [db, PageBreak()] # PAGE 8 MANAGEMENT AND TAKEAWAYS story += [sec_header("Case Management and Key Takeaways"), br()] story += [Paragraph(b("Management of Baby Hamza (OTC Deficiency):"), SH2)] mgmt = [ ["Phase", "Action", "Rationale"], ["Immediate", "Stop breastfeeding (stop all protein)", "Removes NH3 source immediately"], ["Immediate", "IV 10% Dextrose + Intralipid", "High calorie input suppresses catabolism"], ["Acute", "IV Ammonul (Na Benzoate + Na Phenylacetate)", "Nitrogen scavengers; excrete NH3 as hippurate and phenylacetylglutamine"], ["Acute", "IV Arginine infusion", "Replenish depleted urea cycle intermediates"], ["Acute", "Haemodialysis", "NH3 at 780 umol/L — dialysis urgently required"], ["Stabilised", "Reintroduce protein slowly with formula", "Minimum protein for growth; monitor NH3 closely"], ["Long-term", "Oral sodium phenylbutyrate daily", "Chronic nitrogen scavenging"], ["Long-term", "Liver transplant evaluation", "Curative option for severe OTC deficiency"], ] mgt = Table(mgmt, colWidths=[2.5*cm, 5.5*cm, 9*cm]) mgt.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0), TEAL_DARK), ("TEXTCOLOR",(0,0),(-1,0), WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"), ("FONTSIZE",(0,0),(-1,-1), 8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, GREY_LITE]), ("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1), 5), ("LEFTPADDING",(0,0),(-1,-1), 5), ("BOX",(0,0),(-1,-1), 1, TEAL), ("INNERGRID",(0,0),(-1,-1), 0.3, colors.HexColor("#CCCCCC")), ])) story += [mgt, br()] story += [Paragraph(b("Key Takeaways — Remember These:"), SH2)] points = [ "Urea cycle is the ONLY pathway to clear NH3 — 5 enzymes, 6 steps; NAGS activates CPS-I", "OTC deficiency = most common, X-linked; OROTIC ACID in urine distinguishes it from CPS-I", "NH3 toxicity: depletes alpha-KG (TCA failure); glutamine swells astrocytes causing cerebral oedema", "Neonates present 24-72 h after protein feeds: refusal to feed, vomiting, rapid breathing, coma", "Diagnosis: plasma NH3 + plasma amino acids + URINE OROTIC ACID + genetic testing", "Treatment: STOP protein > IV glucose/lipid > nitrogen scavengers (benzoate/phenylacetate) > arginine > dialysis if severe", "Liver transplant = curative — does NOT reverse existing neurological damage", ] for pt in points: row = Table([[Paragraph(" " + pt, S("pt", parent=BODY, fontSize=9.5))]], colWidths=[W-4*cm]) row.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,-1), GREEN_LITE), ("BOX",(0,0),(-1,-1), 0.8, GREEN_DARK), ("TOPPADDING",(0,0),(-1,-1), 5), ("BOTTOMPADDING",(0,0),(-1,-1), 5), ("LEFTPADDING",(0,0),(-1,-1), 10), ])) story += [row, Spacer(1, 4)] story += [br(), hr(), Paragraph( "Sources: Biochemistry 8th ed — Lippincott Illustrated Reviews (Ferrier 2019) pp. 722-728 " "| Bradley & Daroff's Neurology in Clinical Practice | Basic Medical Biochemistry 6e", CITE)] doc.build(story) print("PDF created:", OUTPUT) PYEOF echo "File written"
python3 /home/daytona/workspace/hyperammonemia-pdf/build_pdf.py 2>&1
cat > /home/daytona/workspace/hyperammonemia-pdf/build_pdf.py << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.lib.units import cm from reportlab.lib.styles import ParagraphStyle from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak OUTPUT = "/home/daytona/workspace/hyperammonemia-pdf/Hyperammonemia_Disorder.pdf" TEAL = colors.HexColor("#0E7C7B") TEAL_DARK = colors.HexColor("#065A59") TEAL_LITE = colors.HexColor("#D4EDED") AMBER = colors.HexColor("#E07B00") AMBER_LITE= colors.HexColor("#FFF3DC") WHITE = colors.white GREY_TXT = colors.HexColor("#333333") GREY_LITE = colors.HexColor("#F5F5F5") RED_LITE = colors.HexColor("#FDE8E8") RED_DARK = colors.HexColor("#C0392B") GREEN_LITE= colors.HexColor("#E8F8EF") GREEN_DARK= colors.HexColor("#1A7A4A") W, H = A4 doc = SimpleDocTemplate(OUTPUT, pagesize=A4, topMargin=1.8*cm, bottomMargin=1.8*cm, leftMargin=2*cm, rightMargin=2*cm) BASE = ParagraphStyle("base", fontName="Helvetica", fontSize=10.5, textColor=GREY_TXT, leading=16, spaceAfter=4, alignment=TA_JUSTIFY) TITLE = ParagraphStyle("title_", fontName="Helvetica-Bold", fontSize=30, textColor=WHITE, alignment=TA_CENTER, leading=38) SUB = ParagraphStyle("sub_", fontName="Helvetica-Oblique", fontSize=14, textColor=TEAL_LITE, alignment=TA_CENTER, leading=20) TAG = ParagraphStyle("tag_", fontName="Helvetica", fontSize=10, textColor=TEAL_LITE, alignment=TA_CENTER, leading=14) SH = ParagraphStyle("sh_", fontName="Helvetica-Bold", fontSize=17, textColor=WHITE, alignment=TA_LEFT, leading=22) SH2 = ParagraphStyle("sh2_", fontName="Helvetica-Bold", fontSize=13, textColor=TEAL_DARK, spaceAfter=4, spaceBefore=6, leading=18) BODY = ParagraphStyle("body_", fontName="Helvetica", fontSize=10.5, textColor=GREY_TXT, leading=16, spaceAfter=4, alignment=TA_JUSTIFY) BODY9 = ParagraphStyle("body9_", fontName="Helvetica", fontSize=9.5, textColor=GREY_TXT, leading=14, spaceAfter=3, alignment=TA_JUSTIFY) CITE = ParagraphStyle("cite_", fontName="Helvetica-Oblique", fontSize=8.5, textColor=colors.HexColor("#888888"), leading=12) CASE_B= ParagraphStyle("case_b_", fontName="Helvetica", fontSize=10, textColor=GREY_TXT, leading=15, spaceAfter=3, alignment=TA_JUSTIFY) def sec_header(text): tbl = Table([[Paragraph(text, SH)]], colWidths=[W - 4*cm]) tbl.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),TEAL_DARK), ("TOPPADDING",(0,0),(-1,-1),8),("BOTTOMPADDING",(0,0),(-1,-1),8),("LEFTPADDING",(0,0),(-1,-1),14)])) return tbl def info_box(text, bg=TEAL_LITE, border=TEAL): t = Table([[Paragraph(text, BODY)]], colWidths=[W - 4*cm]) t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),bg),("BOX",(0,0),(-1,-1),1.2,border), ("TOPPADDING",(0,0),(-1,-1),8),("BOTTOMPADDING",(0,0),(-1,-1),8), ("LEFTPADDING",(0,0),(-1,-1),12),("RIGHTPADDING",(0,0),(-1,-1),8)])) return t def grid(data, col_widths, hdr_bg=TEAL_DARK, row_bgs=None): if row_bgs is None: row_bgs = [WHITE, GREY_LITE] tbl = Table(data, colWidths=col_widths) tbl.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0),hdr_bg),("TEXTCOLOR",(0,0),(-1,0),WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),("FONTSIZE",(0,0),(-1,-1),8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1),row_bgs),("VALIGN",(0,0),(-1,-1),"TOP"), ("ALIGN",(0,0),(-1,-1),"LEFT"),("TOPPADDING",(0,0),(-1,-1),5), ("BOTTOMPADDING",(0,0),(-1,-1),5),("LEFTPADDING",(0,0),(-1,-1),5), ("BOX",(0,0),(-1,-1),1,TEAL),("INNERGRID",(0,0),(-1,-1),0.3,colors.HexColor("#CCCCCC"))])) return tbl def br(n=8): return Spacer(1, n) def hr(): return HRFlowable(width="100%",thickness=0.5,color=colors.HexColor("#CCCCCC"),spaceAfter=6,spaceBefore=6) def b(t): return "<b>%s</b>" % t story = [] # PAGE 1 TITLE tit = Table([[Paragraph("HYPERAMMONEMIA", TITLE)], [Paragraph("Urea Cycle Disorder — Biochemistry and Clinical Management", SUB)], [Spacer(1,6)], [Paragraph("Biochemistry Presentation | Class Module", TAG)]], colWidths=[W-4*cm]) tit.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),TEAL_DARK), ("TOPPADDING",(0,0),(-1,-1),16),("BOTTOMPADDING",(0,0),(-1,-1),14),("LEFTPADDING",(0,0),(-1,-1),24)])) story += [tit, br(16)] story += [info_box( b("What is Hyperammonemia?") + " Ammonia (NH3) is a waste product of amino acid breakdown. " "Normally the liver converts it to urea (via the Urea Cycle) and excretes it in urine. " "When this pathway fails — due to a genetic enzyme defect or liver disease — ammonia builds up in blood, " "crosses the blood-brain barrier, and becomes <b>directly neurotoxic</b>. " "Normal NH3 = <b>5-35 umol/L</b>; crisis levels exceed <b>1,000 umol/L</b>." ), br(10)] kft = Table([[ Paragraph(b("Normal NH3")+"\n5-35 umol/L", BODY), Paragraph(b("Danger Level")+"\n> 100 umol/L", ParagraphStyle("kf2",fontName="Helvetica-Bold",fontSize=10.5,textColor=RED_DARK,leading=16)), Paragraph(b("Emergency")+"\n> 200 umol/L\ncoma risk", ParagraphStyle("kf3",fontName="Helvetica-Bold",fontSize=10.5,textColor=RED_DARK,leading=16)), Paragraph(b("Incidence")+"\n~1 : 25,000 births", BODY), ]], colWidths=[(W-4*cm)/4]*4) kft.setStyle(TableStyle([ ("BACKGROUND",(0,0),(0,0),TEAL_LITE),("BACKGROUND",(1,0),(1,0),RED_LITE), ("BACKGROUND",(2,0),(2,0),RED_LITE),("BACKGROUND",(3,0),(3,0),TEAL_LITE), ("BOX",(0,0),(-1,-1),0.8,TEAL),("INNERGRID",(0,0),(-1,-1),0.5,colors.HexColor("#CCCCCC")), ("ALIGN",(0,0),(-1,-1),"CENTER"),("VALIGN",(0,0),(-1,-1),"MIDDLE"), ("TOPPADDING",(0,0),(-1,-1),10),("BOTTOMPADDING",(0,0),(-1,-1),10)])) story += [kft, PageBreak()] # PAGE 2 UREA CYCLE story += [sec_header("The Urea Cycle — How Ammonia Becomes Urea"), br()] story += [Paragraph("Think of it as a <b>5-step factory inside the liver</b>: grab toxic NH3 and turn it into harmless urea.", BODY), br()] story += [grid([ ["Step","Location","Enzyme","What Happens","Key Change"], ["1","Mitochondria","CPS-I\n(needs NAGS)","NH3 + CO2 form Carbamoyl phosphate","NH3 captured"], ["2","Mitochondria","OTC\n(X-linked!)","Carbamoyl-P + Ornithine form Citrulline","Citrulline made"], ["3","Cytoplasm","ASS","Citrulline + Aspartate form Argininosuccinate","2nd nitrogen enters"], ["4","Cytoplasm","ASL","Argininosuccinate > Arginine + Fumarate","Arginine released"], ["5","Cytoplasm","Arginase-I","Arginine > Urea + Ornithine (cycle restarts)","UREA out!"], ], [1.2*cm,2.2*cm,3.5*cm,5.8*cm,4.3*cm]), br()] story += [info_box( b("Memory trick:") + " <i>Ordinarily, Careless Cows Aren't Agitated</i> " "= Ornithine > Carbamoyl-P > Citrulline > Argininosuccinate > Arginine > Ornithine. " "Two waste nitrogens in, one urea out per turn.", bg=GREEN_LITE, border=GREEN_DARK), PageBreak()] # PAGE 3 BRAIN DAMAGE story += [sec_header("How Ammonia Damages the Brain"), br()] story += [Paragraph(b("3 Key Mechanisms of Neurotoxicity:"), SH2), br()] mt = Table([ ["Mechanism","What happens inside","Clinical result"], ["Alpha-KG Depletion", "NH3 + alpha-KG > Glutamate (GDH)\nGlutamate + NH3 > Glutamine (GS)\nDrains TCA cycle of alpha-KG", "Less ATP in brain\nBrain energy failure"], ["Glutamine Accumulation", "Glutamine builds up inside astrocytes\nOsmotic water follows into glial cells", "Cerebral oedema\nRaised intracranial pressure"], ["Neurotransmitter Disruption", "Excess glutamate causes excitotoxicity\nAltered GABA signalling", "Seizures\nAltered consciousness"], ], colWidths=[3.5*cm,8*cm,5.5*cm]) mt.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0),AMBER),("TEXTCOLOR",(0,0),(-1,0),WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),("FONTSIZE",(0,0),(-1,-1),9), ("ROWBACKGROUNDS",(0,1),(-1,-1),[AMBER_LITE,WHITE]),("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),("LEFTPADDING",(0,0),(-1,-1),6), ("BOX",(0,0),(-1,-1),1,AMBER),("INNERGRID",(0,0),(-1,-1),0.3,colors.HexColor("#E0C080"))])) story += [mt, br()] story += [Paragraph(b("How Ammonia Travels Safely in Blood:"), SH2)] half = (W-4*cm-0.4*cm)/2 trt = Table([[ Paragraph(b("Glutamine (main carrier)")+"\n\nGlutamate+NH3 > Glutamine (Glutamine Synthetase)\nTravels to liver. Glutaminase releases NH3 > urea cycle.", BODY9), Paragraph(b("Alanine (Glucose-Alanine Cycle)")+"\n\nMuscle: amino acids > pyruvate+glutamate > Alanine (ALT)\nLiver: Alanine > pyruvate (gluconeogenesis)+NH3 > urea cycle.", BODY9), ]], colWidths=[half,half]) trt.setStyle(TableStyle([ ("BACKGROUND",(0,0),(0,0),TEAL_LITE),("BACKGROUND",(1,0),(1,0),GREEN_LITE), ("BOX",(0,0),(0,0),1,TEAL),("BOX",(1,0),(1,0),1,GREEN_DARK), ("TOPPADDING",(0,0),(-1,-1),8),("BOTTOMPADDING",(0,0),(-1,-1),8), ("LEFTPADDING",(0,0),(-1,-1),10),("RIGHTPADDING",(0,0),(-1,-1),10),("VALIGN",(0,0),(-1,-1),"TOP")])) story += [trt, PageBreak()] # PAGE 4 ENZYME DEFECTS story += [sec_header("Urea Cycle Enzyme Defects"), br()] story += [Paragraph("Each enzyme can be deficient. Quick reference:", BODY), br()] dt = Table([ ["Deficiency","Other Name","Key Lab Finding","Notes"], ["CPS-I","—","Low citrulline and arginine\nNo orotic acid rise","Rare; severe neonatal crisis"], ["OTC (MOST COMMON)","OTC deficiency","Low citrulline\nOrotic acid HIGH in urine","X-linked; mainly males; female carriers can be symptomatic"], ["ASS","Citrullinemia Type 1","Citrulline HIGH in blood and urine","Detected on newborn screening"], ["ASL","Argininosuccinic aciduria","Argininosuccinate HIGH in urine","Neurological delays in severe forms"], ["Arginase-I","Argininemia","Arginine HIGH; milder hyperammonemia","Normal birth; symptoms after 1-3 years"], ["NAGS","—","Same as CPS-I; responds to carglumic acid","Very rare; specifically treatable"], ], colWidths=[2.5*cm,3*cm,4.5*cm,7*cm]) dt.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0),TEAL_DARK),("TEXTCOLOR",(0,0),(-1,0),WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),("FONTSIZE",(0,0),(-1,-1),8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE,GREY_LITE]), ("BACKGROUND",(0,2),(-1,2),colors.HexColor("#FFF0D0")), ("FONTNAME",(0,2),(0,2),"Helvetica-Bold"), ("VALIGN",(0,0),(-1,-1),"TOP"),("TOPPADDING",(0,0),(-1,-1),5), ("BOTTOMPADDING",(0,0),(-1,-1),5),("LEFTPADDING",(0,0),(-1,-1),5), ("BOX",(0,0),(-1,-1),1,TEAL),("INNERGRID",(0,0),(-1,-1),0.3,colors.HexColor("#CCCCCC"))])) story += [dt, br()] story += [info_box( b("OTC vs CPS-I — how to distinguish:") + " Both give low citrulline and arginine. ONLY OTC raises urinary orotic acid. " "Why? Blocked OTC means carbamoyl phosphate overflows into cytoplasm, enters pyrimidine synthesis, producing excess orotic acid.", bg=AMBER_LITE, border=AMBER), PageBreak()] # PAGE 5 SYMPTOMS AND DIAGNOSIS story += [sec_header("Clinical Features and Diagnosis"), br()] story += [Paragraph(b("Symptoms — depend on severity and age:"), SH2)] symt = Table([[ Paragraph(b("Neonatal (Severe)")+"\n\n" "- Refusal to feed (24-48 h after protein)\n- Vomiting, lethargy\n" "- Rapid breathing (hyperventilation)\n- Floppy baby (hypotonia)\n" "- Seizures\n- Coma and death if untreated", BODY9), Paragraph(b("Late-onset / Partial Defect")+"\n\n" "- Episodes triggered by illness, fasting,\n high protein, or stress\n" "- Headache, confusion, irritability\n- Tremors, slurred speech\n" "- Intellectual disability over time\n- Developmental delay", BODY9), ]], colWidths=[(W-4*cm)/2]*2) symt.setStyle(TableStyle([ ("BACKGROUND",(0,0),(0,0),RED_LITE),("BACKGROUND",(1,0),(1,0),AMBER_LITE), ("BOX",(0,0),(0,0),1,RED_DARK),("BOX",(1,0),(1,0),1,AMBER), ("VALIGN",(0,0),(-1,-1),"TOP"),("TOPPADDING",(0,0),(-1,-1),8), ("BOTTOMPADDING",(0,0),(-1,-1),8),("LEFTPADDING",(0,0),(-1,-1),8)])) story += [symt, br()] story += [Paragraph(b("Diagnostic Tests:"), SH2)] story += [grid([ ["Test","Finding","Tells You"], ["Plasma Ammonia","> 100-200 umol/L","Confirms hyperammonemia"], ["Plasma Amino Acids","Glutamine up, Alanine up\nSpecific AAs per defect","Locates cycle block"], ["Urine Orotic Acid","HIGH in OTC deficiency","Distinguishes OTC from CPS-I"], ["Urine Amino Acids","Argininosuccinate up > ASL\nCitrulline up > ASS","Identifies specific defect"], ["Blood Gas (ABG)","Respiratory alkalosis\n(high pH, low pCO2)","NH3 drives hyperventilation"], ["LFTs","Often normal in congenital forms","Excludes liver disease"], ["Genetic Testing","Confirms exact mutation","Definitive diagnosis"], ], [4*cm,4.5*cm,8.5*cm]), PageBreak()] # PAGE 6 TREATMENT story += [sec_header("Treatment Plan"), br()] story += [info_box( b("4 Goals: ") + "1) Reduce NH3 production 2) Enhance NH3 removal 3) Prevent brain damage 4) Long-term metabolic control" ), br()] story += [Paragraph(b("ACUTE Emergency Management (ICU):"), SH2)] at = Table([ ["Intervention","How it works"], ["Stop protein intake (48-72 h)","Removes NH3 source immediately"], ["IV 10% Glucose + Lipid infusion","High-calorie — stops body from breaking down muscle"], ["IV Sodium Benzoate +\nSodium Phenylacetate (Ammonul)","Nitrogen scavengers:\nBenzoate + Glycine > Hippurate (excreted in urine)\nPhenylacetate + Glutamine > Phenylacetylglutamine (excreted)\nEach molecule carries waste nitrogen out of body"], ["IV Arginine (or Citrulline)","Replenishes urea cycle intermediates; drives cycle forward"], ["Haemodialysis","Fastest NH3 clearance; use when NH3 > 500 umol/L or coma"], ["Carglumic acid (NAGS only)","Synthetic NAG > activates CPS-I > restores cycle"], ], colWidths=[4.5*cm,12.5*cm]) at.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0),RED_DARK),("TEXTCOLOR",(0,0),(-1,0),WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),("FONTSIZE",(0,0),(-1,-1),8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1),[RED_LITE,WHITE]),("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),("LEFTPADDING",(0,0),(-1,-1),6), ("BOX",(0,0),(-1,-1),1,RED_DARK),("INNERGRID",(0,0),(-1,-1),0.3,colors.HexColor("#CCCCCC"))])) story += [at, br()] story += [Paragraph(b("LONG-TERM Chronic Management:"), SH2)] ct = Table([ ["Strategy","Detail"], ["Low-protein diet","Tailored to age and weight; enough for growth, minimal excess"], ["Medical formula / special foods","Essential amino acids without excess nitrogen load"], ["Oral sodium phenylbutyrate (Buphenyl / Ravicti)","Daily nitrogen scavenger"], ["Arginine / Citrulline supplementation","Replenishes depleted urea cycle intermediates"], ["Liver transplantation","CURATIVE — replaces defective enzyme. Existing brain damage NOT reversed"], ["Gene therapy (investigational)","AAV-mediated gene correction — in clinical trials"], ], colWidths=[4.5*cm,12.5*cm]) ct.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0),GREEN_DARK),("TEXTCOLOR",(0,0),(-1,0),WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),("FONTSIZE",(0,0),(-1,-1),8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1),[GREEN_LITE,WHITE]),("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),("LEFTPADDING",(0,0),(-1,-1),6), ("BOX",(0,0),(-1,-1),1,GREEN_DARK),("INNERGRID",(0,0),(-1,-1),0.3,colors.HexColor("#AADDBB"))])) story += [ct, PageBreak()] # PAGE 7 CLINICAL CASE story += [sec_header("Clinical Case — OTC Deficiency"), br()] c1 = Table([[Paragraph( b("PRESENTING COMPLAINT")+"\n\n" "Baby Hamza, a 5-day-old male, born at full term. Birth weight 3.2 kg. Breastfeeding started day 1.\n\n" "On day 4, mother notices he is <b>feeding poorly and vomiting</b>. " "By day 5 he is <b>hypotonic, unresponsive</b>, and breathing very fast. Rushed to emergency.", CASE_B )]], colWidths=[W-4*cm]) c1.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),AMBER_LITE),("BOX",(0,0),(-1,-1),1.5,AMBER), ("TOPPADDING",(0,0),(-1,-1),10),("BOTTOMPADDING",(0,0),(-1,-1),10), ("LEFTPADDING",(0,0),(-1,-1),14),("RIGHTPADDING",(0,0),(-1,-1),14)])) story += [c1, br()] story += [Paragraph(b("Investigations:"), SH2)] it = Table([ ["Test","Result","Interpretation"], ["Plasma Ammonia","780 umol/L (Normal: 5-35)","SEVERELY elevated — hyperammonemia crisis"], ["Blood Gas","pH 7.55, pCO2 28 mmHg","Respiratory alkalosis (NH3 drives hyperventilation)"], ["Plasma Amino Acids","Glutamine HIGH, Alanine HIGH\nCitrulline very LOW","Early urea cycle block"], ["Urine Orotic Acid","MARKEDLY elevated","KEY finding > OTC deficiency (not CPS-I)"], ["Plasma Arginine","Low","Downstream product depleted"], ["LFTs","Normal","Excludes liver disease as cause"], ["Genetic Testing","Hemizygous OTC mutation","DEFINITIVE: OTC deficiency confirmed"], ], colWidths=[4*cm,4.5*cm,8.5*cm]) it.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0),TEAL_DARK),("TEXTCOLOR",(0,0),(-1,0),WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),("FONTSIZE",(0,0),(-1,-1),8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE,GREY_LITE]), ("BACKGROUND",(0,4),(-1,4),colors.HexColor("#FFF0D0")), ("VALIGN",(0,0),(-1,-1),"TOP"),("TOPPADDING",(0,0),(-1,-1),5), ("BOTTOMPADDING",(0,0),(-1,-1),5),("LEFTPADDING",(0,0),(-1,-1),5), ("BOX",(0,0),(-1,-1),1,TEAL),("INNERGRID",(0,0),(-1,-1),0.3,colors.HexColor("#CCCCCC"))])) story += [it, br()] db = Table([[Paragraph( b("DIAGNOSIS: OTC Deficiency")+"\n\n" "OTC (step 2 of urea cycle) is blocked. Carbamoyl phosphate overflows into the cytoplasm, " "enters pyrimidine synthesis, and produces excess orotic acid. " "This ELEVATED URINE OROTIC ACID is the diagnostic hallmark that differentiates OTC from CPS-I.", CASE_B )]], colWidths=[W-4*cm]) db.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),RED_LITE),("BOX",(0,0),(-1,-1),2,RED_DARK), ("TOPPADDING",(0,0),(-1,-1),10),("BOTTOMPADDING",(0,0),(-1,-1),10), ("LEFTPADDING",(0,0),(-1,-1),14),("RIGHTPADDING",(0,0),(-1,-1),14)])) story += [db, PageBreak()] # PAGE 8 MANAGEMENT AND TAKEAWAYS story += [sec_header("Case Management and Key Takeaways"), br()] story += [Paragraph(b("Management of Baby Hamza (OTC Deficiency):"), SH2)] mgt = Table([ ["Phase","Action","Rationale"], ["Immediate","Stop breastfeeding (stop all protein)","Removes NH3 source immediately"], ["Immediate","IV 10% Dextrose + Intralipid","High calorie input suppresses catabolism"], ["Acute","IV Ammonul (Na Benzoate + Na Phenylacetate)","Nitrogen scavengers; excrete NH3 as hippurate and phenylacetylglutamine"], ["Acute","IV Arginine infusion","Replenish depleted urea cycle intermediates"], ["Acute","Haemodialysis","NH3 at 780 umol/L — dialysis urgently required"], ["Stabilised","Reintroduce protein slowly with formula","Minimum protein for growth; monitor NH3 closely"], ["Long-term","Oral sodium phenylbutyrate daily","Chronic nitrogen scavenging"], ["Long-term","Liver transplant evaluation","Curative option for severe OTC deficiency"], ], colWidths=[2.5*cm,5.5*cm,9*cm]) mgt.setStyle(TableStyle([ ("BACKGROUND",(0,0),(-1,0),TEAL_DARK),("TEXTCOLOR",(0,0),(-1,0),WHITE), ("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),("FONTSIZE",(0,0),(-1,-1),8.5), ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE,GREY_LITE]),("VALIGN",(0,0),(-1,-1),"TOP"), ("TOPPADDING",(0,0),(-1,-1),5),("BOTTOMPADDING",(0,0),(-1,-1),5),("LEFTPADDING",(0,0),(-1,-1),5), ("BOX",(0,0),(-1,-1),1,TEAL),("INNERGRID",(0,0),(-1,-1),0.3,colors.HexColor("#CCCCCC"))])) story += [mgt, br()] story += [Paragraph(b("Key Takeaways — Remember These:"), SH2)] points = [ "Urea cycle is the ONLY pathway to clear NH3 — 5 enzymes; NAGS activates CPS-I to start the cycle", "OTC deficiency = most common urea cycle disorder; X-linked; OROTIC ACID in urine distinguishes it from CPS-I", "NH3 toxicity: depletes alpha-KG (drains TCA); glutamine swells astrocytes causing cerebral oedema", "Neonates present 24-72 h after protein feeds: refusal to feed, vomiting, rapid breathing, coma", "Diagnosis: plasma NH3 + plasma amino acids + URINE OROTIC ACID + genetic testing", "Treatment: STOP protein > IV glucose/lipid > nitrogen scavengers (benzoate/phenylacetate) > arginine > dialysis if severe", "Liver transplant = curative — does NOT reverse existing neurological damage", ] for pt in points: row = Table([[Paragraph(" " + pt, BODY9)]], colWidths=[W-4*cm]) row.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),GREEN_LITE),("BOX",(0,0),(-1,-1),0.8,GREEN_DARK), ("TOPPADDING",(0,0),(-1,-1),5),("BOTTOMPADDING",(0,0),(-1,-1),5),("LEFTPADDING",(0,0),(-1,-1),10)])) story += [row, Spacer(1,4)] story += [br(),hr(),Paragraph( "Sources: Biochemistry 8th ed (Lippincott Illustrated Reviews, Ferrier 2019) pp.722-728 " "| Bradley & Daroff's Neurology in Clinical Practice | Basic Medical Biochemistry 6e", CITE)] doc.build(story) print("PDF created:", OUTPUT) PYEOF python3 /home/daytona/workspace/hyperammonemia-pdf/build_pdf.py 2>&1
ls -lh /home/daytona/workspace/hyperammonemia-pdf/
Hyperammonemia Disorder
PDF Document · PDF
| Page | Content |
|---|---|
| 1 | Title slide + "What is hyperammonemia?" + key numbers (normal NH3, danger level, emergency threshold, incidence) |
| 2 | Urea Cycle — 5-step table (location, enzyme, what happens) + mnemonic |
| 3 | How NH3 damages the brain — 3 mechanisms (alpha-KG depletion, glutamine swelling, neurotransmitter disruption) + transport via glutamine and alanine |
| 4 | All 6 enzyme defects compared in one table — OTC highlighted as most common + OTC vs CPS-I distinction box |
| 5 | Clinical features (neonatal vs late-onset) + full diagnostic work-up table |
| 6 | Treatment — acute ICU management + long-term chronic management with clear rationale for each |
| 7 | Clinical Case — Baby Hamza (OTC deficiency neonatal crisis) with full investigation table and diagnosis box |
| 8 | Case management plan + 7 key takeaways in green boxes |