Cryopreservestion m pharm 1 sem presentation in unique way

Asking for Preferences
Reading File
Reading File
Searching the Web

cryopreservation pharmaceutics M.Pharm topics principles methods cryoprotectants

Reading File
Finding Sources
Reading File
Finding Sources
Reading Web Page

https://www.intechopen.com/chapters/64165

Running Command

mkdir -p /tmp/workspace/cryopreservation-pptx && ls /tmp/workspace/cryopreservation-pptx/

Writing File

~/cryopreservation-pptx/build_pptx.py

"""
Cryopreservation – M.Pharm 1st Semester Presentation
Unique design: Ice-blue & deep-space dark theme with gradient accent bars,
icon-style emoji headers, timeline mechanics, and infographic layouts.
"""

from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.oxml.ns import qn
from pptx.oxml import parse_xml
from lxml import etree
import copy

# ── Color Palette ───────────────────────────────────────────────────────────
BG_DARK      = RGBColor(0x04, 0x10, 0x24)   # deep navy
BG_CARD      = RGBColor(0x07, 0x1A, 0x38)   # card navy
ACCENT_ICE   = RGBColor(0x00, 0xC8, 0xFF)   # electric ice blue
ACCENT_TEAL  = RGBColor(0x00, 0xFF, 0xC8)   # teal mint
ACCENT_GOLD  = RGBColor(0xFF, 0xD7, 0x00)   # gold highlight
ACCENT_RED   = RGBColor(0xFF, 0x45, 0x5C)   # warning red
WHITE        = RGBColor(0xFF, 0xFF, 0xFF)
LIGHT_GREY   = RGBColor(0xB8, 0xCC, 0xDD)
MID_GREY     = RGBColor(0x5A, 0x7A, 0x9A)

W = Inches(13.333)
H = Inches(7.5)

prs = Presentation()
prs.slide_width  = W
prs.slide_height = H
blank = prs.slide_layouts[6]

# ── Helpers ─────────────────────────────────────────────────────────────────

def fill_bg(slide, color=BG_DARK):
    """Solid background rectangle."""
    bg = slide.shapes.add_shape(1, 0, 0, W, H)   # MSO_SHAPE_TYPE.RECTANGLE = 1
    bg.fill.solid()
    bg.fill.fore_color.rgb = color
    bg.line.fill.background()

def add_rect(slide, x, y, w, h, color, alpha=None):
    s = slide.shapes.add_shape(1, x, y, w, h)
    s.fill.solid()
    s.fill.fore_color.rgb = color
    s.line.fill.background()
    return s

def add_tb(slide, x, y, w, h, text, size, bold=False, color=WHITE,
           align=PP_ALIGN.LEFT, italic=False, wrap=True):
    tb = slide.shapes.add_textbox(x, y, w, h)
    tf = tb.text_frame
    tf.word_wrap = wrap
    tf.margin_left = 0; tf.margin_right = 0
    tf.margin_top  = 0; tf.margin_bottom = 0
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.size  = Pt(size)
    run.font.bold  = bold
    run.font.italic = italic
    run.font.color.rgb = color
    run.font.name  = "Calibri"
    return tb

def add_para(slide, x, y, w, h, lines, size=13, color=LIGHT_GREY,
             bullet=False, line_spacing=1.3):
    """Multi-line text with optional bullet circles."""
    tb = slide.shapes.add_textbox(x, y, w, h)
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left  = Inches(0.05)
    tf.margin_right = Inches(0.05)
    tf.margin_top   = 0
    tf.margin_bottom = 0
    first = True
    for line in lines:
        if first:
            p = tf.paragraphs[0]; first = False
        else:
            p = tf.add_paragraph()
        if bullet:
            p.space_before = Pt(4)
        run = p.add_run()
        run.text = ("  β€’  " if bullet else "") + line
        run.font.size  = Pt(size)
        run.font.color.rgb = color
        run.font.name  = "Calibri"
    return tb

def accent_bar(slide, y_frac=0.0, height=Inches(0.07),
               color=ACCENT_ICE, width_frac=1.0):
    """Horizontal accent bar."""
    add_rect(slide,
             0, int(H * y_frac),
             int(W * width_frac), height,
             color)

def card(slide, x, y, w, h, color=BG_CARD):
    add_rect(slide, x, y, w, h, color)

def section_header_bar(slide, title, subtitle=""):
    fill_bg(slide)
    # top accent line
    accent_bar(slide, y_frac=0, height=Inches(0.08), color=ACCENT_ICE)
    # centre glow rectangle
    add_rect(slide,
             Inches(1.5), Inches(2.2),
             Inches(10.3), Inches(3.2),
             RGBColor(0x00, 0x35, 0x60))
    # left edge accent
    add_rect(slide,
             Inches(1.4), Inches(2.2),
             Inches(0.12), Inches(3.2),
             ACCENT_ICE)
    add_tb(slide,
           Inches(1.8), Inches(2.5),
           Inches(9.5), Inches(1.5),
           title, 44, bold=True, color=ACCENT_ICE, align=PP_ALIGN.CENTER)
    if subtitle:
        add_tb(slide,
               Inches(1.8), Inches(3.8),
               Inches(9.5), Inches(0.8),
               subtitle, 20, color=LIGHT_GREY, align=PP_ALIGN.CENTER)

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 1 – Title Slide
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)

# Top & bottom accent lines
accent_bar(s, 0,       Inches(0.09), ACCENT_ICE)
accent_bar(s, 0.97,    Inches(0.09), ACCENT_TEAL)

# Decorative ice circles (large blurred look via stacked shapes)
for radius, alpha_color in [
    (Inches(3.5), RGBColor(0x00, 0x40, 0x70)),
    (Inches(2.4), RGBColor(0x00, 0x55, 0x90)),
    (Inches(1.3), RGBColor(0x00, 0x70, 0xB0)),
]:
    cx = Inches(11.5); cy = Inches(1.5)
    circ = s.shapes.add_shape(9, cx - radius/2, cy - radius/2, radius, radius)  # 9=oval
    circ.fill.solid(); circ.fill.fore_color.rgb = alpha_color
    circ.line.fill.background()

# Title block
add_rect(s, Inches(0.4), Inches(2.0), Inches(8.2), Inches(0.07), ACCENT_ICE)
add_tb(s,
       Inches(0.4), Inches(1.0),
       Inches(8.5), Inches(1.1),
       "CRYOPRESERVATION", 54, bold=True, color=ACCENT_ICE)
add_tb(s,
       Inches(0.4), Inches(2.25),
       Inches(8.5), Inches(0.6),
       "Preserving Life at the Edge of Absolute Zero", 20,
       italic=True, color=ACCENT_TEAL)

# Subtitle card
add_rect(s, Inches(0.4), Inches(3.1), Inches(6.8), Inches(1.8), BG_CARD)
add_rect(s, Inches(0.4), Inches(3.1), Inches(0.1),  Inches(1.8), ACCENT_GOLD)
lines_sub = [
    "M.Pharm – 1st Semester | Pharmaceutics",
    "Department of Pharmaceutical Sciences",
    "Presented by: [Your Name]"
]
add_para(s, Inches(0.7), Inches(3.2), Inches(6.2), Inches(1.6),
         lines_sub, size=15, color=LIGHT_GREY)

# Bottom tag line
add_tb(s, Inches(0.4), Inches(6.8), Inches(9), Inches(0.5),
       "🧊  Freeze  ·  Protect  ·  Revive  ·  Advance Science",
       14, color=MID_GREY)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 2 – Agenda / Table of Contents
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_ICE)

add_tb(s, Inches(0.5), Inches(0.2), Inches(12), Inches(0.7),
       "πŸ“‹  PRESENTATION AGENDA", 22, bold=True, color=ACCENT_ICE)

agenda_items = [
    ("01", "Introduction & Definition",        "What is cryopreservation?"),
    ("02", "Historical Timeline",              "From ancient ice to modern biobanks"),
    ("03", "Principles & Mechanisms",          "Thermodynamics of freezing & vitrification"),
    ("04", "Cryoprotective Agents (CPAs)",     "Intracellular vs extracellular β€’ DMSO, glycerol, EG"),
    ("05", "Methods of Cryopreservation",      "Slow cooling β€’ Vitrification β€’ Freeze-drying"),
    ("06", "Equipment & Storage",              "Controlled-rate freezer β€’ Liquid nitrogen"),
    ("07", "Applications in Pharmacy",         "Biologics, stem cells, organs, germ cells"),
    ("08", "Cryoinjury & Solutions",           "Ice crystal damage β€’ Osmotic stress β€’ ROS"),
    ("09", "Current Advances & Future Scope",  "AI-driven protocols β€’ Nano-cryoprotectants"),
    ("10", "Summary & References",             "Key take-aways"),
]

cols = 2
rows_per_col = 5
col_w = Inches(6.2)
row_h = Inches(1.13)

for i, (num, title, sub) in enumerate(agenda_items):
    col = i // rows_per_col
    row = i %  rows_per_col
    x = Inches(0.3) + col * col_w
    y = Inches(0.95) + row * row_h

    card(s, x, y, col_w - Inches(0.15), row_h - Inches(0.08))
    # number badge
    add_rect(s, x, y, Inches(0.55), row_h - Inches(0.08), ACCENT_ICE)
    add_tb(s, x, y + Inches(0.15), Inches(0.55), Inches(0.6),
           num, 18, bold=True, color=BG_DARK, align=PP_ALIGN.CENTER)
    add_tb(s, x + Inches(0.65), y + Inches(0.05),
           col_w - Inches(0.9), Inches(0.5),
           title, 13, bold=True, color=WHITE)
    add_tb(s, x + Inches(0.65), y + Inches(0.52),
           col_w - Inches(0.9), Inches(0.45),
           sub, 11, color=MID_GREY, italic=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 3 – Introduction & Definition
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_ICE)

add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "01  |  INTRODUCTION & DEFINITION", 22, bold=True, color=ACCENT_ICE)

# Big definition card
card(s, Inches(0.4), Inches(0.9), Inches(12.5), Inches(1.9), RGBColor(0x00, 0x28, 0x50))
add_rect(s, Inches(0.4), Inches(0.9), Inches(0.12), Inches(1.9), ACCENT_TEAL)
add_tb(s, Inches(0.65), Inches(0.98), Inches(11.8), Inches(0.5),
       "DEFINITION", 12, bold=True, color=ACCENT_TEAL)
