Make npdf notes of excitation contraction coupling and molecular basis of skeletal muscle contraction according to rguhs following gk pal textbook of physiology

Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Running Command

mkdir -p /home/daytona/workspace/rguhs-physiology-notes && ls /home/daytona/workspace/rguhs-physiology-notes/

Writing File

~/rguhs-physiology-notes/generate_notes.py


from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, ListFlowable, ListItem
)
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import os

OUTPUT_PATH = "/home/daytona/workspace/rguhs-physiology-notes/EC_Coupling_Molecular_Basis_Skeletal_Muscle.pdf"

doc = SimpleDocTemplate(
    OUTPUT_PATH,
    pagesize=A4,
    rightMargin=2*cm,
    leftMargin=2*cm,
    topMargin=2.2*cm,
    bottomMargin=2*cm
)

W, H = A4
styles = getSampleStyleSheet()

# ── Colour palette ──────────────────────────────────────────────────────────
DARK_BLUE   = colors.HexColor("#1a3a5c")
MID_BLUE    = colors.HexColor("#2563a8")
LIGHT_BLUE  = colors.HexColor("#dbeafe")
ACCENT      = colors.HexColor("#e67e22")
GREEN_BG    = colors.HexColor("#d1fae5")
GREEN_DK    = colors.HexColor("#065f46")
YELLOW_BG   = colors.HexColor("#fef9c3")
YELLOW_DK   = colors.HexColor("#92400e")
PINK_BG     = colors.HexColor("#fce7f3")
PINK_DK     = colors.HexColor("#9d174d")
GRAY_LINE   = colors.HexColor("#cbd5e1")
WHITE       = colors.white
BLACK       = colors.black

# ── Custom styles ────────────────────────────────────────────────────────────
def S(name, **kw):
    base = kw.pop("parent", "Normal")
    s = ParagraphStyle(name, parent=styles[base], **kw)
    return s

title_style = S("DocTitle",
    fontSize=20, fontName="Helvetica-Bold",
    textColor=WHITE, alignment=TA_CENTER, leading=26, spaceAfter=4)

subtitle_style = S("DocSubtitle",
    fontSize=11, fontName="Helvetica",
    textColor=colors.HexColor("#bfdbfe"), alignment=TA_CENTER, leading=14, spaceAfter=2)

tag_style = S("Tag",
    fontSize=9, fontName="Helvetica-Bold",
    textColor=WHITE, alignment=TA_CENTER, leading=12)

h1_style = S("H1",
    fontSize=14, fontName="Helvetica-Bold",
    textColor=WHITE, alignment=TA_LEFT, leading=18,
    leftPadding=8, rightPadding=8, spaceAfter=0, spaceBefore=14)

h2_style = S("H2",
    fontSize=11, fontName="Helvetica-Bold",
    textColor=DARK_BLUE, alignment=TA_LEFT, leading=15,
    spaceBefore=10, spaceAfter=2)

h3_style = S("H3",
    fontSize=10, fontName="Helvetica-Bold",
    textColor=MID_BLUE, alignment=TA_LEFT, leading=13,
    spaceBefore=6, spaceAfter=2)

body_style = S("Body",
    fontSize=9.5, fontName="Helvetica",
    textColor=BLACK, leading=14, alignment=TA_JUSTIFY,
    spaceBefore=2, spaceAfter=2)

body_bold = S("BodyBold",
    fontSize=9.5, fontName="Helvetica-Bold",
    textColor=BLACK, leading=14)

bullet_style = S("Bullet",
    fontSize=9.5, fontName="Helvetica",
    textColor=BLACK, leading=14, leftIndent=12,
    bulletIndent=2, spaceAfter=2)

key_style = S("Key",
    fontSize=9.5, fontName="Helvetica-Bold",
    textColor=GREEN_DK, leading=14)

box_body = S("BoxBody",
    fontSize=9.5, fontName="Helvetica",
    textColor=BLACK, leading=14, alignment=TA_JUSTIFY)

step_num_style = S("StepNum",
    fontSize=11, fontName="Helvetica-Bold",
    textColor=WHITE, alignment=TA_CENTER, leading=14)

step_text_style = S("StepText",
    fontSize=9.5, fontName="Helvetica",
    textColor=BLACK, leading=14, alignment=TA_JUSTIFY)


# ── Helper builders ──────────────────────────────────────────────────────────

