Explain everything in detail cover all the points
ls -la /home/daytona/workspace/attachments/40307a91-b508-4195-9d00-3afa72d74cc2/
file /home/daytona/workspace/attachments/40307a91-b508-4195-9d00-3afa72d74cc2/"DOC-20260711-WA0038." && xxd /home/daytona/workspace/attachments/40307a91-b508-4195-9d00-3afa72d74cc2/"DOC-20260711-WA0038." | head -20
cp /home/daytona/workspace/attachments/40307a91-b508-4195-9d00-3afa72d74cc2/"DOC-20260711-WA0038." /home/daytona/workspace/attachments/40307a91-b508-4195-9d00-3afa72d74cc2/DOC-20260711-WA0038.pptx && python -m markitdown /home/daytona/workspace/attachments/40307a91-b508-4195-9d00-3afa72d74cc2/DOC-20260711-WA0038.pptx
python3 -c " from pptx import Presentation prs = Presentation('/home/daytona/workspace/attachments/40307a91-b508-4195-9d00-3afa72d74cc2/DOC-20260711-WA0038.pptx') for i, slide in enumerate(prs.slides, 1): print(f'\\n===== SLIDE {i} =====') for shape in slide.shapes: if hasattr(shape, 'text') and shape.text.strip(): print(f'[{shape.shape_type}] {shape.name}: {shape.text}') if shape.has_table: print(f'TABLE in {shape.name}:') for row in shape.table.rows: for cell in row.cells: print(f' | {cell.text}', end='') print() "
pip install --user python-pptx -q && python3 -c " from pptx import Presentation prs = Presentation('/home/daytona/workspace/attachments/40307a91-b508-4195-9d00-3afa72d74cc2/DOC-20260711-WA0038.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): print(f'\\n===== SLIDE {i} =====') for shape in slide.shapes: if hasattr(shape, 'text') and shape.text.strip(): print(f'[{shape.name}]: {shape.text}') if hasattr(shape, 'has_table') and shape.has_table: print(f'TABLE in {shape.name}:') for row in shape.table.rows: row_text = ' | '.join(cell.text.strip() for cell in row.cells) print(f' {row_text}') "
| Zymogen | Active Enzyme | Cleaves |
|---|---|---|
| Trypsinogen | Trypsin | After Arg, Lys |
| Chymotrypsinogen | Chymotrypsin | After Phe, Tyr, Trp |
| Proelastase | Elastase | After small neutral AAs |
| Disorder | Defect | Consequence |
|---|---|---|
| Cystinuria | COAL transport system (Cystine, Ornithine, Arginine, Lysine) | These AAs lost in urine → kidney stones (cystine precipitates). Most common inherited AA transport disorder (1:7,000) |
| Hartnup Disease | Neutral amino acid transport (especially tryptophan) | Reduced tryptophan absorption → inadequate niacin synthesis → pellagra-like symptoms (dermatitis, diarrhea, dementia) |
| Enzyme | Reaction | Significance |
|---|---|---|
| ALT (Alanine aminotransferase) | Alanine + α-KG ⇌ Pyruvate + Glutamate | Collects nitrogen from alanine (Glucose-Alanine Cycle) |
| AST (Aspartate aminotransferase) | Glutamate + OAA ⇌ Aspartate + α-KG | Aspartate supplies one nitrogen atom to the urea cycle |
| Condition | Elevates |
|---|---|
| Severe viral hepatitis | Both ALT and AST (ALT > AST typically) |
| Drug/toxin-induced liver injury | ALT and AST |
| Circulatory collapse ("shock liver") | Markedly elevated transaminases |
| Myocardial infarction | Primarily AST (also troponin, CK-MB) |
| Muscle disorders (myopathies) | AST and CK |
Aspartate + NH₃ + CO₂ + 3 ATP + H₂O →
Urea + Fumarate + 2 ADP + AMP + 2 Pi + PPi
| Source | Mechanism |
|---|---|
| Amino acid catabolism | Transdeamination (aminotransferase + GDH) |
| Glutamine | Glutaminase in intestine/kidneys releases NH₃ |
| Intestinal bacteria | Urease converts urea → NH₃ |
| Amines | Monoamine oxidase (MAO) deaminates biogenic amines |
| Purines/Pyrimidines | Deamination during nucleotide catabolism |
| Strategy | Details |
|---|---|
| Protein-restricted diet | Reduce nitrogen load; must provide adequate calories to prevent catabolism |
| Nitrogen scavengers | Phenylbutyrate → converted to phenylacetate → conjugates with glutamine → phenylacetylglutamine excreted in urine (exports 2 N per molecule) |
| Sodium benzoate | Conjugates with glycine → hippurate excreted in urine (exports 1 N) |
| Oral antibiotics (neomycin) | Reduce gut bacteria → less urease activity → less intestinal NH₃ production |
| Lactulose | Acidifies colon → traps NH₄⁺, reduces absorption |
| Arginine/citrulline supplementation | Restores urea cycle intermediate pool |
| Liver transplant | Definitive cure for genetic urea cycle disorders |
Dietary Protein
↓ (digestion & absorption)
Amino Acid Pool
↓ (aminotransferases - PLP-dependent)
Glutamate (central nitrogen collector)
↓ (Glutamate Dehydrogenase)
NH₃ + α-KG
↓
Transport to liver (as Glutamine or Alanine)
↓
UREA CYCLE (liver mitochondria + cytoplasm)
↓
Urea → Kidney → Urine
| Key Enzyme | Location | Coenzyme | Clinical Relevance |
|---|---|---|---|
| Aminotransferases (ALT, AST) | All tissues | PLP (Vit B6) | Elevated in liver/muscle damage |
| Glutamate Dehydrogenase | Liver/kidney mito | NAD⁺/NADP⁺ | Regulated by energy status (GTP/ADP) |
| CPS I | Mitochondria | NAG activator | Rate-limiting step; congenital deficiency → hyperammonemia |
| OTC | Mitochondria | - | Most common urea cycle disorder (X-linked) |
| Arginase I | Liver cytosol | - | Exclusively in liver; produces urea |
| Glutamine synthetase | Most tissues | ATP | Non-toxic ammonia transport |
Make me to learn this in 15 mins cover all the points which you have given teach me everything without leaving any content
The body cannot store excess amino acids, so it strips off the nitrogen (toxic as ammonia), converts it to urea, and burns the carbon skeletons for energy.
| Fills the pool | Drains the pool |
|---|---|
| Dietary protein | Protein synthesis |
| Body protein breakdown | N-containing compounds (purines, heme) |
| Synthesis of nonessential AAs | Energy production (oxidized) |
| System | Energy | Degrades |
|---|---|---|
| Ubiquitin-Proteasome | ATP-dependent | Intracellular proteins; PEST sequences = fast degradation |
| Lysosomal | ATP-independent | Extracellular/membrane proteins via acid hydrolases |
| Zymogen | Active enzyme | Cleaves next to |
|---|---|---|
| Trypsinogen | Trypsin | Arg, Lys |
| Chymotrypsinogen | Chymotrypsin | Phe, Tyr, Trp |
| Proelastase | Elastase | Small neutral AAs |
| Disorder | Defect | Problem | Result |
|---|---|---|---|
| Cystinuria | COAL system (Cystine, Ornithine, Arginine, Lysine) | Can't reabsorb these in kidney | Kidney stones (cystine precipitates). Most common AA transport disorder 1:7,000 |
| Hartnup Disease | Neutral AA transport (esp. tryptophan) | Can't absorb tryptophan → less niacin | Pellagra-like: dermatitis, diarrhea, dementia |
Most AAs dump their nitrogen onto α-ketoglutarate → making Glutamate
| Enzyme | Reaction | Why important |
|---|---|---|
| ALT | Alanine + α-KG ⇌ Pyruvate + Glutamate | Glucose-Alanine Cycle; liver marker |
| AST | Glutamate + OAA ⇌ Aspartate + α-KG | Aspartate feeds 2nd N into urea cycle |
Glutamate → α-ketoglutarate + free NH₃
NH₃ + Glutamate → Glutamine [Glutamine synthetase; uses ATP]
Glutamine → liver/kidney
Glutamine → Glutamate + NH₃ [Glutaminase; releases for urea/excretion]
Muscle: Pyruvate + Glutamate → Alanine [ALT]
Alanine travels to liver
Liver: Alanine → Pyruvate + Glutamate [ALT reversed]
Pyruvate → Glucose [gluconeogenesis] → back to muscle
"Can Citrulline Always Act Usefully?" Carbamoyl phosphate → Citrulline → Argininosuccinate → Arginine → Urea
Aspartate + NH₃ + CO₂ + 3 ATP + H₂O →
Urea + Fumarate + 2 ADP + AMP + 2 Pi + PPi
| Source | Mechanism |
|---|---|
| Amino acids | Transdeamination (ATase + GDH) |
| Glutamine | Glutaminase in intestine/kidney |
| Gut bacteria | Urease: urea → NH₃ |
| Amines | MAO (monoamine oxidase) |
| Purines/Pyrimidines | Deamination |
| Type | Cause | Key Feature |
|---|---|---|
| Acquired | Liver disease (hepatitis, cirrhosis), portal shunting | Adults; treat underlying liver disease |
| Congenital | Urea cycle enzyme deficiency | Newborns; presents after protein feeding |
| Deficiency | Inheritance | Notes |
|---|---|---|
| OTC deficiency | X-linked | Most common; male newborns; severe |
| All others | Autosomal recessive | CPS I, ASS, ASL, Arginase |
| Arginase deficiency | Autosomal recessive | Mildest presentation |
| Treatment | Mechanism |
|---|---|
| Protein restriction | Reduce N load (must give enough calories to prevent catabolism) |
| Phenylbutyrate → phenylacetate → + Glutamine → phenylacetylglutamine (urine) | Excretes 2 N per molecule via urine |
| Sodium benzoate → + Glycine → hippurate (urine) | Excretes 1 N per molecule |
| Oral neomycin / lactulose | Reduce gut NH₃ production |
| Arginine/citrulline supplementation | Replenish cycle intermediates |
| Liver transplant | Definitive cure for genetic defects |
Dietary Protein
↓ HCl + Pepsin (stomach)
↓ Trypsin/Chymotrypsin (pancreas) — activated by enteropeptidase
↓ Aminopeptidase (brush border)
Free Amino Acids absorbed (Na⁺ cotransport)
↓
Amino Acid Pool (300-400g turned over daily)
↓ Aminotransferases (PLP/Vit B6) → funnel nitrogen to GLUTAMATE
↓ Glutamate Dehydrogenase (GDH) → releases free NH₃ [GTP inhibits, ADP activates]
↓
NH₃ transported as GLUTAMINE (all tissues) or ALANINE (muscle)
↓
LIVER: UREA CYCLE
Mito: NH₃ + CO₂ → Carbamoyl-P [CPS I; NAG activates]
Mito: + Ornithine → Citrulline [OTC]
Cyto: + Aspartate → Argininosuccinate [ASS; 2nd N enters here]
Cyto: → Arginine + Fumarate [ASL]
Cyto: → UREA + Ornithine [Arginase I; liver only]
↓
UREA → Kidneys → Urine ✅
Create a study guide PDF with diagrams of the urea cycle
mkdir -p /home/daytona/workspace/nitrogen-study-guide && python3 -c "import reportlab; print('reportlab ok')"
~/nitrogen-study-guide/generate_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, KeepTogether
)
from reportlab.platypus.flowables import Flowable
from reportlab.graphics.shapes import (
Drawing, Rect, Circle, Ellipse, String, Arrow,
Line, Polygon, Group
)
from reportlab.graphics import renderPDF
from reportlab.graphics.shapes import Drawing, Rect, Ellipse, String, Line, Polygon, Circle
import math
# ── Color Palette ──────────────────────────────────────────────────────────────
DEEP_NAVY = colors.HexColor("#0D1B2A")
ROYAL_BLUE = colors.HexColor("#1B4F8A")
TEAL = colors.HexColor("#0F7B8C")
ACCENT_GOLD = colors.HexColor("#E8A020")
ACCENT_GREEN = colors.HexColor("#2EAA6E")
ACCENT_RED = colors.HexColor("#C0392B")
ACCENT_PURP = colors.HexColor("#7B2D8B")
LIGHT_BLUE = colors.HexColor("#D6EAF8")
LIGHT_GREEN = colors.HexColor("#D5F5E3")
LIGHT_GOLD = colors.HexColor("#FEF9E7")
LIGHT_PURP = colors.HexColor("#F5EEF8")
LIGHT_RED = colors.HexColor("#FDEDEC")
WHITE = colors.white
DARK_GRAY = colors.HexColor("#2C3E50")
MID_GRAY = colors.HexColor("#7F8C8D")
LIGHT_GRAY = colors.HexColor("#ECF0F1")
MITO_COLOR = colors.HexColor("#FFF3CD")
CYTO_COLOR = colors.HexColor("#D1ECF1")
MITO_BORDER = colors.HexColor("#E6A817")
CYTO_BORDER = colors.HexColor("#17A2B8")
W, H = A4 # 595 x 842 pts
# ── Styles ─────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def make_style(name, parent='Normal', **kw):
return ParagraphStyle(name, parent=styles[parent], **kw)
cover_title = make_style('CoverTitle', fontSize=32, textColor=WHITE,
leading=38, alignment=TA_CENTER, fontName='Helvetica-Bold')
cover_sub = make_style('CoverSub', fontSize=16, textColor=LIGHT_BLUE,
leading=22, alignment=TA_CENTER)
cover_auth = make_style('CoverAuth', fontSize=11, textColor=ACCENT_GOLD,
alignment=TA_CENTER)
section_h = make_style('SectionH', fontSize=15, textColor=WHITE,
leading=20, fontName='Helvetica-Bold', alignment=TA_CENTER)
h2 = make_style('H2', fontSize=13, textColor=ROYAL_BLUE,
leading=18, fontName='Helvetica-Bold', spaceAfter=4)
h3 = make_style('H3', fontSize=11, textColor=TEAL,
leading=15, fontName='Helvetica-Bold', spaceAfter=3)
body = make_style('Body', fontSize=9.5, textColor=DARK_GRAY,
leading=14, spaceAfter=3, alignment=TA_JUSTIFY)
bullet_s = make_style('Bullet', fontSize=9.5, textColor=DARK_GRAY,
leading=13, leftIndent=14, firstLineIndent=-10, spaceAfter=2)
small = make_style('Small', fontSize=8.5, textColor=MID_GRAY, leading=12)
caption = make_style('Caption', fontSize=8, textColor=MID_GRAY,
alignment=TA_CENTER, fontName='Helvetica-Oblique')
highlight = make_style('Highlight', fontSize=9.5, textColor=DARK_GRAY,
leading=13, backColor=LIGHT_GOLD, leftIndent=8,
rightIndent=8, borderPadding=4)
alert = make_style('Alert', fontSize=9.5, textColor=ACCENT_RED,
leading=13, fontName='Helvetica-Bold')
def b(t): return f"<b>{t}</b>"
def col(t, c): return f'<font color="{c}">{t}</font>'
def bullet(t): return Paragraph(f"• {t}", bullet_s)
def hline(): return HRFlowable(width="100%", thickness=0.5, color=LIGHT_GRAY,
spaceAfter=4, spaceBefore=4)
# ── Section Banner ─────────────────────────────────────────────────────────────
class SectionBanner(Flowable):
def __init__(self, text, bg=ROYAL_BLUE, w=None, h=26):
super().__init__()
self.text = text
self.bg = bg
self._w = w or (W - 3*cm)
self._h = h
def wrap(self, aw, ah): return self._w, self._h + 6
def draw(self):
c = self.canv
c.setFillColor(self.bg)
c.roundRect(0, 0, self._w, self._h, 5, fill=1, stroke=0)
c.setFillColor(WHITE)
c.setFont('Helvetica-Bold', 12)
c.drawCentredString(self._w/2, 7, self.text)
# ── Key Box ────────────────────────────────────────────────────────────────────
class KeyBox(Flowable):
def __init__(self, lines, bg=LIGHT_GOLD, border=ACCENT_GOLD, w=None):
super().__init__()
self.lines = lines
self.bg = bg
self.border = border
self._w = w or (W - 3*cm)
def wrap(self, aw, ah):
self._h = len(self.lines) * 16 + 16
return self._w, self._h
def draw(self):
c = self.canv
c.setFillColor(self.bg)
c.setStrokeColor(self.border)
c.setLineWidth(1.5)
c.roundRect(0, 0, self._w, self._h, 6, fill=1, stroke=1)
c.setFillColor(DARK_GRAY)
for i, line in enumerate(self.lines):
y = self._h - 14 - i*16
if line.startswith('★'):
c.setFont('Helvetica-Bold', 9)
c.setFillColor(ACCENT_RED)
else:
c.setFont('Helvetica', 9)
c.setFillColor(DARK_GRAY)
c.drawString(10, y, line)
# ══════════════════════════════════════════════════════════════════════════════
# DIAGRAM 1 – Full Urea Cycle
# ══════════════════════════════════════════════════════════════════════════════
def draw_urea_cycle(dw=500, dh=460):
d = Drawing(dw, dh)
cx, cy = dw/2, dh/2 - 10
# ── Background compartments ───────────────────────────────────────────────
# Mitochondria oval
mito_rx, mito_ry = 195, 185
d.add(Ellipse(cx, cy+18, mito_rx, mito_ry,
fillColor=MITO_COLOR, strokeColor=MITO_BORDER,
strokeWidth=2.5, strokeDashArray=[5,3]))
d.add(String(cx-40, cy+mito_ry-12, "MITOCHONDRIA",
fontName='Helvetica-Bold', fontSize=8,
fillColor=MITO_BORDER))
# Cytoplasm rectangle outside
d.add(Rect(2, 2, dw-4, dh-4,
fillColor=CYTO_COLOR, strokeColor=CYTO_BORDER,
strokeWidth=1.5, strokeDashArray=[4,2]))
d.add(String(8, dh-18, "CYTOPLASM",
fontName='Helvetica-Bold', fontSize=8,
fillColor=CYTO_BORDER))
# Re-draw mito on top
d.add(Ellipse(cx, cy+18, mito_rx, mito_ry,
fillColor=MITO_COLOR, strokeColor=MITO_BORDER,
strokeWidth=2.5, strokeDashArray=[5,3]))
# ── Helper functions ───────────────────────────────────────────────────────
def node(x, y, text, lines2=None, fill=ROYAL_BLUE, tc=WHITE, w=90, h=28, r=8):
d.add(Rect(x-w/2, y-h/2, w, h,
fillColor=fill, strokeColor=colors.white,
strokeWidth=1, rx=r, ry=r))
d.add(String(x, y + (6 if not lines2 else 8), text,
fontName='Helvetica-Bold', fontSize=8.5,
fillColor=tc, textAnchor='middle'))
if lines2:
d.add(String(x, y-4, lines2,
fontName='Helvetica', fontSize=7,
fillColor=tc, textAnchor='middle'))
def enzyme_tag(x, y, text, color=TEAL):
words = text.split()
mid = len(words)//2
line1 = ' '.join(words[:mid])
line2 = ' '.join(words[mid:])
tw = max(len(line1), len(line2)) * 5.5 + 8
d.add(Rect(x - tw/2, y-8, tw, 22,
fillColor=color, strokeColor=WHITE,
strokeWidth=0.5, rx=4, ry=4))
if line2:
d.add(String(x, y+7, line1, fontName='Helvetica-Oblique',
fontSize=6.8, fillColor=WHITE, textAnchor='middle'))
d.add(String(x, y-1, line2, fontName='Helvetica-Oblique',
fontSize=6.8, fillColor=WHITE, textAnchor='middle'))
else:
d.add(String(x, y+3, text, fontName='Helvetica-Oblique',
fontSize=6.8, fillColor=WHITE, textAnchor='middle'))
def side_label(x, y, text, color=ACCENT_GOLD):
d.add(String(x, y, text, fontName='Helvetica', fontSize=7.5,
fillColor=color, textAnchor='middle'))
def arrow(x1, y1, x2, y2, color=DARK_GRAY, w=1.8):
dx, dy = x2-x1, y2-y1
length = math.sqrt(dx*dx + dy*dy)
if length == 0: return
ux, uy = dx/length, dy/length
# shaft
d.add(Line(x1, y1, x2-ux*8, y2-uy*8,
strokeColor=color, strokeWidth=w))
# arrowhead
angle = math.atan2(uy, ux)
al = 9
aw2 = 4
tip_x, tip_y = x2, y2
left_x = tip_x - al*math.cos(angle) + aw2*math.sin(angle)
left_y = tip_y - al*math.sin(angle) - aw2*math.cos(angle)
right_x = tip_x - al*math.cos(angle) - aw2*math.sin(angle)
right_y = tip_y - al*math.sin(angle) + aw2*math.cos(angle)
d.add(Polygon([tip_x, tip_y, left_x, left_y, right_x, right_y],
fillColor=color, strokeColor=color, strokeWidth=0.5))
# ── Node positions (clock face on a cycle) ────────────────────────────────
# Mito nodes: NH3+CO2 (top-left in mito), Ornithine (bottom-left mito),
# Carbamoyl-P (top-center mito), Citrulline (right mito exit)
n = {
'orn_mito': (cx-95, cy+18), # Ornithine enters mito (left)
'cp': (cx-30, cy+130), # Carbamoyl phosphate (top mito)
'cit_mito': (cx+100, cy+70), # Citrulline (right mito)
'cit_cyto': (cx+135, cy-30), # Citrulline in cytoplasm
'ass': (cx+100, cy-130), # Argininosuccinate
'arg': (cx-50, cy-155), # Arginine
'orn_cyto': (cx-140, cy-80), # Ornithine cytoplasm
'urea': (cx-165, cy+18), # Urea exits
}
# Input nodes (substrates)
nh3_x, nh3_y = cx-105, cy+145
asp_x, asp_y = cx+30, cy-185
# ── Arrows between cycle intermediates ───────────────────────────────────
# NH3 + CO2 → Carbamoyl-P
arrow(nh3_x+38, nh3_y, n['cp'][0]-10, n['cp'][1]+6, ACCENT_GREEN)
# Carbamoyl-P → Citrulline (mito)
arrow(n['cp'][0]+48, n['cp'][1], n['cit_mito'][0]-42, n['cit_mito'][1]+28, DARK_GRAY)
# Orn (mito) → Citrulline
arrow(n['orn_mito'][0]+46, n['orn_mito'][1]+5, n['cit_mito'][0]-42, n['cit_mito'][1]-5, DARK_GRAY)
# Citrulline exits mito into cytoplasm
arrow(n['cit_mito'][0]+2, n['cit_mito'][1]-14, n['cit_cyto'][0]-2, n['cit_cyto'][1]+10, ACCENT_GOLD, 2)
# Citrulline+Asp → Argininosuccinate
arrow(n['cit_cyto'][0]-15, n['cit_cyto'][1]-15, n['ass'][0]+10, n['ass'][1]+14, DARK_GRAY)
# Asp enters
arrow(asp_x, asp_y+15, n['ass'][0]-5, n['ass'][1]+14, ACCENT_GREEN)
# Argininosuccinate → Arginine
arrow(n['ass'][0]-46, n['ass'][1]+4, n['arg'][0]+44, n['arg'][1]+4, DARK_GRAY)
# Arginine → Ornithine + Urea
arrow(n['arg'][0]-42, n['arg'][1], n['orn_cyto'][0]+44, n['orn_cyto'][1]+8, DARK_GRAY)
# Ornithine (cyto) → Ornithine (mito) re-enters
arrow(n['orn_cyto'][0]+20, n['orn_cyto'][1]+16, n['orn_mito'][0]-10, n['orn_mito'][1]-10, ACCENT_GOLD, 2)
# Urea exits
arrow(n['urea'][0]-10, n['urea'][1]+5, 32, n['urea'][1]+5, ACCENT_RED, 2)
# Fumarate exits from Argininosuccinate lyase step
arrow(n['arg'][0]+20, n['arg'][1]-14,
n['arg'][0]+55, n['arg'][1]-55, ACCENT_PURP)
# ── Metabolite nodes ──────────────────────────────────────────────────────
# Substrates / inputs
node(nh3_x, nh3_y, "NH₃ + CO₂", "2 ATP consumed",
fill=ACCENT_GREEN, w=100, h=30)
node(asp_x, asp_y, "Aspartate", "(2nd Nitrogen)",
fill=ACCENT_GREEN, w=92, h=28)
# Cycle intermediates
node(n['cp'][0], n['cp'][1], "Carbamoyl", "Phosphate",
fill=ROYAL_BLUE, w=86, h=30)
node(n['cit_mito'][0], n['cit_mito'][1], "Citrulline", "(mito)",
fill=ROYAL_BLUE, w=86, h=28)
node(n['orn_mito'][0], n['orn_mito'][1], "Ornithine", "(mito)",
fill=ROYAL_BLUE, w=86, h=28)
node(n['cit_cyto'][0], n['cit_cyto'][1], "Citrulline", "(cytoplasm)",
fill=TEAL, w=90, h=28)
node(n['ass'][0], n['ass'][1], "Argino-", "succinate",
fill=TEAL, w=88, h=30)
node(n['arg'][0], n['arg'][1], "Arginine",
fill=TEAL, w=82, h=28)
node(n['orn_cyto'][0], n['orn_cyto'][1], "Ornithine", "(cytoplasm)",
fill=TEAL, w=88, h=28)
# Products
node(n['urea'][0], n['urea'][1], "UREA",
fill=ACCENT_RED, tc=WHITE, w=70, h=30)
d.add(String(22, n['urea'][1]+5, "→ Urine",
fontName='Helvetica-Bold', fontSize=8,
fillColor=ACCENT_RED))
# Fumarate label
node(n['arg'][0]+72, n['arg'][1]-70, "Fumarate", "→ TCA cycle",
fill=ACCENT_PURP, w=90, h=28)
# ── Enzyme labels ─────────────────────────────────────────────────────────
enzyme_tag(cx-72, cy+115, "CPS I", ACCENT_GREEN)
enzyme_tag(cx+42, cy+110, "OTC", MITO_BORDER)
enzyme_tag(cx+148, cy+20, "Antiporter", MITO_BORDER)
enzyme_tag(cx+145, cy-90, "ASS", TEAL)
enzyme_tag(cx+25, cy-165, "ASL", TEAL)
enzyme_tag(cx-110, cy-140, "Arginase I", ACCENT_RED)
enzyme_tag(cx-175, cy-42, "Antiporter", MITO_BORDER)
# ── Step numbers ──────────────────────────────────────────────────────────
steps = [(cx-72, cy+138, "①"), (cx+42, cy+125, "②"),
(cx+160, cy+6, "③"), (cx+145, cy-108, "④"),
(cx+20, cy-178, "⑤"), (cx-108, cy-155, "⑥")]
for sx, sy, st in steps:
d.add(Circle(sx, sy, 8, fillColor=ACCENT_GOLD, strokeColor=WHITE,
strokeWidth=0.5))
d.add(String(sx, sy-3, st,
fontName='Helvetica-Bold', fontSize=7,
fillColor=WHITE, textAnchor='middle'))
# ── NAG note ──────────────────────────────────────────────────────────────
d.add(Rect(cx-175, cy+145, 95, 30,
fillColor=LIGHT_GOLD, strokeColor=ACCENT_GOLD,
strokeWidth=1, rx=4, ry=4))
d.add(String(cx-130, cy+167, "★ NAG activates CPS I",
fontName='Helvetica-Bold', fontSize=7,
fillColor=ACCENT_RED))
d.add(String(cx-130, cy+154, "(Rate-limiting step)",
fontName='Helvetica', fontSize=6.5,
fillColor=DARK_GRAY))
# ── ATP cost label ────────────────────────────────────────────────────────
d.add(Rect(cx+30, cy+145, 115, 30,
fillColor=LIGHT_RED, strokeColor=ACCENT_RED,
strokeWidth=1, rx=4, ry=4))
d.add(String(cx+88, cy+167, "4 ATP equivalents used",
fontName='Helvetica-Bold', fontSize=7,
fillColor=ACCENT_RED, textAnchor='middle'))
d.add(String(cx+88, cy+154, "per urea synthesized",
fontName='Helvetica', fontSize=6.5,
fillColor=DARK_GRAY, textAnchor='middle'))
return d
# ══════════════════════════════════════════════════════════════════════════════
# DIAGRAM 2 – Transdeamination (Transamination + Oxidative Deamination)
# ══════════════════════════════════════════════════════════════════════════════
def draw_transdeamination(dw=480, dh=200):
d = Drawing(dw, dh)
y = dh / 2
def box(x, cy, text, sub=None, fill=ROYAL_BLUE, tc=WHITE, w=95, h=34):
d.add(Rect(x-w/2, cy-h/2, w, h,
fillColor=fill, strokeColor=WHITE, strokeWidth=1, rx=7, ry=7))
d.add(String(x, cy+(7 if sub else 3), text,
fontName='Helvetica-Bold', fontSize=8.5,
fillColor=tc, textAnchor='middle'))
if sub:
d.add(String(x, cy-7, sub,
fontName='Helvetica', fontSize=7,
fillColor=tc, textAnchor='middle'))
def arr(x1, y1, x2, y2, label='', lc=DARK_GRAY):
d.add(Line(x1, y1, x2-8, y2,
strokeColor=DARK_GRAY, strokeWidth=1.8))
d.add(Polygon([x2, y2, x2-10, y2+5, x2-10, y2-5],
fillColor=DARK_GRAY, strokeColor=DARK_GRAY))
if label:
d.add(String((x1+x2)/2, y2+9, label,
fontName='Helvetica-Oblique', fontSize=7.5,
fillColor=TEAL, textAnchor='middle'))
def note(x, y, text, color=ACCENT_GOLD):
d.add(String(x, y, text, fontName='Helvetica', fontSize=7,
fillColor=color, textAnchor='middle'))
# Background panels
d.add(Rect(2, 2, dw/2-5, dh-4,
fillColor=LIGHT_BLUE, strokeColor=ROYAL_BLUE,
strokeWidth=1, rx=6, ry=6))
d.add(String(dw/4, dh-14, "Step 1: TRANSAMINATION",
fontName='Helvetica-Bold', fontSize=8,
fillColor=ROYAL_BLUE, textAnchor='middle'))
d.add(Rect(dw/2+3, 2, dw/2-5, dh-4,
fillColor=LIGHT_GREEN, strokeColor=ACCENT_GREEN,
strokeWidth=1, rx=6, ry=6))
d.add(String(3*dw/4, dh-14, "Step 2: OXIDATIVE DEAMINATION",
fontName='Helvetica-Bold', fontSize=8,
fillColor=ACCENT_GREEN, textAnchor='middle'))
# Step 1 boxes
box(55, y, "Amino Acid", "(e.g., Alanine)", ROYAL_BLUE)
arr(108, y, 148, y, "")
box(195, y, "α-Keto Acid", "(e.g., Pyruvate)", TEAL)
note(150, y+22, "α-KG")
note(150, y+12, "↕")
note(150, y+2, "Glutamate")
note(52, y-28, "Enzyme: Aminotransferase")
note(52, y-38, "Coenzyme: PLP (Vit B6)")
# Separator arrow to step 2
arr(235, y, 270, y, "")
# Step 2 boxes
box(310, y, "Glutamate", fill=ACCENT_GREEN)
arr(360, y, 396, y, "GDH")
box(435, y, "α-KG +", "Free NH₃", ACCENT_RED)
note(310, y-25, "NAD⁺ → NADH")
note(435, y-28, "★ Free NH₃ released")
note(435, y-38, "→ enters urea cycle")
# Regulation note
d.add(Rect(dw/2+8, 10, 100, 32,
fillColor=LIGHT_GOLD, strokeColor=ACCENT_GOLD,
strokeWidth=0.8, rx=4, ry=4))
d.add(String(dw/2+58, 33, "GTP ⛔ Inhibits GDH",
fontName='Helvetica', fontSize=6.5,
fillColor=DARK_GRAY, textAnchor='middle'))
d.add(String(dw/2+58, 20, "ADP ✅ Activates GDH",
fontName='Helvetica', fontSize=6.5,
fillColor=DARK_GRAY, textAnchor='middle'))
return d
# ══════════════════════════════════════════════════════════════════════════════
# DIAGRAM 3 – Ammonia Transport (Glucose-Alanine Cycle)
# ══════════════════════════════════════════════════════════════════════════════
def draw_alanine_cycle(dw=480, dh=210):
d = Drawing(dw, dh)
def box(x, y, text, sub=None, fill=ROYAL_BLUE, tc=WHITE, w=100, h=32):
d.add(Rect(x-w/2, y-h/2, w, h,
fillColor=fill, strokeColor=WHITE, strokeWidth=1, rx=7, ry=7))
d.add(String(x, y+(6 if sub else 2), text,
fontName='Helvetica-Bold', fontSize=8.5,
fillColor=tc, textAnchor='middle'))
if sub:
d.add(String(x, y-8, sub, fontName='Helvetica', fontSize=7,
fillColor=tc, textAnchor='middle'))
def arr(x1, y1, x2, y2, label='', color=DARK_GRAY, above=True):
d.add(Line(x1, y1, x2-9, y2, strokeColor=color, strokeWidth=1.8))
d.add(Polygon([x2, y2, x2-11, y2+5, x2-11, y2-5],
fillColor=color, strokeColor=color))
if label:
ly = (y1+y2)/2 + (10 if above else -12)
d.add(String((x1+x2)/2, ly, label,
fontName='Helvetica-Oblique', fontSize=7.5,
fillColor=TEAL, textAnchor='middle'))
def label(x, y, text, color=DARK_GRAY, bold=False):
fn = 'Helvetica-Bold' if bold else 'Helvetica'
d.add(String(x, y, text, fontName=fn, fontSize=7.5,
fillColor=color, textAnchor='middle'))
# Background panels
d.add(Rect(4, 4, dw/2-10, dh-8,
fillColor=LIGHT_BLUE, strokeColor=ROYAL_BLUE,
strokeWidth=1.2, rx=6, ry=6))
label(dw/4, dh-14, "MUSCLE", ROYAL_BLUE, bold=True)
d.add(Rect(dw/2+6, 4, dw/2-10, dh-8,
fillColor=LIGHT_GREEN, strokeColor=ACCENT_GREEN,
strokeWidth=1.2, rx=6, ry=6))
label(3*dw/4, dh-14, "LIVER", ACCENT_GREEN, bold=True)
# Muscle side
box(90, 155, "Pyruvate", fill=TEAL)
box(90, 85, "Alanine", fill=ROYAL_BLUE)
label(90, 120, "ALT + NH₃", DARK_GRAY)
arr(90, 138, 90, 102, "", ROYAL_BLUE)
# Transport arrow
arr(148, 85, 330, 85, "Blood transport", ACCENT_GOLD)
# Liver side
box(382, 85, "Alanine", fill=ROYAL_BLUE)
box(382, 155, "Pyruvate", fill=TEAL)
label(382, 120, "ALT releases NH₃", DARK_GRAY)
arr(382, 102, 382, 138, "", TEAL)
# NH3 → urea cycle
box(460, 155, "NH₃", "→ Urea Cycle", ACCENT_RED, w=90)
arr(428, 155, 414, 155, "", ACCENT_RED)
# Glucose return
box(382, 30, "Glucose", "Gluconeogenesis", ACCENT_GREEN)
arr(382, 138, 382, 46, "", ACCENT_GREEN)
arr(330, 30, 148, 30, "Glucose → Muscle", ACCENT_GREEN)
arr(90, 46, 90, 68, "", ACCENT_GREEN)
label(240, 68, "★ Glucose-Alanine Cycle", ACCENT_RED, bold=True)
return d
# ══════════════════════════════════════════════════════════════════════════════
# DIAGRAM 4 – Protein Digestion Flow
# ══════════════════════════════════════════════════════════════════════════════
def draw_digestion(dw=480, dh=170):
d = Drawing(dw, dh)
stages = [
("STOMACH", "HCl + Pepsin\nDenatures & cleaves\n→ Polypeptides", ROYAL_BLUE, 60),
("PANCREAS", "Trypsin, Chymotrypsin\nElastase, Carboxypeptidase\n→ Oligopeptides + AAs", TEAL, 180),
("BRUSH BORDER", "Aminopeptidase\n→ Di/tripeptides + AAs", ACCENT_PURP, 300),
("ABSORPTION", "Na⁺-linked (free AAs)\nH⁺-linked (di/tri)\n→ Portal blood", ACCENT_GREEN, 420),
]
for name, detail, color, x in stages:
bh = 100
d.add(Rect(x-55, dh-bh-20, 110, bh,
fillColor=color, strokeColor=WHITE, strokeWidth=1, rx=8, ry=8))
d.add(String(x, dh-25, name,
fontName='Helvetica-Bold', fontSize=8,
fillColor=WHITE, textAnchor='middle'))
lines = detail.split('\n')
for i, line in enumerate(lines):
d.add(String(x, dh-42-i*16, line,
fontName='Helvetica', fontSize=7.5,
fillColor=WHITE, textAnchor='middle'))
if x < 420:
d.add(Polygon([x+60, dh-68, x+70, dh-62, x+60, dh-56],
fillColor=ACCENT_GOLD, strokeColor=ACCENT_GOLD))
# Activation cascade note
d.add(Rect(120, 2, 240, 18,
fillColor=LIGHT_GOLD, strokeColor=ACCENT_GOLD,
strokeWidth=0.8, rx=3, ry=3))
d.add(String(240, 7, "★ Enteropeptidase → Trypsin → activates all other zymogens",
fontName='Helvetica-Bold', fontSize=6.5,
fillColor=ACCENT_RED, textAnchor='middle'))
return d
# ══════════════════════════════════════════════════════════════════════════════
# DIAGRAM 5 – Hyperammonemia Types & Treatment
# ══════════════════════════════════════════════════════════════════════════════
def draw_hyperammonemia(dw=480, dh=190):
d = Drawing(dw, dh)
# Central circle
d.add(Circle(240, 100, 55,
fillColor=ACCENT_RED, strokeColor=WHITE, strokeWidth=2))
d.add(String(240, 112, "HYPER-",
fontName='Helvetica-Bold', fontSize=10,
fillColor=WHITE, textAnchor='middle'))
d.add(String(240, 98, "AMMONEMIA",
fontName='Helvetica-Bold', fontSize=10,
fillColor=WHITE, textAnchor='middle'))
d.add(String(240, 82, ">35 µmol/L",
fontName='Helvetica', fontSize=8,
fillColor=LIGHT_RED, textAnchor='middle'))
def side_box(x, y, title, lines, fill, border):
h = len(lines)*14 + 22
w = 155
d.add(Rect(x, y-h/2, w, h,
fillColor=fill, strokeColor=border,
strokeWidth=1.2, rx=6, ry=6))
d.add(String(x+w/2, y+h/2-14, title,
fontName='Helvetica-Bold', fontSize=8,
fillColor=border, textAnchor='middle'))
for i, line in enumerate(lines):
d.add(String(x+8, y+h/2-26-i*14, line,
fontName='Helvetica', fontSize=7.2,
fillColor=DARK_GRAY))
# Acquired (left)
side_box(8, 105, "ACQUIRED (Adults)",
["• Liver disease (hepatitis/cirrhosis)",
"• Portal-systemic shunting",
"• Impaired urea cycle"],
LIGHT_RED, ACCENT_RED)
d.add(Line(163, 105, 186, 105, strokeColor=ACCENT_RED, strokeWidth=1.5))
d.add(Polygon([186,105,178,109,178,101],
fillColor=ACCENT_RED, strokeColor=ACCENT_RED))
# Congenital (right)
side_box(318, 105, "CONGENITAL (Newborns)",
["• OTC deficiency (X-linked) ← most common",
"• CPS I, ASS, ASL deficiencies (AR)",
"• Arginine becomes essential AA"],
LIGHT_GOLD, ACCENT_GOLD)
d.add(Line(294, 105, 318, 105, strokeColor=ACCENT_GOLD, strokeWidth=1.5))
d.add(Polygon([318,105,310,109,310,101],
fillColor=ACCENT_GOLD, strokeColor=ACCENT_GOLD))
# Treatment (bottom)
tx_items = [
"① Protein restriction + adequate calories",
"② Phenylbutyrate → exports 2 N as phenylacetylglutamine",
"③ Na-benzoate → exports 1 N as hippurate",
"④ Neomycin/lactulose → ↓ gut NH₃",
"⑤ Arginine/citrulline supplementation",
"⑥ Liver transplant (definitive cure)",
]
tx_h = len(tx_items)*13 + 18
d.add(Rect(4, 2, dw-8, tx_h-2,
fillColor=LIGHT_GREEN, strokeColor=ACCENT_GREEN,
strokeWidth=1, rx=5, ry=5))
d.add(String(dw/2, tx_h-4, "TREATMENT STRATEGIES",
fontName='Helvetica-Bold', fontSize=8,
fillColor=ACCENT_GREEN, textAnchor='middle'))
for i, item in enumerate(tx_items):
d.add(String(12, tx_h-16-i*13, item,
fontName='Helvetica', fontSize=7,
fillColor=DARK_GRAY))
return d
# ══════════════════════════════════════════════════════════════════════════════
# TABLE helpers
# ══════════════════════════════════════════════════════════════════════════════
def styled_table(data, col_widths, header_bg=ROYAL_BLUE):
t = Table(data, colWidths=col_widths)
style = 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,0), 9),
('ALIGN', (0,0), (-1,0), 'CENTER'),
('ROWBACKGROUNDS',(0,1),(-1,-1),[WHITE, LIGHT_GRAY]),
('FONTNAME', (0,1), (-1,-1),'Helvetica'),
('FONTSIZE', (0,1), (-1,-1), 8.5),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING',(0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 7),
('GRID', (0,0), (-1,-1), 0.4, colors.HexColor("#CCCCCC")),
('ROWBACKGROUNDS',(0,1),(-1,-1),[WHITE, LIGHT_BLUE]),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
])
t.setStyle(style)
return t
def section_header(text, bg=ROYAL_BLUE):
return SectionBanner(text, bg=bg, w=W-3*cm)
# ══════════════════════════════════════════════════════════════════════════════
# COVER PAGE
# ══════════════════════════════════════════════════════════════════════════════
class CoverPage(Flowable):
def __init__(self, w=W, h=H):
super().__init__()
self._w = w
self._h = h
def wrap(self, aw, ah): return self._w, self._h
def draw(self):
c = self.canv
# Deep gradient background
c.setFillColor(DEEP_NAVY)
c.rect(0, 0, self._w, self._h, fill=1, stroke=0)
# Accent band
c.setFillColor(ROYAL_BLUE)
c.rect(0, self._h*0.38, self._w, self._h*0.28, fill=1, stroke=0)
# Top accent line
c.setFillColor(ACCENT_GOLD)
c.rect(0, self._h*0.66+2, self._w, 4, fill=1, stroke=0)
c.rect(0, self._h*0.38-2, self._w, 4, fill=1, stroke=0)
# DNA helix decoration (simple circles)
import random
random.seed(42)
for i in range(18):
x = self._w*0.88 + 10*math.sin(i*0.7)
y = self._h*0.1 + i*30
r = 6+3*abs(math.sin(i*0.7))
c.setFillColor(colors.HexColor("#1B4F8A"))
c.circle(x, y, r, fill=1, stroke=0)
# Title text
c.setFillColor(WHITE)
c.setFont('Helvetica-Bold', 30)
c.drawCentredString(self._w/2, self._h*0.72, "Amino Acids:")
c.setFont('Helvetica-Bold', 30)
c.drawCentredString(self._w/2, self._h*0.66+12, "Disposal of Nitrogen")
c.setFillColor(LIGHT_BLUE)
c.setFont('Helvetica', 14)
c.drawCentredString(self._w/2, self._h*0.62, "Chapter 19 — Lippincott's Illustrated Reviews: Biochemistry")
# Chapter tags
tags = ["Urea Cycle", "Transdeamination", "Hyperammonemia",
"Protein Digestion", "Ammonia Transport", "Nitrogen Balance"]
tag_x = 60
for tag in tags:
tw = len(tag)*7 + 16
c.setFillColor(TEAL)
c.roundRect(tag_x, self._h*0.56, tw, 18, 4, fill=1, stroke=0)
c.setFillColor(WHITE)
c.setFont('Helvetica', 8)
c.drawString(tag_x+8, self._h*0.56+5, tag)
tag_x += tw + 8
# Author/source
c.setFillColor(ACCENT_GOLD)
c.setFont('Helvetica-Bold', 10)
c.drawCentredString(self._w/2, self._h*0.34, "Comprehensive Study Guide with Diagrams")
c.setFillColor(MID_GRAY)
c.setFont('Helvetica', 9)
c.drawCentredString(self._w/2, self._h*0.30, "Based on Lippincott's Biochemistry, Chapter 19")
# Bottom bar
c.setFillColor(ACCENT_GOLD)
c.rect(0, 0, self._w, 30, fill=1, stroke=0)
c.setFillColor(DEEP_NAVY)
c.setFont('Helvetica-Bold', 9)
c.drawCentredString(self._w/2, 10, "Biochemistry • Amino Acid Metabolism • Nitrogen Disposal")
# ══════════════════════════════════════════════════════════════════════════════
# BUILD THE PDF
# ══════════════════════════════════════════════════════════════════════════════
OUTPUT = "/home/daytona/workspace/nitrogen-study-guide/Amino_Acids_Nitrogen_Disposal_Study_Guide.pdf"
def build_pdf():
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.5*cm, rightMargin=1.5*cm,
topMargin=1.5*cm, bottomMargin=1.5*cm,
title="Amino Acids: Disposal of Nitrogen — Study Guide",
author="Lippincott's Biochemistry Ch.19",
)
story = []
S = Spacer(1, 0.3*cm)
SM = Spacer(1, 0.5*cm)
LG = Spacer(1, 0.8*cm)
# ── COVER ──────────────────────────────────────────────────────────────────
story.append(CoverPage())
story.append(PageBreak())
# ── TABLE OF CONTENTS ──────────────────────────────────────────────────────
story.append(section_header("📋 TABLE OF CONTENTS"))
story.append(SM)
toc_data = [
["#", "Section", "Page"],
["1", "Overview & Big Picture", "3"],
["2", "Amino Acid Pool & Protein Turnover", "3"],
["3", "Protein Digestion (with Diagram)", "4"],
["4", "Amino Acid Transport & Genetic Disorders", "4"],
["5", "Removal of Nitrogen: Transdeamination (with Diagram)", "5"],
["6", "Ammonia Transport: Glutamine & Glucose-Alanine Cycle", "6"],
["7", "THE UREA CYCLE — Full Diagram + Steps", "7"],
["8", "Urea Cycle Stoichiometry & Regulation", "8"],
["9", "Hyperammonemia: Types & Treatment (with Diagram)", "9"],
["10", "High-Yield Summary Tables", "10"],
["11", "Exam One-Liners & Memory Tricks", "11"],
]
story.append(styled_table(toc_data, [0.7*cm, 11*cm, 1.8*cm]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════
# SECTION 1 — OVERVIEW
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("1 · Overview & The Big Picture", DEEP_NAVY))
story.append(SM)
story.append(Paragraph(
b("Core principle:") + " Amino acids cannot be stored. Excess amino acids are degraded — "
"nitrogen is stripped off (toxic as ammonia) and converted to urea for excretion; "
"carbon skeletons enter central metabolic pathways.",
highlight))
story.append(S)
story.append(Paragraph(b("Two phases of amino acid catabolism:"), h3))
story.append(bullet(b("Phase 1 — Nitrogen removal:") + " α-amino group removed → free NH₃ + α-keto acid. NH₃ → converted to urea (main route)."))
story.append(bullet(b("Phase 2 — Carbon skeleton fate:") + " α-keto acid enters TCA cycle, gluconeogenesis, fatty acid synthesis, or ketogenesis."))
story.append(S)
story.append(Paragraph(b("Nitrogen balance:"), h3))
story.append(bullet("Healthy adults: N input = N output (zero balance)"))
story.append(bullet("Positive balance: growth, pregnancy, recovery from illness"))
story.append(bullet("Negative balance: starvation, severe illness, muscle wasting"))
story.append(SM)
# ══════════════════════════════════════════════════════════════════════════
# SECTION 2 — AMINO ACID POOL & TURNOVER
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("2 · Amino Acid Pool & Protein Turnover", ROYAL_BLUE))
story.append(SM)
pool_data = [
["Fills the Pool", "Drains the Pool"],
["Dietary protein digestion & absorption", "Protein synthesis"],
["Body protein breakdown (turnover)", "Biosynthesis of N-containing compounds\n(purines, heme, creatine)"],
["Synthesis of nonessential amino acids", "Energy production (oxidation)"],
]
story.append(styled_table(pool_data, [8*cm, 8*cm]))
story.append(S)
story.append(Paragraph(
b("Protein turnover:") + " ~300–400 g of protein hydrolyzed and resynthesized DAILY. "
"Regulatory proteins (enzymes, transcription factors) are short-lived (minutes–hours). "
"Structural proteins (collagen, muscle) are long-lived (days–years).",
body))
story.append(S)
story.append(Paragraph(b("Two protein degradation systems:"), h3))
deg_data = [
["System", "Energy", "Mechanism", "Targets"],
["Ubiquitin-Proteasome", "ATP-dependent", "Proteins tagged with ubiquitin\n→ fed into proteasome barrel", "Intracellular proteins;\nPEST-sequence proteins (fast)"],
["Lysosomal Degradation", "ATP-independent", "Acid hydrolases (cathepsins)\ndegrade engulfed material", "Extracellular/membrane proteins;\nautophagocytosed organelles"],
]
story.append(styled_table(deg_data, [3.5*cm, 2.8*cm, 5*cm, 5*cm]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════
# SECTION 3 — PROTEIN DIGESTION
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("3 · Protein Digestion", TEAL))
story.append(SM)
story.append(Paragraph("Figure 1 — Protein Digestion Pipeline (Stomach → Absorption)", caption))
story.append(S)
story.append(draw_digestion())
story.append(S)
story.append(Paragraph("Caption: Proteins are digested sequentially by three stations. All pancreatic enzymes are secreted as "
"inactive zymogens; enteropeptidase triggers the activation cascade by activating trypsinogen → trypsin, "
"which then activates all others.", caption))
story.append(SM)
dig_data = [
["Location", "Enzyme/Agent", "Type", "Action"],
["Stomach (Parietal cells)", "HCl", "Acid", "Denatures proteins; activates pepsinogen"],
["Stomach (Chief cells)", "Pepsin", "Endopeptidase", "Cleaves large proteins → polypeptides (active at pH 1–2)"],
["Pancreas", "Trypsin", "Endopeptidase", "Cleaves after Arg, Lys"],
["Pancreas", "Chymotrypsin", "Endopeptidase", "Cleaves after Phe, Tyr, Trp"],
["Pancreas", "Elastase", "Endopeptidase", "Cleaves after small neutral AAs"],
["Pancreas", "Carboxypeptidases A/B", "Exopeptidase", "Cleaves C-terminal amino acids"],
["Brush border", "Aminopeptidase", "Exopeptidase", "Cleaves N-terminal amino acids"],
["Enterocytes", "Intracellular peptidases", "Hydrolase", "Hydrolyze di/tripeptides → free AAs"],
]
story.append(styled_table(dig_data, [3.5*cm, 4*cm, 2.8*cm, 5.4*cm]))
story.append(S)
story.append(Paragraph(
b("Absorption:") + " Free AAs → Na⁺-coupled transport. Di/tripeptides → H⁺-coupled (PepT1) → hydrolyzed inside "
"enterocyte. Only free AAs enter portal blood. " +
b("Exception:") + " Branched-chain AAs (Val, Leu, Ile) bypass liver and go directly to muscle.",
body))
story.append(SM)
# ══════════════════════════════════════════════════════════════════════════
# SECTION 4 — TRANSPORT & GENETIC DISORDERS
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("4 · Amino Acid Transport & Genetic Disorders", ACCENT_PURP))
story.append(SM)
story.append(Paragraph(
"Intracellular [AA] > extracellular [AA] → maintained by active transport (at least 7 transport systems). "
"The same systems are shared between the intestinal brush border and the renal proximal tubule, so a "
"single defect causes both malabsorption and aminoaciduria.",
body))
story.append(S)
disorder_data = [
["Disorder", "Defect", "Amino Acids Affected", "Consequence"],
["Cystinuria", "COAL transport system", "Cystine, Ornithine,\nArginine, Lysine",
"Kidney stones (cystine precipitates at normal urine pH).\nMost common AA transport disorder (1:7,000)"],
["Hartnup Disease", "Neutral AA transporter\n(SLC6A19)", "Tryptophan (main)\n+ other neutral AAs",
"↓ Tryptophan → ↓ Niacin synthesis → pellagra-like:\ndermatitis, diarrhea, dementia"],
]
story.append(styled_table(disorder_data, [2.8*cm, 3.2*cm, 3.5*cm, 6.7*cm]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════
# SECTION 5 — TRANSDEAMINATION
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("5 · Removal of Nitrogen: Transdeamination", ROYAL_BLUE))
story.append(SM)
story.append(Paragraph("Figure 2 — Transdeamination: Transamination + Oxidative Deamination", caption))
story.append(S)
story.append(draw_transdeamination())
story.append(S)
story.append(Paragraph(
"Caption: Step 1 (transamination) funnels nitrogen from most amino acids onto α-ketoglutarate, producing "
"glutamate — the central nitrogen collector. Step 2 (oxidative deamination by GDH) releases free NH₃ "
"from glutamate for the urea cycle.", caption))
story.append(SM)
story.append(Paragraph(b("Step 1 — Transamination (the nitrogen funnel)"), h2))
story.append(bullet("Most amino acids transfer their α-amino group to " + b("α-ketoglutarate") + " → " + b("Glutamate") + " + α-keto acid"))
story.append(bullet("Enzyme: " + b("Aminotransferases (transaminases)") + " — coenzyme: " + b("PLP (pyridoxal phosphate)") + " from Vitamin B6"))
story.append(bullet("PLP is covalently bound to a lysine residue at the active site (Schiff base linkage)"))
story.append(bullet("Equilibrium ~1 → " + b("fully reversible") + ": functions in both catabolism (after meals) and anabolism (synthesis)"))
story.append(bullet(b("Exceptions:") + " Lysine and Threonine do NOT undergo transamination"))
story.append(S)
trans_data = [
["Enzyme", "Reaction", "Location", "Clinical Significance"],
["ALT\n(Alanine aminotransferase)", "Alanine + α-KG ⇌\nPyruvate + Glutamate",
"Liver (high), also\nmuscle, kidney", "Elevated in hepatocellular damage;\nmore liver-specific than AST"],
["AST\n(Aspartate aminotransferase)", "Glutamate + OAA ⇌\nAspartate + α-KG",
"Heart, liver,\nmuscle, RBCs", "Elevated in MI, liver disease,\nmyopathies"],
]
story.append(styled_table(trans_data, [3.5*cm, 4.5*cm, 3.5*cm, 4.7*cm]))
story.append(S)
story.append(Paragraph(b("Clinical: Elevated plasma ALT/AST = tissue damage"), h3))
elevate_data = [
["Condition", "ALT", "AST", "Notes"],
["Viral hepatitis", "↑↑↑", "↑↑", "ALT > AST typical"],
["Alcoholic liver disease", "↑", "↑↑", "AST:ALT ratio > 2:1"],
["Drug/toxin liver injury", "↑↑↑", "↑↑↑", "Can be massive elevation"],
["Myocardial infarction", "Normal", "↑↑", "Also ↑ troponin, CK-MB"],
["Muscle disorders", "Mild ↑", "↑↑", "Also ↑ CK"],
]
story.append(styled_table(elevate_data, [5*cm, 2*cm, 2*cm, 7.2*cm]))
story.append(S)
story.append(Paragraph(b("Step 2 — Oxidative Deamination (GDH)"), h2))
story.append(bullet(b("Glutamate Dehydrogenase (GDH)") + " — liver/kidney mitochondria"))
story.append(bullet("Glutamate + NAD⁺ → α-ketoglutarate + " + b("free NH₃") + " + NADH"))
story.append(bullet("Dual coenzymes: NAD⁺ for deamination (catabolism); NADP⁺ for reductive amination (anabolism)"))
story.append(bullet(b("Allosteric regulation:") + " GTP ⛔ inhibits (energy-rich) | ADP ✅ activates (energy-poor)"))
story.append(S)
story.append(Paragraph(b("D-Amino Acid Oxidase (DAO):") + " FAD-dependent, peroxisomal. Oxidizes dietary D-amino acids → α-keto acid + NH₃ + H₂O₂. "
"Also degrades D-serine (NMDA receptor modulator) — altered DAO activity linked to schizophrenia.", body))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════
# SECTION 6 — AMMONIA TRANSPORT
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("6 · Ammonia Transport to the Liver", TEAL))
story.append(SM)
story.append(Paragraph(
"Free NH₃ is neurotoxic even at low concentrations. Peripheral tissues package nitrogen into "
"non-toxic carriers for safe transport to the liver.",
body))
story.append(S)
story.append(Paragraph("Figure 3 — Glucose-Alanine Cycle (Muscle-Liver Axis)", caption))
story.append(S)
story.append(draw_alanine_cycle())
story.append(S)
story.append(Paragraph(
"Caption: In muscle, pyruvate accepts nitrogen (via ALT) to form alanine, which travels to the liver. "
"There, ALT reverses the reaction — releasing NH₃ for the urea cycle and pyruvate for gluconeogenesis. "
"The resulting glucose returns to muscle, completing the cycle.", caption))
story.append(SM)
transport_data = [
["Carrier", "Tissues", "Formation", "Fate in Liver"],
["Glutamine\n(main carrier)", "All tissues\n(esp. brain, muscle)", "Glutamine synthetase (ATP):\nNH₃ + Glutamate → Glutamine",
"Glutaminase:\nGlutamine → Glu + NH₃\n→ urea synthesis"],
["Alanine\n(muscle-specific)", "Skeletal muscle", "ALT: Pyruvate + Glu → Alanine\n(packages muscle NH₃)",
"ALT (reversed): Alanine → Pyruvate\nPyruvate → glucose (gluconeogenesis)"],
]
story.append(styled_table(transport_data, [2.8*cm, 3.2*cm, 5.5*cm, 4.7*cm]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════
# SECTION 7 — UREA CYCLE
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("7 · THE UREA CYCLE", DEEP_NAVY))
story.append(SM)
story.append(Paragraph(
b("Overview:") + " Urea = primary nitrogen disposal form in humans (~90% of urinary nitrogen). "
"Each urea molecule carries 2 nitrogen atoms: 1 from free NH₃ (GDH) and 1 from aspartate (AST). "
"Occurs in hepatocytes (mitochondria + cytoplasm). Urea → blood → kidneys → urine.",
highlight))
story.append(SM)
story.append(Paragraph("Figure 4 — Complete Urea Cycle Diagram", caption))
story.append(S)
story.append(draw_urea_cycle(dw=int(W-3*cm), dh=470))
story.append(S)
story.append(Paragraph(
"Caption: Numbered steps ① – ⑥ show the sequential reactions. Yellow background = mitochondrial reactions (Steps ①②); "
"blue-green background = cytoplasmic reactions (Steps ③④⑤). Ornithine antiporter (③ transition) shuttles "
"citrulline out and ornithine back in. Fumarate exits to the TCA cycle, linking the two pathways.",
caption))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════
# SECTION 8 — STEPS, STOICHIOMETRY, REGULATION
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("8 · Urea Cycle Steps, Stoichiometry & Regulation", ROYAL_BLUE))
story.append(SM)
steps_data = [
["Step", "Location", "Substrate(s)", "Enzyme", "Product(s)", "Key Notes"],
["①", "Mitochondria", "NH₃ + CO₂\n+ 2 ATP", "CPS I\n(Carbamoyl\nPhosphate\nSynthetase I)",
"Carbamoyl\nPhosphate + 2 ADP", "★ RATE-LIMITING STEP\nActivated by N-acetylglutamate (NAG)\nNAG is essential allosteric activator"],
["②", "Mitochondria", "Carbamoyl-P\n+ Ornithine", "OTC\n(Ornithine\nTranscarbamoylase)",
"Citrulline + Pi", "Most common urea cycle disorder\nis OTC deficiency (X-linked)"],
["—", "Membrane", "Citrulline\n(mito → cyto)", "Ornithine/\nCitrulline\nAntiporter",
"Citrulline\nin cytoplasm", "Ornithine re-enters mito in exchange"],
["③", "Cytoplasm", "Citrulline\n+ Aspartate\n+ ATP", "Argininosuccinate\nSynthetase (ASS)",
"Argininosuccinate\n+ AMP + PPi", "★ SECOND NITROGEN enters here\n(from aspartate)\n1 ATP used → AMP (= 2 bonds)"],
["④", "Cytoplasm", "Argininosuccinate", "Argininosuccinate\nLyase (ASL)",
"Arginine\n+ Fumarate", "Fumarate → TCA cycle (malate → OAA)\nLinks urea cycle to TCA"],
["⑤", "Cytoplasm", "Arginine\n+ H₂O", "Arginase I",
"Urea\n+ Ornithine", "★ Arginase I exclusive to liver\nOrnithine recycled back to mito"],
]
story.append(styled_table(steps_data, [1*cm, 2.2*cm, 2.5*cm, 3*cm, 2.5*cm, 5*cm]))
story.append(SM)
story.append(Paragraph(b("Stoichiometry:"), h2))
story.append(KeyBox([
"Aspartate + NH₃ + CO₂ + 3 ATP + H₂O → Urea + Fumarate + 2 ADP + AMP + 2 Pi + PPi",
"★ 4 high-energy phosphate bonds consumed per urea molecule (counts PPi hydrolysis)",
"★ Reaction is IRREVERSIBLE — large negative ΔG",
"★ Both nitrogens of urea ultimately derive from GLUTAMATE",
], bg=LIGHT_BLUE, border=ROYAL_BLUE))
story.append(SM)
story.append(Paragraph(b("Regulation:"), h2))
story.append(bullet(b("Rate-limiting enzyme:") + " CPS I — activated by N-acetylglutamate (NAG)"))
story.append(bullet(b("NAG synthesis:") + " NAGS enzyme: Acetyl-CoA + Glutamate → NAG; Arginine activates NAGS (positive feedback)"))
story.append(bullet(b("Short-term:") + " Substrate availability (more protein → more NH₃ → more NAG → more CPS I activity)"))
story.append(bullet(b("Long-term:") + " High-protein diet induces transcription of urea cycle enzyme genes"))
story.append(SM)
story.append(Paragraph(b("Fate of Urea:"), h2))
story.append(bullet("Diffuses from liver → blood → kidneys → filtered and excreted in urine (main route)"))
story.append(bullet("~25% diffuses into intestine → gut bacteria urease → CO₂ + NH₃"))
story.append(bullet(b("Renal failure:") + " elevated plasma urea drives more urea into gut → more bacterial NH₃ → worsens hyperammonemia"))
story.append(bullet(b("Treatment:") + " oral neomycin (antibiotic reduces gut bacteria) or lactulose (acidifies colon, traps NH₄⁺)"))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════
# SECTION 9 — HYPERAMMONEMIA
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("9 · Hyperammonemia: Types & Treatment", ACCENT_RED))
story.append(SM)
story.append(Paragraph("Figure 5 — Hyperammonemia: Types & Treatment Overview", caption))
story.append(S)
story.append(draw_hyperammonemia(dw=int(W-3*cm), dh=200))
story.append(SM)
story.append(Paragraph(b("Normal plasma NH₃: 5–35 µmol/L | Emergency threshold: ~1000 µmol/L"), alert))
story.append(S)
story.append(Paragraph(b("Mechanism of CNS toxicity:"), h3))
story.append(bullet("NH₃ depletes α-ketoglutarate (TCA intermediate) → impairs brain energy metabolism"))
story.append(bullet("Excess glutamine synthesis in astrocytes → osmotic swelling → " + b("cerebral edema")))
story.append(bullet("Direct neuronal membrane depolarization and impaired neurotransmitter balance"))
story.append(S)
story.append(Paragraph(b("Symptom progression (in order of severity):"), h3))
story.append(Paragraph(
"Tremors → Vomiting → Slurred speech → Asterixis (flapping tremor) → "
"Encephalopathy/Confusion → " + b("Cerebral Edema → Coma → Death"),
highlight))
story.append(SM)
ucd_data = [
["Enzyme Deficiency", "Inheritance", "Severity", "Notes"],
["OTC (Ornithine Transcarbamylase)", "X-linked", "Severe", "Most common urea cycle disorder; males severely affected in neonates"],
["CPS I deficiency", "Autosomal recessive", "Severe", "No carbamoyl phosphate → complete urea cycle block"],
["Argininosuccinate Synthetase\n(Citrullinemia Type I)", "Autosomal recessive", "Severe", "Citrulline accumulates in blood"],
["Argininosuccinate Lyase\n(Argininosuccinic aciduria)", "Autosomal recessive", "Moderate-Severe", "Argininosuccinate in blood/urine"],
["Arginase I deficiency", "Autosomal recessive", "Mild-Moderate", "Spastic diplegia; seizures; arginine accumulates"],
]
story.append(styled_table(ucd_data, [5.2*cm, 3.2*cm, 2.8*cm, 5*cm]))
story.append(S)
story.append(Paragraph(
b("Key fact:") + " With any urea cycle enzyme defect (except arginase deficiency), "
b("arginine becomes an essential amino acid") + " because it cannot be synthesized.",
body))
story.append(SM)
tx_data = [
["Treatment", "Mechanism", "N Exported"],
["Protein restriction + adequate calories", "Reduce nitrogen load; prevent catabolism", "—"],
["Phenylbutyrate → phenylacetate\n→ + Glutamine → phenylacetylglutamine", "Excreted in urine; bypasses urea cycle", "2 N per molecule"],
["Sodium benzoate → hippurate\n(+ Glycine)", "Excreted in urine", "1 N per molecule"],
["Oral neomycin / lactulose", "↓ gut bacteria → ↓ urease activity → ↓ intestinal NH₃", "—"],
["Arginine / citrulline supplementation", "Replenish depleted urea cycle intermediates", "—"],
["Liver transplant", "Definitive cure — restores full urea cycle enzyme activity", "—"],
]
story.append(styled_table(tx_data, [6*cm, 6.5*cm, 2.5*cm]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════
# SECTION 10 — HIGH-YIELD SUMMARY TABLES
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("10 · High-Yield Summary Tables", TEAL))
story.append(SM)
story.append(Paragraph(b("Key Enzymes of Nitrogen Metabolism"), h2))
enzyme_data = [
["Enzyme", "Location", "Coenzyme/\nActivator", "Direction", "Clinical Relevance"],
["Aminotransferases\n(ALT, AST)", "All tissues", "PLP (Vit B6)", "Reversible", "Elevated in liver/muscle damage"],
["Glutamate\nDehydrogenase (GDH)", "Liver/kidney\nmitochondria", "NAD⁺ / NADP⁺\nGTP ⛔ ADP ✅", "Both", "Releases free NH₃ for urea cycle"],
["CPS I", "Mitochondria\n(liver)", "NAG (activator)\n2 ATP consumed", "Irreversible", "Rate-limiting; deficiency → hyperammonemia"],
["OTC", "Mitochondria\n(liver)", "—", "Irreversible", "Most common UCD; X-linked"],
["Argininosuccinate\nSynthetase (ASS)", "Cytoplasm", "ATP (→ AMP)", "Irreversible", "Citrullinemia Type I if deficient"],
["Argininosuccinate\nLyase (ASL)", "Cytoplasm", "—", "Irreversible", "Argininosuccinic aciduria if deficient"],
["Arginase I", "Cytoplasm\n(liver only)", "—", "Irreversible", "Liver-exclusive; produces urea"],
["Glutamine\nSynthetase", "Most tissues", "ATP", "Irreversible", "Non-toxic NH₃ transport carrier"],
["D-Amino Acid\nOxidase (DAO)", "Peroxisomes", "FAD", "Irreversible", "D-serine metabolism; schizophrenia link"],
]
story.append(styled_table(enzyme_data, [3.5*cm, 2.8*cm, 2.8*cm, 2*cm, 5.1*cm]))
story.append(SM)
story.append(Paragraph(b("Sources of Ammonia in the Body"), h2))
nh3_data = [
["Source", "Mechanism", "Relative Contribution"],
["Amino acid catabolism", "Transdeamination (aminotransferase + GDH)", "Major"],
["Glutamine hydrolysis", "Glutaminase in intestine and kidney", "Major"],
["Intestinal bacteria", "Urease converts dietary urea → NH₃", "Significant"],
["Biogenic amines", "MAO (monoamine oxidase) deaminates amines", "Minor"],
["Purine/pyrimidine catabolism", "Deamination during nucleotide breakdown", "Minor"],
]
story.append(styled_table(nh3_data, [4.5*cm, 7*cm, 4.7*cm]))
story.append(PageBreak())
# ══════════════════════════════════════════════════════════════════════════
# SECTION 11 — EXAM ONE-LINERS
# ══════════════════════════════════════════════════════════════════════════
story.append(section_header("11 · Exam One-Liners & Memory Tricks", ACCENT_GOLD))
story.append(SM)
story.append(Paragraph(b("★ Must-Know One-Liners"), h2))
oneliner_data = [
["#", "One-Liner", "Why it matters"],
["1", "Amino acids CANNOT be stored — excess is degraded.", "Foundation of the whole chapter"],
["2", "Lysine and Threonine do NOT transaminate.", "Exam trap; all others do"],
["3", "ALL aminotransferases require PLP (Vitamin B6).", "Any B6 deficiency impairs nitrogen removal"],
["4", "ALT is more liver-specific than AST.", "MI raises AST but not ALT significantly"],
["5", "Glutamate is the central nitrogen collector.", "All roads lead to glutamate first"],
["6", "GDH: GTP inhibits, ADP activates.", "Energy status controls amino acid catabolism"],
["7", "CPS I is the rate-limiting step of the urea cycle.", "Activated by NAG (not by substrate alone)"],
["8", "NAG = essential allosteric activator of CPS I.", "No NAG = no urea synthesis"],
["9", "Arginine activates NAGS → more NAG → more CPS I.", "Positive feedback after protein-rich meal"],
["10", "OTC deficiency = most common urea cycle disorder; X-linked.", "Males affected severely; presents in newborns"],
["11", "All other urea cycle disorders = autosomal recessive.", "OTC is the only X-linked one"],
["12", "4 ATP equivalents consumed per urea molecule.", "Highly exergonic → irreversible"],
["13", "2 nitrogens in urea: 1 from NH₃ (GDH), 1 from aspartate (AST).", "Both ultimately from glutamate"],
["14", "Arginase I is exclusive to the liver.", "Only liver can complete the full urea cycle"],
["15", "Cystinuria = COAL defect → kidney stones.", "Cystine, Ornithine, Arginine, Lysine"],
["16", "Hartnup = tryptophan transport defect → pellagra-like.", "Dermatitis, diarrhea, dementia (3 D's)"],
["17", "Enteropeptidase activates trypsinogen → trypsin activates all others.", "Master switch of pancreatic digestion"],
["18", "Phenylbutyrate exports 2 N; benzoate exports 1 N.", "Nitrogen scavenger drugs for hyperammonemia"],
["19", "In urea cycle defects, arginine becomes essential.", "Cannot be synthesized; must be supplemented"],
["20", "Branched-chain AAs (Val, Leu, Ile) bypass liver → muscle.", "Oxidized in muscle, not liver"],
]
story.append(styled_table(oneliner_data, [0.8*cm, 9.5*cm, 5.9*cm]))
story.append(SM)
story.append(Paragraph(b("Memory Tricks"), h2))
tricks = [
("Urea Cycle Steps", '"Can Citrulline Always Act Usefully?" = Carbamoyl-P → Citrulline → Argininosuccinate → Arginine → Urea'),
("COAL transport defect", '"COAL" = Cystine, Ornithine, Arginine, Lysine — all deficient in Cystinuria'),
("GDH regulation", '"GTP = Got Too much energy → stop degrading. ADP = A Deficit of energy → go degrade."'),
("PLP coenzyme", "B6 → PLP → ALL transaminations. If you see any aminotransferase, think Vitamin B6."),
("Urea nitrogens", "NH₃ from GDH (mito) = nitrogen #1. Aspartate from AST (cyto) = nitrogen #2."),
("OTC deficiency", "OTC = Only The Child (male newborn); X-linked; urea cycle shuts down → hyperammonemia."),
]
for title, trick in tricks:
story.append(KeyBox([f"{title}: {trick}"], bg=LIGHT_PURP, border=ACCENT_PURP))
story.append(Spacer(1, 4))
story.append(SM)
# ── FINAL FLOW SUMMARY ─────────────────────────────────────────────────────
story.append(section_header("★ Master Summary Flow", DEEP_NAVY))
story.append(SM)
flow_data = [
["Stage", "Process", "Key Enzyme/Agent", "Product"],
["Dietary protein", "Digestion (stomach, pancreas, brush border)", "Pepsin → Trypsin → Aminopeptidase", "Free amino acids"],
["Absorption", "Na⁺ / H⁺ cotransport into enterocytes", "PepT1 for di/tripeptides", "AAs → portal blood"],
["Nitrogen removal (Step 1)", "Transamination to α-ketoglutarate", "Aminotransferases (PLP)", "Glutamate + α-keto acid"],
["Nitrogen removal (Step 2)", "Oxidative deamination of glutamate", "GDH (NAD⁺; ADP activates)", "Free NH₃ + α-KG"],
["NH₃ transport (general)", "Packaging into glutamine", "Glutamine synthetase (ATP)", "Glutamine → liver"],
["NH₃ transport (muscle)", "Packaging into alanine", "ALT (Glucose-Alanine Cycle)", "Alanine → liver"],
["Urea synthesis (Mito 1)", "Carbamoyl phosphate formation", "CPS I (NAG activator)", "Carbamoyl-P"],
["Urea synthesis (Mito 2)", "Citrulline formation", "OTC", "Citrulline → cytoplasm"],
["Urea synthesis (Cyto 3)", "Argininosuccinate synthesis", "ASS (ATP)", "Argininosuccinate"],
["Urea synthesis (Cyto 4)", "Argininosuccinate cleavage", "ASL", "Arginine + Fumarate"],
["Urea synthesis (Cyto 5)", "Urea formation", "Arginase I (liver only)", "Urea + Ornithine"],
["Excretion", "Blood → kidneys → urine", "Renal filtration", "Urea excreted"],
]
story.append(styled_table(flow_data, [4*cm, 5*cm, 4.5*cm, 2.7*cm]))
story.append(SM)
story.append(Paragraph(
"All content based on: " + b("Lippincott's Illustrated Reviews: Biochemistry, Chapter 19") +
" — Amino Acids: Disposal of Nitrogen.",
caption))
doc.build(story)
print(f"PDF created: {OUTPUT}")
build_pdf()
cd /home/daytona/workspace/nitrogen-study-guide && python3 generate_pdf.py 2>&1
~/nitrogen-study-guide/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/nitrogen-study-guide/generate_pdf.py'
cd /home/daytona/workspace/nitrogen-study-guide && python3 -c " import ast, sys with open('generate_pdf.py') as f: src = f.read() try: ast.parse(src) print('Syntax OK') except SyntaxError as e: print(f'SyntaxError at line {e.lineno}: {e.msg}') "
cd /home/daytona/workspace/nitrogen-study-guide && python3 generate_pdf.py 2>&1
~/nitrogen-study-guide/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/nitrogen-study-guide/generate_pdf.py'
cd /home/daytona/workspace/nitrogen-study-guide && python3 generate_pdf.py 2>&1
~/nitrogen-study-guide/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/nitrogen-study-guide/generate_pdf.py'
cd /home/daytona/workspace/nitrogen-study-guide && python3 generate_pdf.py 2>&1
ls -lh /home/daytona/workspace/nitrogen-study-guide/Amino_Acids_Nitrogen_Disposal_Study_Guide.pdf
Amino Acids Nitrogen Disposal Study Guide
PDF Document · PDF
| Section | Content |
|---|---|
| Cover Page | Styled title page with topic tags |
| Table of Contents | All 11 sections with page numbers |
| Section 1-2 | Overview, amino acid pool, protein turnover & degradation systems |
| Section 3 | Protein digestion pipeline — with Figure 1 (4-station flow diagram: Stomach → Pancreas → Brush Border → Absorption) |
| Section 4 | Amino acid transport + Cystinuria & Hartnup disease tables |
| Section 5 | Transdeamination — with Figure 2 (two-panel transamination + oxidative deamination diagram), ALT/AST clinical table |
| Section 6 | Ammonia transport — with Figure 3 (Glucose-Alanine Cycle muscle-liver diagram) |
| Section 7 | Figure 4 — Full Urea Cycle Diagram (colour-coded mitochondria vs cytoplasm, all 5 steps numbered, enzymes labelled, NAG regulation box) |
| Section 8 | Step-by-step table, stoichiometry box, regulation, fate of urea |
| Section 9 | Hyperammonemia — with Figure 5 (types + treatment overview), all UCD deficiencies table |
| Section 10 | High-yield enzyme summary table + ammonia sources table |
| Section 11 | 20 exam one-liners + 6 memory trick boxes |
| Master Summary | Complete nitrogen disposal flow table (soup to nuts) |