add_tb(s, Inches(0.65), Inches(1.3), Inches(11.8), Inches(1.3),
       '"Cryopreservation is the process of cooling and storing biological materials '
       '(cells, tissues, organs) at ultra-low temperatures (≀ βˆ’80Β°C to βˆ’196Β°C) to '
       'halt all metabolic and biochemical activity, thereby preserving viability for '
       'future use without significant damage."',
       16, italic=True, color=WHITE, wrap=True)

# 4 key fact cards
facts = [
    ("🌑️", "Temperature Range", "βˆ’80Β°C (mechanical)\nto βˆ’196Β°C (liquid Nβ‚‚)"),
    ("⏸️", "Core Goal",         "Halt metabolism &\nextend shelf life"),
    ("🧫", "Materials",         "Cells, tissues,\norgans, embryos"),
    ("πŸ’Š", "Pharma Relevance",  "Biologics, vaccines,\nstem-cell therapies"),
]
fx = Inches(0.4)
for icon, title, body in facts:
    card(s, fx, Inches(3.0), Inches(2.9), Inches(2.5))
    add_tb(s, fx + Inches(0.1), Inches(3.05), Inches(0.8), Inches(0.8),
           icon, 28, align=PP_ALIGN.CENTER)
    add_tb(s, fx + Inches(0.05), Inches(3.75), Inches(2.7), Inches(0.45),
           title, 13, bold=True, color=ACCENT_ICE)
    add_tb(s, fx + Inches(0.05), Inches(4.15), Inches(2.75), Inches(0.75),
           body, 12, color=LIGHT_GREY, wrap=True)
    fx += Inches(3.22)

# Why it matters
add_tb(s, Inches(0.4), Inches(5.65), Inches(12.5), Inches(0.45),
       "WHY IT MATTERS IN PHARMACY", 14, bold=True, color=ACCENT_GOLD)
wh = [
    "Preserves biological activity of labile drugs (biologics, blood products, vaccines)",
    "Enables global supply chains for stem cells, cord blood, and reproductive medicine",
    "Critical for pharmaceutical R&D – cell-based assays, toxicology studies",
]
add_para(s, Inches(0.4), Inches(6.05), Inches(12.5), Inches(1.35),
         wh, size=13, bullet=True, color=LIGHT_GREY)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 4 – Historical Timeline (Unique horizontal timeline)
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_ICE)
add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "02  |  HISTORICAL TIMELINE", 22, bold=True, color=ACCENT_ICE)

# Timeline spine
add_rect(s, Inches(0.5), Inches(3.55), Inches(12.3), Inches(0.08), ACCENT_TEAL)

events = [
    ("1949", "First CPA\nDiscovered", "Polge: glycerol\nprotects sperm", True),
    ("1959", "Human Sperm\nFreezing", "1st successful\nhuman sperm bank", False),
    ("1972", "Red Blood Cell\nBanking", "Glycerol used for\nlong-term RBC storage", True),
    ("1983", "First IVF from\nFrozen Embryo", "Trounson &\nMohr milestone", False),
    ("1998", "Vitrification\nAdvancement", "Kuwayama protocol\nfor oocytes", True),
    ("2010s", "Stem Cell\nBiobanks", "Global cord blood &\nhematopoietic banks", False),
    ("2020s", "Nano-CPAs\n& AI", "Nanoparticle CPAs,\nAI-optimized protocols", True),
]

n = len(events)
x_step = Inches(12.3) / (n - 1)
x0 = Inches(0.5)
for i, (year, title, desc, above) in enumerate(events):
    cx = x0 + i * x_step
    cy = Inches(3.59)
    # dot
    dot = s.shapes.add_shape(9, cx - Inches(0.12), cy - Inches(0.06),
                             Inches(0.24), Inches(0.24))
    dot.fill.solid(); dot.fill.fore_color.rgb = ACCENT_ICE
    dot.line.fill.background()
    # vertical stem
    stem_h = Inches(1.0)
    if above:
        sy = cy - stem_h - Inches(0.12)
        add_rect(s, cx - Inches(0.02), sy, Inches(0.04), stem_h, MID_GREY)
        # card
        cx_card = max(Inches(0.3), cx - Inches(0.85))
        card(s, cx_card, sy - Inches(1.4), Inches(1.7), Inches(1.5),
             RGBColor(0x05, 0x20, 0x40))
        add_tb(s, cx_card + Inches(0.05), sy - Inches(1.35),
               Inches(1.6), Inches(0.38),
               year, 13, bold=True, color=ACCENT_GOLD)
        add_tb(s, cx_card + Inches(0.05), sy - Inches(1.05),
               Inches(1.6), Inches(0.5),
               title, 11, bold=True, color=WHITE, wrap=True)
        add_tb(s, cx_card + Inches(0.05), sy - Inches(0.6),
               Inches(1.6), Inches(0.6),
               desc, 9, color=MID_GREY, wrap=True)
    else:
        add_rect(s, cx - Inches(0.02), cy + Inches(0.12),
                 Inches(0.04), stem_h, MID_GREY)
        cx_card = max(Inches(0.3), cx - Inches(0.85))
        card(s, cx_card, cy + stem_h + Inches(0.1), Inches(1.7), Inches(1.5),
             RGBColor(0x05, 0x20, 0x40))
        add_tb(s, cx_card + Inches(0.05),
               cy + stem_h + Inches(0.12),
               Inches(1.6), Inches(0.38),
               year, 13, bold=True, color=ACCENT_GOLD)
        add_tb(s, cx_card + Inches(0.05),
               cy + stem_h + Inches(0.42),
               Inches(1.6), Inches(0.5),
               title, 11, bold=True, color=WHITE, wrap=True)
        add_tb(s, cx_card + Inches(0.05),
               cy + stem_h + Inches(0.87),
               Inches(1.6), Inches(0.6),
               desc, 9, color=MID_GREY, wrap=True)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 5 – Principles & Mechanisms
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_ICE)
add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "03  |  PRINCIPLES & MECHANISMS", 22, bold=True, color=ACCENT_ICE)

# Two main columns
left_x = Inches(0.4)
right_x = Inches(6.8)
col_w2 = Inches(6.1)

# ── Left: Slow Freezing
card(s, left_x, Inches(0.9), col_w2, Inches(6.4), BG_CARD)
add_rect(s, left_x, Inches(0.9), col_w2, Inches(0.55), RGBColor(0x00, 0x55, 0x90))
add_tb(s, left_x + Inches(0.1), Inches(0.94), col_w2, Inches(0.45),
       "❄️  SLOW COOLING / CONTROLLED-RATE FREEZING", 13, bold=True, color=ACCENT_ICE)

sf_pts = [
    "Cooling rate: βˆ’0.5 to βˆ’2Β°C/min",
    "Ice forms extracellularly first β†’ draws water out of cell (osmosis)",
    "Cell becomes concentrated & dehydrated – less intracellular ice",
    "Final plunge into liquid nitrogen at βˆ’196Β°C",
    "Key concern: Heat of Fusion – must be compensated",
    "Controlled-rate freezer programs counteract exothermic heat release",
    "Used for: HPCs, RBCs, sperm, skin, cord blood",
]
add_para(s, left_x + Inches(0.15), Inches(1.55), col_w2 - Inches(0.3), Inches(5.2),
         sf_pts, size=13, bullet=True, color=LIGHT_GREY)

# ── Right: Vitrification
card(s, right_x, Inches(0.9), col_w2, Inches(6.4), BG_CARD)
add_rect(s, right_x, Inches(0.9), col_w2, Inches(0.55), RGBColor(0x00, 0x50, 0x45))
add_tb(s, right_x + Inches(0.1), Inches(0.94), col_w2, Inches(0.45),
       "πŸ”¬  VITRIFICATION (FLASH FREEZING)", 13, bold=True, color=ACCENT_TEAL)

vit_pts = [
    "Rapid cooling: >15,000Β°C/min",
    "Converts liquid directly into amorphous glass-like state",
    "NO ice crystal formation β†’ avoids mechanical cell damage",
    "Requires high CPA concentration (30–50%)",
    "Advantage: superior survival rates (oocytes, embryos)",
    "Drawback: CPA toxicity at high concentrations",
    "Used for: oocytes, embryos, reproductive cells, some tissues",
]
add_para(s, right_x + Inches(0.15), Inches(1.55), col_w2 - Inches(0.3), Inches(5.2),
         vit_pts, size=13, bullet=True, color=LIGHT_GREY)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 6 – Cryoprotective Agents (CPAs)
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_ICE)
add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "04  |  CRYOPROTECTIVE AGENTS (CPAs)", 22, bold=True, color=ACCENT_ICE)

# Header subtitle
add_tb(s, Inches(0.5), Inches(0.72), Inches(12), Inches(0.42),
       "Chemical compounds that prevent freezing injury by reducing ice formation & balancing osmotic pressure",
       14, italic=True, color=ACCENT_TEAL)

# Intracellular CPAs
card(s, Inches(0.4), Inches(1.25), Inches(5.9), Inches(5.7), BG_CARD)
add_rect(s, Inches(0.4), Inches(1.25), Inches(5.9), Inches(0.5), ACCENT_ICE)
add_tb(s, Inches(0.5), Inches(1.28), Inches(5.7), Inches(0.42),
       "INTRACELLULAR (Penetrating) CPAs", 13, bold=True, color=BG_DARK)

ic_cpas = [
    ("DMSO", "Dimethyl Sulfoxide", "Most widely used; HPCs, skin, stem cells; 10% v/v standard"),
    ("Glycerol", "Propane-1,2,3-triol", "Classic CPA; sperm & RBC preservation; non-toxic"),
    ("Ethylene Glycol (EG)", "1,2-Ethanediol", "Low viscosity; preferred in vitrification protocols"),
    ("Propylene Glycol (PG)", "1,2-Propanediol", "Used in embryo & oocyte cryopreservation"),
    ("Methanol", "CH₃OH", "Plant cryopreservation; toxic to mammalian cells"),
]
for j, (name, chem, desc) in enumerate(ic_cpas):
    y_pos = Inches(1.85) + j * Inches(0.98)
    add_rect(s, Inches(0.5), y_pos, Inches(0.08), Inches(0.78), ACCENT_ICE)
    add_tb(s, Inches(0.68), y_pos + Inches(0.02), Inches(4.8), Inches(0.35),
           name, 13, bold=True, color=WHITE)
    add_tb(s, Inches(0.68), y_pos + Inches(0.33), Inches(4.8), Inches(0.22),
           chem, 10, italic=True, color=ACCENT_TEAL)
    add_tb(s, Inches(0.68), y_pos + Inches(0.52), Inches(4.8), Inches(0.35),
           desc, 10, color=LIGHT_GREY, wrap=True)

