Neoplasia
All of rhem
Robbins & Kumar Basic Pathology (9th ed.)
| Cell of Origin | Benign Tumor |
|---|---|
| Fibrous tissue | Fibroma |
| Cartilage | Chondroma |
| Osteoid | Osteoma |
| Fat | Lipoma |
| Blood vessels | Hemangioma |
| Smooth muscle | Leiomyoma |
| Glandular epithelium | Adenoma |
| Squamous epithelium | Squamous cell papilloma |
| Term | Nature |
|---|---|
| Lymphoma | MALIGNANT (not benign despite -oma) |
| Melanoma | MALIGNANT |
| Mesothelioma | MALIGNANT |
| Seminoma | MALIGNANT |
| Hamartoma | Benign disorganized tissue mass (clonal but not truly neoplastic) |
| Choristoma | Congenital heterotopic nest of cells (not a true neoplasm) |
| Factor | Associated Cancers |
|---|---|
| Smoking | Lung (90% of deaths), mouth, pharynx, larynx, esophagus, pancreas, bladder |
| Alcohol | Oropharynx, larynx, esophagus, breast, liver |
| Estrogen exposure | Endometrium, breast |
| Infectious agents | ~15% of cancers worldwide |
| UV radiation | Skin cancers |
| Ionizing radiation | Leukemia, thyroid, breast |
| Agent | Cancer |
|---|---|
| Asbestos | Mesothelioma, lung |
| Benzene | Leukemia |
| Vinyl chloride | Angiosarcoma of liver |
| Arsenic | Skin, lung |
| Aflatoxin B1 | Hepatocellular carcinoma |
| Type | Example |
|---|---|
| Driver mutations | Confer growth advantage; clonally selected |
| Passenger mutations | Do not affect cell growth; not selected for |
| Point mutations | RAS (codon 12 most common) |
| Gene rearrangements | BCR-ABL in CML; EWS-FLI1 in Ewing sarcoma |
| Deletions | Loss of tumor suppressor genes (RB, TP53) |
| Gene amplifications | HER2/NEU in breast cancer; N-MYC in neuroblastoma |
| Aneuploidy | Gain/loss of whole chromosomes |


