Neoplasia

Reading File
Asking for Preferences

All of rhem

Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Here is a complete, structured guide to Neoplasia based on Robbins & Kumar Basic Pathology.

NEOPLASIA - Comprehensive Guide

Robbins & Kumar Basic Pathology (9th ed.)

1. DEFINITION & FUNDAMENTAL CONCEPTS

A neoplasm (Greek: "new growth") is an abnormal mass of tissue whose growth exceeds and is uncoordinated with that of normal tissues, and persists in the same excessive manner even after the stimulus that evoked the change is removed (Willis's definition).
Cancer is fundamentally a genetic disease. Key shared features of all cancers:
  1. Genetic disorder - caused by DNA mutations (acquired via mutagens, spontaneous replication errors, or inherited). Epigenetic alterations (altered DNA methylation, histone modification) also play a role.
  2. Heritable alterations - mutations are passed to daughter cells; cells with growth/survival advantage outcompete neighbors (Darwinian selection).
  3. Clonal origin - individual tumors originate from a single transformed progenitor cell.
  4. Tumor progression - ongoing Darwinian selection favors genetically distinct subclones with increasingly aggressive characteristics.

2. NOMENCLATURE & CLASSIFICATION

Benign Tumors

Named by attaching the suffix -oma to the cell of origin:
Cell of OriginBenign Tumor
Fibrous tissueFibroma
CartilageChondroma
OsteoidOsteoma
FatLipoma
Blood vesselsHemangioma
Smooth muscleLeiomyoma
Glandular epitheliumAdenoma
Squamous epitheliumSquamous cell papilloma

Malignant Tumors

  • Carcinoma - malignancy of epithelial cells
    • Adenocarcinoma - glandular pattern of growth
    • Squamous cell carcinoma - squamous differentiation
    • Undifferentiated carcinoma - little/no differentiation
  • Sarcoma - malignancy of mesenchymal cells (fibrosarcoma, liposarcoma, leiomyosarcoma, etc.)
  • Leukemia/Lymphoma - malignancies of hematopoietic/lymphoid cells

Important Exceptions (memorize these)

TermNature
LymphomaMALIGNANT (not benign despite -oma)
MelanomaMALIGNANT
MesotheliomaMALIGNANT
SeminomaMALIGNANT
HamartomaBenign disorganized tissue mass (clonal but not truly neoplastic)
ChoristomaCongenital heterotopic nest of cells (not a true neoplasm)

Mixed Tumors

  • Pleomorphic adenoma (mixed tumor of salivary gland) - epithelial + myxoid stroma components; clonal, but progenitor can differentiate along >1 lineage
  • Teratoma - contains mature/immature cells from >1 (sometimes all 3) germ layers; originates from totipotent germ cells in ovary/testis

3. CHARACTERISTICS OF BENIGN vs. MALIGNANT NEOPLASMS

Three key discriminating features:

A. Differentiation and Anaplasia

  • Well-differentiated (benign): cells closely resemble their tissue of origin, morphologically and functionally
  • Poorly differentiated/Anaplastic (malignant): lack of differentiation; hallmarks of anaplasia include:
    • Pleomorphism (variation in cell and nuclear size/shape)
    • Hyperchromatism (dark-staining nuclei)
    • High nuclear-to-cytoplasmic ratio (normal ~1:4-6; tumor ~1:1)
    • Prominent nucleoli
    • Atypical mitoses (tripolar, quadripolar spindles)
    • Tumor giant cells

B. Local Invasion

  • Benign: grow as cohesive, expansile masses; remain localized; develop a fibrous capsule; do NOT invade surrounding tissues
  • Malignant: invade and infiltrate surrounding normal tissues; poorly demarcated; no true capsule (though some have a pseudo-capsule); fingers of malignant cells penetrate adjacent structures

C. Metastasis

  • Definition: spread of tumor to sites discontinuous with the primary tumor - the hallmark of malignancy
  • Benign tumors do NOT metastasize
  • Routes of spread:
    1. Lymphatic spread - typical of carcinomas; follows regional lymph node drainage
    2. Hematogenous spread - typical of sarcomas; veins more often than arteries; liver and lungs are most common sites (portal drainage to liver; all venous drainage through lungs)
    3. Seeding of body cavities - especially peritoneal cavity (e.g., ovarian carcinoma → "pseudomyxoma peritonei")

4. EPIDEMIOLOGY

  • Cancer is the 2nd leading cause of death in the US (after cardiovascular disease)
  • Most cancer deaths occur between 55-75 years of age
  • Cancer accounts for >10% of deaths in children <15 years

Major Environmental Risk Factors

FactorAssociated Cancers
SmokingLung (90% of deaths), mouth, pharynx, larynx, esophagus, pancreas, bladder
AlcoholOropharynx, larynx, esophagus, breast, liver
Estrogen exposureEndometrium, breast
Infectious agents~15% of cancers worldwide
UV radiationSkin cancers
Ionizing radiationLeukemia, thyroid, breast

Key Occupational Carcinogens (Table 6.2)

AgentCancer
AsbestosMesothelioma, lung
BenzeneLeukemia
Vinyl chlorideAngiosarcoma of liver
ArsenicSkin, lung
Aflatoxin B1Hepatocellular carcinoma

Acquired Predisposing Conditions

  • Chronic inflammation - creates a fertile soil for carcinoma, mesothelioma, lymphoma
  • Immunodeficiency states - predispose mainly to virus-induced cancers
  • Precursor lesions - disturbances of epithelial differentiation (e.g., Barrett esophagus, cervical dysplasia); often share genetic lesions with their associated cancers

5. GENETIC LESIONS IN CANCER

Types of Mutations

TypeExample
Driver mutationsConfer growth advantage; clonally selected
Passenger mutationsDo not affect cell growth; not selected for
Point mutationsRAS (codon 12 most common)
Gene rearrangementsBCR-ABL in CML; EWS-FLI1 in Ewing sarcoma
DeletionsLoss of tumor suppressor genes (RB, TP53)
Gene amplificationsHER2/NEU in breast cancer; N-MYC in neuroblastoma
AneuploidyGain/loss of whole chromosomes

Epigenetic Alterations

  • DNA methylation of promoter regions silences tumor suppressor genes
  • Histone modifications alter gene expression without changing DNA sequence
  • MicroRNAs (miRNAs) - small non-coding RNAs that regulate gene expression; can act as oncogenes or tumor suppressors

6. CARCINOGENESIS: A MULTISTEP PROCESS

Cancer results from the sequential acquisition of multiple mutations. This is supported by:
  • Experimental models showing that transformation requires multiple steps
  • Epidemiologic data showing exponential increase in cancer incidence with age
  • Molecular analysis of cancers showing multiple genetic changes
The concept of tumor progression refers to the ongoing accumulation of mutations that drive increasingly aggressive behavior.

7. HALLMARKS OF CANCER

Eight fundamental phenotypic properties acquired by all cancer cells (Hanahan & Weinberg):
Hallmarks of Cancer diagram
(Fig. 6.15: Eight cancer hallmarks and two enabling factors)

1. Self-Sufficiency in Growth Signals

  • Result of gain-of-function mutations converting proto-oncogenes to oncogenes
  • Oncogenes produce oncoproteins that promote cell growth without normal growth signals
  • Proto-oncogenes activated by:
    • Point mutations: RAS - most commonly mutated oncogene in human cancers (codon 12 → locks RAS in activated GTP-bound state; seen in ~30% of all human tumors)
    • Translocation: BCR-ABL (Philadelphia chromosome in CML) - constitutively active tyrosine kinase
    • Amplification: N-MYC (neuroblastoma), C-MYC (Burkitt lymphoma), HER2/NEU (breast)
Normal growth signaling sequence:
  1. Growth factor binds receptor on cell membrane
  2. Transient activation of receptor - activates signal-transducing proteins
  3. Transmission via second messengers to nucleus
  4. Induction and activation of nuclear transcription factors
  5. Entry into and progression through cell cycle
Growth factor receptors as oncoproteins:
  • ERBB1 (EGFR) - overexpressed in lung, head/neck cancers
  • ERBB2 (HER2) - amplified in ~20% of breast cancers; targetable (trastuzumab)
  • RET - point mutations in MEN2A/2B and familial medullary thyroid carcinoma

2. Insensitivity to Growth-Inhibitory Signals: Tumor Suppressor Genes

  • Result of loss-of-function mutations in tumor suppressor genes
  • Both alleles must be inactivated (Knudson's two-hit hypothesis)
RB - Governor of the Cell Cycle
  • RB protein regulates the G1-S checkpoint
  • Hypophosphorylated RB (active) - binds E2F transcription factors, recruits chromatin remodeling factors, blocks S-phase gene transcription → growth ARREST
  • Hyperphosphorylated RB (inactive) - releases E2F → cell enters S phase
  • In cancer: loss of RB function → E2F constantly free → uncontrolled proliferation
  • Virtually all cancers show dysregulation at G1-S checkpoint (mutations in RB, CDK4, cyclin D, or CDKN2A/p16)
RB cell cycle diagram
TP53 - Guardian of the Genome
  • Most commonly mutated gene in human cancer
  • TP53 is a transcription factor that responds to cellular stress (DNA damage, anoxia, inappropriate growth signals) via three mechanisms:
    1. Temporary cell cycle arrest (quiescence) at G1 via CDKN1A (p21) → CDK inhibition → RB stays hypophosphorylated
    2. Permanent cell cycle arrest (senescence)
    3. Apoptosis via upregulation of proapoptotic genes (BAX, PUMA)
  • In unstressed cells: p53 has short half-life (20 min) because MDM2 targets it for destruction
  • Under stress: ATM kinase phosphorylates p53 → releases it from MDM2 → p53 accumulates → activates target genes
  • If DNA repair fails after G1 arrest → p53 triggers senescence or apoptosis
  • Loss of p53 → DNA damage goes unrepaired → mutations accumulate → malignant transformation
  • Found in biallelic mutations in virtually every cancer type (lung, colon, breast)
  • Li-Fraumeni syndrome = germline TP53 mutation → multiple early-onset cancers

3. Altered Cellular Metabolism (Warburg Effect)

  • Cancer cells preferentially use aerobic glycolysis (glucose → lactate even in presence of O2)
  • Aerobic glycolysis provides biosynthetic precursors (lipids, nucleotides, amino acids) needed for rapid cell growth
  • Oncometabolism: mutations in IDH1/IDH2 (in gliomas, AML) produce 2-hydroxyglutarate, an oncometabolite that inhibits enzymes regulating epigenetics

4. Evasion of Apoptosis

  • Cancer cells resist apoptotic signals via:
    • Overexpression of BCL-2 (anti-apoptotic) - classic example: follicular lymphoma t(14;18)
    • Loss of TP53 - removes apoptotic stimulus
    • Upregulation of survival signals (PI3K/AKT pathway)

5. Limitless Replicative Potential (Immortality)

  • Normal cells have a finite number of divisions (Hayflick limit) due to telomere shortening
  • With each division, telomeres shorten → eventually trigger senescence or apoptosis
  • Cancer cells overcome this by upregulating telomerase (normally silent in somatic cells), which rebuilds telomeres after each division → immortality

6. Sustained Angiogenesis

  • Tumors >1-2 mm cannot grow without a blood supply
  • Tumor angiogenesis is driven by the angiogenic switch - shift in balance of pro- vs. anti-angiogenic factors:
    • Pro-angiogenic: VEGF (vascular endothelial growth factor) - primary driver; bFGF
    • Anti-angiogenic: thrombospondin-1, angiostatin, endostatin
  • Tumor vasculature is abnormal - leaky, tortuous, with poor pericyte coverage
  • Basis for anti-VEGF therapy (bevacizumab)

7. Invasion and Metastasis

This is the most clinically important property and responsible for ~90% of cancer deaths.
Invasion of Extracellular Matrix (ECM) - 4-step process:
  1. Detachment from neighboring cells - loss of E-cadherin (key cell-cell adhesion molecule); E-cadherin acts as invasion suppressor; loss is hallmark of epithelial cancers
  2. Attachment to ECM components via integrins that bind laminin and fibronectin
  3. Local proteolysis of ECM via matrix metalloproteinases (MMPs) and cathepsins - create paths through basement membrane and interstitial matrix
  4. Migration through degraded ECM
Epithelial-Mesenchymal Transition (EMT):
  • Process by which epithelial cells acquire mesenchymal features (motility, invasiveness, resistance to apoptosis)
  • Driven by transcription factors (SNAIL, SLUG, TWIST) that repress E-cadherin and upregulate N-cadherin, vimentin
  • Critical for local invasion and initiation of metastatic cascade
Vascular Dissemination and Homing:
  1. Tumor cells intravasate into blood/lymph vessels
  2. Circulate as circulating tumor cells (CTCs) - often as aggregates with platelets (protection from immune killing)
  3. Arrest in target organ capillary beds
  4. Extravasate into parenchyma
  5. Form micrometastases → some remain dormant; others grow into macrometastases
Metastatic Organotropism - tumors show preferential homing to specific organs:
  • Breast → bone, lung, liver, brain
  • Lung → adrenals, brain, bone
  • Colon → liver (via portal circulation)
  • Prostate → bone (osteoblastic metastases)
  • Explained by "seed and soil" hypothesis (Paget, 1889): cancer cells (seed) prefer specific tissue microenvironments (soil)

8. Evasion of Immune Surveillance

  • Tumors express tumor antigens (mutant proteins, viral proteins, overexpressed self-proteins, oncofetal antigens)
  • Normal immune response: CD8+ CTLs, NK cells destroy tumor cells
  • Tumors evade immunity by:
    • Downregulating MHC class I expression (less visible to CTLs)
    • Expressing PD-L1 - ligand for PD-1 on T cells; delivers inhibitory signal → T cell exhaustion (basis for anti-PD-1/PD-L1 immunotherapy)
    • Recruiting immunosuppressive cells - regulatory T cells (Tregs), tumor-associated macrophages (M2 phenotype), MDSCs
    • Secreting immunosuppressive cytokines (TGF-β, IL-10)

Enabling Characteristics

  • Genomic Instability - defects in DNA repair accelerate the acquisition of driver mutations; e.g., mismatch repair defects (Lynch syndrome → colorectal cancer), BRCA1/2 defects (breast/ovarian cancer)
  • Tumor-Promoting Inflammation - chronic inflammation supplies growth factors, pro-angiogenic factors, and survival signals to tumor cells

8. ETIOLOGY OF CANCER: CARCINOGENIC AGENTS

A. Chemical Carcinogens

TypeExampleMechanismAssociated Cancer
Direct-actingNitrogen mustards, alkylating agentsDirectly damage DNA without metabolic activationLeukemia after chemotherapy
Indirect-acting (procarcinogens)Polycyclic hydrocarbons (benzo[a]pyrene) in cigarette smokeRequire metabolic activation by CYP enzymesLung cancer
Aromatic amines (2-naphthylamine)Activated in liver, excreted in urineBladder cancer
Aflatoxin B1Produced by Aspergillus flavus; mutates TP53 codon 249Hepatocellular carcinoma
Mechanism: Initiation (irreversible DNA mutation) → Promotion (clonal expansion of initiated cells by non-mutagenic agents) → Progression (acquisition of additional mutations)

B. Radiation Carcinogenesis

  • Ionizing radiation - UV, X-rays, gamma rays, nuclear fallout
    • UV-B (280-320 nm): pyrimidine dimers → skin cancers; XP (xeroderma pigmentosum) patients have defective nucleotide excision repair → extreme sensitivity
    • Atomic bomb survivors: leukemia peak at 5-7 years; solid tumors at 10-30 years
  • Highest radiosensitive tumors: leukemia, thyroid (especially in children), breast

C. Viral and Microbial Oncogenesis

AgentCancerMechanism
HPV (16, 18)Cervical, oropharyngeal, analE6 protein degrades p53; E7 inactivates RB
EBVBurkitt lymphoma, Hodgkin lymphoma, nasopharyngeal carcinomaLMP-1 activates NF-κB; EBER miRNAs block apoptosis
HBV/HCVHepatocellular carcinomaChronic inflammation + cirrhosis; HBV integrates into genome; HBx activates proto-oncogenes
HTLV-1Adult T-cell leukemia/lymphomaTax protein activates NF-κB, IL-2/IL-2R → autonomous T cell proliferation
H. pyloriGastric carcinoma, MALT lymphomaChronic gastritis → CagA protein activates SRC kinases
HHV-8 (KSHV)Kaposi sarcoma, PELFLICE inhibitory proteins block apoptosis; viral IL-6 promotes angiogenesis

9. CLINICAL ASPECTS OF NEOPLASIA

Effects on the Host

Local Effects:
  • Obstruction (colonic carcinoma)
  • Ulceration and bleeding (GI tumors)
  • Pain (bone metastases)
  • Pressure effects (brain tumors)
Cancer Cachexia:
  • Progressive loss of body fat and lean muscle mass, weakness, anorexia, and anemia
  • Driven by TNF-α, IL-1, IL-6, IFN-γ from tumor-activated macrophages
  • NOT simply due to malnutrition; metabolism is fundamentally altered
  • Basal metabolic rate is elevated despite decreased food intake
Paraneoplastic Syndromes: Symptoms caused by the remote effects of a tumor (not direct invasion or metastasis).
SyndromeMediatorAssociated Tumor
HypercalcemiaPTHrPSquamous cell carcinoma of lung, breast
SIADHADH (ectopic)Small cell lung carcinoma
Cushing syndromeACTH (ectopic)Small cell lung carcinoma, pancreatic
Eaton-LambertAb against Ca2+ channelsSmall cell lung carcinoma
PolycythemiaErythropoietin (ectopic)Renal cell carcinoma, hepatocellular
Migratory thrombophlebitis (Trousseau sign)ProcoagulantsPancreatic/GI adenocarcinoma
HypoglycemiaIGF-2Fibrosarcoma, hepatoma

10. GRADING AND STAGING

Grading

  • Assesses the degree of differentiation of a tumor
  • Based on histologic features (nuclear pleomorphism, mitotic rate, necrosis)
  • Grade I: Well-differentiated (resembles normal tissue)
  • Grade II: Moderately differentiated
  • Grade III: Poorly differentiated
  • Grade IV: Undifferentiated/anaplastic
  • Higher grade = more aggressive = worse prognosis
  • Note: Grading is imprecise - not used uniformly across all tumor types

Staging

  • Assesses the anatomic extent of spread of a tumor
  • More important than grading in determining prognosis and treatment
  • TNM System (AJCC/UICC):
    • T (Tumor): Size and local extent (T1-T4)
    • N (Nodes): Regional lymph node involvement (N0-N3)
    • M (Metastasis): Distant metastasis (M0 or M1)
  • Combined into Stage I-IV:
    • Stage I: Localized, small
    • Stage II: Locally advanced, no nodes
    • Stage III: Regional lymph node involvement
    • Stage IV: Distant metastases

11. LABORATORY DIAGNOSIS OF CANCER

Morphologic Methods

  • Fine-needle aspiration cytology (FNAC) - cytologic smear from a mass
  • Core needle biopsy - histologic architecture preserved
  • Excisional/incisional biopsy - gold standard
  • Frozen sections - intraoperative margin assessment
  • Cytology (Pap smear) - for exfoliated cells (cervix, sputum, urine, CSF)
  • Immunohistochemistry (IHC) - identifies cell-specific antigens; determines tumor type (e.g., cytokeratin for carcinomas, vimentin for sarcomas, CD markers for lymphomas)

Tumor Markers

Biochemical assays of antigens or hormones associated with neoplasms. Used for:
  • Screening (PSA for prostate)
  • Monitoring response to therapy
  • Detecting recurrence
  • NOT used for definitive diagnosis alone
MarkerAssociated Tumor
PSAProstate carcinoma
AFP (Alpha-fetoprotein)Hepatocellular carcinoma, yolk sac tumors (testis/ovary)
CEA (Carcinoembryonic Ag)Colorectal, pancreatic, gastric, breast
CA-125Ovarian carcinoma (serous type)
CA 19-9Pancreatic carcinoma
hCG (beta)Choriocarcinoma, gestational trophoblastic disease, testicular germ cell tumors
CalcitoninMedullary thyroid carcinoma
Chromogranin ANeuroendocrine tumors, pheochromocytoma
S-100Melanoma, nerve sheath tumors

Molecular Diagnosis

  • PCR / RT-PCR - detect fusion transcripts (BCR-ABL), minimal residual disease
  • FISH (Fluorescence in situ hybridization) - detect gene amplifications (HER2), translocations
  • Next-generation sequencing (NGS) - comprehensive tumor mutation profiling
  • Flow cytometry - immunophenotyping of leukemias/lymphomas; cell cycle analysis
  • Molecular profiling (gene expression arrays) - classify tumors, predict prognosis/drug response

QUICK SUMMARY TABLE: Benign vs. Malignant

FeatureBenignMalignant
DifferentiationWell-differentiatedVariable; may be anaplastic
Rate of growthSlowUsually rapid
EncapsulationUsually encapsulatedNo true capsule; infiltrative
Local invasionNoYes
MetastasisNoYes
Mitotic figuresRare; normalFrequent; may be atypical
Nuclear changesNormalPleomorphism, hyperchromasia, prominent nucleoli
Effect on hostUsually mildOften life-threatening

All content sourced from Robbins & Kumar Basic Pathology, Chapter 6 - Neoplasia.

Create a study guide PDF on oncogenes, tumor suppressors, and hallmarks of cancer

Reading File
Running Command

ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "workspace ready"

Running Command

mkdir -p /tmp/workspace/neoplasia-guide && python3 -c "from reportlab.lib import colors; print('reportlab ok')"

Writing File

~/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 &amp; 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 &gt;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()
Running Command

cd /tmp/workspace/neoplasia-guide && python3 build_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/neoplasia-guide/

Your study guide PDF is ready. Here's a summary of what's inside:

Oncogenes TumorSuppressors Hallmarks

PDF Document · PDF


What the PDF contains (5 sections, ~8 pages):

Section 1 — Oncogenes
  • Proto-oncogene vs oncogene (4 activation mechanisms)
  • Categories of oncoproteins table (growth factors, receptors, GTPases, kinases, TFs, cell cycle, anti-apoptotic)
  • RAS deep-dive (most commonly mutated oncogene, ~30% of all cancers)
  • 10-oncogene quick reference table with drug targets (HER2, EGFR, BCR-ABL, N-MYC, ALK, etc.)
Section 2 — Tumor Suppressor Genes
  • Knudson's Two-Hit Hypothesis with retinoblastoma example
  • RB protein - complete G1/S checkpoint mechanism table
  • TP53 guardian of the genome - stress response, MDM2 degradation, p21/apoptosis pathways
  • 10-TSG reference table (APC, BRCA1/2, PTEN, VHL, NF1, MLH1, WT1, etc.) with hereditary syndromes
Section 3 — Hallmarks of Cancer
  • All 8 hallmarks in color-coded cards with key molecular details and drug targets
  • 2 enabling characteristics (genomic instability, tumor-promoting inflammation)
Section 4 — Quick Review Tables
  • Oncogene vs TSG comparison table
  • Hereditary cancer syndromes table (10 syndromes)
  • Viral oncogenesis table (HPV, EBV, HBV, HCV, HTLV-1, HHV-8, H. pylori)
Section 5 — Therapeutic Targeting
  • 12-drug class table mapping hallmarks → targets → drugs → cancers
  • High-yield exam summary box (11 must-know bullet points)
This is a shared conversation. Sign in to Orris to start your own chat.