# Extracellular CPAs
card(s, Inches(6.7), Inches(1.25), Inches(6.2), Inches(5.7), BG_CARD)
add_rect(s, Inches(6.7), Inches(1.25), Inches(6.2), Inches(0.5), ACCENT_TEAL)
add_tb(s, Inches(6.8), Inches(1.28), Inches(6.0), Inches(0.42),
       "EXTRACELLULAR (Non-Penetrating) CPAs", 13, bold=True, color=BG_DARK)

ec_cpas = [
    ("Sucrose", "Disaccharide", "Osmotic dehydration buffer; vitrification additive"),
    ("Trehalose", "Non-reducing sugar", "Protects membrane; used in dry preservation"),
    ("Dextran", "Polysaccharide", "Reduces extracellular ice; macromolecule"),
    ("Polyvinylpyrrolidone (PVP)", "Synthetic polymer", "Blood cell & sperm preservation"),
    ("Hydroxyethyl Starch (HES)", "Colloid", "Volume expander; granulocyte & RBC banking"),
]
for j, (name, chem, desc) in enumerate(ec_cpas):
    y_pos = Inches(1.85) + j * Inches(0.98)
    add_rect(s, Inches(6.8), y_pos, Inches(0.08), Inches(0.78), ACCENT_TEAL)
    add_tb(s, Inches(6.98), y_pos + Inches(0.02), Inches(5.5), Inches(0.35),
           name, 13, bold=True, color=WHITE)
    add_tb(s, Inches(6.98), y_pos + Inches(0.33), Inches(5.5), Inches(0.22),
           chem, 10, italic=True, color=ACCENT_ICE)
    add_tb(s, Inches(6.98), y_pos + Inches(0.52), Inches(5.5), Inches(0.35),
           desc, 10, color=LIGHT_GREY, wrap=True)

# Mechanism note bar
add_rect(s, Inches(0.4), Inches(7.05), Inches(12.5), Inches(0.38),
         RGBColor(0x00, 0x30, 0x50))
add_tb(s, Inches(0.55), Inches(7.08), Inches(12), Inches(0.32),
       "Mechanism: CPAs ↑ solute concentration β†’ ↓ ice formed at any temperature | "
       "Also lower glass-transition temperature (Tg) enabling vitrification",
       11, italic=True, color=ACCENT_TEAL)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 7 – Methods of Cryopreservation
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_ICE)
add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "05  |  METHODS OF CRYOPRESERVATION", 22, bold=True, color=ACCENT_ICE)

methods = [
    ("❄️", "Slow Cooling\n(Controlled-Rate)",
     ["Rate: βˆ’0.5 to βˆ’2Β°C/min", "Uses controlled-rate freezer", "Compensates heat of fusion",
      "Final storage: βˆ’80Β°C to βˆ’196Β°C", "Best for: HPCs, sperm, RBCs"],
     ACCENT_ICE),
    ("⚑", "Vitrification\n(Ultra-rapid)",
     ["Rate: >15,000Β°C/min", "Direct liquid β†’ glass transition", "No ice crystal formation",
      "High CPA concentration needed", "Best for: oocytes, embryos"],
     ACCENT_TEAL),
    ("🌬️", "Freeze-Drying\n(Lyophilization)",
     ["Sublimation under vacuum", "Removes water without thawing", "Structural bone, some proteins",
      "Long shelf life (5 yr – indefinite)", "No liquid nitrogen required"],
     ACCENT_GOLD),
    ("🧊", "Dry Ice\n(Intermediate)",
     ["Temperature: βˆ’78Β°C", "COβ‚‚ sublimation medium", "Short-term transport",
      "Not suitable for long-term", "Used for: shipping biologics"],
     RGBColor(0xC0, 0x80, 0xFF)),
]

mx = Inches(0.35)
for icon, title, pts, col in methods:
    card(s, mx, Inches(0.9), Inches(3.05), Inches(5.9), BG_CARD)
    add_rect(s, mx, Inches(0.9), Inches(3.05), Inches(0.9), col)
    add_tb(s, mx + Inches(0.05), Inches(0.95), Inches(0.7), Inches(0.78),
           icon, 30, align=PP_ALIGN.CENTER)
    add_tb(s, mx + Inches(0.7), Inches(0.95), Inches(2.2), Inches(0.78),
           title, 12, bold=True, color=BG_DARK, wrap=True)
    add_para(s, mx + Inches(0.1), Inches(1.9), Inches(2.75), Inches(4.5),
             pts, size=12, bullet=True, color=LIGHT_GREY)
    mx += Inches(3.32)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 8 – Equipment & Storage
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_ICE)
add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "06  |  EQUIPMENT & STORAGE", 22, bold=True, color=ACCENT_ICE)

equip = [
    ("πŸ–₯️", "Controlled-Rate Freezer",
     "Programmable device that freezes at precise rates (βˆ’1Β°C/min). "
     "Compensates for heat of fusion. Ensures uniform ice front propagation.",
     ACCENT_ICE),
    ("🧊", "Liquid Nitrogen Dewar",
     "Stores samples at βˆ’150Β°C (vapor) or βˆ’196Β°C (liquid phase). "
     "Long-term storage vessel. 5-year minimum expiry for most tissues.",
     ACCENT_TEAL),
    ("🧫", "Cryovials / Straws",
     "Polypropylene tubes (1–2 mL) or thin straws used for cell/embryo storage. "
     "Color-coded for sample tracking. Withstand liquid Nβ‚‚ immersion.",
     ACCENT_GOLD),
    ("🌑️", "Mechanical Freezer",
     "Ultra-low temperature (βˆ’80Β°C) short-to-mid-term option. "
     "Used before LNβ‚‚ plunge or as standalone for some tissues.",
     RGBColor(0xFF, 0x80, 0x40)),
    ("πŸ’»", "LIMS / Biobank Software",
     "Laboratory Information Management System. Tracks sample ID, location, "
     "donor, date, and viability. Critical for regulatory compliance (GMP/GLP).",
     RGBColor(0xC0, 0x80, 0xFF)),
    ("πŸ”¬", "Cryo-Microscope",
     "Monitors ice crystal formation in real time during freezing. "
     "Used in research to optimize CPA concentration and cooling protocols.",
     RGBColor(0x80, 0xFF, 0x80)),
]

ex = Inches(0.35)
ey = Inches(0.9)
for idx, (icon, name, desc, col) in enumerate(equip):
    if idx == 3:
        ex = Inches(0.35); ey = Inches(4.15)
    card(s, ex, ey, Inches(4.1), Inches(3.0), BG_CARD)
    add_rect(s, ex, ey, Inches(4.1), Inches(0.5), col)
    add_tb(s, ex + Inches(0.08), ey + Inches(0.04), Inches(0.5), Inches(0.44),
           icon, 22, align=PP_ALIGN.CENTER)
    add_tb(s, ex + Inches(0.6), ey + Inches(0.06), Inches(3.35), Inches(0.44),
           name, 13, bold=True, color=BG_DARK)
    add_tb(s, ex + Inches(0.1), ey + Inches(0.6), Inches(3.8), Inches(2.2),
           desc, 12, color=LIGHT_GREY, wrap=True)
    ex += Inches(4.44)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 9 – Applications in Pharmacy
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_ICE)
add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "07  |  APPLICATIONS IN PHARMACY & MEDICINE", 22, bold=True, color=ACCENT_ICE)

apps = [
    ("🩸", "Blood Banking",
     "Red blood cells (glycerol; βˆ’80Β°C)\nPlatelets (short-term)\nCord blood stem cells (LNβ‚‚; βˆ’196Β°C)"),
    ("🌱", "Stem Cell Therapy",
     "Hematopoietic stem cells (HSC)\nMesenchymal stem cells (MSC)\nInduced pluripotent stem cells (iPSC)"),
    ("🧬", "Reproductive Medicine",
     "Sperm banking (infertility, oncology)\nOocyte & embryo banking (IVF)\nOvarian tissue (cancer patients)"),
    ("πŸ’‰", "Biologics & Vaccines",
     "Monoclonal antibodies (βˆ’80Β°C)\nViral vectors for gene therapy\nAttenuated live vaccines"),
    ("πŸ«€", "Organ Preservation",
     "Heart, kidney, liver (short-term)\nHypothermic machine perfusion\nFuture: whole organ vitrification"),
    ("πŸ”¬", "Research & QC",
     "Cell line banking (ATCC, NCBI)\nReference standards (USP/WHO)\nIn-vitro tox models (frozen hepatocytes)"),
]

ax = Inches(0.35); ay = Inches(0.9)
for idx, (icon, title, body) in enumerate(apps):
    if idx == 3:
        ax = Inches(0.35); ay = Inches(4.2)
    card(s, ax, ay, Inches(4.1), Inches(3.1), BG_CARD)
    add_rect(s, ax, ay, Inches(0.7), Inches(3.1), RGBColor(0x00, 0x35, 0x60))
    add_tb(s, ax + Inches(0.08), ay + Inches(0.15), Inches(0.58), Inches(0.6),
           icon, 26, align=PP_ALIGN.CENTER)
    add_tb(s, ax + Inches(0.8), ay + Inches(0.1), Inches(3.1), Inches(0.5),
           title, 13, bold=True, color=ACCENT_ICE)
    add_tb(s, ax + Inches(0.8), ay + Inches(0.55), Inches(3.15), Inches(2.35),
           body, 12, color=LIGHT_GREY, wrap=True)
    ax += Inches(4.44)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 10 – Cryoinjury & Solutions
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_RED)
add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "08  |  CRYOINJURY – TYPES & SOLUTIONS", 22, bold=True, color=ACCENT_RED)

injuries = [
    ("πŸ”΄", "Intracellular Ice\nFormation (IIF)",
     "Ice crystals pierce membranes & organelles\n→ Irreversible cell death",
     "Use optimized cooling rate\n+ appropriate CPA (DMSO/EG)"),
    ("🟠", "Osmotic Stress\n(Freeze-Thaw)",
     "Shrink-swell response during CPA loading/unloading\n→ Membrane rupture",
     "Stepwise CPA addition & removal\nSerum albumin buffering"),
    ("🟑", "Solution Effect\nInjury",
     "Solute concentration ↑ during freezing\nβ†’ Protein denaturation & pH shift",
     "Rapid cooling to minimize exposure\nOptimize CPA concentration"),
    ("πŸ”΅", "Chilling Injury\n(Above 0Β°C)",
     "Phase transitions in membrane lipids\n→ Leakage before freezing begins",
     "Add sucrose / trehalose\nControl pre-freeze temperature"),
    ("🟣", "Reactive Oxygen\nSpecies (ROS)",
     "Oxidative stress during thawing\n→ DNA damage & apoptosis",
     "Add antioxidants: vitamin E, NAC,\nmelatonin to CPA solution"),
    ("βšͺ", "Thermal Shock\n(Rapid Thawing)",
     "Recrystallization if thaw too slow\n→ Secondary ice damage",
     "Rapid thaw: 37Β°C water bath\nAvoid partial thaw"),
]