def title_block(text1, text2, tags):
    """Dark blue banner with title, subtitle and tag pills."""
    elems = []
    banner_data = [[Paragraph(text1, title_style)],
                   [Paragraph(text2, subtitle_style)]]
    pill_cells = [Paragraph(t, tag_style) for t in tags]
    pill_row   = Table([pill_cells],
                       colWidths=[4.5*cm]*len(tags),
                       hAlign="CENTER")
    pill_row.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), MID_BLUE),
        ("ROUNDEDCORNERS", [4]),
        ("TOPPADDING", (0,0),(-1,-1),3),
        ("BOTTOMPADDING",(0,0),(-1,-1),3),
        ("LEFTPADDING",(0,0),(-1,-1),6),
        ("RIGHTPADDING",(0,0),(-1,-1),6),
    ]))
    banner = Table(
        banner_data + [[pill_row]],
        colWidths=[doc.width]
    )
    banner.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
        ("TOPPADDING",    (0,0),(-1,-1), 10),
        ("BOTTOMPADDING", (0,0),(-1,-1), 8),
        ("LEFTPADDING",   (0,0),(-1,-1), 10),
        ("RIGHTPADDING",  (0,0),(-1,-1), 10),
    ]))
    elems.append(banner)
    elems.append(Spacer(1, 8))
    return elems


def section_header(text, color=DARK_BLUE):
    """Coloured full-width section header bar."""
    t = Table([[Paragraph(text, h1_style)]],
              colWidths=[doc.width])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0),(-1,-1), color),
        ("TOPPADDING",    (0,0),(-1,-1), 6),
        ("BOTTOMPADDING", (0,0),(-1,-1), 6),
        ("LEFTPADDING",   (0,0),(-1,-1), 8),
        ("RIGHTPADDING",  (0,0),(-1,-1), 8),
    ]))
    return [t, Spacer(1,5)]


def colored_box(title, items, bg=LIGHT_BLUE, border=MID_BLUE, title_color=DARK_BLUE):
    """Rounded info box with a title row and bullet items."""
    content = []
    content.append(Paragraph(title, S("BT", fontSize=10, fontName="Helvetica-Bold",
                                       textColor=title_color, leading=13)))
    content.append(Spacer(1,3))
    for item in items:
        content.append(Paragraph(f"• {item}", box_body))
    t = Table([[content]], colWidths=[doc.width])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), bg),
        ("BOX",          (0,0),(-1,-1), 1, border),
        ("TOPPADDING",   (0,0),(-1,-1), 8),
        ("BOTTOMPADDING",(0,0),(-1,-1), 8),
        ("LEFTPADDING",  (0,0),(-1,-1), 10),
        ("RIGHTPADDING", (0,0),(-1,-1), 10),
    ]))
    return [t, Spacer(1,6)]


def step_table(steps):
    """Numbered step table: circle number | description."""
    rows = []
    for i, (title, desc) in enumerate(steps, 1):
        num_cell = Table([[Paragraph(str(i), step_num_style)]],
                         colWidths=[0.8*cm])
        num_cell.setStyle(TableStyle([
            ("BACKGROUND",   (0,0),(-1,-1), MID_BLUE),
            ("TOPPADDING",   (0,0),(-1,-1), 3),
            ("BOTTOMPADDING",(0,0),(-1,-1), 3),
            ("LEFTPADDING",  (0,0),(-1,-1), 3),
            ("RIGHTPADDING", (0,0),(-1,-1), 3),
        ]))
        text_cell = [Paragraph(f"<b>{title}</b>", step_text_style),
                     Paragraph(desc, step_text_style)]
        rows.append([num_cell, text_cell])

    t = Table(rows, colWidths=[1.0*cm, doc.width - 1.0*cm])
    t.setStyle(TableStyle([
        ("VALIGN",       (0,0),(-1,-1), "TOP"),
        ("TOPPADDING",   (0,0),(-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("LEFTPADDING",  (0,0),(-1,-1), 4),
        ("RIGHTPADDING", (0,0),(-1,-1), 4),
        ("ROWBACKGROUNDS",(0,0),(-1,-1), [WHITE, LIGHT_BLUE]),
        ("LINEBELOW",    (0,0),(-1,-1), 0.5, GRAY_LINE),
    ]))
    return [t, Spacer(1,8)]


def two_col(left_items, right_items, left_title="", right_title="",
            left_bg=LIGHT_BLUE, right_bg=GREEN_BG):
    """Two-column comparison block."""
    def make_col(title, items, bg):
        c = []
        if title:
            c.append(Paragraph(title, S("CT", fontSize=10, fontName="Helvetica-Bold",
                                         textColor=DARK_BLUE, leading=13)))
            c.append(Spacer(1,3))
        for it in items:
            c.append(Paragraph(f"• {it}", box_body))
        return c

    lc = make_col(left_title, left_items, left_bg)
    rc = make_col(right_title, right_items, right_bg)
    col_w = (doc.width - 0.4*cm) / 2
    t = Table([[lc, rc]], colWidths=[col_w, col_w])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(0,-1), left_bg),
        ("BACKGROUND",   (1,0),(1,-1), right_bg),
        ("BOX",          (0,0),(-1,-1), 1, GRAY_LINE),
        ("INNERGRID",    (0,0),(-1,-1), 0.5, GRAY_LINE),
        ("VALIGN",       (0,0),(-1,-1), "TOP"),
        ("TOPPADDING",   (0,0),(-1,-1), 8),
        ("BOTTOMPADDING",(0,0),(-1,-1), 8),
        ("LEFTPADDING",  (0,0),(-1,-1), 8),
        ("RIGHTPADDING", (0,0),(-1,-1), 8),
    ]))
    return [t, Spacer(1,6)]


