~/biochem-cheatsheet/generate_cheatsheet.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table,
TableStyle, HRFlowable, PageBreak)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus import KeepTogether
OUTPUT = "/home/daytona/workspace/biochem-cheatsheet/Biochem_Paper2_CheatSheet.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.5*cm, rightMargin=1.5*cm,
topMargin=1.8*cm, bottomMargin=1.8*cm
)
W, H = A4
# ── Colour palette ──────────────────────────────────────────────────────────
C_RED = colors.HexColor("#C0392B")
C_ORANGE = colors.HexColor("#E67E22")
C_BLUE = colors.HexColor("#1A5276")
C_TEAL = colors.HexColor("#148F77")
C_GREEN = colors.HexColor("#1E8449")
C_PURPLE = colors.HexColor("#6C3483")
C_GREY = colors.HexColor("#F2F3F4")
C_LTBLUE = colors.HexColor("#D6EAF8")
C_LTYEL = colors.HexColor("#FEF9E7")
C_LTRED = colors.HexColor("#FDEDEC")
C_LTGRN = colors.HexColor("#E9F7EF")
C_WHITE = colors.white
C_BLACK = colors.HexColor("#1C2833")
C_BADGE = colors.HexColor("#922B21")
styles = getSampleStyleSheet()
def S(name, **kw):
base = styles["Normal"]
return ParagraphStyle(name, parent=base, **kw)
# ── Style definitions ────────────────────────────────────────────────────────
sTITLE = S("sTITLE", fontSize=20, leading=24, textColor=C_WHITE,
fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=2)
sSUB = S("sSUB", fontSize=10, leading=13, textColor=C_WHITE,
fontName="Helvetica", alignment=TA_CENTER)
sH1 = S("sH1", fontSize=13, leading=16, textColor=C_WHITE,
fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=2)
sH2 = S("sH2", fontSize=10, leading=13, textColor=C_BLUE,
fontName="Helvetica-Bold", spaceBefore=4, spaceAfter=1)
sH3 = S("sH3", fontSize=9, leading=12, textColor=C_TEAL,
fontName="Helvetica-Bold", spaceBefore=3, spaceAfter=1)
sBODY = S("sBODY", fontSize=8, leading=11, textColor=C_BLACK,
fontName="Helvetica", spaceAfter=1)
sBULL = S("sBULL", fontSize=8, leading=11, textColor=C_BLACK,
fontName="Helvetica", leftIndent=10, spaceAfter=1)
sKEY = S("sKEY", fontSize=8, leading=11, textColor=C_RED,
fontName="Helvetica-Bold", leftIndent=10, spaceAfter=1)
sTABH = S("sTABH", fontSize=7.5,leading=10, textColor=C_WHITE,
fontName="Helvetica-Bold", alignment=TA_CENTER)
sTABC = S("sTABC", fontSize=7.5,leading=10, textColor=C_BLACK,
fontName="Helvetica", alignment=TA_LEFT)
sFOOT = S("sFOOT", fontSize=7, leading=9, textColor=colors.grey,
fontName="Helvetica-Oblique", alignment=TA_CENTER)
def badge(text, bg=C_RED):
return Table([[Paragraph(text, S("b", fontSize=7, fontName="Helvetica-Bold",
textColor=C_WHITE, alignment=TA_CENTER))]],
colWidths=[1.6*cm],
style=[("BACKGROUND",(0,0),(-1,-1), bg),
("ROUNDEDCORNERS",[3]),
("TOPPADDING",(0,0),(-1,-1),1),
("BOTTOMPADDING",(0,0),(-1,-1),1)])
def section_header(title, color=C_BLUE):
tbl = Table([[Paragraph(title, sH1)]],
colWidths=[doc.width],
style=[("BACKGROUND",(0,0),(-1,-1), color),
("TOPPADDING",(0,0),(-1,-1),4),
("BOTTOMPADDING",(0,0),(-1,-1),4),
("LEFTPADDING",(0,0),(-1,-1),8),
("ROUNDEDCORNERS",[4])])
return tbl
def two_col(left_items, right_items):
"""Put two lists of flowables side-by-side."""
half = (doc.width - 0.4*cm) / 2
lt = [[item] for item in left_items]
rt = [[item] for item in right_items]
# Build inner tables
def inner(rows, w):
return Table(rows, colWidths=[w],
style=[("TOPPADDING",(0,0),(-1,-1),0),
("BOTTOMPADDING",(0,0),(-1,-1),0),
("LEFTPADDING",(0,0),(-1,-1),0),
("RIGHTPADDING",(0,0),(-1,-1),0)])
return Table([[inner(lt, half), inner(rt, half)]],
colWidths=[half+0.2*cm, half+0.2*cm],
style=[("VALIGN",(0,0),(-1,-1),"TOP"),
("LEFTPADDING",(0,0),(-1,-1),0),
("RIGHTPADDING",(0,0),(-1,-1),0),
("TOPPADDING",(0,0),(-1,-1),0),
("BOTTOMPADDING",(0,0),(-1,-1),0)])
def card(content_rows, bg=C_GREY, border_color=C_BLUE):
inner = Table([[r] for r in content_rows], colWidths=[doc.width - 0.6*cm],
style=[("TOPPADDING",(0,0),(-1,-1),0),
("BOTTOMPADDING",(0,0),(-1,-1),0),
("LEFTPADDING",(0,0),(-1,-1),0),
("RIGHTPADDING",(0,0),(-1,-1),0)])
outer = Table([[inner]],
colWidths=[doc.width],
style=[("BACKGROUND",(0,0),(-1,-1), bg),
("BOX",(0,0),(-1,-1),1, border_color),
("TOPPADDING",(0,0),(-1,-1),5),
("BOTTOMPADDING",(0,0),(-1,-1),5),
("LEFTPADDING",(0,0),(-1,-1),6),
("RIGHTPADDING",(0,0),(-1,-1),6)])
return outer
def make_table(headers, rows, col_widths, header_color=C_BLUE):
data = [[Paragraph(h, sTABH) for h in headers]]
for row in rows:
data.append([Paragraph(str(c), sTABC) for c in row])
t = Table(data, colWidths=col_widths)
style = [
("BACKGROUND",(0,0),(-1,0), header_color),
("ROWBACKGROUNDS",(0,1),(-1,-1),[C_WHITE, C_LTBLUE]),
("GRID",(0,0),(-1,-1),0.4, colors.HexColor("#BFC9CA")),
("TOPPADDING",(0,0),(-1,-1),3),
("BOTTOMPADDING",(0,0),(-1,-1),3),
("LEFTPADDING",(0,0),(-1,-1),4),
("RIGHTPADDING",(0,0),(-1,-1),4),
("VALIGN",(0,0),(-1,-1),"TOP"),
]
t.setStyle(TableStyle(style))
return t
# ════════════════════════════════════════════════════════════════════════════
# BUILD STORY
# ════════════════════════════════════════════════════════════════════════════
story = []
# ── COVER BANNER ─────────────────────────────────────────────────────────────
banner = Table([
[Paragraph("AMRITA MBBS · BIOCHEMISTRY PAPER 2", sTITLE)],
[Paragraph("TOP 15 MOST REPEATED TOPICS · QUICK REVISION CHEAT SHEET", sSUB)],
[Paragraph("Based on Nov/Dec 2023 | Jan 2024 (Supp) | Jul/Aug 2024 | Sep 2025 papers", sSUB)],
], colWidths=[doc.width],
style=[("BACKGROUND",(0,0),(-1,-1), C_BLUE),
("TOPPADDING",(0,0),(-1,-1),8),
("BOTTOMPADDING",(0,0),(-1,-1),8),
("ROUNDEDCORNERS",[5])])
story.append(banner)
story.append(Spacer(1, 0.3*cm))
# ── FREQUENCY TABLE ──────────────────────────────────────────────────────────
story.append(section_header("📋 FREQUENCY MAP — How Often Each Topic Appears", C_RED))
story.append(Spacer(1, 0.15*cm))
freq_data = [
["Allopurinol / Gout / Uric acid / Lesch-Nyhan", "4/4 🔥🔥🔥"],
["TCA Cycle (amphibolic, steps, inhibitors)", "4/4 🔥🔥🔥"],
["DNA Replication / Transcription / Translation", "4/4 🔥🔥🔥"],
["Renal acid-base regulation", "4/4 🔥🔥🔥"],
["Cholesterol / LDL / Lipoproteins", "4/4 🔥🔥🔥"],
["Acid-base case (Metabolic Alkalosis — vomiting)", "3/4 🔥🔥"],
["Ketogenesis / DKA case", "3/4 🔥🔥"],
["PCR (principle, technique, applications)", "3/4 🔥🔥"],
["Collagen structure + disorders", "3/4 🔥🔥"],
["Tumor markers", "3/4 🔥🔥"],
["PUFA / Fish oil — give reason", "3/4 🔥🔥"],
["Aspirin in MI prevention — give reason", "3/4 🔥🔥"],
["ELISA", "3/4 🔥🔥"],
["Thyroid function tests (T3, T4, TSH)", "3/4 🔥🔥"],
["Creatinine clearance / Renal clearance tests", "3/4 🔥🔥"],
]
story.append(make_table(["Topic", "Frequency"],
freq_data, [13*cm, 3.5*cm], C_RED))
story.append(Spacer(1, 0.3*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 1 — ALLOPURINOL / GOUT
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("1. ALLOPURINOL / GOUT / URIC ACID / LESCH-NYHAN [Asked ALL 4 papers]", C_RED),
Spacer(1, 0.1*cm),
card([
Paragraph("<b>Uric acid</b> = final product of purine catabolism in humans (lack uricase). Normal: males <7 mg/dL.", sBODY),
Paragraph("<b>Pathway:</b> Hypoxanthine → Xanthine → Uric acid [enzyme: <b>Xanthine oxidase</b>]", sKEY),
Paragraph("<b>Allopurinol mechanism:</b> Structural analog of hypoxanthine → competitively + irreversibly inhibits xanthine oxidase → ↓ uric acid synthesis → prevents urate crystal deposition in joints.", sBODY),
Paragraph("<b>Gout:</b> Deposition of monosodium urate crystals in joints (1st MTP = podagra). Causes: overproduction or underexcretion of uric acid.", sBODY),
Paragraph("<b>Lesch-Nyhan Syndrome:</b> X-linked recessive. Complete deficiency of <b>HGPRT</b> (Hypoxanthine-Guanine PhosphoRibosylTransferase). Features: severe hyperuricemia, gout, intellectual disability, choreoathetosis, <b>self-mutilation</b> (pathognomonic). Tx: allopurinol (controls uric acid only; neuro features persist).", sBODY),
], C_LTRED, C_RED),
]))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 2 — TCA CYCLE
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("2. TCA CYCLE — Amphibolic Role, Steps, Inhibitors [All 4 papers]", C_TEAL),
Spacer(1, 0.1*cm),
card([
Paragraph("<b>Location:</b> Mitochondrial matrix. Substrate: Acetyl-CoA (2C) + OAA (4C) → Citrate (6C).", sBODY),
Paragraph("<b>Per turn yield:</b> 3 NADH + 1 FADH₂ + 1 GTP + 2 CO₂ → ~10 ATP", sKEY),
], C_LTGRN, C_TEAL),
]))
story.append(Spacer(1, 0.1*cm))
tca_enzymes = [
["Citrate synthase", "OAA + Acetyl-CoA → Citrate", "—"],
["Isocitrate dehydrogenase", "Isocitrate → α-KG", "NAD⁺ (rate-limiting)"],
["α-KG dehydrogenase", "α-KG → Succinyl-CoA", "B1, B2, B3, Lipoate"],
["Succinate dehydrogenase", "Succinate → Fumarate", "FAD (Complex II of ETC)"],
["Malate dehydrogenase", "Malate → OAA", "NAD⁺"],
]
story.append(make_table(["Enzyme","Reaction","Cofactor"], tca_enzymes,
[5.5*cm, 5.5*cm, 5.5*cm], C_TEAL))
story.append(Spacer(1, 0.1*cm))
story.append(card([
Paragraph("<b>Amphibolic role</b> (catabolic + anabolic):", sH3),
Paragraph("• Citrate → FA synthesis | • α-KG → Glutamate | • Succinyl-CoA → Heme synthesis", sBULL),
Paragraph("• OAA → Gluconeogenesis | • Fumarate → Amino acids", sBULL),
Paragraph("<b>Anaplerosis</b> (refilling cycle): Pyruvate carboxylase (pyruvate → OAA, requires biotin/B7)", sBODY),
Paragraph("<b>Inhibitors:</b> Fluoroacetate (→ fluorocitrate, blocks aconitase) | Arsenite (inhibits α-KG dehydrogenase)", sKEY),
], C_LTGRN, C_TEAL))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 3 — DNA REPLICATION / TRANSCRIPTION / TRANSLATION
# ═══════════════════════════════════════════════════════════
story.append(section_header("3. DNA REPLICATION / TRANSCRIPTION / TRANSLATION [All 4 papers]", C_PURPLE))
story.append(Spacer(1, 0.1*cm))
replic_enzymes = [
["Helicase","Unwinds double helix at replication fork"],
["Topoisomerase / Gyrase","Relieves supercoiling ahead of fork"],
["Primase","Synthesizes RNA primer (required to start)"],
["DNA Pol III (prokaryotes)","Main synthesis enzyme; 5'→3' synthesis"],
["DNA Pol I (prokaryotes)","Removes RNA primer, fills in gap"],
["DNA Ligase","Joins Okazaki fragments; seals nick"],
["SSBPs","Stabilize single-stranded DNA"],
["Telomerase (eukaryotes)","Extends telomeres using RNA template"],
]
story.append(make_table(["Enzyme","Function"], replic_enzymes,
[5*cm, 11.5*cm], C_PURPLE))
story.append(Spacer(1, 0.1*cm))
transl_inh = [
["Streptomycin","30S","Misreads mRNA"],
["Tetracycline","30S","Blocks aminoacyl-tRNA binding to A site"],
["Chloramphenicol","50S","Inhibits peptidyl transferase"],
["Erythromycin","50S","Blocks translocation"],
["Linezolid","70S","Blocks initiation complex"],
]
story.append(card([Paragraph("<b>Translation inhibitor antibiotics:</b>", sH3)],
C_GREY, C_PURPLE))
story.append(make_table(["Antibiotic","Target","Mechanism"], transl_inh,
[5*cm, 2.5*cm, 9*cm], C_PURPLE))
story.append(Spacer(1, 0.1*cm))
story.append(card([
Paragraph("<b>Post-translational modifications:</b> Phosphorylation | Glycosylation | Hydroxylation (collagen — needs Vit C) | Ubiquitination (protein degradation) | Acetylation | Methylation", sBODY),
Paragraph("<b>Stop codons:</b> UAA · UAG · UGA | <b>Start:</b> AUG (Met) | Genetic code: degenerate, unambiguous, universal, non-overlapping", sKEY),
], C_GREY, C_PURPLE))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 4 — ACID-BASE CASE (Metabolic Alkalosis)
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("4. ACID-BASE CASE — Metabolic Alkalosis (Vomiting) [3/4 papers]", C_ORANGE),
Spacer(1, 0.1*cm),
card([
Paragraph("<b>Classic case:</b> Young man, persistent vomiting, dehydrated, shallow respiration, ↑HCO₃⁻, ↓H⁺ (high pH), ↑pCO₂, ↓K⁺.", sBODY),
Paragraph("<b>Disturbance:</b> Metabolic alkalosis with respiratory compensation.", sKEY),
Paragraph("<b>Cause:</b> Vomiting → loss of HCl → loss of H⁺ and Cl⁻ → ↑pH. Hypokalemia (K⁺ 2.9) worsens alkalosis (K⁺ exits cells, H⁺ enters cells).", sBODY),
Paragraph("<b>Compensation:</b> Lungs hypoventilate → retain CO₂ (↑pCO₂). Kidneys excrete HCO₃⁻.", sBODY),
], C_LTYEL, C_ORANGE),
]))
story.append(Spacer(1, 0.1*cm))
abdisordr = [
["Metabolic acidosis","↓","↓ (primary)","—","↓ (compensation)"],
["Metabolic alkalosis","↑","↑ (primary)","—","↑ (compensation)"],
["Respiratory acidosis","↓","—","↑ (primary)","↑ (compensation)"],
["Respiratory alkalosis","↑","—","↓ (primary)","↓ (compensation)"],
]
story.append(make_table(["Disorder","pH","HCO₃⁻","pCO₂","Compensation"],
abdisordr, [4.5*cm, 1.5*cm, 2.8*cm, 2.5*cm, 5.2*cm], C_ORANGE))
story.append(Spacer(1, 0.1*cm))
story.append(card([
Paragraph("<b>Buffer systems:</b>", sH3),
Paragraph("1. Bicarbonate/H₂CO₃ — main ECF buffer (regulated by lungs + kidneys)", sBULL),
Paragraph("2. Phosphate (H₂PO₄⁻/HPO₄²⁻) — intracellular & urine", sBULL),
Paragraph("3. Protein/Hemoglobin — intracellular (RBCs)", sBULL),
Paragraph("4. Ammonia — renal tubules (NH₃ + H⁺ → NH₄⁺ excreted)", sBULL),
Paragraph("<b>Renal role:</b> ① Reabsorb filtered HCO₃⁻ (proximal tubule) ② Titratable acid excretion (H⁺ + HPO₄²⁻ → H₂PO₄⁻) ③ Ammonia synthesis → new HCO₃⁻", sKEY),
], C_LTYEL, C_ORANGE))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 5 — CHOLESTEROL / LDL / LIPOPROTEINS
# ═══════════════════════════════════════════════════════════
story.append(section_header("5. CHOLESTEROL / LDL / LIPOPROTEINS [All 4 papers]", C_BLUE))
story.append(Spacer(1, 0.1*cm))
lipo_data = [
["Chylomicron","Dietary TG","Apo B-48","Delivers dietary fat to tissues"],
["VLDL","Endogenous TG","Apo B-100","Delivers liver TG to periphery"],
["IDL","TG + Chol","Apo B-100","Intermediate; → LDL"],
["LDL","Cholesterol","Apo B-100","Delivers cholesterol to cells (\"bad\")"],
["HDL","Protein-rich","Apo A-I","Reverse cholesterol transport (\"good\")"],
]
story.append(make_table(["Lipoprotein","Main Lipid","Apoprotein","Function"],
lipo_data, [3*cm, 3*cm, 2.8*cm, 7.7*cm]))
story.append(Spacer(1, 0.1*cm))
story.append(card([
Paragraph("<b>LDL pathway:</b> VLDL → (LPL removes TG) → IDL → (Hepatic lipase) → LDL → binds LDL receptor (Apo B-100) → endocytosis → releases cholesterol → feedback inhibits HMG-CoA reductase.", sBODY),
Paragraph("<b>Products of cholesterol:</b> Bile acids | Steroid hormones (cortisol, aldosterone, estrogen, testosterone) | Vitamin D₃ | Oxysterols", sBODY),
Paragraph("<b>Statins:</b> Competitive inhibitors of HMG-CoA reductase (rate-limiting step) → ↓ intracellular cholesterol → ↑ LDL receptor expression → ↑ LDL clearance from blood.", sKEY),
], C_LTBLUE, C_BLUE))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 6 — KETOGENESIS / DKA
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("6. KETOGENESIS / DKA CASE [3/4 papers]", C_ORANGE),
Spacer(1, 0.1*cm),
card([
Paragraph("<b>Ketone bodies:</b> ① Acetoacetate ② β-Hydroxybutyrate (most abundant in DKA) ③ Acetone (exhaled — fruity breath)", sBODY),
Paragraph("<b>Synthesis (liver mitochondria):</b>", sH3),
Paragraph("2 Acetyl-CoA → Acetoacetyl-CoA → + Acetyl-CoA → <b>HMG-CoA</b> (rate-limiting step: HMG-CoA synthase) → Acetoacetate → β-Hydroxybutyrate / Acetone", sBULL),
Paragraph("<b>DKA trigger:</b> ↓ Insulin + ↑ Glucagon → lipolysis → FA flood liver → ↓ malonyl-CoA → carnitine shuttle open → β-oxidation overwhelms TCA → acetyl-CoA → ketogenesis.", sBODY),
Paragraph("<b>DKA ABG:</b> pH ↓, HCO₃⁻ ↓ (primary), pCO₂ ↓ (Kussmaul compensation) = High anion gap metabolic acidosis.", sKEY),
Paragraph("<b>Test for ketones in urine:</b> Rothera's test (sodium nitroprusside + ammonia → purple/violet for acetoacetate).", sBODY),
Paragraph("<b>Other causes of ketonuria:</b> Starvation | Alcoholic ketoacidosis | High-fat diet | Pregnancy | Glycogen storage disease", sBODY),
], C_LTYEL, C_ORANGE),
]))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 7 — PCR
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("7. PCR — Principle, Technique, Applications [3/4 papers]", C_TEAL),
Spacer(1, 0.1*cm),
card([
Paragraph("<b>Principle:</b> In vitro amplification of specific DNA sequences using thermostable Taq DNA polymerase + specific primers + thermocycler.", sBODY),
Paragraph("<b>Components:</b> Template DNA | Two primers (flanking target) | Taq polymerase | dNTPs | MgCl₂ buffer", sBODY),
Paragraph("<b>3 Steps (30-40 cycles):</b>", sH3),
Paragraph("① Denaturation 94°C: strands separate ② Annealing 50-65°C: primers bind ③ Extension 72°C: Taq extends new strand 5'→3'", sBULL),
Paragraph("<b>Result:</b> 2ⁿ copies after n cycles (1 molecule → >1 billion in 30 cycles)", sKEY),
Paragraph("<b>Applications:</b> Infectious disease diagnosis (HIV, TB, COVID) | Genetic disease (sickle cell, CF) | Forensic DNA fingerprinting | Prenatal diagnosis | Cancer mutation detection | RFLP analysis | Paternity testing", sBODY),
], C_LTGRN, C_TEAL),
]))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 8 — COLLAGEN
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("8. COLLAGEN — Structure & Disorders [3/4 papers]", C_BLUE),
Spacer(1, 0.1*cm),
card([
Paragraph("<b>Structure:</b> Repeating Gly-X-Y triplets (X=Pro, Y=Hydroxyproline). Three chains form right-handed triple helix. Stabilized by H-bonds + covalent Lys cross-links.", sBODY),
Paragraph("<b>Synthesis:</b> Ribosomes → Hydroxylation of Pro/Lys (<b>Vit C + Fe²⁺ + O₂</b>) → Glycosylation → Triple helix (procollagen) → Secreted → Peptidases → Tropocollagen → Fibrils (Lysyl oxidase + Cu²⁺)", sBODY),
], C_LTBLUE, C_BLUE),
]))
story.append(Spacer(1, 0.1*cm))
collagen_dis = [
["Scurvy","Vit C deficiency → ↓ hydroxylation","Bleeding gums, poor wound healing, perifollicular hemorrhage"],
["Osteogenesis Imperfecta","COL1A1/A2 mutation (Type I collagen)","Brittle bones, blue sclera, hearing loss"],
["Ehlers-Danlos","Defective cross-linking / Type III collagen","Hyperextensible skin, hypermobile joints"],
["Alport Syndrome","Type IV collagen mutation","Hereditary nephritis + deafness"],
]
story.append(make_table(["Disease","Defect","Features"], collagen_dis,
[3.5*cm, 6*cm, 7*cm]))
story.append(Spacer(1, 0.25*cm))
# PAGE BREAK before remaining topics
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════
# TOPIC 9 — TUMOR MARKERS
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("9. TUMOR MARKERS [3/4 papers]", C_RED),
Spacer(1, 0.1*cm),
]))
tm_data = [
["PSA","Prostate cancer","Screening + monitoring"],
["AFP (α-Fetoprotein)","Hepatocellular ca., testicular (yolk sac)","↑ in pregnancy too"],
["CEA","Colorectal, lung, breast","Monitoring recurrence"],
["CA-125","Ovarian cancer","Treatment response"],
["CA 19-9","Pancreatic, cholangiocarcinoma","Prognosis"],
["β-hCG","Choriocarcinoma, testicular","Also pregnancy test"],
["Bence Jones protein","Multiple myeloma","Detected in urine (light chains)"],
["CA 15-3","Breast cancer","Monitoring"],
]
story.append(make_table(["Marker","Cancer","Note"], tm_data,
[3.5*cm, 5.5*cm, 7.5*cm], C_RED))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 10 — ELISA
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("10. ELISA — Principle & Technique [3/4 papers]", C_PURPLE),
Spacer(1, 0.1*cm),
card([
Paragraph("<b>Principle:</b> Enzyme-labeled antibody detects antigen-antibody binding. Enzyme converts colorless substrate → colored product (quantified by spectrophotometry at 450 nm).", sBODY),
Paragraph("<b>Sandwich ELISA steps:</b> Coat plate with capture Ab → Add sample (Ag binds) → Wash → Add enzyme-linked detection Ab → Wash → Add substrate → Color proportional to Ag concentration → Stop + read OD.", sBODY),
Paragraph("<b>Enzyme-substrate pairs:</b> HRP + TMB | Alkaline phosphatase + pNPP", sBODY),
Paragraph("<b>Applications:</b> HIV diagnosis | Hepatitis B/C | hCG (pregnancy) | Allergy (IgE) | TORCH infections | Autoantibody detection | Drug levels", sKEY),
], C_GREY, C_PURPLE),
]))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 11 — THYROID FUNCTION TESTS
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("11. THYROID FUNCTION TESTS — T3, T4, TSH [3/4 papers]", C_TEAL),
Spacer(1, 0.1*cm),
]))
tft_data = [
["T4 (Thyroxine)","5-12 μg/dL","↑↑","↓"],
["T3 (Triiodothyronine)","80-180 ng/dL","↑↑","↓"],
["TSH","0.4-4.0 mIU/L","↓ (suppressed by -ve feedback)","↑ (pituitary stimulating)"],
["RAI Uptake","Normal","↑","↓"],
]
story.append(make_table(["Parameter","Normal","Hyperthyroidism","Hypothyroidism"],
tft_data, [4*cm, 3*cm, 5*cm, 4.5*cm], C_TEAL))
story.append(Spacer(1, 0.1*cm))
story.append(card([
Paragraph("<b>Hypercholesterolemia in hypothyroidism:</b> ↓T3/T4 → ↓LDL receptor expression → ↓LDL clearance → ↑plasma LDL. Also ↓lipoprotein lipase → ↑TG.", sBODY),
], C_LTGRN, C_TEAL))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 12 — CREATININE CLEARANCE
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("12. CLEARANCE TESTS / CREATININE CLEARANCE [3/4 papers]", C_BLUE),
Spacer(1, 0.1*cm),
card([
Paragraph("<b>Clearance formula:</b> C = (U × V) / P where U = urine conc, V = urine flow (mL/min), P = plasma conc", sKEY),
Paragraph("<b>Creatinine clearance:</b> Produced at constant rate from creatine phosphate in muscle. Freely filtered; slightly secreted (~10% overestimates GFR). Normal: male ~120 mL/min, female ~100 mL/min.", sBODY),
Paragraph("<b>Inulin clearance:</b> Gold standard for GFR (freely filtered only, not secreted/reabsorbed) = 125 mL/min.", sBODY),
Paragraph("<b>PAH clearance:</b> Measures renal plasma flow (filtered + completely secreted) = ~600 mL/min.", sBODY),
Paragraph("<b>Clinical use:</b> Detect + stage CKD | Drug dose adjustment | Monitor transplant function | Pre-op assessment", sBODY),
], C_LTBLUE, C_BLUE),
]))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 13 — FATTY LIVER + LIPOTROPIC FACTORS
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("13. FATTY LIVER & LIPOTROPIC FACTORS [2/4 papers]", C_ORANGE),
Spacer(1, 0.1*cm),
card([
Paragraph("<b>Fatty liver:</b> Abnormal accumulation of TG in hepatocytes (>5% liver weight).", sBODY),
Paragraph("<b>Causes:</b> Alcoholism (most common) | Obesity/T2DM | Protein deficiency (↓ApoB → can't form VLDL) | Starvation | Drugs (tetracycline, valproate) | Choline/methionine deficiency", sBODY),
Paragraph("<b>Lipotropic factors</b> (prevent fat in liver by promoting VLDL synthesis):", sH3),
Paragraph("Choline (phosphatidylcholine for VLDL shell) | Methionine (methyl donor → choline) | Inositol | Betaine | Vitamin B12 + Folate | Essential fatty acids", sBULL),
Paragraph("<b>Key point:</b> Deficiency of lipotropic factors → cannot assemble VLDL → TG trapped in liver → steatosis.", sKEY),
], C_LTYEL, C_ORANGE),
]))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 14 — ANTIOXIDANTS
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("14. ANTIOXIDANTS — Role, Therapeutic Agents, Scavenging Enzymes [2/4 papers]", C_GREEN),
Spacer(1, 0.1*cm),
card([
Paragraph("<b>Free radicals:</b> O₂•⁻ (superoxide), •OH (hydroxyl), ROO• (peroxyl) — generated by ETC leakage, phagocytosis, radiation, smoking.", sBODY),
Paragraph("<b>Damage:</b> Lipid peroxidation | Protein oxidation | DNA strand breaks → mutations, cancer, aging, atherosclerosis", sBODY),
Paragraph("<b>Therapeutic antioxidants:</b> Vitamin E (lipid-soluble, protects membranes) | Vitamin C (water-soluble, regenerates Vit E) | β-Carotene | N-Acetylcysteine (NAC, replenishes GSH) | Selenium", sBODY),
Paragraph("<b>Scavenging enzymes (MOST IMPORTANT):</b>", sH3),
Paragraph("① <b>Superoxide dismutase (SOD)</b>: 2O₂•⁻ + 2H⁺ → H₂O₂ + O₂", sKEY),
Paragraph("② <b>Catalase</b>: 2H₂O₂ → 2H₂O + O₂", sKEY),
Paragraph("③ <b>Glutathione peroxidase (GPx)</b>: H₂O₂ + 2GSH → GSSG + 2H₂O (requires <b>selenium</b>)", sKEY),
], C_LTGRN, C_GREEN),
]))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# TOPIC 15 — ETC + CHEMIOSMOTIC THEORY
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("15. ETC & CHEMIOSMOTIC THEORY + INHIBITORS [All 4 papers]", C_TEAL),
Spacer(1, 0.1*cm),
]))
etc_data = [
["Complex I","NADH dehydrogenase","NADH → CoQ","Yes","Rotenone, Amobarbital"],
["Complex II","Succinate dehydrogenase","FADH₂ → CoQ","No","TTFA, Carboxin"],
["Complex III","Cytochrome bc₁","CoQ → Cyt c","Yes","Antimycin A"],
["Complex IV","Cytochrome c oxidase","Cyt c → O₂","Yes","CN⁻, CO, Azide, H₂S"],
["Complex V","ATP Synthase (F₀F₁)","H⁺ gradient → ATP","—","Oligomycin"],
]
story.append(make_table(["Complex","Name","Electron flow","Pumps H⁺?","Inhibitor"],
etc_data, [2.5*cm, 4*cm, 3.5*cm, 2*cm, 4.5*cm], C_TEAL))
story.append(Spacer(1, 0.1*cm))
story.append(card([
Paragraph("<b>Chemiosmotic Theory (Peter Mitchell):</b> Complexes I, III, IV pump H⁺ from matrix → intermembrane space → creates proton motive force (ΔpH + membrane potential). H⁺ flows back through ATP synthase → drives rotational synthesis of ATP.", sBODY),
Paragraph("<b>Uncouplers</b> (e.g., DNP, thermogenin/UCP1 in brown fat): dissipate H⁺ gradient as heat — O₂ consumed but no ATP made. Basis of thermogenesis in newborns.", sKEY),
], C_LTGRN, C_TEAL))
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# GIVE REASONS QUICK REFERENCE
# ═══════════════════════════════════════════════════════════
story.append(section_header("⚡ GIVE REASONS — QUICK REFERENCE (2-3 marks each)", C_RED))
story.append(Spacer(1, 0.1*cm))
gr_data = [
["Allopurinol treats Gout","Structural analog of hypoxanthine → competitively + irreversibly inhibits xanthine oxidase → ↓ uric acid synthesis → prevents urate crystal deposition"],
["Aspirin prevents MI","Irreversibly acetylates COX-1 → ↓TXA₂ (platelet aggregator) → anti-platelet → prevents coronary thrombosis"],
["PUFA beneficial for health","↓TG, ↓LDL, ↑HDL | Anti-inflammatory (resolvins, protectins) | Anti-thrombotic | ↑membrane fluidity | DHA essential for brain development"],
["Trans FA bad for health","Straight chain like saturated FA → ↑LDL, ↓HDL | Pro-inflammatory (↑CRP) | ↑cardiovascular risk, insulin resistance"],
["Hypercholesterolemia in hypothyroidism","↓T3/T4 → ↓LDL receptor expression → ↓LDL clearance → ↑plasma LDL. Also ↓LPL → ↑TG"],
["Hyperkalaemia treated with glucose + insulin","Insulin activates Na⁺/K⁺-ATPase → drives K⁺ into cells (ICF). Glucose prevents hypoglycemia. Rapid, temporary shift of K⁺"],
["Starvation: FFA preferred fuel for muscle","↓Insulin, ↑Glucagon → adipose lipolysis → FFA released → muscle β-oxidation → spares glucose for brain"],
["Purine synthesis inhibitors as anti-cancer drugs","Rapidly dividing cancer cells need purines for DNA synthesis. Methotrexate inhibits DHFR → ↓THF → ↓purine synthesis. 6-MP inhibits PRPP amidotransferase"],
["Bicarbonate is the most important buffer","Regulated by both lungs (CO₂) and kidneys (HCO₃⁻) independently. High concentration in ECF. Open system allows rapid adjustment"],
["Fish oil good for health","Omega-3 FA (EPA, DHA): ↓TG, ↓LDL, ↑HDL, anti-inflammatory, anti-thrombotic, prevents arrhythmias, ↓CV disease risk"],
]
gr_table = Table(
[[Paragraph("<b>"+r[0]+"</b>", S("g1", fontSize=7.5, fontName="Helvetica-Bold", textColor=C_BLUE)),
Paragraph(r[1], sBODY)] for r in gr_data],
colWidths=[5.5*cm, 11*cm],
style=[
("ROWBACKGROUNDS",(0,0),(-1,-1),[C_WHITE, C_LTBLUE]),
("GRID",(0,0),(-1,-1),0.3, colors.HexColor("#BFC9CA")),
("TOPPADDING",(0,0),(-1,-1),3),
("BOTTOMPADDING",(0,0),(-1,-1),3),
("LEFTPADDING",(0,0),(-1,-1),4),
("RIGHTPADDING",(0,0),(-1,-1),4),
("VALIGN",(0,0),(-1,-1),"TOP"),
]
)
story.append(gr_table)
story.append(Spacer(1, 0.25*cm))
# ═══════════════════════════════════════════════════════════
# CARDIAC MARKERS TABLE
# ═══════════════════════════════════════════════════════════
story.append(KeepTogether([
section_header("🫀 BONUS: CARDIAC MARKERS IN MI [Sep 2025 paper]", C_RED),
Spacer(1, 0.1*cm),
]))
cm_data = [
["Myoglobin","1-2 hrs","6-9 hrs","24-36 hrs","Earliest; not cardiac-specific"],
["CK-MB","4-6 hrs","18-24 hrs","2-3 days","Reinfarction detection"],
["Troponin I/T","3-6 hrs","12-24 hrs","7-14 days","GOLD STANDARD; most specific"],
["LDH","12-24 hrs","2-3 days","7-10 days","Late marker"],
]
story.append(make_table(["Marker","Rises","Peaks","Normalizes","Note"],
cm_data, [3*cm, 2.5*cm, 2.5*cm, 2.5*cm, 6*cm], C_RED))
story.append(Spacer(1, 0.2*cm))
# ── FOOTER ───────────────────────────────────────────────────────────────────
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.grey))
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph(
"Amrita MBBS Biochemistry Paper 2 · Cheat Sheet · Based on Nov/Dec 2023 | Jan 2024 (Supp) | Jul/Aug 2024 | Sep 2025 Past Papers · For exam preparation only",
sFOOT))
# ── BUILD ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF generated: {OUTPUT}")