ix = Inches(0.35); iy = Inches(0.9)
for idx, (icon, inj, cause, sol) in enumerate(injuries):
    if idx == 3:
        ix = Inches(0.35); iy = Inches(4.3)
    card(s, ix, iy, Inches(4.1), Inches(3.2), BG_CARD)
    # injury header
    add_rect(s, ix, iy, Inches(4.1), Inches(0.45), RGBColor(0x40, 0x00, 0x10))
    add_tb(s, ix + Inches(0.05), iy + Inches(0.03), Inches(0.4), Inches(0.38),
           icon, 18, align=PP_ALIGN.CENTER)
    add_tb(s, ix + Inches(0.45), iy + Inches(0.03), Inches(3.5), Inches(0.38),
           inj, 12, bold=True, color=ACCENT_RED, wrap=True)
    add_tb(s, ix + Inches(0.1), iy + Inches(0.52), Inches(3.8), Inches(0.2),
           "CAUSE:", 10, bold=True, color=ACCENT_GOLD)
    add_tb(s, ix + Inches(0.1), iy + Inches(0.68), Inches(3.8), Inches(0.9),
           cause, 11, color=LIGHT_GREY, wrap=True)
    add_tb(s, ix + Inches(0.1), iy + Inches(1.55), Inches(3.8), Inches(0.2),
           "SOLUTION:", 10, bold=True, color=ACCENT_TEAL)
    add_tb(s, ix + Inches(0.1), iy + Inches(1.72), Inches(3.8), Inches(0.9),
           sol, 11, color=LIGHT_GREY, wrap=True)
    ix += Inches(4.44)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 11 – Freeze-Drying (Lyophilization) Detail
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_GOLD)
add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "05b  |  FREEZE-DRYING (LYOPHILIZATION) – DETAILED", 22, bold=True, color=ACCENT_GOLD)

stages = [
    ("1️⃣", "Pre-treatment\n& Formulation",
     ["Add lyoprotectants: sucrose, mannitol, trehalose",
      "Adjust pH, concentration, buffer system",
      "Fill into vials under sterile conditions"]),
    ("2️⃣", "Freezing",
     ["Temperature lowered to βˆ’40 to βˆ’50Β°C",
      "Product solidifies (forms eutectic mixture)",
      "Controlled rate to ensure uniform ice structure"]),
    ("3️⃣", "Primary Drying\n(Sublimation)",
     ["Pressure reduced to 100–200 mTorr",
      "Ice sublimes directly β†’ water vapor",
      "Shelf temperature: βˆ’10 to βˆ’30Β°C",
      "~70–90% water removed"]),
    ("4️⃣", "Secondary Drying\n(Desorption)",
     ["Shelf temp raised to +20 to +40Β°C",
      "Removes bound (unfrozen) water",
      "Residual moisture <1–3%",
      "Vials sealed under vacuum/nitrogen"]),
]

sx = Inches(0.35)
for icon, stage_name, pts in stages:
    card(s, sx, Inches(0.9), Inches(3.05), Inches(5.9), BG_CARD)
    add_rect(s, sx, Inches(0.9), Inches(3.05), Inches(0.75), ACCENT_GOLD)
    add_tb(s, sx + Inches(0.08), Inches(0.94), Inches(0.6), Inches(0.65),
           icon, 26, align=PP_ALIGN.CENTER)
    add_tb(s, sx + Inches(0.68), Inches(0.96), Inches(2.2), Inches(0.65),
           stage_name, 12, bold=True, color=BG_DARK, wrap=True)
    add_para(s, sx + Inches(0.12), Inches(1.75), Inches(2.75), Inches(4.8),
             pts, size=12, bullet=True, color=LIGHT_GREY)
    sx += Inches(3.32)

# Advantages strip
add_rect(s, Inches(0.35), Inches(6.9), Inches(12.6), Inches(0.55),
         RGBColor(0x20, 0x15, 0x00))
advantages = "βœ” Long shelf life (5 yr+)   βœ” No liquid Nβ‚‚ required   βœ” Easy reconstitution   βœ” Ideal for heat-labile biologics"
add_tb(s, Inches(0.5), Inches(6.93), Inches(12.3), Inches(0.45),
       advantages, 13, color=ACCENT_GOLD)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 12 – Current Advances & Future Scope
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_TEAL)
add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "09  |  CURRENT ADVANCES & FUTURE SCOPE", 22, bold=True, color=ACCENT_TEAL)

advances = [
    ("πŸ€–", "AI & Machine Learning",
     "Algorithm-optimized CPA protocols\nPredicts optimal cooling rates per cell type\nReduces trial-and-error in biobanks"),
    ("πŸ”¬", "Nanoparticle CPAs",
     "Gold & iron oxide nanoparticles act as\nmicrowave absorbers for uniform rewarming\nPrevents recrystallization at scale"),
    ("🧫", "Synthetic Biology CPAs",
     "Antifreeze proteins (AFPs) from fish/insects\nIce-recrystallization inhibitors (IRIs)\nPolyampholytes – lab-made ice blockers"),
    ("πŸ«€", "Whole Organ Banking",
     "Supercooling at βˆ’6Β°C (no ice) for livers\nVasomotor perfusion cryopreservation\nGoal: 24h β†’ weeks of storage"),
    ("πŸ’Š", "Pharma Manufacturing",
     "Lyophilized biologics (mRNA vaccines)\nPre-filled cryo-syringes\nReady-to-use CAR-T cell therapies"),
    ("🌐", "Global Biobanks",
     "WHO-aligned biospecimen repositories\nNational cord blood registries\nCRISPR-modified cryopreserved cells"),
]

ax = Inches(0.35); ay = Inches(0.9)
for idx, (icon, title, body) in enumerate(advances):
    if idx == 3:
        ax = Inches(0.35); ay = Inches(4.15)
    card(s, ax, ay, Inches(4.1), Inches(3.1), BG_CARD)
    add_rect(s, ax, ay, Inches(4.1), Inches(0.5), RGBColor(0x00, 0x40, 0x38))
    add_tb(s, ax + Inches(0.08), ay + Inches(0.05), Inches(0.5), Inches(0.42),
           icon, 22, align=PP_ALIGN.CENTER)
    add_tb(s, ax + Inches(0.65), ay + Inches(0.06), Inches(3.3), Inches(0.42),
           title, 13, bold=True, color=ACCENT_TEAL)
    add_tb(s, ax + Inches(0.12), ay + Inches(0.62), Inches(3.85), Inches(2.3),
           body, 12, color=LIGHT_GREY, wrap=True)
    ax += Inches(4.44)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 13 – Summary
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.07), ACCENT_ICE)
add_tb(s, Inches(0.5), Inches(0.15), Inches(12), Inches(0.6),
       "10  |  SUMMARY – KEY TAKE-AWAYS", 22, bold=True, color=ACCENT_ICE)

key_points = [
    ("❄️ Definition",
     "Preservation of biologicals at β‰€βˆ’80Β°C to βˆ’196Β°C by halting metabolic activity"),
    ("πŸ§ͺ Core Mechanism",
     "CPAs reduce intracellular ice formation and balance osmotic pressure during freeze-thaw"),
    ("βš—οΈ CPA Classes",
     "Intracellular (DMSO, glycerol, EG) – penetrate cells; "
     "Extracellular (sucrose, dextran) – protect extracellular space"),
    ("πŸ”„ Main Methods",
     "Slow cooling (βˆ’1Β°C/min), Vitrification (>15,000Β°C/min), Freeze-drying (lyophilization)"),
    ("πŸ₯ Applications",
     "Blood banking, stem cell therapy, IVF, biologics, organ preservation, R&D cell banks"),
    ("⚠️ Cryoinjury",
     "IIF, osmotic stress, solution effect, chilling injury, ROS – all preventable with optimized protocol"),
    ("πŸš€ Future",
     "AI-driven CPA design, nanoparticle rewarming, AFPs, whole-organ vitrification"),
]

sy = Inches(0.9)
for icon_title, body in key_points:
    card(s, Inches(0.4), sy, Inches(12.5), Inches(0.78), BG_CARD)
    add_rect(s, Inches(0.4), sy, Inches(0.08), Inches(0.78), ACCENT_ICE)
    add_tb(s, Inches(0.58), sy + Inches(0.04), Inches(2.6), Inches(0.38),
           icon_title, 12, bold=True, color=ACCENT_ICE)
    add_tb(s, Inches(3.2), sy + Inches(0.04), Inches(9.5), Inches(0.7),
           body, 12, color=LIGHT_GREY, wrap=True)
    sy += Inches(0.87)


# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 14 – References & Thank You
# ══════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
fill_bg(s)
accent_bar(s, 0, Inches(0.09), ACCENT_ICE)
accent_bar(s, 0.97, Inches(0.09), ACCENT_TEAL)

add_tb(s, Inches(0.5), Inches(0.2), Inches(12), Inches(0.6),
       "REFERENCES", 22, bold=True, color=ACCENT_ICE)

refs = [
    "1. McPherson RA, Pincus MR. Henry's Clinical Diagnosis and Management by Laboratory Methods. 23rd ed. Elsevier; 2022.",
    "2. Mazur P. Principles of Cryobiology. In: Fuller BJ, Lane N, Benson EE (eds). Life in the Frozen State. CRC Press; 2004.",
    "3. Bhattacharya S. Cryoprotectants and Their Usage in Cryopreservation Process. IntechOpen; 2018.",
    "4. Pegg DE. Principles of Cryopreservation. Methods Mol Biol. 2007;368:39-57.",
    "5. Wolkers WF, Oldenhof H (eds). Cryopreservation and Freeze-Drying Protocols. Springer; 2021.",
    "6. ICH Q5C: Quality of Biotechnological Products: Stability Testing. ICH Harmonised Tripartite Guideline.",
    "7. USP <1229.14> Freeze-Drying. United States Pharmacopeia and National Formulary.",
]
add_para(s, Inches(0.5), Inches(0.85), Inches(12.3), Inches(4.3),
         refs, size=12, color=LIGHT_GREY)

# Thank you block
add_rect(s, Inches(1.5), Inches(5.3), Inches(10.3), Inches(1.9),
         RGBColor(0x00, 0x28, 0x50))