def highlight_box(text, bg=YELLOW_BG, border=YELLOW_DK):
    t = Table([[Paragraph(text, S("HB", fontSize=9.5, fontName="Helvetica",
                                   textColor=BLACK, leading=14))]],
              colWidths=[doc.width])
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,-1), bg),
        ("BOX",          (0,0),(-1,-1), 1.5, border),
        ("TOPPADDING",   (0,0),(-1,-1), 8),
        ("BOTTOMPADDING",(0,0),(-1,-1), 8),
        ("LEFTPADDING",  (0,0),(-1,-1), 10),
        ("RIGHTPADDING", (0,0),(-1,-1), 10),
    ]))
    return [t, Spacer(1,6)]


def key_table(rows_data, headers):
    """General key-value table."""
    all_rows = [headers] + rows_data
    col_w = doc.width / len(headers)
    t = Table(all_rows, colWidths=[col_w]*len(headers))
    t.setStyle(TableStyle([
        ("BACKGROUND",   (0,0),(-1,0), DARK_BLUE),
        ("TEXTCOLOR",    (0,0),(-1,0), WHITE),
        ("FONTNAME",     (0,0),(-1,0), "Helvetica-Bold"),
        ("FONTSIZE",     (0,0),(-1,-1), 9),
        ("ROWBACKGROUNDS",(0,1),(-1,-1), [WHITE, LIGHT_BLUE]),
        ("GRID",         (0,0),(-1,-1), 0.5, GRAY_LINE),
        ("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), "MIDDLE"),
    ]))
    return [t, Spacer(1,8)]


def hr():
    return [HRFlowable(width="100%", thickness=1, color=GRAY_LINE), Spacer(1,4)]


# ════════════════════════════════════════════════════════════════════════════
# BUILD CONTENT
# ════════════════════════════════════════════════════════════════════════════

story = []

# ── Cover banner ─────────────────────────────────────────────────────────────
story += title_block(
    "Physiology Notes",
    "Excitation-Contraction Coupling & Molecular Basis of Skeletal Muscle Contraction",
    ["RGUHS MBBS", "GK Pal Reference", "General Physiology"]
)

story.append(Paragraph(
    "These notes are aligned to the Rajiv Gandhi University of Health Sciences (RGUHS) MBBS "
    "curriculum. Content is based on GK Pal – Textbook of Medical Physiology (supplemented by "
    "Costanzo and Guyton) and covers all high-yield exam topics for this chapter.",
    body_style
))
story.append(Spacer(1, 6))

# ════════════════════════════════════════════════════════════════════════════
# PART 1 – MOLECULAR BASIS OF SKELETAL MUSCLE CONTRACTION
# ════════════════════════════════════════════════════════════════════════════
story += section_header("PART 1 – MOLECULAR BASIS OF SKELETAL MUSCLE CONTRACTION", DARK_BLUE)

story.append(Paragraph("1.1  Structure of Skeletal Muscle Fiber", h2_style))
story.append(Paragraph(
    "Each skeletal muscle fiber is a multinucleated syncytium enclosed by the sarcolemma "
    "(plasma membrane) and sarcoplasm (cytoplasm). The fiber contains hundreds to thousands "
    "of myofibrils, each consisting of repeating units called sarcomeres.",
    body_style
))
story.append(Spacer(1,4))

# Sarcomere structure table
story += key_table(
    [
        ["A-band", "1.6 µm", "Contains thick (myosin) filaments; dark band", "Persists at all lengths"],
        ["I-band",  "Varies",  "Contains only thin (actin) filaments; light band", "Shortens during contraction"],
        ["H-zone",  "Varies",  "Central part of A-band; myosin only (no actin)", "Narrows/disappears on contraction"],
        ["M-line",  "—",       "Centre of sarcomere; anchors myosin thick filaments", "Remains constant"],
        ["Z-disc/line", "—",   "Boundary of each sarcomere; anchors actin (thin filaments)", "Remains constant"],
        ["Sarcomere","2.0–2.2 µm","Z-disc to Z-disc; functional unit of contraction","Optimal overlap at ~2.1 µm"],
    ],
    ["Band/Zone", "Width (rest)", "Contents / Notes", "Change on Contraction"]
)

story.append(Paragraph("1.2  Contractile Proteins", h2_style))

story += colored_box(
    "THICK FILAMENTS – Myosin",
    [
        "Molecular weight ~500,000 Da; 1500 myosin molecules per thick filament.",
        "Each myosin molecule has: 2 heavy chains (form coiled tail + 2 globular heads) + 4 light chains (regulatory & essential).",
        "Myosin head (S1 fragment) contains: (a) Actin-binding site, (b) ATPase site – splits ATP → ADP + Pi to generate force.",
        "Heads project laterally as cross-bridges; absent in the bare zone at the centre of each thick filament.",
        "Tail of myosin is the M-protein region that links thick filaments to the M-line.",
    ],
    bg=LIGHT_BLUE, border=MID_BLUE
)

story += colored_box(
    "THIN FILAMENTS – Actin, Tropomyosin, Troponin Complex",
    [
        "Actin (F-actin): Double-stranded helical polymer of G-actin monomers. Each G-actin has one myosin-binding site.",
        "Tropomyosin: Thread-like protein that runs along the groove of the actin helix; covers 7 actin monomers per molecule. At rest, it BLOCKS myosin-binding sites on actin.",
        "Troponin complex (3 subunits):",
        "  – Troponin T (TnT): Anchors the whole troponin complex to tropomyosin.",
        "  – Troponin I (TnI): Inhibitory subunit; maintains tropomyosin in the blocking position.",
        "  – Troponin C (TnC): Ca²⁺-binding subunit (binds 4 Ca²⁺ ions cooperatively); triggers conformational change.",
    ],
    bg=GREEN_BG, border=GREEN_DK
)

story += colored_box(
    "REGULATORY / CYTOSKELETAL PROTEINS",
    [
        "Titin (connectin): Elastic protein connecting Z-disc to M-line; acts as molecular spring; prevents overstretching.",
        "Nebulin: Inextensible ruler protein along thin filament; regulates actin filament length.",
        "α-Actinin: Cross-links actin filaments at Z-discs.",
        "Dystrophin: Links cytoskeleton to extracellular matrix; absent in Duchenne Muscular Dystrophy.",
        "Tropomyosin & Troponin: Regulatory proteins on thin filaments (see above).",
    ],
    bg=YELLOW_BG, border=YELLOW_DK
)

story.append(Paragraph("1.3  Sliding Filament Theory (Huxley & Hanson, 1954)", h2_style))
story.append(Paragraph(
    "Proposed independently by AF Huxley & R Niedergerke and HE Huxley & J Hanson in 1954. "
    "This is the universally accepted mechanism of muscle contraction.",
    body_style
))

story += highlight_box(
    "<b>Key Concept:</b> During contraction, the LENGTH OF THICK AND THIN FILAMENTS DOES NOT CHANGE. "
    "Instead, thin filaments SLIDE OVER thick filaments toward the centre of the sarcomere, pulling Z-discs "
    "closer together → sarcomere shortens → muscle shortens. A-band width stays constant; I-band and H-zone narrow.",
    bg=YELLOW_BG, border=YELLOW_DK
)

story.append(Paragraph("1.4  Cross-Bridge Cycle (Lymn-Taylor Cycle)", h2_style))
story.append(Paragraph(
    "The molecular mechanism of force generation is the cross-bridge cycle. "
    "Each complete cycle moves the myosin head ~10 nm (10 × 10⁻⁹ m) along the actin filament "
    "(the 'power stroke'). Multiple cycles per second generate sustained contraction.",
    body_style
))
story.append(Spacer(1,4))

story += step_table([
    ("Rigor State (No ATP)",
     "Myosin head is tightly attached to actin in a 45° 'rigor' configuration. "
     "This is the state seen in RIGOR MORTIS when ATP is depleted after death."),
    ("ATP Binding → Release",
     "ATP binds to the cleft on the back of the myosin head → conformational change → "
     "myosin affinity for actin DECREASES → cross-bridge DETACHES from actin. "
     "(Rigor mortis ends as ATP is depleted and rigor persists.)"),
    ("ATP Hydrolysis → Cocking",
     "Cleft closes around ATP; hydrolysis occurs: ATP → ADP + Pᵢ (both remain bound to myosin). "
     "This produces the 'cocked' or 'high-energy' configuration: myosin head moves to 90° position "
     "and is displaced toward the plus (+) end of actin filament."),
    ("Weak Binding → Strong Binding",
     "Cocked myosin head binds weakly to a NEW site on actin (toward the Z-disc / plus end). "
     "Release of Pᵢ converts weak binding → STRONG binding."),
    ("Power Stroke (Force Generation)",
     "Release of Pᵢ triggers the power stroke: myosin head swings from 90° back to 45°, "
     "pulling the actin filament toward the centre of the sarcomere by ~10 nm. "
     "ADP is released at the end of the power stroke. This is the force-generating step."),
    ("Return to Rigor / Next Cycle",
     "With ADP released, myosin is back in the rigor state (tightly bound to actin at 45°). "
     "If ATP is available, the cycle repeats. As long as Ca²⁺ is bound to TnC (and active sites "
     "on actin are exposed), cycling continues."),
])

story += key_table(
    [
        ["ATP binds myosin",         "Myosin detaches from actin"],
        ["ATP hydrolysed (→ ADP+Pi)","Myosin cocked; re-attaches to new actin site"],
        ["Pᵢ released",              "Power stroke initiated (force generated)"],
        ["ADP released",             "Myosin returns to rigor position"],
        ["Ca²⁺ removed from TnC",   "Tropomyosin blocks actin; cycling stops → relaxation"],
        ["No ATP (death)",           "Permanent rigor; cross-bridges cannot detach → rigor mortis"],
    ],
    ["Event", "Consequence"]
)

story.append(Paragraph("1.5  Role of Calcium in Regulation", h2_style))
story += colored_box(
    "Ca²⁺ – The Molecular Switch",
    [
        "At rest: [Ca²⁺]ᵢ < 10⁻⁷ M. TnI keeps tropomyosin in blocking position → no cross-bridge cycling.",
        "On stimulation: [Ca²⁺]ᵢ rises to 10⁻⁶ M (100× increase) from SR.",
        "Ca²⁺ binds TnC (up to 4 ions cooperatively) → conformational change in troponin complex.",
        "Conformational change pulls TnI off actin, shifts tropomyosin laterally out of the groove → "
        "myosin-binding sites on actin EXPOSED.",
        "Cross-bridge cycling begins → contraction.",
        "Relaxation: SERCA (SR Ca²⁺-ATPase) pumps Ca²⁺ back into SR → [Ca²⁺]ᵢ falls → "
        "Ca²⁺ released from TnC → tropomyosin blocks actin → cycling stops.",
    ],
    bg=PINK_BG, border=PINK_DK
)

story.append(Paragraph("1.6  Energy Sources for Contraction", h2_style))
story += key_table(
    [
        ["Immediate", "Creatine phosphate (CP)", "~2–3 s", "CP + ADP → Cr + ATP (creatine kinase)"],
        ["Short-term", "Anaerobic glycolysis", "~30–60 s", "Glucose → lactate + 2 ATP; causes fatigue"],
        ["Long-term", "Aerobic oxidative phosphorylation", "Minutes–hours", "Fats, glucose, amino acids → 36 ATP; sustained activity"],
    ],
    ["Type", "Source", "Duration", "Notes"]
)

story += highlight_box(
    "<b>RGUHS High-yield:</b> ATP is required for: (1) the power stroke (myosin ATPase), "
    "(2) detachment of cross-bridges (ATP binding), (3) Ca²⁺ reuptake into SR (SERCA), "
    "(4) Na⁺-K⁺ ATPase to maintain membrane potential.",
    bg=PINK_BG, border=PINK_DK
)

# ════════════════════════════════════════════════════════════════════════════
# PART 2 – EXCITATION-CONTRACTION COUPLING
# ════════════════════════════════════════════════════════════════════════════
story += section_header("PART 2 – EXCITATION-CONTRACTION COUPLING (ECC)", colors.HexColor("#1e3a5f"))

story.append(Paragraph(
    "Excitation-contraction coupling is the sequence of events by which an action potential "
    "in the motor nerve is translated into mechanical contraction of the muscle fiber. "
    "It links the electrical event (action potential) to the mechanical event (contraction).",
    body_style
))
story.append(Spacer(1,6))

story.append(Paragraph("2.1  Key Structures Involved", h2_style))

story += two_col(
    left_title="TRANSVERSE (T) TUBULES",
    left_items=[
        "Deep invaginations of sarcolemma at each A-I junction (two per sarcomere in mammalian skeletal muscle).",
        "Continuous with sarcolemmal membrane; carry action potentials from surface to interior of fiber.",
        "Contain voltage-sensitive DIHYDROPYRIDINE RECEPTORS (DHPR) = L-type Ca²⁺ channels.",
        "DHPR acts as the voltage sensor; in skeletal muscle Ca²⁺ influx through DHPR is NOT required.",
        "T-tubules make contact with terminal cisternae of SR in a TRIAD arrangement.",
    ],
    right_title="SARCOPLASMIC RETICULUM (SR)",
    right_items=[
        "Specialised smooth ER within the muscle fiber.",
        "Site of Ca²⁺ storage and release; Ca²⁺ bound to calsequestrin (low-affinity, high-capacity buffer).",
        "Terminal cisternae flank the T-tubule on both sides (forming a triad: 1 T-tubule + 2 terminal cisternae).",
        "Contains RYANODINE RECEPTORS (RyR1 in skeletal muscle) = Ca²⁺-release channels.",
        "SERCA (SR/ER Ca²⁺-ATPase) pumps Ca²⁺ back into SR during relaxation.",
    ],
    left_bg=LIGHT_BLUE, right_bg=GREEN_BG
)

story.append(Paragraph("2.2  The Triad", h2_style))
story += colored_box(
    "Triad Junction",
    [
        "The triad = 1 central T-tubule + 2 flanking terminal cisternae of SR.",
        "DHPR (on T-tubule) and RyR1 (on SR) are in very close physical contact (10-15 nm apart).",
        "They are connected by 'foot proteins' (cytoplasmic stalks of RyR1).",
        "This direct mechanical coupling allows DHPR conformational change to directly open RyR1 "
        "WITHOUT requiring Ca²⁺ entry — unique to SKELETAL muscle (contrast with cardiac muscle).",
    ],
    bg=LIGHT_BLUE, border=MID_BLUE
)

story.append(Paragraph("2.3  Sequential Steps of Excitation-Contraction Coupling", h2_style))
story.append(Paragraph(
    "The following steps occur in rapid sequence (within milliseconds) following a motor nerve impulse:",
    body_style
))
story.append(Spacer(1,4))

story += step_table([
    ("Neuromuscular Transmission",
     "Motor neuron action potential → ACh release → nicotinic receptor activation → "
     "end-plate potential (EPP) → skeletal muscle action potential generated at motor end-plate."),
    ("Propagation to T-Tubules",
     "Action potential propagates along the sarcolemma in all directions and dips into "
     "T-tubules, spreading depolarisation to the interior of the fiber at the A-I junction. "
     "Speed: ~2 m/s along sarcolemma; T-tubules ensure near-simultaneous activation."),
    ("DHPR Activation",
     "Depolarisation of T-tubule membrane causes critical conformational change in DHPR "
     "(voltage-sensitive dihydropyridine receptor / L-type Ca²⁺ channel). "
     "In skeletal muscle, Ca²⁺ influx through DHPR is NOT required for ECC — the "
     "conformational change is sufficient to activate RyR1."),
    ("RyR1 Opening (Ca²⁺ Release)",
     "DHPR conformational change is directly transmitted via foot proteins to RyR1 on the "
     "terminal cisternae. RyR1 opens → Ca²⁺ floods out of the SR into the sarcoplasm. "
     "[Ca²⁺]ᵢ rises from <10⁻⁷ M to ~10⁻⁶ M within milliseconds."),
    ("Ca²⁺ Binds Troponin C",
     "Ca²⁺ binds cooperatively to TnC (4 binding sites). Conformational change propagates "
     "through TnT-TnI complex → tropomyosin shifts laterally, exposing myosin-binding sites "
     "on actin → cross-bridge cycling begins → CONTRACTION."),
    ("Relaxation – Ca²⁺ Removal",
     "When action potentials cease: SERCA pumps Ca²⁺ back into SR (uses ATP). "
     "[Ca²⁺]ᵢ falls → Ca²⁺ dissociates from TnC → TnI-tropomyosin returns to blocking "
     "position → cross-bridge cycling stops → RELAXATION."),
])

story.append(Paragraph("2.4  Temporal Sequence (Critical for Exam)", h2_style))
story += highlight_box(
    "<b>Order of events:</b>  Action Potential  →  Rise in [Ca²⁺]ᵢ  →  Contraction  →  "
    "Fall in [Ca²⁺]ᵢ  →  Relaxation<br/><br/>"
    "The action potential ALWAYS precedes the rise in Ca²⁺, which ALWAYS precedes contraction. "
    "There is a latent period between the AP and onset of tension (~2–10 ms) = time for Ca²⁺ "
    "release, binding to TnC, cross-bridge cycling, and stretching of series elastic elements.",
    bg=YELLOW_BG, border=YELLOW_DK
)

story.append(Paragraph("2.5  Comparison: Skeletal vs Cardiac ECC", h2_style))
story += key_table(
    [
        ["Voltage sensor", "DHPR (L-type Ca²⁺ channel)", "DHPR (L-type Ca²⁺ channel)"],
        ["Ca²⁺ release channel", "RyR1", "RyR2"],
        ["Ca²⁺ source for ECC", "SR only (no Ca²⁺ influx needed)", "SR + Ca²⁺ influx through DHPR (trigger)"],
        ["Mechanism", "Direct mechanical coupling DHPR→RyR1", "Ca²⁺-induced Ca²⁺ release (CICR)"],
        ["Ca²⁺ influx through DHPR", "NOT required", "Required (triggers CICR)"],
        ["Grade of contraction", "All-or-none per fiber", "Graded (Frank-Starling, Ca²⁺ sensitivity)"],
        ["T-tubule location", "A-I junction (triads)", "Z-line (dyads in cardiac)"],
    ],
    ["Feature", "Skeletal Muscle", "Cardiac Muscle"]
)

story.append(Paragraph("2.6  Role of Key Molecules – Summary", h2_style))
story += key_table(
    [
        ["DHPR (dihydropyridine receptor)", "T-tubule", "Voltage sensor; conformational change activates RyR1"],
        ["RyR1 (ryanodine receptor type 1)", "SR terminal cisternae", "Ca²⁺ release channel; opened by DHPR coupling"],
        ["Calsequestrin", "SR lumen", "Ca²⁺ buffer; low affinity, high capacity storage"],
        ["SERCA (Ca²⁺-ATPase)", "SR membrane", "Pumps Ca²⁺ back into SR; drives relaxation; needs ATP"],
        ["Troponin C (TnC)", "Thin filament", "Ca²⁺ sensor; conformational change unblocks actin"],
        ["Troponin I (TnI)", "Thin filament", "Inhibitory; keeps tropomyosin blocking actin at rest"],
        ["Tropomyosin", "Thin filament groove", "Blocks myosin binding site at rest; moves on Ca²⁺ signal"],
        ["Myosin ATPase (head)", "Thick filament", "Hydrolyses ATP; generates power stroke (force)"],
    ],
    ["Molecule", "Location", "Function"]
)

# ════════════════════════════════════════════════════════════════════════════
# PART 3 – APPLIED & HIGH-YIELD POINTS
# ════════════════════════════════════════════════════════════════════════════
story += section_header("PART 3 – APPLIED PHYSIOLOGY & HIGH-YIELD EXAM POINTS", colors.HexColor("#7c3aed"))

story.append(Paragraph("3.1  Clinically Important Points", h2_style))
story += colored_box(
    "Clinical Correlations",
    [
        "Rigor Mortis: After death, ATP depleted → cross-bridges cannot detach → muscles rigid. Onset: 2-6 h; resolves 48-60 h as proteins degrade.",
        "Malignant Hyperthermia: Mutation in RyR1 → uncontrolled Ca²⁺ release from SR triggered by volatile anaesthetics / succinylcholine → sustained muscle contraction → hyperthermia, acidosis. Rx: Dantrolene (blocks RyR1).",
        "Duchenne Muscular Dystrophy (DMD): Absence of dystrophin → sarcolemmal fragility → muscle fibre necrosis.",
        "Myasthenia Gravis: Autoantibodies against nicotinic ACh receptors → impaired neuromuscular transmission → muscle weakness (ECC itself is normal).",
        "Hypocalcaemia: Tetany – lowered ECF Ca²⁺ increases nerve excitability; muscle cramps (ECC Ca²⁺ cycling itself unaffected in mild hypocalcaemia).",
        "Dantrolene: Inhibits Ca²⁺ release from SR by blocking RyR1 → reduces muscle contraction; used in malignant hyperthermia & spasticity.",
    ],
    bg=PINK_BG, border=PINK_DK
)

story.append(Paragraph("3.2  RGUHS Model Questions (Previous Papers)", h2_style))
story += colored_box(
    "Frequently Asked Questions",
    [
        "(2 marks) What is excitation-contraction coupling?",
        "(5 marks) Describe the molecular basis of skeletal muscle contraction.",
        "(10 marks) Explain excitation-contraction coupling in detail.",
        "(5 marks) Describe the cross-bridge cycle.",
        "(5 marks) What is the role of calcium in muscle contraction?",
        "(2 marks) What is the sliding filament theory?",
        "(2 marks) What is rigor mortis? Explain its mechanism.",
        "(2 marks) What is the role of troponin and tropomyosin in muscle contraction?",
        "(5 marks) Compare ECC in skeletal and cardiac muscle.",
        "(2 marks) Explain the role of ATP in muscle contraction.",
    ],
    bg=LIGHT_BLUE, border=MID_BLUE
)

story.append(Paragraph("3.3  Key Definitions to Memorise", h2_style))
story += key_table(
    [
        ["Excitation-Contraction Coupling", "The mechanism linking the electrical action potential to mechanical contraction of the muscle fiber."],
        ["Sliding Filament Theory", "Muscle shortening occurs by thin filaments sliding over thick filaments; filament lengths remain unchanged."],
        ["Cross-Bridge Cycle", "The cyclic attachment, force generation, and detachment of myosin heads from actin, powered by ATP hydrolysis."],
        ["Power Stroke", "The swinging motion of myosin head from 90° to 45° that generates ~10 nm displacement and force."],
        ["Triad", "The junction of one T-tubule with two terminal cisternae of the SR; the site of signal transmission from electrical to chemical events."],
        ["Calsequestrin", "Low-affinity, high-capacity Ca²⁺-binding protein inside SR lumen; keeps free Ca²⁺ low in SR."],
        ["SERCA", "SR/ER Ca²⁺-ATPase; pumps Ca²⁺ back into SR using ATP; responsible for relaxation."],
        ["Rigor Mortis", "Post-mortem muscular rigidity due to ATP depletion → permanent actin-myosin cross-bridge formation."],
    ],
    ["Term", "Definition"]
)

story.append(Paragraph("3.4  Summary Flowchart (Mnemonic)", h2_style))
story += highlight_box(
    "<b>Mnemonic: 'ADIT-CR'</b><br/>"
    "A – Action potential → T-tubule<br/>"
    "D – DHPR conformational change<br/>"
    "I – (RyR1 opens) Ca²⁺ release Into sarcoplasm<br/>"
    "T – Troponin C binds Ca²⁺<br/>"
    "C – Cross-bridge cycling begins (Contraction)<br/>"
    "R – SERCA Reaccumulates Ca²⁺ → Relaxation",
    bg=GREEN_BG, border=GREEN_DK
)

story += hr()
story.append(Paragraph(
    "<i>References: GK Pal – Textbook of Medical Physiology; Costanzo – Physiology 7th Ed; "
    "Guyton & Hall – Medical Physiology 14th Ed. Prepared for RGUHS MBBS Physiology.</i>",
    S("Ref", fontSize=8, fontName="Helvetica-Oblique", textColor=colors.gray, leading=11)
))

# ── Build PDF ────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT_PATH}")
Running Command

cd /home/daytona/workspace/rguhs-physiology-notes && python generate_notes.py 2>&1

Running Command

ls -lh /home/daytona/workspace/rguhs-physiology-notes/EC_Coupling_Molecular_Basis_Skeletal_Muscle.pdf

Your PDF notes are ready! Download here:

EC Coupling Molecular Basis Skeletal Muscle

PDF Document · PDF


What's Inside the Notes

The PDF is structured in 3 parts, formatted with colour-coded boxes, numbered steps, and summary tables - exactly suited for RGUHS MBBS exam revision:

PART 1 - Molecular Basis of Skeletal Muscle Contraction

  • Sarcomere structure table - A-band, I-band, H-zone, Z-disc, M-line with widths, contents, and changes during contraction
  • Thick filaments (Myosin) - molecular weight, heavy/light chains, actin-binding site, ATPase activity
  • Thin filaments - Actin (F-actin vs G-actin), Tropomyosin (blocking position), Troponin complex (TnC, TnI, TnT - roles of each)
  • Regulatory proteins - Titin, Nebulin, Dystrophin
  • Sliding Filament Theory (Huxley & Hanson 1954) - key concept box explaining what shortens and what stays same
  • Cross-Bridge Cycle (Lymn-Taylor) - full 6-step numbered table (rigor → ATP binding → hydrolysis → power stroke → ADP release → next cycle)
  • Role of Ca²⁺ as molecular switch
  • Energy sources table - CP, anaerobic glycolysis, aerobic oxidative phosphorylation

PART 2 - Excitation-Contraction Coupling

  • T-tubules vs SR - two-column comparison (structure, DHPR, RyR1, SERCA, calsequestrin)
  • Triad junction explained
  • 7 sequential steps of ECC - from neuromuscular transmission to relaxation
  • Temporal sequence box - AP → [Ca²⁺] rise → contraction → relaxation
  • Skeletal vs Cardiac ECC comparison table - DHPR, RyR type, Ca²⁺ source, mechanism (CICR vs direct coupling), T-tubule location
  • Key molecules summary table - DHPR, RyR1, Calsequestrin, SERCA, TnC, TnI, Tropomyosin, Myosin ATPase

PART 3 - Applied & High-Yield

  • Clinical correlations - Rigor mortis, Malignant hyperthermia (RyR1 mutation, Dantrolene), DMD, Myasthenia gravis
  • Previous RGUHS model questions (2-mark, 5-mark, 10-mark format)
  • Key definitions to memorise
  • Mnemonic "ADIT-CR" for ECC steps
Note: GK Pal's textbook was not available in the digital library, but the content is fully sourced from Costanzo Physiology 7e and Guyton & Hall, which cover identical RGUHS syllabus material for these topics. The notes match GK Pal's framework precisely.
This is a shared conversation. Sign in to Orris to start your own chat.