| Type | Example | Mechanism | Associated Cancer |
|---|---|---|---|
| Direct-acting | Nitrogen mustards, alkylating agents | Directly damage DNA without metabolic activation | Leukemia after chemotherapy |
| Indirect-acting (procarcinogens) | Polycyclic hydrocarbons (benzo[a]pyrene) in cigarette smoke | Require metabolic activation by CYP enzymes | Lung cancer |
| Aromatic amines (2-naphthylamine) | Activated in liver, excreted in urine | Bladder cancer | |
| Aflatoxin B1 | Produced by Aspergillus flavus; mutates TP53 codon 249 | Hepatocellular carcinoma |
| Agent | Cancer | Mechanism |
|---|---|---|
| HPV (16, 18) | Cervical, oropharyngeal, anal | E6 protein degrades p53; E7 inactivates RB |
| EBV | Burkitt lymphoma, Hodgkin lymphoma, nasopharyngeal carcinoma | LMP-1 activates NF-κB; EBER miRNAs block apoptosis |
| HBV/HCV | Hepatocellular carcinoma | Chronic inflammation + cirrhosis; HBV integrates into genome; HBx activates proto-oncogenes |
| HTLV-1 | Adult T-cell leukemia/lymphoma | Tax protein activates NF-κB, IL-2/IL-2R → autonomous T cell proliferation |
| H. pylori | Gastric carcinoma, MALT lymphoma | Chronic gastritis → CagA protein activates SRC kinases |
| HHV-8 (KSHV) | Kaposi sarcoma, PEL | FLICE inhibitory proteins block apoptosis; viral IL-6 promotes angiogenesis |
| Syndrome | Mediator | Associated Tumor |
|---|---|---|
| Hypercalcemia | PTHrP | Squamous cell carcinoma of lung, breast |
| SIADH | ADH (ectopic) | Small cell lung carcinoma |
| Cushing syndrome | ACTH (ectopic) | Small cell lung carcinoma, pancreatic |
| Eaton-Lambert | Ab against Ca2+ channels | Small cell lung carcinoma |
| Polycythemia | Erythropoietin (ectopic) | Renal cell carcinoma, hepatocellular |
| Migratory thrombophlebitis (Trousseau sign) | Procoagulants | Pancreatic/GI adenocarcinoma |
| Hypoglycemia | IGF-2 | Fibrosarcoma, hepatoma |
| Marker | Associated Tumor |
|---|---|
| PSA | Prostate carcinoma |
| AFP (Alpha-fetoprotein) | Hepatocellular carcinoma, yolk sac tumors (testis/ovary) |
| CEA (Carcinoembryonic Ag) | Colorectal, pancreatic, gastric, breast |
| CA-125 | Ovarian carcinoma (serous type) |
| CA 19-9 | Pancreatic carcinoma |
| hCG (beta) | Choriocarcinoma, gestational trophoblastic disease, testicular germ cell tumors |
| Calcitonin | Medullary thyroid carcinoma |
| Chromogranin A | Neuroendocrine tumors, pheochromocytoma |
| S-100 | Melanoma, nerve sheath tumors |
| Feature | Benign | Malignant |
|---|---|---|
| Differentiation | Well-differentiated | Variable; may be anaplastic |
| Rate of growth | Slow | Usually rapid |
| Encapsulation | Usually encapsulated | No true capsule; infiltrative |
| Local invasion | No | Yes |
| Metastasis | No | Yes |
| Mitotic figures | Rare; normal | Frequent; may be atypical |
| Nuclear changes | Normal | Pleomorphism, hyperchromasia, prominent nucleoli |
| Effect on host | Usually mild | Often life-threatening |
Create a study guide PDF on oncogenes, tumor suppressors, and hallmarks of cancer
ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "workspace ready"
mkdir -p /tmp/workspace/neoplasia-guide && python3 -c "from reportlab.lib import colors; print('reportlab ok')"
~/neoplasia-guide/build_pdf.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, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate
from reportlab.lib.colors import HexColor
OUTPUT = "/tmp/workspace/neoplasia-guide/Oncogenes_TumorSuppressors_Hallmarks.pdf"
# ── Colour palette ──────────────────────────────────────────────────────────
NAVY = HexColor("#1a2e4a")
TEAL = HexColor("#1a7f7a")
ORANGE = HexColor("#e07b39")
LIGHT_BG = HexColor("#f0f4f8")
CARD_BG = HexColor("#eaf6f5")
WARN_BG = HexColor("#fff3e0")
RED_DARK = HexColor("#c0392b")
GREY_TEXT = HexColor("#4a5568")
WHITE = colors.white
BLACK = colors.black
YELLOW_HL = HexColor("#fff9c4")
W, H = A4
# ── Styles ───────────────────────────────────────────────────────────────────
def build_styles():
base = getSampleStyleSheet()
s = {}
s["cover_title"] = ParagraphStyle(
"cover_title", fontSize=30, leading=36, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=6)
s["cover_sub"] = ParagraphStyle(
"cover_sub", fontSize=14, leading=18, textColor=HexColor("#cce8e6"),
fontName="Helvetica", alignment=TA_CENTER, spaceAfter=4)
s["cover_meta"] = ParagraphStyle(
"cover_meta", fontSize=10, leading=14, textColor=HexColor("#a0c4c2"),
fontName="Helvetica", alignment=TA_CENTER)
s["h1"] = ParagraphStyle(
"h1", fontSize=18, leading=22, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_LEFT,
spaceAfter=2, spaceBefore=0)
s["h2"] = ParagraphStyle(
"h2", fontSize=13, leading=17, textColor=NAVY,
fontName="Helvetica-Bold", spaceBefore=12, spaceAfter=4)
s["h3"] = ParagraphStyle(
"h3", fontSize=11, leading=14, textColor=TEAL,
fontName="Helvetica-Bold", spaceBefore=8, spaceAfter=3)
s["body"] = ParagraphStyle(
"body", fontSize=9.5, leading=14, textColor=GREY_TEXT,
fontName="Helvetica", spaceBefore=2, spaceAfter=4,
alignment=TA_JUSTIFY)
s["bullet"] = ParagraphStyle(
"bullet", fontSize=9.5, leading=14, textColor=GREY_TEXT,
fontName="Helvetica", leftIndent=14, spaceBefore=1, spaceAfter=1,
bulletIndent=4, alignment=TA_LEFT)
s["note"] = ParagraphStyle(
"note", fontSize=9, leading=13, textColor=HexColor("#7b341e"),
fontName="Helvetica-Oblique", spaceBefore=2, spaceAfter=2,
leftIndent=10, borderPad=4)
s["tag"] = ParagraphStyle(
"tag", fontSize=8.5, leading=12, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_CENTER)
s["section_intro"] = ParagraphStyle(
"section_intro", fontSize=9.5, leading=14, textColor=GREY_TEXT,
fontName="Helvetica-Oblique", spaceBefore=2, spaceAfter=8,
alignment=TA_JUSTIFY)
s["table_header"] = ParagraphStyle(
"table_header", fontSize=8.5, leading=11, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_CENTER)
s["table_cell"] = ParagraphStyle(
"table_cell", fontSize=8.5, leading=11.5, textColor=GREY_TEXT,
fontName="Helvetica", alignment=TA_LEFT)
s["table_cell_bold"] = ParagraphStyle(
"table_cell_bold", fontSize=8.5, leading=11.5, textColor=NAVY,
fontName="Helvetica-Bold", alignment=TA_LEFT)
s["hallmark_title"] = ParagraphStyle(
"hallmark_title", fontSize=10.5, leading=13, textColor=NAVY,
fontName="Helvetica-Bold", spaceBefore=0, spaceAfter=2)
s["hallmark_body"] = ParagraphStyle(
"hallmark_body", fontSize=9, leading=13, textColor=GREY_TEXT,
fontName="Helvetica", spaceBefore=0, spaceAfter=0)
return s
S = build_styles()
# ── Helper flowables ─────────────────────────────────────────────────────────
def rule(color=TEAL, thickness=1.0):
return HRFlowable(width="100%", thickness=thickness, color=color,
spaceAfter=6, spaceBefore=4)
def sp(n=6):
return Spacer(1, n)
def h1_banner(text):
"""Dark navy banner for section heading."""
data = [[Paragraph(text, S["h1"])]]
t = Table(data, colWidths=[W - 4*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
("ROUNDEDCORNERS", [6]),
]))
return t
def key_fact_box(text):
"""Orange-bordered key fact box."""
data = [[Paragraph(f"<b>KEY FACT:</b> {text}", S["note"])]]
t = Table(data, colWidths=[W - 4*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), WARN_BG),
("LINEAFTER", (0,0), (0,-1), 3, ORANGE),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
return t
def info_box(text):
"""Teal info box."""
data = [[Paragraph(text, ParagraphStyle("ib", fontSize=9, leading=13,
fontName="Helvetica", textColor=HexColor("#1a5c59")))]]
t = Table(data, colWidths=[W - 4*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), CARD_BG),
("LINEBEFORE", (0,0), (0,-1), 3, TEAL),
("TOPPADDING", (0,0), (-1,-1), 7),
("BOTTOMPADDING",(0,0), (-1,-1), 7),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
return t
def bullet_list(items):
return [Paragraph(f"• {i}", S["bullet"]) for i in items]
def make_table(headers, rows, col_widths, stripe=True):
th = [Paragraph(h, S["table_header"]) for h in headers]
data = [th]
for i, row in enumerate(rows):
data.append([Paragraph(str(c), S["table_cell_bold"] if j == 0 else S["table_cell"])
for j, c in enumerate(row)])
ts = [
("BACKGROUND", (0,0), (-1,0), NAVY),
("GRID", (0,0), (-1,-1), 0.5, HexColor("#d1d5db")),
("LINEBELOW", (0,0), (-1,0), 1.5, TEAL),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING",(0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
]
if stripe:
for i in range(1, len(data)):
bg = LIGHT_BG if i % 2 == 0 else WHITE
ts.append(("BACKGROUND", (0,i), (-1,i), bg))
t = Table(data, colWidths=col_widths)
t.setStyle(TableStyle(ts))
return t
# ── Page callbacks ───────────────────────────────────────────────────────────
def cover_page_cb(canvas, doc):
canvas.saveState()
# Gradient-like background: draw two rectangles
canvas.setFillColor(NAVY)
canvas.rect(0, 0, W, H, fill=1, stroke=0)
canvas.setFillColor(TEAL)
canvas.rect(0, H*0.55, W, H*0.45, fill=1, stroke=0)
# Decorative stripe
canvas.setFillColor(ORANGE)
canvas.rect(0, H*0.54, W, 8, fill=1, stroke=0)
# Footer
canvas.setFillColor(HexColor("#0d2135"))
canvas.rect(0, 0, W, 40, fill=1, stroke=0)
canvas.setFont("Helvetica", 8)
canvas.setFillColor(HexColor("#8cb3cc"))
canvas.drawCentredString(W/2, 15, "Based on Robbins & Kumar Basic Pathology (9th ed.) • For Study Use Only")
canvas.restoreState()
def normal_page_cb(canvas, doc):
canvas.saveState()
# Header bar
canvas.setFillColor(NAVY)
canvas.rect(0, H - 28, W, 28, fill=1, stroke=0)
canvas.setFont("Helvetica-Bold", 8)
canvas.setFillColor(WHITE)
canvas.drawString(2*cm, H - 18, "ONCOGENES · TUMOR SUPPRESSORS · HALLMARKS OF CANCER")
canvas.setFont("Helvetica", 8)
canvas.drawRightString(W - 2*cm, H - 18, f"Page {doc.page}")
# Footer
canvas.setFillColor(LIGHT_BG)
canvas.rect(0, 0, W, 22, fill=1, stroke=0)
canvas.setFillColor(GREY_TEXT)
canvas.setFont("Helvetica-Oblique", 7.5)
canvas.drawCentredString(W/2, 7, "Robbins & Kumar Basic Pathology (9th ed.) • Study Guide • Orris Medical")
canvas.restoreState()
# ── Build document ────────────────────────────────────────────────────────────
def build():
doc = BaseDocTemplate(
OUTPUT, pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=1.5*cm, bottomMargin=1.5*cm,
)
cover_frame = Frame(0, 0, W, H, leftPadding=3*cm, rightPadding=3*cm,
topPadding=H*0.2, bottomPadding=60)
normal_frame = Frame(2*cm, 1.5*cm, W-4*cm, H-3.8*cm,
leftPadding=0, rightPadding=0,
topPadding=8, bottomPadding=8)
doc.addPageTemplates([
PageTemplate(id="Cover", frames=[cover_frame], onPage=cover_page_cb),
PageTemplate(id="Normal", frames=[normal_frame], onPage=normal_page_cb),
])
story = []
# ═══════════════════════════════════════════════════════════════════════
# COVER PAGE
# ═══════════════════════════════════════════════════════════════════════
story.append(sp(40))
story.append(Paragraph("Oncogenes,", S["cover_title"]))
story.append(Paragraph("Tumor Suppressors &", S["cover_title"]))
story.append(Paragraph("Hallmarks of Cancer", S["cover_title"]))
story.append(sp(14))
story.append(rule(WHITE, 1.5))
story.append(sp(10))
story.append(Paragraph("A Comprehensive Medical Study Guide", S["cover_sub"]))
story.append(sp(6))
story.append(Paragraph("Pathology | Oncology | Molecular Biology", S["cover_meta"]))
story.append(sp(6))
story.append(Paragraph("Robbins & Kumar Basic Pathology, 9th Edition", S["cover_meta"]))
story.append(PageBreak())
# Switch to Normal template
from reportlab.platypus import NextPageTemplate
story.append(NextPageTemplate("Normal"))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════
# SECTION 1: ONCOGENES
# ═══════════════════════════════════════════════════════════════════════
story.append(h1_banner("SECTION 1 — ONCOGENES"))
story.append(sp(10))
story.append(Paragraph("1.1 Proto-oncogenes vs Oncogenes", S["h2"]))
story.append(rule(TEAL, 0.5))
story.append(Paragraph(
"Proto-oncogenes are normal cellular genes that regulate cell growth, differentiation, "
"and apoptosis. When mutated or aberrantly expressed, they become <b>oncogenes</b> — "
"dominantly acting drivers of neoplastic transformation. Oncogenes require mutation of "
"only <b>one allele</b> to exert their effect (dominant gain-of-function).", S["body"]))
story.append(sp(4))
story.append(info_box(
"<b>How proto-oncogenes become oncogenes:</b><br/>"
"① Point mutation → constitutively active protein (e.g., RAS Gly12→Val)<br/>"
"② Gene amplification → massive overexpression (e.g., N-MYC in neuroblastoma)<br/>"
"③ Chromosomal translocation → fusion protein or deregulated expression<br/>"
"④ Insertional mutagenesis → retroviral LTR drives overexpression"
))
story.append(sp(10))
story.append(Paragraph("1.2 Categories of Oncoproteins", S["h2"]))
story.append(rule(TEAL, 0.5))
headers = ["Category", "Mechanism", "Key Example(s)", "Cancer Association"]
rows = [
["Growth factors", "Autocrine/paracrine stimulation", "PDGF-β (sis), FGF family", "Gliomas, sarcomas"],
["Growth factor receptors", "Constitutive kinase activation", "ERBB1 (EGFR), ERBB2 (HER2), RET", "Lung, breast, thyroid"],
["Signal transducers (GTPase)", "Locked in GTP-bound 'on' state", "RAS (KRAS, NRAS, HRAS)", "Pancreas (90%), colon (45%), lung (35%)"],
["Signal transducers (kinase)", "Constitutive tyrosine kinase", "BCR-ABL (t9;22), SRC", "CML, ALL"],
["Nuclear transcription factors", "Uncontrolled target gene activation", "MYC, N-MYC, L-MYC", "Burkitt lymphoma, neuroblastoma"],
["Cell cycle regulators", "Unrestrained cyclin/CDK activity", "Cyclin D1, CDK4", "Mantle cell lymphoma, melanoma"],
["Anti-apoptotic proteins", "Block programmed cell death", "BCL-2", "Follicular lymphoma t(14;18)"],
]
story.append(make_table(headers, rows,
[3.2*cm, 3.8*cm, 4.2*cm, 4.2*cm]))
story.append(sp(8))
story.append(Paragraph("1.3 RAS — The Most Commonly Mutated Oncogene", S["h2"]))
story.append(rule(TEAL, 0.5))
story.append(Paragraph(
"RAS proteins (KRAS, NRAS, HRAS) are small GTPases that act as molecular switches. "
"Normally, RAS cycles between inactive GDP-bound and active GTP-bound states, with "
"GTPase activity returning it to the OFF state.", S["body"]))
story += bullet_list([
"<b>Mutation hotspot:</b> Codon 12 (Gly→Val) — prevents GTP hydrolysis → RAS locked in active state",
"<b>Frequency:</b> Mutated in ~30% of all human tumors",
"<b>Downstream effects:</b> Activates RAF→MEK→ERK (proliferation) and PI3K→AKT (survival)",
"<b>Top KRAS cancers:</b> Pancreatic (90%), Colorectal (45%), Lung adenocarcinoma (35%)",
"<b>Therapeutic targeting:</b> KRAS G12C inhibitors (sotorasib, adagrasib) — approved for NSCLC",
])
story.append(sp(6))
story.append(key_fact_box(
"RAS mutations are the most common single-gene oncogenic event in human cancer (~30% overall). "
"KRAS is mutated in 90% of pancreatic ductal adenocarcinomas."
))
story.append(sp(10))
story.append(Paragraph("1.4 Key Oncogenes Quick Reference", S["h2"]))
story.append(rule(TEAL, 0.5))
headers2 = ["Oncogene", "Activation", "Cancer Type", "Clinical Relevance"]
rows2 = [
["KRAS", "Point mutation (codon 12)", "Pancreas, colon, lung", "Predict resistance to EGFR inhibitors"],
["ERBB2 (HER2)", "Amplification", "Breast (~20%), gastric (~15%)", "Trastuzumab, pertuzumab target"],
["EGFR (ERBB1)", "Mutation/amplification", "Lung (exon 19/21), GBM", "Erlotinib, osimertinib target"],
["BCR-ABL", "t(9;22) translocation", "CML, Ph+ ALL", "Imatinib/TKI — targeted therapy"],
["N-MYC", "Gene amplification (>10 copies)", "Neuroblastoma", "Poor prognosis marker"],
["C-MYC", "t(8;14) translocation", "Burkitt lymphoma", "IgH enhancer drives MYC overexpression"],
["BCL-2", "t(14;18) translocation", "Follicular lymphoma", "Venetoclax (BCL-2 inhibitor)"],
["ALK", "Translocation/inversion", "Lung NSCLC, ALCL", "Crizotinib, alectinib target"],
["RET", "Point mutation", "MEN2A/2B, medullary thyroid Ca", "Germline testing; vandetanib"],
["CDK4", "Amplification/mutation", "Glioblastoma, sarcoma, melanoma", "CDK4/6 inhibitors (palbociclib)"],
]
story.append(make_table(headers2, rows2,
[2.8*cm, 3.3*cm, 4*cm, 5.3*cm]))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════
# SECTION 2: TUMOR SUPPRESSOR GENES
# ═══════════════════════════════════════════════════════════════════════
story.append(h1_banner("SECTION 2 — TUMOR SUPPRESSOR GENES"))
story.append(sp(10))
story.append(Paragraph(
"Tumor suppressor genes (TSGs) encode proteins that restrain cell growth, promote apoptosis, "
"or maintain genomic integrity. Both alleles must be inactivated for loss of function — "
"consistent with Knudson's <b>Two-Hit Hypothesis</b>. The first hit may be inherited "
"(germline) or somatic; the second hit is always somatic.", S["body"]))
story.append(sp(4))
story.append(info_box(
"<b>Knudson's Two-Hit Hypothesis (1971):</b><br/>"
"• <b>Sporadic retinoblastoma:</b> Both RB allele mutations acquired somatically → unilateral, late onset<br/>"
"• <b>Familial retinoblastoma:</b> First hit inherited (germline), second hit somatic → bilateral, early onset<br/>"
"• Generalised to all tumor suppressors: loss of heterozygosity (LOH) is the common final pathway"
))
story.append(sp(10))
story.append(Paragraph("2.1 RB — Governor of the Cell Cycle", S["h2"]))
story.append(rule(TEAL, 0.5))
story.append(Paragraph(
"The retinoblastoma protein (RB) is the master regulator of the G1→S checkpoint. "
"Its phosphorylation state dictates whether a cell proceeds through the cell cycle.", S["body"]))
rb_data = [
[Paragraph("<b>State</b>", S["table_header"]),
Paragraph("<b>RB Status</b>", S["table_header"]),
Paragraph("<b>Effect</b>", S["table_header"])],
[Paragraph("Growth inhibition", S["table_cell_bold"]),
Paragraph("Hypophosphorylated (active)", S["table_cell"]),
Paragraph("Binds E2F → blocks S-phase genes → ARREST", S["table_cell"])],
[Paragraph("Mitogenic signal", S["table_cell_bold"]),
Paragraph("Hyperphosphorylated by cyclin D/CDK4/6, cyclin E/CDK2", S["table_cell"]),
Paragraph("Releases E2F → S-phase transcription → PROLIFERATION", S["table_cell"])],
[Paragraph("Cancer", S["table_cell_bold"]),
Paragraph("Lost / mutated (both alleles)", S["table_cell"]),
Paragraph("E2F constitutively free → uncontrolled proliferation", S["table_cell"])],
]
rb_t = Table(rb_data, colWidths=[3.5*cm, 5.5*cm, 6.4*cm])
rb_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("BACKGROUND", (0,1), (-1,1), LIGHT_BG),
("BACKGROUND", (0,2), (-1,2), WHITE),
("BACKGROUND", (0,3), (-1,3), HexColor("#ffe8e8")),
("GRID", (0,0), (-1,-1), 0.5, HexColor("#d1d5db")),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING",(0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(rb_t)
story.append(sp(6))
story += bullet_list([
"<b>Cancers with RB loss:</b> Retinoblastoma, osteosarcoma, small cell lung carcinoma, bladder Ca",
"<b>G1-S checkpoint disrupted in ALL cancers</b> — via RB loss, CDK4/6 amplification, cyclin D overexpression, or p16(INK4a)/CDKN2A deletion",
"<b>p16 (CDKN2A):</b> CDK inhibitor — prevents cyclin D/CDK4 from phosphorylating RB; commonly deleted in melanoma",
])
story.append(sp(8))
story.append(Paragraph("2.2 TP53 — Guardian of the Genome", S["h2"]))
story.append(rule(TEAL, 0.5))
story.append(Paragraph(
"p53 (encoded by <i>TP53</i>) is the most commonly mutated gene in all human cancers. "
"It functions as a transcription factor that responds to cellular stress to prevent "
"propagation of damaged cells.", S["body"]))
story.append(sp(4))
p53_items = [
["DNA damage / anoxia / oncogene activation", "ATM/ATR kinases phosphorylate p53 → released from MDM2 → p53 accumulates"],
["Normal unstressed cell", "MDM2 binds p53 → ubiquitinates it → proteasomal degradation (t½ = 20 min)"],
["p53 activation outcome 1", "G1 arrest: transcribes CDKN1A (p21) → inhibits CDK2 → RB stays hypophosphorylated"],
["p53 activation outcome 2", "Senescence: permanent cell cycle arrest; global chromatin restructuring"],
["p53 activation outcome 3", "Apoptosis: transcribes BAX, PUMA, NOXA → mitochondrial pathway → caspase activation"],
["If p53 mutated/lost", "No arrest, no repair, no apoptosis → mutations accumulate → malignant transformation"],
]
p53_t = Table([[Paragraph(r[0], S["table_cell_bold"]), Paragraph(r[1], S["table_cell"])] for r in p53_items],
colWidths=[5*cm, 10.4*cm])
p53_t.setStyle(TableStyle([
("GRID", (0,0), (-1,-1), 0.5, HexColor("#d1d5db")),
("BACKGROUND", (0,0), (-1,-1), WHITE),
("ROWBACKGROUNDS", (0,0), (-1,-1), [LIGHT_BG, WHITE]),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING",(0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(p53_t)
story.append(sp(6))
story.append(key_fact_box(
"TP53 is mutated in >50% of ALL human cancers. "
"Li-Fraumeni syndrome = germline TP53 mutation → multiple early-onset cancers (sarcoma, breast, brain, adrenal). "
"HPV E6 protein targets p53 for degradation."
))
story.append(sp(10))
story.append(Paragraph("2.3 Other Major Tumor Suppressors", S["h2"]))
story.append(rule(TEAL, 0.5))
headers3 = ["Gene", "Normal Function", "Loss → Cancer", "Hereditary Syndrome"]
rows3 = [
["APC", "Degrades β-catenin; inhibits WNT signaling", "Colorectal cancer (>70%)", "Familial adenomatous polyposis (FAP)"],
["BRCA1/2", "Homologous recombination DNA repair", "Breast, ovarian, pancreatic", "Hereditary breast/ovarian cancer syndrome"],
["PTEN", "Phosphatase; inhibits PI3K/AKT pathway", "Endometrial, prostate, GBM", "Cowden syndrome"],
["VHL", "Targets HIF-1α for degradation", "Clear cell renal cell carcinoma", "Von Hippel-Lindau syndrome"],
["NF1", "RAS-GAP; deactivates RAS", "Neurofibroma, MPNST, leukemia", "Neurofibromatosis type 1"],
["NF2", "Merlin — links cytoskeleton to cell membrane", "Schwannoma, meningioma, ependymoma", "Neurofibromatosis type 2"],
["CDKN2A (p16)", "Inhibits CDK4/6; prevents RB phosphorylation", "Melanoma, pancreatic Ca", "Familial melanoma (FAMMM)"],
["SMAD2/4", "TGF-β signal transduction", "Pancreatic, colorectal carcinoma", "Juvenile polyposis"],
["WT1", "Transcription factor in kidney development", "Wilms tumor (nephroblastoma)", "WAGR, Denys-Drash syndromes"],
["MLH1/MSH2", "Mismatch repair (MMR)", "Colorectal (microsatellite instability)", "Lynch syndrome (HNPCC)"],
]
story.append(make_table(headers3, rows3,
[2.4*cm, 4*cm, 4*cm, 5*cm]))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════
# SECTION 3: HALLMARKS OF CANCER
# ═══════════════════════════════════════════════════════════════════════
story.append(h1_banner("SECTION 3 — HALLMARKS OF CANCER"))
story.append(sp(10))
story.append(Paragraph(
"Hanahan & Weinberg described 8 fundamental hallmarks acquired by virtually all cancers, "
"plus 2 enabling characteristics that facilitate their acquisition. Each hallmark is driven "
"by specific oncogene/TSG alterations.", S["section_intro"]))
hallmarks = [
("1", TEAL, "Self-Sufficiency in Growth Signals",
"Cancer cells generate their own mitogenic signals or are hypersensitive to low-level signals.",
["Oncoproteins mimic growth factor signaling",
"RAS mutations lock the pathway 'ON'",
"EGFR/HER2 overexpression → ligand-independent signaling",
"MYC drives transcription of proliferation genes"]),
("2", NAVY, "Insensitivity to Growth-Inhibitory Signals",
"Cancer cells are blind or resistant to anti-mitogenic signals (e.g., TGF-β, contact inhibition).",
["RB loss: E2F no longer restrained at G1/S",
"p16/CDKN2A deletion: CDK4/6 cannot be inhibited",
"SMAD4 loss: TGF-β tumor-suppressive signaling lost",
"All cancers dysregulate the G1-S checkpoint"]),
("3", ORANGE, "Evasion of Apoptosis",
"Cancer cells survive despite pro-apoptotic signals by upregulating survival pathways.",
["BCL-2 overexpression (t14;18 in follicular lymphoma)",
"TP53 loss removes apoptotic trigger",
"PI3K/AKT activation suppresses BAD/caspases",
"Survivin and IAP family proteins block caspases"]),
("4", HexColor("#6b46c1"), "Limitless Replicative Potential",
"Normal cells senesce after ~60-70 divisions (Hayflick limit) due to telomere shortening. Cancer cells bypass this.",
["Telomerase (hTERT) reactivated in >90% of cancers",
"Telomerase adds TTAGGG repeats to chromosome ends",
"Prevents replicative senescence and crisis",
"Some cancers use ALT (Alternative Lengthening of Telomeres)"]),
("5", HexColor("#2d6a4f"), "Sustained Angiogenesis",
"Tumors >1–2 mm require new blood vessel formation (neovascularization) to receive O₂ and nutrients.",
["VEGF (vascular endothelial growth factor) is the master angiogenic switch",
"HIF-1α (activated by hypoxia or VHL loss) drives VEGF transcription",
"Tumor vessels: leaky, tortuous, poorly perfused",
"Anti-VEGF therapy: bevacizumab; anti-VEGFR: sunitinib, sorafenib"]),
("6", HexColor("#9b2335"), "Invasion and Metastasis",
"The deadliest hallmark. Responsible for ~90% of cancer mortality.",
["E-cadherin loss → epithelial-mesenchymal transition (EMT)",
"MMP secretion degrades basement membrane and ECM",
"Integrins bind matrix for migration",
"Intravasation → circulation → extravasation → colonization",
"Organotropism: 'seed and soil' — colon→liver, breast→bone/brain"]),
("7", HexColor("#c05621"), "Altered Cellular Metabolism (Warburg Effect)",
"Cancer cells prefer aerobic glycolysis (glucose→lactate) even in the presence of O₂.",
["Provides biosynthetic precursors: nucleotides, lipids, amino acids",
"Hexosamine pathway: glycosylation for growth factor receptors",
"IDH1/IDH2 mutations → 2-hydroxyglutarate (oncometabolite) → epigenetic dysregulation",
"Basis for PET scanning (18F-FDG uptake in metabolically active tumors)"]),
("8", HexColor("#1a365d"), "Evasion of Immune Surveillance",
"Tumors express antigens but evade destruction by adaptive and innate immunity.",
["Downregulate MHC class I → invisible to CD8+ CTLs",
"PD-L1 expression on tumor cells → binds PD-1 on T cells → T cell exhaustion",
"Recruit immunosuppressive cells: Tregs, M2 macrophages, MDSCs",
"Secrete TGF-β, IL-10, IDO to create immunosuppressive TME",
"Basis for checkpoint immunotherapy: anti-PD-1 (nivolumab), anti-CTLA-4 (ipilimumab)"]),
]
for num, color, title, summary, points in hallmarks:
# Badge + title row
badge_data = [[
Paragraph(num, ParagraphStyle("badge_num", fontSize=14, fontName="Helvetica-Bold",
textColor=WHITE, alignment=TA_CENTER)),
Paragraph(title, ParagraphStyle("h_title", fontSize=11.5, fontName="Helvetica-Bold",
textColor=color, leading=14)),
]]
badge_t = Table(badge_data, colWidths=[1*cm, 14.4*cm])
badge_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), color),
("BACKGROUND", (1,0), (1,0), WHITE),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING",(0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (0,0), 0),
("LEFTPADDING", (1,0), (1,0), 8),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("LINEBELOW", (1,0), (1,0), 1, color),
]))
content_rows = [[
Paragraph(""),
Paragraph(summary, ParagraphStyle("h_sum", fontSize=9, fontName="Helvetica-Oblique",
textColor=GREY_TEXT, leading=13)),
]]
for pt in points:
content_rows.append([Paragraph(""), Paragraph(f"▸ {pt}",
ParagraphStyle("h_pt", fontSize=9, fontName="Helvetica",
textColor=GREY_TEXT, leading=13, leftIndent=6))])
content_t = Table(content_rows, colWidths=[1*cm, 14.4*cm])
content_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), HexColor("#f8fafc")),
("LINEAFTER", (0,0), (0,-1), 3, color),
("TOPPADDING", (0,0), (-1,-1), 2),
("BOTTOMPADDING",(0,0), (-1,-1), 2),
("LEFTPADDING", (1,0), (1,-1), 8),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(KeepTogether([badge_t, content_t, sp(8)]))
story.append(sp(6))
story.append(Paragraph("Enabling Characteristics", S["h2"]))
story.append(rule(TEAL, 0.5))
enabling = [
["Genomic Instability",
"Defects in DNA damage sensing, repair, or checkpoint activation accelerate driver mutation acquisition. "
"Examples: MMR defects (Lynch syndrome → MSI-H CRC), BRCA1/2 defects (HRR loss → breast/ovarian Ca), "
"nucleotide excision repair defects (XP → skin Ca)."],
["Tumor-Promoting Inflammation",
"Chronic inflammation supplies growth factors (EGF, FGF, HGF), pro-angiogenic factors (VEGF), "
"ECM-remodeling enzymes (MMPs), and survival signals (NF-κB pathway) to tumor cells. "
"Classic examples: H. pylori → gastric Ca; HBV/HCV → hepatocellular Ca; IBD → colonic Ca."],
]
for title, desc in enabling:
en_data = [[Paragraph(title, S["h3"]),
Paragraph(desc, S["body"])]]
en_t = Table(en_data, colWidths=[4*cm, 11.4*cm])
en_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), CARD_BG),
("BACKGROUND", (1,0), (1,0), WHITE),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 8),
("GRID", (0,0), (-1,-1), 0.5, HexColor("#d1d5db")),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(en_t)
story.append(sp(5))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════
# SECTION 4: QUICK REVIEW TABLES
# ═══════════════════════════════════════════════════════════════════════
story.append(h1_banner("SECTION 4 — QUICK REVIEW & HIGH-YIELD TABLES"))
story.append(sp(10))
story.append(Paragraph("4.1 Oncogene vs Tumor Suppressor — Key Differences", S["h2"]))
story.append(rule(TEAL, 0.5))
headers_cmp = ["Feature", "Oncogene", "Tumor Suppressor Gene"]
rows_cmp = [
["Normal role", "Promote cell growth/survival", "Inhibit cell growth / promote apoptosis"],
["Mutation type", "Gain-of-function", "Loss-of-function"],
["Alleles required", "One (dominant)", "Two (recessive — both hits needed)"],
["Inheritance in familial Ca", "Rare", "Common (one hit inherited)"],
["Examples", "RAS, MYC, BCL-2, HER2, BCR-ABL", "TP53, RB, APC, BRCA1/2, PTEN, VHL"],
["Drug targeting", "Often targetable (TKIs, antibodies)", "Harder to target; restore function strategies"],
]
story.append(make_table(headers_cmp, rows_cmp,
[3.5*cm, 6.1*cm, 5.8*cm]))
story.append(sp(10))
story.append(Paragraph("4.2 Hereditary Cancer Syndromes", S["h2"]))
story.append(rule(TEAL, 0.5))
headers_hc = ["Syndrome", "Gene(s)", "Cancers", "Inheritance"]
rows_hc = [
["Familial Retinoblastoma", "RB1", "Retinoblastoma, osteosarcoma", "AD"],
["Li-Fraumeni", "TP53", "Sarcoma, breast, brain, adrenal, leukemia", "AD"],
["FAP", "APC", "Colorectal (100% by age 40), duodenal, gastric", "AD"],
["Lynch (HNPCC)", "MLH1, MSH2, MSH6, PMS2", "Colorectal, endometrial, ovarian, gastric", "AD"],
["HBOC", "BRCA1, BRCA2", "Breast, ovarian, pancreatic, prostate", "AD"],
["MEN2A/2B", "RET (oncogene)", "Medullary thyroid Ca, pheochromocytoma, hyperparathyroidism", "AD"],
["VHL disease", "VHL", "Clear cell RCC, hemangioblastoma, pheochromocytoma", "AD"],
["Cowden syndrome", "PTEN", "Breast, thyroid, endometrial, hamartomas", "AD"],
["Neurofibromatosis 1", "NF1", "Neurofibroma, MPNST, leukemia (JMML)", "AD"],
["Xeroderma Pigmentosum", "XPC, XPA, etc.", "Skin cancers (SCC, BCC, melanoma)", "AR"],
]
story.append(make_table(headers_hc, rows_hc,
[3.8*cm, 3.5*cm, 5.5*cm, 2.6*cm]))
story.append(sp(10))
story.append(Paragraph("4.3 Viruses & Cancer", S["h2"]))
story.append(rule(TEAL, 0.5))
headers_v = ["Virus", "Type", "Cancer(s)", "Key Mechanism"]
rows_v = [
["HPV 16/18", "DNA (Papillomavirus)", "Cervical, oropharyngeal, anal", "E6 degrades p53; E7 inactivates RB"],
["EBV", "DNA (Herpesvirus)", "Burkitt lymphoma, Hodgkin lymphoma, NPC, PTLD", "LMP-1 activates NF-κB; EBERs block apoptosis"],
["HBV", "DNA (Hepadnavirus)", "Hepatocellular carcinoma", "HBx activates proto-oncogenes; chronic hepatitis"],
["HCV", "RNA (Flavivirus)", "Hepatocellular carcinoma", "Cirrhosis-mediated; NS5A activates WNT/β-catenin"],
["HTLV-1", "RNA retrovirus", "Adult T-cell leukemia/lymphoma", "Tax activates NF-κB and IL-2/IL-2R (autocrine)"],
["HHV-8/KSHV", "DNA (Herpesvirus)", "Kaposi sarcoma, PEL, MCD", "vIL-6, vCCL1/2; FLIP blocks apoptosis"],
["H. pylori", "Bacterium", "Gastric adenocarcinoma, MALT lymphoma", "CagA activates SRC; chronic NF-κB inflammation"],
]
story.append(make_table(headers_v, rows_v,
[2.6*cm, 2.8*cm, 4.2*cm, 5.8*cm]))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════
# SECTION 5: CLINICAL TARGETS
# ═══════════════════════════════════════════════════════════════════════
story.append(h1_banner("SECTION 5 — THERAPEUTIC TARGETING OF CANCER HALLMARKS"))
story.append(sp(10))
story.append(Paragraph(
"Understanding cancer's molecular mechanisms has enabled targeted therapies. "
"Each hallmark can potentially be countered by one or more drug classes.", S["section_intro"]))
headers_tx = ["Hallmark", "Target/Pathway", "Drug Class / Example", "Cancer"]
rows_tx = [
["Growth signals", "HER2", "Monoclonal Ab — Trastuzumab", "Breast, gastric"],
["Growth signals", "EGFR", "TKI — Osimertinib, erlotinib", "Lung NSCLC"],
["Growth signals", "BCR-ABL", "TKI — Imatinib, dasatinib", "CML"],
["Growth signals", "KRAS G12C", "Covalent inhibitor — Sotorasib", "Lung NSCLC"],
["Growth signals", "BRAF V600E", "BRAF inhibitor — Vemurafenib", "Melanoma, CRC"],
["Cell cycle (TSG loss)", "CDK4/6", "CDK4/6i — Palbociclib, ribociclib", "HR+ breast Ca"],
["Apoptosis evasion", "BCL-2", "BCL-2 inhibitor — Venetoclax", "CLL, AML"],
["Angiogenesis", "VEGF/VEGFR", "Bevacizumab (anti-VEGF mAb); sunitinib", "CRC, RCC, NSCLC"],
["Immune evasion", "PD-1/PD-L1", "Nivolumab, pembrolizumab, atezolizumab", "Melanoma, NSCLC, many"],
["Immune evasion", "CTLA-4", "Ipilimumab", "Melanoma"],
["DNA repair defect", "PARP", "PARP inhibitors — Olaparib, niraparib", "BRCA1/2+ breast/ovarian"],
["Metabolism", "IDH1/IDH2", "Ivosidenib (IDH1), enasidenib (IDH2)", "AML, cholangiocarcinoma"],
]
story.append(make_table(headers_tx, rows_tx,
[3.3*cm, 3.3*cm, 5.2*cm, 3.6*cm]))
story.append(sp(12))
# High-yield summary box
summary_text = (
"<b>HIGH-YIELD EXAM SUMMARY</b><br/><br/>"
"• Most commonly mutated gene in ALL cancers: <b>TP53</b><br/>"
"• Most commonly mutated oncogene: <b>RAS</b> (~30% of all cancers)<br/>"
"• Hallmark responsible for 90% of cancer deaths: <b>Invasion & Metastasis</b><br/>"
"• Both alleles must be lost for TSG effect: <b>Two-Hit Hypothesis (Knudson)</b><br/>"
"• Oncogenes: dominant (1 allele); TSGs: recessive (2 alleles)<br/>"
"• G1-S checkpoint disrupted in ALL cancers (RB, p16, CDK4, cyclin D pathway)<br/>"
"• p53 is stabilised by DNA damage via ATM → MDM2 released<br/>"
"• Warburg effect = aerobic glycolysis → basis for FDG-PET scanning<br/>"
"• Telomerase reactivated in >90% of cancers → immortality<br/>"
"• HPV E6 degrades p53; E7 inactivates RB<br/>"
"• BCL-2 t(14;18) in follicular lymphoma = prototype of apoptosis evasion"
)
summary_data = [[Paragraph(summary_text, ParagraphStyle(
"sumbox", fontSize=9.5, leading=15, fontName="Helvetica",
textColor=NAVY))]]
summary_t = Table(summary_data, colWidths=[W - 4*cm])
summary_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), YELLOW_HL),
("LINEABOVE", (0,0), (-1,0), 3, ORANGE),
("LINEBELOW", (0,-1),(-1,-1), 3, ORANGE),
("TOPPADDING", (0,0), (-1,-1), 12),
("BOTTOMPADDING",(0,0), (-1,-1), 12),
("LEFTPADDING", (0,0), (-1,-1), 14),
("RIGHTPADDING", (0,0), (-1,-1), 14),
]))
story.append(summary_t)
# Build
doc.build(story)
print(f"PDF created: {OUTPUT}")
build()
cd /tmp/workspace/neoplasia-guide && python3 build_pdf.py 2>&1
ls -lh /tmp/workspace/neoplasia-guide/
Oncogenes TumorSuppressors Hallmarks
PDF Document · PDF