add_rect(s, Inches(1.5), Inches(5.3), Inches(0.12), Inches(1.9), ACCENT_ICE)
add_rect(s, Inches(11.68), Inches(5.3), Inches(0.12), Inches(1.9), ACCENT_ICE)
add_tb(s, Inches(1.8), Inches(5.45), Inches(9.7), Inches(0.7),
       "THANK YOU", 38, bold=True, color=ACCENT_ICE, align=PP_ALIGN.CENTER)
add_tb(s, Inches(1.8), Inches(6.1), Inches(9.7), Inches(0.5),
       "Questions & Discussion Welcome", 18, italic=True,
       color=ACCENT_TEAL, align=PP_ALIGN.CENTER)

add_tb(s, Inches(0.5), Inches(7.1), Inches(12.3), Inches(0.35),
       "🧊  Freeze  ·  Protect  ·  Revive  |  M.Pharm 1st Semester  |  Pharmaceutics",
       12, color=MID_GREY, align=PP_ALIGN.CENTER)


# ══════════════════════════════════════════════════════════════════════════════
# Save
# ══════════════════════════════════════════════════════════════════════════════
out = "/tmp/workspace/cryopreservation-pptx/Cryopreservation_MPharm_1Sem.pptx"
prs.save(out)
print(f"Saved: {out}")
Running Command

cd /tmp/workspace/cryopreservation-pptx && python build_pptx.py 2>&1

Running Command

python -c " from pptx import Presentation prs = Presentation('/tmp/workspace/cryopreservation-pptx/Cryopreservation_MPharm_1Sem.pptx') print(f'Slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): texts = [] for shape in slide.shapes: if shape.has_text_frame: t = shape.text_frame.text.strip() if t: texts.append(t[:60]) print(f' Slide {i:02d}: {\" | \".join(texts[:3])}') "

Your presentation is ready! 🧊

Cryopreservation MPharm 1Sem

Presentation Β· PPTX


What's Inside - 14 Slides

#SlideUnique Design Element
1Title SlideDeep-space navy + electric ice-blue, decorative frost circles
2Agenda10-item numbered badge grid, two-column layout
3Introduction & DefinitionFormal definition card + 4 icon fact tiles
4Historical TimelineAlternating above/below horizontal timeline (1949 - 2020s)
5Principles & MechanismsSplit-panel: Slow Cooling vs Vitrification comparison
6Cryoprotective AgentsDual column - Intracellular vs Extracellular CPAs with color bars
7Methods of Cryopreservation4-column infographic cards (Slow / Vitrification / Lyophilization / Dry Ice)
8Equipment & Storage6-card grid with equipment icons
9Applications in Pharmacy6-card application grid with icon sidebars
10Cryoinjury & SolutionsRed-alert theme, Cause + Solution per injury type
11Freeze-Drying (Detailed)4-stage workflow cards with gold accent
12Current Advances & Future ScopeTeal theme, AI / Nano-CPAs / AFPs / Whole organ banking
13SummaryNumbered key-take-aways strip layout
14References + Thank YouCentered thank-you block with teal accent

Color Theme

  • Background: Deep navy (#041024)
  • Primary accent: Electric ice blue (#00C8FF)
  • Secondary: Teal mint (#00FFC8) + Gold (#FFD700)
  • Danger/Injury: Red (#FF455C)
Replace [Your Name] on slide 1 and submit. Good luck! πŸŽ“

Generate a Word document with speaker notes for each slide

Reading File
Writing File

~/cryopreservation-pptx/build_docx.py

"""
Cryopreservation – M.Pharm 1st Semester
Speaker Notes Word Document
Professional formatting: cover page, slide-by-slide notes, colored headings
"""

from docx import Document
from docx.shared import Pt, Inches, RGBColor, Cm
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.oxml.ns import qn
from docx.oxml import OxmlElement
import copy

doc = Document()

# ── Page margins ─────────────────────────────────────────────────────────────
section = doc.sections[0]
section.top_margin    = Inches(1.0)
section.bottom_margin = Inches(1.0)
section.left_margin   = Inches(1.2)
section.right_margin  = Inches(1.2)

# ── Default style ────────────────────────────────────────────────────────────
normal = doc.styles["Normal"]
normal.font.name = "Calibri"
normal.font.size = Pt(11)

# ── Helper: add horizontal rule ──────────────────────────────────────────────
def add_hr(doc):
    p = doc.add_paragraph()
    p.paragraph_format.space_before = Pt(2)
    p.paragraph_format.space_after  = Pt(2)
    pPr = p._p.get_or_add_pPr()
    pBdr = OxmlElement('w:pBdr')
    bottom = OxmlElement('w:bottom')
    bottom.set(qn('w:val'), 'single')
    bottom.set(qn('w:sz'), '6')
    bottom.set(qn('w:space'), '1')
    bottom.set(qn('w:color'), '00C8FF')
    pBdr.append(bottom)
    pPr.append(pBdr)
    return p

# ── Helper: styled paragraph ─────────────────────────────────────────────────
def add_styled_para(doc, text, size=11, bold=False, italic=False,
                    color=None, indent=0, space_before=0, space_after=6,
                    align=WD_ALIGN_PARAGRAPH.LEFT):
    p = doc.add_paragraph()
    p.paragraph_format.left_indent   = Inches(indent)
    p.paragraph_format.space_before  = Pt(space_before)
    p.paragraph_format.space_after   = Pt(space_after)
    p.alignment = align
    run = p.add_run(text)
    run.font.name   = "Calibri"
    run.font.size   = Pt(size)
    run.font.bold   = bold
    run.font.italic = italic
    if color:
        run.font.color.rgb = RGBColor(*color)
    return p

# ── Helper: bullet point ─────────────────────────────────────────────────────
def add_bullet(doc, text, level=0, size=11, color=None):
    p = doc.add_paragraph(style="List Bullet")
    p.paragraph_format.left_indent  = Inches(0.3 + level * 0.25)
    p.paragraph_format.space_after  = Pt(3)
    run = p.add_run(text)
    run.font.name = "Calibri"
    run.font.size = Pt(size)
    if color:
        run.font.color.rgb = RGBColor(*color)
    return p

# ── Helper: slide section header ─────────────────────────────────────────────
def slide_header(doc, slide_num, slide_title):
    # Colored badge line
    p = doc.add_paragraph()
    p.paragraph_format.space_before = Pt(14)
    p.paragraph_format.space_after  = Pt(2)
    # Badge
    badge_run = p.add_run(f"  SLIDE {slide_num:02d}  ")
    badge_run.font.name  = "Calibri"
    badge_run.font.size  = Pt(10)
    badge_run.font.bold  = True
    badge_run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF)
    # Shade the badge run
    rPr = badge_run._r.get_or_add_rPr()
    shd = OxmlElement('w:shd')
    shd.set(qn('w:val'), 'clear')
    shd.set(qn('w:color'), 'auto')
    shd.set(qn('w:fill'), '00608A')
    rPr.append(shd)
    # Title
    title_run = p.add_run(f"   {slide_title}")
    title_run.font.name  = "Calibri"
    title_run.font.size  = Pt(14)
    title_run.font.bold  = True
    title_run.font.color.rgb = RGBColor(0x00, 0x40, 0x70)
    add_hr(doc)

# ── Helper: notes sub-section ────────────────────────────────────────────────
def notes_section(doc, label, items, label_color=(0x00, 0x80, 0xA0)):
    add_styled_para(doc, label, size=10, bold=True, color=label_color,
                    space_before=6, space_after=2)
    if isinstance(items, str):
        add_styled_para(doc, items, size=11, indent=0.2, space_after=4)
    else:
        for item in items:
            add_bullet(doc, item, size=11)

# ══════════════════════════════════════════════════════════════════════════════
# COVER PAGE
# ══════════════════════════════════════════════════════════════════════════════
# Title
add_styled_para(doc, "CRYOPRESERVATION", size=26, bold=True,
                color=(0x00, 0x40, 0x70), space_before=30, space_after=4,
                align=WD_ALIGN_PARAGRAPH.CENTER)
add_styled_para(doc, "Preserving Life at the Edge of Absolute Zero",
                size=14, italic=True, color=(0x00, 0x80, 0xA0),
                space_before=0, space_after=6, align=WD_ALIGN_PARAGRAPH.CENTER)
add_hr(doc)
add_styled_para(doc, "M.Pharm – 1st Semester  |  Pharmaceutics",
                size=12, color=(0x33, 0x33, 0x33),
                space_before=4, space_after=2, align=WD_ALIGN_PARAGRAPH.CENTER)
add_styled_para(doc, "Speaker Notes & Presentation Script",
                size=12, bold=True, color=(0x00, 0x40, 0x70),
                space_before=2, space_after=4, align=WD_ALIGN_PARAGRAPH.CENTER)
add_styled_para(doc, "Prepared by: [Your Name]  |  Date: [Date]  |  Guide: [Guide Name]",
                size=11, italic=True, color=(0x66, 0x66, 0x66),
                space_before=2, space_after=30, align=WD_ALIGN_PARAGRAPH.CENTER)

add_styled_para(doc,
    "HOW TO USE THIS DOCUMENT",
    size=11, bold=True, color=(0x00, 0x40, 0x70), space_before=0, space_after=3)
add_styled_para(doc,
    "This document contains detailed speaker notes for every slide of the "
    "Cryopreservation presentation. Each section provides: (1) What to say verbatim "
    "or paraphrase, (2) Key points to emphasise, (3) Transition cues to the next slide, "
    "and (4) Expected questions with brief answers. Read through these notes before "
    "your presentation and practice each section.",
    size=11, color=(0x33, 0x33, 0x33), indent=0, space_after=8)

doc.add_page_break()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE-BY-SLIDE SPEAKER NOTES
# ══════════════════════════════════════════════════════════════════════════════

slides_data = [

    # ── SLIDE 1 ──────────────────────────────────────────────────────────────
    {
        "num": 1,
        "title": "Title Slide – CRYOPRESERVATION",
        "opening": (
            "Good [morning/afternoon] everyone. My name is [Your Name], and today I will "
            "be presenting on Cryopreservation – a topic that sits at the fascinating "
            "intersection of physics, chemistry, cell biology, and pharmaceutical sciences."
        ),
        "key_points": [
            "Start with a hook: 'Imagine being able to pause life – freeze a living cell today and bring it back weeks, months, or even years later, fully functional. That is exactly what cryopreservation achieves.'",
            "Mention that this technology underpins modern blood banking, IVF clinics, stem-cell transplantation, and the production of cutting-edge biologics.",
            "State the presentation structure: 10 main topics, approximately 25–30 minutes.",
        ],
        "transition": (
            "Let us begin with the agenda to see what we will cover today."
        ),
        "expected_q": [],
    },

    # ── SLIDE 2 ──────────────────────────────────────────────────────────────
    {
        "num": 2,
        "title": "Presentation Agenda",
        "opening": (
            "Here is our roadmap for the next 25–30 minutes. We have 10 main topics "
            "ranging from the basic definition all the way through to future directions "
            "in the field."
        ),
        "key_points": [
            "Briefly read through each numbered item – do NOT explain them yet, just name them.",
            "Mention that you will pause for questions at the end, but quick clarifications are welcome throughout.",
            "Point out that slides 5b and 7 cover slightly advanced detail – good for exam preparation.",
        ],
        "transition": (
            "Let us start right from the beginning – what exactly is cryopreservation?"
        ),
        "expected_q": [],
    },

    # ── SLIDE 3 ──────────────────────────────────────────────────────────────
    {
        "num": 3,
        "title": "Introduction & Definition",
        "opening": (
            "Cryopreservation comes from the Greek word 'kryos' meaning icy cold or frost. "
            "In its simplest form, it is the science of cooling biological material to "
            "sub-zero temperatures to halt all life processes – and then, crucially, "
            "being able to restore full function upon warming."
        ),
        "key_points": [
            "Read the definition from the slide. Emphasise the word 'viability' – the material must survive the freeze-thaw cycle intact and functional.",
            "Temperature ranges: βˆ’80Β°C is achievable with mechanical (ultra-low) freezers. βˆ’196Β°C is the boiling point of liquid nitrogen – the gold standard for long-term storage.",
            "Distinguish cryopreservation from ordinary freezing of food: the goal here is not preservation of texture or taste, but of living, functional cells.",
            "Pharmaceutical relevance: Most biologics (monoclonal antibodies, cell therapies, vaccines) cannot survive at room temperature. Cryopreservation is their lifeline.",
            "The four fact tiles on the slide summarise: temperature, core goal, types of materials, and pharma relevance – memorise these for exams.",
        ],
        "transition": (
            "Before we go into the science, let us see how this field developed over time."
        ),
        "expected_q": [
            "Q: Is all freezing the same as cryopreservation? A: No. Cryopreservation uses specific controlled protocols and cryoprotective agents to prevent cell damage. Simple freezing (e.g., food) causes massive ice crystal damage to cells.",
        ],
    },

    # ── SLIDE 4 ──────────────────────────────────────────────────────────────
    {
        "num": 4,
        "title": "Historical Timeline",
        "opening": (
            "The field of cryopreservation has a surprisingly rich history. It did not "
            "begin in a high-tech laboratory – it began with a chance observation involving "
            "glycerol and bull sperm in 1949."
        ),
        "key_points": [
            "1949 – Christopher Polge at the UK's ARC discovered that glycerol protects sperm from freeze damage. This was accidental – a mislabelled bottle of glycerol in a bird sperm experiment led to the first successful cryopreservation.",
            "1959 – Human sperm banking became feasible, opening the door to sperm donation programs.",
            "1972 – Red blood cell banking with glycerol at βˆ’80Β°C. This was critical for military blood banking.",
            "1983 – First live birth from a frozen embryo by Trounson and Mohr – a landmark in reproductive medicine.",
            "1998 – Masashige Kuwayama's vitrification protocol for oocytes revolutionised IVF success rates.",
            "2010s – Global biobank networks established for cord blood stem cells.",
            "2020s – Artificial intelligence optimises CPA cocktail formulation; nanoparticle-assisted rewarming prevents recrystallisation.",
        ],
        "transition": (
            "Now that we understand the history, let us get into the actual science – "
            "how does cryopreservation work mechanically and thermodynamically?"
        ),
        "expected_q": [
            "Q: Who is the father of cryobiology? A: Peter Mazur is widely credited as the father of modern cryobiology for his mathematical two-factor hypothesis of cryoinjury (1970).",
        ],
    },

    # ── SLIDE 5 ──────────────────────────────────────────────────────────────
    {
        "num": 5,
        "title": "Principles & Mechanisms",
        "opening": (
            "There are two fundamentally different approaches to cryopreservation, "
            "and understanding the difference is critical for your exams and for "
            "selecting the right method in practice."
        ),
        "key_points": [
            "SLOW COOLING (left panel): Ice forms first OUTSIDE the cell. This creates a hypertonic extracellular environment, which draws water out of the cell by osmosis. The cell shrinks and becomes more concentrated – minimising the water available to freeze inside. The rate of βˆ’1Β°C/min allows this gradual dehydration without shocking the cell.",
            "HEAT OF FUSION: When water changes from liquid to solid, it releases latent heat (~334 J/g). If not compensated, this sudden heat release warms the sample and disrupts the ice front. A controlled-rate freezer is programmed to apply extra cooling at this exact point.",
            "VITRIFICATION (right panel): Instead of slowly dehydrating cells, you use very HIGH concentrations of cryoprotectants and then plunge directly into liquid nitrogen. The solution never forms crystalline ice – it goes from a liquid to a glass-like amorphous solid (vitreous state) in milliseconds.",
            "Key trade-off: Slow cooling uses lower CPA concentrations (less toxic) but risks intracellular ice if too fast. Vitrification has zero ice risk but requires high CPAs which can be toxic.",
        ],
        "transition": (
            "This brings us to the heroes of cryopreservation – the cryoprotective agents or CPAs."
        ),
        "expected_q": [
            "Q: What happens if slow cooling is too rapid? A: Intracellular ice forms – this mechanically ruptures the cell membrane and organelles, causing irreversible cell death.",
            "Q: What is the glass transition temperature (Tg)? A: The temperature below which the vitrified solution behaves like a solid glass. CPAs lower Tg, helping achieve vitrification at more practical temperatures.",
        ],
    },

    # ── SLIDE 6 ──────────────────────────────────────────────────────────────
    {
        "num": 6,
        "title": "Cryoprotective Agents (CPAs)",
        "opening": (
            "Cryoprotective agents are the pharmacological backbone of cryopreservation. "
            "They are chemical substances that protect cells from the two major forms "
            "of cryoinjury: ice crystal formation and osmotic stress."
        ),
        "key_points": [
            "MECHANISM: CPAs work by (1) increasing solute concentration – this lowers the freezing point and reduces the amount of ice formed at any given temperature; (2) replacing intracellular water – penetrating CPAs enter the cell and substitute water, reducing the volume of water available to crystallise.",
            "INTRACELLULAR CPAs (penetrating): Small molecules that pass through cell membranes. DMSO is the gold standard – 10% v/v is standard for HPCs and most nucleated cells. Glycerol is preferred for sperm and RBCs because it is less toxic to these cell types. Ethylene glycol (EG) has lower viscosity – favoured in vitrification. Propylene glycol (PG) is used in embryo protocols.",
            "EXTRACELLULAR CPAs (non-penetrating): Large molecules that CANNOT enter cells. They act outside – reducing extracellular ice volume and preventing osmotic collapse. Sucrose is added as an 'osmotic buffer' during CPA washout after thawing. Trehalose is found naturally in organisms that survive complete desiccation (tardigrades, brine shrimp).",
            "CLINICAL NOTE: DMSO has side effects in patients – garlic breath, nausea, hypotension. The 10% DMSO in a stem-cell infusion must be diluted and infused slowly with patient monitoring.",
            "The bottom bar on the slide states the mechanism in one sentence – memorise it for exams.",
        ],
        "transition": (
            "Now let us look at the actual practical methods used in the laboratory and clinic."
        ),
        "expected_q": [
            "Q: Why is glycerol used for sperm but not for stem cells? A: Glycerol permeates sperm slowly but effectively without causing the osmotic damage seen in nucleated cells. DMSO permeates faster and is better for HPCs.",
            "Q: Can two CPAs be combined? A: Yes. Combination protocols (e.g., DMSO + sucrose) are common – they reduce the required concentration of each individual agent, lowering toxicity while maintaining protection.",
        ],
    },

    # ── SLIDE 7 ──────────────────────────────────────────────────────────────
    {
        "num": 7,
        "title": "Methods of Cryopreservation",
        "opening": (
            "We have four main methods, each suited to different biological materials "
            "and clinical applications. Think of them as a spectrum from the slowest "
            "and gentlest to the fastest."
        ),
        "key_points": [
            "SLOW COOLING: The most widely used industrial method. A controlled-rate freezer programmed at βˆ’1Β°C/min. Used for cord blood banks, RBC banks, and most cell therapy products. Final temperature after the controlled phase is βˆ’80Β°C in a mechanical freezer, then transferred to liquid nitrogen.",
            "VITRIFICATION: Fastest method – used almost exclusively in reproductive medicine for oocytes and embryos. The Cryotop or open pulled straw device is used to achieve ultra-rapid cooling rates. Post-warming survival of oocytes is now >90% with modern vitrification protocols.",
            "FREEZE-DRYING (Lyophilization): Removes ALL water by sublimation under vacuum. The result is a dry powder that is shelf-stable for years. This is how most lyophilised vaccines, antibiotics, and injectable biologics are manufactured.",
            "DRY ICE: A practical, no-infrastructure option for short-term transport. COβ‚‚ sublimates at βˆ’78.5Β°C. Not suitable for long-term preservation because the temperature is not low enough to arrest all metabolic processes in all cell types.",
            "Highlight to the audience: which method would you choose for (a) shipping mRNA vaccines? – dry ice; (b) long-term stem cell banking? – slow cooling + LNβ‚‚; (c) preserving a patient's eggs? – vitrification.",
        ],
        "transition": (
            "Let us now look at the equipment that makes all of this possible."
        ),
        "expected_q": [
            "Q: Can vitrification be used for organ preservation? A: Currently it is experimental for whole organs. The high CPA concentrations needed are toxic at the organ scale. Researchers are working on nanoparticle-assisted rewarming to make this viable.",
        ],
    },

    # ── SLIDE 8 ──────────────────────────────────────────────────────────────
    {
        "num": 8,
        "title": "Equipment & Storage",
        "opening": (
            "Good science requires good tools. Let me walk you through the six "
            "essential pieces of equipment in a cryopreservation laboratory."
        ),
        "key_points": [
            "CONTROLLED-RATE FREEZER: The CPU of cryopreservation. It runs pre-programmed scripts – e.g., 'cool at βˆ’1Β°C/min to βˆ’80Β°C, then compensate for heat of fusion with a βˆ’5Β°C/min burst'. Brands: Planer, CryoMed, Asymptote.",
            "LIQUID NITROGEN DEWAR: Maintains βˆ’196Β°C indefinitely as long as LNβ‚‚ is replenished. Vapour-phase storage (βˆ’150Β°C) is preferred for samples stored >5 years because LNβ‚‚ contamination in liquid phase can transmit bloodborne pathogens through cracks in vials.",
            "CRYOVIALS AND STRAWS: Externally threaded cryovials are safer (no internal threading that could trap LNβ‚‚ and cause explosive venting on thaw). Straws (0.25 mL) are standard in IVF for embryo/sperm storage.",
            "MECHANICAL FREEZER: βˆ’80Β°C units (e.g., Thermo Fisher) are used as an intermediate step or standalone for short-to-medium-term storage of biological samples, cell pellets, and DNA.",
            "LIMS (Laboratory Information Management System): Regulatory requirement in GMP facilities. Tracks sample location (tank/rack/box/position), donor traceability, chain of custody, and expiry.",
            "CRYO-MICROSCOPE: Used in R&D to visually observe ice crystal formation and select optimal protocols.",
        ],
        "transition": (
            "Now let us see where all this technology is applied in the real world."
        ),
        "expected_q": [
            "Q: What is the expiry date of cryopreserved tissue? A: Most tissue banks set 5 years for cell-based products (conservative estimate). Structural bone can be stored indefinitely. The definitive expiry for cord blood units is still being determined from long-term viability data.",
        ],
    },

    # ── SLIDE 9 ──────────────────────────────────────────────────────────────
    {
        "num": 9,
        "title": "Applications in Pharmacy & Medicine",
        "opening": (
            "Cryopreservation is not just a laboratory curiosity – it is the foundation "
            "of some of the most important medical and pharmaceutical services in the world today."
        ),
        "key_points": [
            "BLOOD BANKING: Red blood cells preserved with glycerol at βˆ’80Β°C can be stored for up to 10 years (rare blood groups). Cord blood units stored at βˆ’196Β°C are a source of HLAs-matched HSCs for transplantation.",
            "STEM CELL THERAPY: Hematopoietic stem cells (HSCs) for bone marrow transplants, mesenchymal stem cells (MSCs) for regenerative medicine, and iPSCs for personalised therapy research all rely on DMSO-based cryopreservation at βˆ’196Β°C.",
            "REPRODUCTIVE MEDICINE: Sperm banking before chemotherapy or vasectomy. Oocyte banking for 'social freezing' or cancer patients. Embryo banking is standard in IVF clinics worldwide.",
            "BIOLOGICS & VACCINES: mRNA COVID-19 vaccines required βˆ’70Β°C storage. Monoclonal antibodies (e.g., trastuzumab) are stored at βˆ’80Β°C. Viral vectors for gene therapy (AAV, lentivirus) are cryopreserved to maintain titre.",
            "ORGAN PRESERVATION: Currently limited to hours with cold perfusion solutions (UW solution). Future goal: cryopreserve donor organs to extend the window from hours to days/weeks, saving thousands of lives.",
            "RESEARCH & QC: American Type Culture Collection (ATCC) stores reference cell lines in LNβ‚‚. WHO and USP maintain reference biological standards in cryopreserved form.",
        ],
        "transition": (
            "But not everything is perfect. There are several ways a cell can be damaged "
            "during the freeze-thaw process – let us look at these cryoinjury mechanisms."
        ),
        "expected_q": [
            "Q: Why are mRNA vaccines stored at βˆ’70Β°C rather than βˆ’196Β°C? A: mRNA molecules are stable at βˆ’70Β°C for the durations required. βˆ’196Β°C infrastructure is expensive and impractical for mass vaccination campaigns. βˆ’70Β°C dry-ice-compatible freezers are far more widely available.",
        ],
    },

    # ── SLIDE 10 ─────────────────────────────────────────────────────────────
    {
        "num": 10,
        "title": "Cryoinjury – Types & Solutions",
        "opening": (
            "Every step of the freeze-thaw cycle carries a risk of cell damage. "
            "Understanding these injuries is as important as knowing the preservation "
            "methods – because your protocol is only as good as its weakest step."
        ),
        "key_points": [
            "INTRACELLULAR ICE FORMATION (IIF): The most deadly form. Ice crystals inside the cell physically pierce membranes and organelles. If you can see a cell under a cryo-microscope and it suddenly 'darkens' during freezing, that is IIF. Solution: optimise cooling rate + CPA.",
            "OSMOTIC STRESS (Shrink-Swell): During CPA loading, the cell first shrinks (water leaves due to high osmolarity) then swells as CPA enters. Extreme volume changes rupture the membrane. Solution: stepwise CPA addition in increasing concentrations.",
            "SOLUTION EFFECT: As ice forms outside the cell, solutes (salts, proteins) become progressively concentrated in the remaining liquid. This 'solution effect' denatures proteins and shifts pH. Solution: rapid cooling through the dangerous temperature range (βˆ’15 to βˆ’60Β°C).",
            "CHILLING INJURY: Above 0Β°C, certain cells (particularly sperm and red cells) are damaged by the lipid phase transition in their membranes. Cholesterol in membranes changes from fluid to gel phase when cooled. Solution: trehalose, sucrose, or controlled pre-cooling steps.",
            "REACTIVE OXYGEN SPECIES (ROS): Rewarming generates a burst of oxidative stress. Mitochondria produce superoxide and hydrogen peroxide, which damage DNA and trigger apoptosis. Solution: antioxidants (vitamin E, N-acetylcysteine, melatonin) added to the CPA solution.",
            "THERMAL SHOCK ON THAWING: If thawing is too slow (e.g., room temperature), recrystallisation occurs – small ice crystals grow into large damaging ones. Solution: rapid thaw in a 37Β°C water bath (30–60 seconds for a 1 mL cryovial).",
        ],
        "transition": (
            "Now let us take a closer look at freeze-drying, which avoids most of these "
            "cryoinjury mechanisms by removing water entirely."
        ),
        "expected_q": [
            "Q: What is Mazur's two-factor hypothesis? A: Peter Mazur proposed that cell death during cryopreservation results from two competing factors: (1) intracellular ice formation if cooling is too fast, and (2) solution effect injury if cooling is too slow. There is an optimal cooling rate between these two extremes.",
        ],
    },

    # ── SLIDE 11 ─────────────────────────────────────────────────────────────
    {
        "num": 11,
        "title": "Freeze-Drying (Lyophilization) – Detailed",
        "opening": (
            "Freeze-drying – or lyophilization – is arguably the most pharmaceutically "
            "important cryopreservation-adjacent technique. It is used in the manufacture "
            "of hundreds of injectable drug products, vaccines, and biologics worldwide."
        ),
        "key_points": [
            "STEP 1 – PRE-TREATMENT: Lyoprotectants (sucrose, mannitol, trehalose) are added to the formulation before freezing. They hydrogen-bond to the protein/cell surface and replace the water molecules in the hydration shell – preventing denaturation during drying. This is called the 'water replacement hypothesis'.",
            "STEP 2 – FREEZING: The product is cooled to βˆ’40 to βˆ’50Β°C on the freeze-dryer shelves. The product must freeze completely before primary drying begins. Nucleation temperature is critical – if nucleation occurs at too high a temperature, larger ice crystals form, which leave larger pores in the cake (good for reconstitution speed but may reduce stability).",
            "STEP 3 – PRIMARY DRYING (Sublimation): Chamber pressure is reduced to 100–200 mTorr. The shelf temperature is raised slightly (βˆ’10 to βˆ’30Β°C) to supply the energy needed for sublimation (ice β†’ vapour, bypassing liquid phase). This is the longest step – 12 to 48 hours. Approximately 70–90% of total water is removed here.",
            "STEP 4 – SECONDARY DRYING (Desorption): Shelf temperature is raised to +20 to +40Β°C. This removes 'bound water' – water molecules adsorbed onto the protein surface that did not freeze. Residual moisture must be <1–3% for stability. Vials are then stoppered and crimped under nitrogen or vacuum.",
            "PHARMACEUTICAL ADVANTAGE: The resulting 'lyophilised cake' can be stored at refrigerator temperature (2–8Β°C) or even room temperature for years. Reconstitution with sterile water for injection takes <2 minutes.",
            "EXAMPLES: Ceftriaxone, vancomycin, lyophilised mRNA vaccines (Moderna, Pfizer-BioNTech updated formulations), Factor VIII for haemophilia, antibody-drug conjugates (ADCs).",
        ],
        "transition": (
            "With such an established field, what is new? Let us explore the cutting-edge advances."
        ),
        "expected_q": [
            "Q: What is a 'eutectic mixture' in freeze-drying? A: A eutectic mixture is the specific composition of solute and solvent that has the lowest melting point. The product must be frozen well below the eutectic temperature to ensure complete solidification before drying begins.",
            "Q: What is 'cake collapse' in lyophilization? A: If primary drying temperature is too high, the dried structure loses rigidity and collapses into an amorphous mass. This reduces surface area, impairs reconstitution, and may compromise stability. It indicates the drying was conducted above the collapse temperature (Tc).",
        ],
    },

    # ── SLIDE 12 ─────────────────────────────────────────────────────────────
    {
        "num": 12,
        "title": "Current Advances & Future Scope",
        "opening": (
            "Cryopreservation is not a solved problem – there is enormous active research. "
            "Let me highlight six areas that represent the frontier of the field as of 2024–2026."
        ),
        "key_points": [
            "AI & MACHINE LEARNING: Researchers are training neural networks on thousands of freeze-thaw experiments to predict optimal CPA combinations, concentrations, and cooling rates for specific cell types – replacing decades of trial-and-error empirical work.",
            "NANOPARTICLE CPAs: Gold nanoparticles and iron oxide superparamagnetic nanoparticles can be excited by radiofrequency magnetic fields to generate heat uniformly throughout a frozen sample. This allows extremely rapid, uniform rewarming – critical for organs, which suffer thermal gradients during conventional rewarming.",
            "ANTIFREEZE PROTEINS (AFPs) & IRIs: Organisms like Arctic fish (Notothenioid fish), snow fleas, and winter wheat produce proteins that bind to ice crystals and prevent their growth (ice recrystallisation inhibition). Synthetic mimics called IRIs (ice recrystallisation inhibitors) are being developed as non-toxic CPA additives.",
            "POLYAMPHOLYTES: Synthetic zwitterionic polymers (carrying both positive and negative charges) that show excellent IRI activity and cell membrane protection. They could replace DMSO in future clinical-grade CPA formulations.",
            "WHOLE ORGAN BANKING: A team at the University of Minnesota achieved 4-day storage of rat livers by supercooling at βˆ’6Β°C (liquid but ice-free) with machine perfusion. Human-scale organ vitrification remains a 10–15 year goal but could transform transplant medicine.",
            "PHARMA MANUFACTURING: CAR-T cell therapies (Kymriah, Yescarta) rely entirely on cryopreserved patient T-cells. The commercial success of these therapies has driven massive investment in GMP-grade cryopreservation infrastructure.",
        ],
        "transition": (
            "Let us now consolidate everything into a quick summary before we close."
        ),
        "expected_q": [
            "Q: What are polyampholytes? A: Polyampholytes are synthetic polymers bearing both positive and negative charges. They adsorb to ice surfaces and inhibit recrystallisation, acting like biomimetic antifreeze proteins but without the toxicity of DMSO.",
        ],
    },

    # ── SLIDE 13 ─────────────────────────────────────────────────────────────
    {
        "num": 13,
        "title": "Summary – Key Take-Aways",
        "opening": (
            "Let me leave you with the seven key points from today's presentation "
            "that you absolutely must remember – both for your exams and for your "
            "professional practice."
        ),
        "key_points": [
            "DEFINITION: Cryopreservation preserves biological materials at β‰€βˆ’80Β°C to βˆ’196Β°C by halting metabolic activity. Viability must be maintained.",
            "MECHANISM: CPAs reduce ice formation AND balance osmotic pressure. Both intracellular and extracellular spaces must be protected.",
            "CPA CLASSES: Intracellular (DMSO, glycerol, EG, PG) vs Extracellular (sucrose, trehalose, dextran, PVP). Know examples of each and their uses.",
            "METHODS: Slow cooling (βˆ’1Β°C/min) vs Vitrification (ultra-rapid) vs Lyophilization (drying). Know which method is used for which material.",
            "APPLICATIONS: Blood banking, stem cells, IVF, biologics, organ preservation. Cryopreservation touches almost every branch of modern medicine.",
            "CRYOINJURY: Six types – IIF, osmotic stress, solution effect, chilling injury, ROS, thermal shock. Each has a specific preventive strategy.",
            "FUTURE: AI optimisation, nanoparticle rewarming, antifreeze proteins, polyampholytes, and whole-organ vitrification are the next frontiers.",
        ],
        "transition": (
            "I will now open the floor for questions. Thank you for your attention."
        ),
        "expected_q": [],
    },

    # ── SLIDE 14 ─────────────────────────────────────────────────────────────
    {
        "num": 14,
        "title": "References & Thank You",
        "opening": (
            "I would like to thank all the authors whose work I have drawn upon. "
            "These references are listed on the slide and are available in full text "
            "through your institution's library."
        ),
        "key_points": [
            "Henry's Clinical Diagnosis (2022) – source for clinical cryopreservation protocols (DMSO, controlled-rate freezing, tissue bank procedures).",
            "Mazur P (2007) – the foundational paper on the two-factor hypothesis of cryoinjury. Essential reading.",
            "Bhattacharya S (2018, IntechOpen) – detailed review of cryoprotectant mechanisms and vitrification.",
            "ICH Q5C and USP <1229.14> – the regulatory frameworks governing pharmaceutical freeze-drying. Relevant for pharma students.",
            "Encourage students to look up Peter Mazur, Gregory Fahy (vitrification), and Mehmet Toner (microfluidic cryopreservation) as key researchers in this field.",
        ],
        "transition": "N/A – end of presentation.",
        "expected_q": [
            "Q: What is the difference between cryopreservation and hypothermic preservation? A: Hypothermic preservation stores tissue at 4Β°C (above freezing) – extends viability for hours. Cryopreservation stores below βˆ’80Β°C – extends viability for months to years. The mechanisms of injury and protection are completely different.",
            "Q: Is cryopreservation used for whole-body preservation (cryonics)? A: Cryonics (preserving deceased humans for future revival) is a controversial, unproven concept. It is NOT medically or scientifically validated. Cryopreservation of individual cells and small tissues is established science; whole-body cryopreservation is speculative.",
        ],
    },
]

# ══════════════════════════════════════════════════════════════════════════════
# BUILD SLIDES
# ══════════════════════════════════════════════════════════════════════════════

for sd in slides_data:
    slide_header(doc, sd["num"], sd["title"])

    notes_section(doc, "β–Ά OPENING LINE", sd["opening"],
                  label_color=(0x00, 0x60, 0x90))

    notes_section(doc, "πŸ“Œ KEY POINTS TO COVER", sd["key_points"],
                  label_color=(0x00, 0x60, 0x90))

    if sd.get("transition"):
        notes_section(doc, "➑ TRANSITION TO NEXT SLIDE",
                      sd["transition"],
                      label_color=(0x33, 0x66, 0x00))

    if sd.get("expected_q"):
        notes_section(doc, "❓ ANTICIPATED QUESTIONS",
                      sd["expected_q"],
                      label_color=(0x80, 0x00, 0x40))

    # small gap after each slide
    add_styled_para(doc, "", size=6, space_before=0, space_after=0)


# ══════════════════════════════════════════════════════════════════════════════
# APPENDIX: QUICK REVISION TABLE
# ══════════════════════════════════════════════════════════════════════════════
doc.add_page_break()
add_styled_para(doc, "APPENDIX – QUICK REVISION TABLE",
                size=16, bold=True, color=(0x00, 0x40, 0x70),
                space_before=0, space_after=6)
add_hr(doc)
add_styled_para(doc,
    "Use this table for last-minute revision before your exam or viva.",
    size=11, italic=True, color=(0x55, 0x55, 0x55), space_after=8)

table = doc.add_table(rows=1, cols=3)
table.style = "Table Grid"

# Header row
hdr = table.rows[0].cells
hdr[0].text = "Topic"
hdr[1].text = "Key Detail"
hdr[2].text = "Example / Value"
for cell in hdr:
    for para in cell.paragraphs:
        for run in para.runs:
            run.font.bold = True
            run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF)
        cell._tc.get_or_add_tcPr()
    # shade header cells
    tcPr = cell._tc.get_or_add_tcPr()
    shd = OxmlElement('w:shd')
    shd.set(qn('w:val'), 'clear')
    shd.set(qn('w:color'), 'auto')
    shd.set(qn('w:fill'), '004070')
    tcPr.append(shd)

rows_data = [
    ("Definition", "Preserve biologicals at β‰€βˆ’80Β°C to βˆ’196Β°C", "HPCs, sperm, embryos, biologics"),
    ("Temperature", "Mechanical freezer / LNβ‚‚ vapor / LNβ‚‚ liquid", "βˆ’80Β°C / βˆ’150Β°C / βˆ’196Β°C"),
    ("Slow cooling rate", "βˆ’0.5 to βˆ’2Β°C/min (typically βˆ’1Β°C/min)", "Controlled-rate freezer"),
    ("Vitrification rate", ">15,000Β°C/min; no ice crystals", "Cryotop device; oocytes/embryos"),
    ("CPA – intracellular", "DMSO, Glycerol, EG, PG", "DMSO 10% v/v for HPCs"),
    ("CPA – extracellular", "Sucrose, Trehalose, Dextran, HES, PVP", "Sucrose 0.1–0.2 M buffer on thaw"),
    ("Heat of fusion", "Latent heat released when water freezes (~334 J/g)", "Controlled-rate freezer compensates"),
    ("IIF", "Intracellular ice formation = lethal to cells", "Prevented by optimised CPA + rate"),
    ("Lyophilization stages", "Freeze β†’ Primary dry β†’ Secondary dry", "Residual moisture <1–3%"),
    ("Lyoprotectants", "Sucrose, mannitol, trehalose", "Replaces water (WRH)"),
    ("Storage limit", "5 years (most cell products)", "Structural bone: indefinite"),
    ("DMSO side effects", "Garlic odour, nausea, hypotension", "Infuse slowly; monitor patient"),
    ("Mazur's hypothesis", "Two-factor: IIF vs solution effect injury", "Optimal cooling rate exists between"),
    ("Recrystallisation", "Small crystals grow on slow thaw", "Prevented by rapid 37Β°C thaw"),
    ("Future: Nano-CPAs", "Au/Fe₃Oβ‚„ NPs for RF-assisted rewarming", "Prevents recrystallisation in organs"),
]

for row_data in rows_data:
    row = table.add_row()
    for i, text in enumerate(row_data):
        cell = row.cells[i]
        cell.text = text
        for para in cell.paragraphs:
            for run in para.runs:
                run.font.size = Pt(10)
                run.font.name = "Calibri"

# ══════════════════════════════════════════════════════════════════════════════
# SAVE
# ══════════════════════════════════════════════════════════════════════════════
out_path = "/tmp/workspace/cryopreservation-pptx/Cryopreservation_SpeakerNotes_MPharm.docx"
doc.save(out_path)
print(f"Saved: {out_path}")
Running Command

cd /tmp/workspace/cryopreservation-pptx && python build_docx.py 2>&1

Running Command

python -c " from docx import Document doc = Document('/tmp/workspace/cryopreservation-pptx/Cryopreservation_SpeakerNotes_MPharm.docx') print('Paragraphs:', len(doc.paragraphs)) print('Tables:', len(doc.tables)) # Print first ~20 non-empty paragraphs count = 0 for p in doc.paragraphs: if p.text.strip() and count < 20: print(f' [{p.style.name}] {p.text[:80]}') count += 1 # Table check if doc.tables: t = doc.tables[0] print(f'Table rows: {len(t.rows)}, cols: {len(t.columns)}') for row in t.rows[:3]: print([c.text[:30] for c in row.cells]) "

225 paragraphs, 14 slides covered, revision table with 16 rows - everything is clean and complete.

Your Word document is ready:

Cryopreservation SpeakerNotes MPharm

Word Document Β· DOCX


What's Inside the Document

Cover Page
  • Title, subtitle, your name/date/guide placeholders
  • "How to Use This Document" instructions
14 Slide Sections - each contains:
SectionWhat it gives you
β–Ά OPENING LINEWord-for-word what to say when the slide appears
πŸ“Œ KEY POINTS TO COVERBulleted talking points with depth and context
➑ TRANSITIONSmooth segue phrase to the next slide
❓ ANTICIPATED QUESTIONSLikely viva/exam questions + model answers
Appendix: Quick Revision Table
  • 15-row colour-coded table covering: temperatures, CPA names, rates, mechanisms, lyophilization stages, Mazur's hypothesis, future directions - perfect for last-minute revision before exams.

Tips for use:
  • Fill in [Your Name], [Date], [Guide Name] on the cover
  • Print it as a personal cheat sheet during practice runs
  • The anticipated Q&A section doubles as viva preparation material
This is a shared conversation. Sign in to Orris to start your own chat.