Structure of haemoglobin and functions
haemoglobin structure quaternary alpha beta chains heme

| Contact type | Location | Bond type | Significance |
|---|---|---|---|
| α₁β₁ (and α₂β₂) | Within each dimer | Strong hydrophobic | Stabilising — largely fixed |
| α₁β₂ (and α₂β₁) | Between dimers | Weaker polar/ionic | Functional — allows movement during O₂ binding |

| Stage | Haemoglobin | Chains |
|---|---|---|
| Embryonic | HbGower 1, HbGower 2, HbPortland | ζ/ε, α/ε, ζ/γ |
| Fetal | HbF | α₂γ₂ |
| Adult (major) | HbA | α₂β₂ (~97%) |
| Adult (minor) | HbA₂ | α₂δ₂ (~2.5%) |
| Property | Detail |
|---|---|
| Molecular weight | ~64,500 Da |
| Subunits | α₂β₂ (adult HbA) |
| Prosthetic group | Heme (Fe²⁺-protoporphyrin IX) |
| O₂ binding sites | 4 per molecule |
| O₂ dissociation curve | Sigmoidal (cooperative) |
| Low-affinity form | T (taut/deoxy) — stabilised by H⁺, CO₂, 2,3-BPG |
| High-affinity form | R (relaxed/oxy) |
| Key allosteric effectors | H⁺, CO₂, 2,3-BPG, Cl⁻, temperature |
Ok please make it in ppt format
ls -la /home/daytona/workspace/
mkdir -p /home/daytona/workspace/haemoglobin-ppt && ls /home/daytona/workspace/
~/haemoglobin-ppt/build.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// ── Fetch images ─────────────────────────────────────────────────────────────
const imageUrls = [
"https://cdn.orris.care/cdss_images/4c130c81bc7151168bbd5479538045d01a127c74e27682b44d01be7c8f2f2c00.png", // T/R form
"https://cdn.orris.care/cdss_images/8f2adb7f60ef59ea0408b6769ec2baf93c11fada08074c5fae09d4506b2131ca.png", // tetramer
];
let imgs = [];
try {
const result = execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`,
{ timeout: 30000 }
).toString();
imgs = JSON.parse(result);
} catch (e) {
console.error("Image fetch error:", e.message);
imgs = [{ base64: null }, { base64: null }];
}
const trFormImg = imgs[0] && !imgs[0].error ? imgs[0].base64 : null;
const tetramerImg = imgs[1] && !imgs[1].error ? imgs[1].base64 : null;
// ── Palette ───────────────────────────────────────────────────────────────────
const DARK_BG = "0D1B2A"; // deep navy
const MID_BG = "1A2E45"; // mid navy
const ACCENT = "E8A020"; // amber gold
const ACCENT2 = "4DB6C8"; // teal
const WHITE = "FFFFFF";
const LIGHTGREY = "D0DCE8";
const SUBTEXT = "A8C0D2";
const CARD_BG = "162436";
const RED_ACCENT = "E05050";
// ── Helper ────────────────────────────────────────────────────────────────────
function headerBar(slide, title, subtitle = null) {
// Dark top bar
slide.addShape("rect", {
x: 0, y: 0, w: 10, h: 1.0,
fill: { color: MID_BG }, line: { type: "none" }
});
// Gold accent strip
slide.addShape("rect", {
x: 0, y: 0, w: 0.06, h: 1.0,
fill: { color: ACCENT }, line: { type: "none" }
});
slide.addText(title, {
x: 0.2, y: 0.12, w: 9.6, h: 0.55,
fontSize: 22, bold: true, color: WHITE, fontFace: "Calibri", margin: 0
});
if (subtitle) {
slide.addText(subtitle, {
x: 0.2, y: 0.65, w: 9.6, h: 0.3,
fontSize: 11, color: ACCENT, fontFace: "Calibri", margin: 0, italic: true
});
}
}
function footerBar(slide) {
slide.addShape("rect", {
x: 0, y: 5.32, w: 10, h: 0.3,
fill: { color: MID_BG }, line: { type: "none" }
});
slide.addText("Structure & Functions of Haemoglobin", {
x: 0.2, y: 5.33, w: 7, h: 0.25,
fontSize: 8, color: SUBTEXT, fontFace: "Calibri", margin: 0
});
slide.addText("Based on Lippincott's Biochemistry | Harrison's | Henry's", {
x: 5, y: 5.33, w: 4.8, h: 0.25,
fontSize: 8, color: SUBTEXT, fontFace: "Calibri", margin: 0, align: "right"
});
}
function card(slide, x, y, w, h, color = CARD_BG) {
slide.addShape("rect", {
x, y, w, h,
fill: { color },
line: { type: "none" },
shadow: { type: "outer", color: "000000", blur: 8, offset: 2, angle: 135, opacity: 0.25 }
});
}
// ── Presentation ─────────────────────────────────────────────────────────────
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Structure and Functions of Haemoglobin";
pres.author = "Orris Medical";
// ════════════════════════════════════════════════════════════════
// SLIDE 1 — Title
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
// Large background circle (decorative)
s.addShape("ellipse", {
x: 6.5, y: -1.5, w: 6, h: 6,
fill: { color: MID_BG }, line: { type: "none" }
});
s.addShape("ellipse", {
x: 7.2, y: -1, w: 4, h: 4,
fill: { color: "1E3A5F" }, line: { type: "none" }
});
// Gold top bar
s.addShape("rect", { x: 0, y: 0, w: 10, h: 0.07, fill: { color: ACCENT }, line: { type: "none" } });
// Molecule icon placeholder circles
for (let i = 0; i < 4; i++) {
s.addShape("ellipse", {
x: 7.4 + (i % 2) * 0.85, y: 1.5 + Math.floor(i / 2) * 0.85, w: 0.65, h: 0.65,
fill: { color: i < 2 ? ACCENT2 : ACCENT }, line: { color: WHITE, pt: 2 }
});
}
// connector lines
s.addShape("line", { x: 7.73, y: 1.825, w: 0.85, h: 0, line: { color: WHITE, pt: 2 } });
s.addShape("line", { x: 7.73, y: 2.675, w: 0.85, h: 0, line: { color: WHITE, pt: 2 } });
s.addShape("line", { x: 7.73, y: 1.825, w: 0, h: 0.85, line: { color: WHITE, pt: 2 } });
s.addShape("line", { x: 8.575, y: 1.825, w: 0, h: 0.85, line: { color: WHITE, pt: 2 } });
// Main title
s.addText("HAEMOGLOBIN", {
x: 0.5, y: 1.4, w: 6.5, h: 0.9,
fontSize: 42, bold: true, color: WHITE, fontFace: "Calibri", charSpacing: 4, margin: 0
});
// Subtitle
s.addText("Structure & Functions", {
x: 0.5, y: 2.35, w: 6, h: 0.6,
fontSize: 26, color: ACCENT, fontFace: "Calibri", italic: true, margin: 0
});
// Divider
s.addShape("rect", { x: 0.5, y: 3.05, w: 2.5, h: 0.05, fill: { color: ACCENT }, line: { type: "none" } });
s.addText([
{ text: "α₂β₂ tetramer • 4 heme groups • 64,500 Da", options: {} }
], {
x: 0.5, y: 3.2, w: 7, h: 0.4,
fontSize: 13, color: LIGHTGREY, fontFace: "Calibri", margin: 0
});
s.addText("Sources: Lippincott's Biochemistry 8e | Harrison's 22e | Henry's Clinical Diagnosis", {
x: 0.5, y: 5.1, w: 9, h: 0.3,
fontSize: 9, color: SUBTEXT, fontFace: "Calibri", margin: 0, italic: true
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 2 — Overview
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
headerBar(s, "Overview", "What is Haemoglobin?");
footerBar(s);
const items = [
{ icon: "●", color: ACCENT, label: "Location", text: "Found exclusively in red blood cells (RBCs)" },
{ icon: "●", color: ACCENT2, label: "Composition", text: "Tetramer of 4 globin chains + 4 heme groups" },
{ icon: "●", color: ACCENT, label: "MW", text: "~64,500 Da | ~280 million molecules per RBC" },
{ icon: "●", color: ACCENT2, label: "Main role", text: "Transports O₂ from lungs → tissues (4 O₂ per molecule)" },
{ icon: "●", color: ACCENT, label: "Also", text: "Carries CO₂, H⁺; acts as a blood buffer; carries NO" },
];
items.forEach((item, i) => {
const y = 1.15 + i * 0.79;
card(s, 0.3, y, 9.4, 0.68);
s.addShape("rect", { x: 0.3, y, w: 0.08, h: 0.68, fill: { color: item.color }, line: { type: "none" } });
s.addText(item.label, {
x: 0.55, y: y + 0.08, w: 1.5, h: 0.3,
fontSize: 11, bold: true, color: item.color, fontFace: "Calibri", margin: 0
});
s.addText(item.text, {
x: 0.55, y: y + 0.32, w: 8.9, h: 0.28,
fontSize: 12, color: LIGHTGREY, fontFace: "Calibri", margin: 0
});
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 3 — Primary & Secondary Structure
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
headerBar(s, "Primary & Secondary Structure", "Globin Chains & Alpha-Helical Folding");
footerBar(s);
// Left column
card(s, 0.3, 1.1, 4.5, 4.0);
s.addText("Primary Structure", {
x: 0.4, y: 1.15, w: 4.3, h: 0.38,
fontSize: 14, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0
});
s.addText([
{ text: "HbA (Adult Hb):", options: { bold: true, color: WHITE, breakLine: true } },
{ text: "• 2 α-chains (141 amino acids each)", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• 2 β-chains (146 amino acids each)", options: { color: LIGHTGREY, breakLine: true } },
{ text: " ", options: { breakLine: true } },
{ text: "Genetic basis:", options: { bold: true, color: WHITE, breakLine: true } },
{ text: "• Each chain encoded by separate genes", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• Mutations → Haemoglobinopathies", options: { color: LIGHTGREY, breakLine: true } },
{ text: " e.g. HbS: Glu→Val at β-chain pos. 6", options: { color: SUBTEXT, breakLine: true } },
{ text: " → Sickle cell disease", options: { color: SUBTEXT, breakLine: true } },
], {
x: 0.45, y: 1.6, w: 4.2, h: 3.2,
fontSize: 11.5, fontFace: "Calibri", margin: 0, lineSpacingMultiple: 1.3
});
// Right column
card(s, 5.1, 1.1, 4.6, 4.0);
s.addText("Secondary Structure", {
x: 5.2, y: 1.15, w: 4.4, h: 0.38,
fontSize: 14, bold: true, color: ACCENT2, fontFace: "Calibri", margin: 0
});
s.addText([
{ text: "Each globin chain contains:", options: { bold: true, color: WHITE, breakLine: true } },
{ text: "• Multiple α-helical segments (A–H)", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• Non-helical hinge regions (corners)", options: { color: LIGHTGREY, breakLine: true } },
{ text: " ", options: { breakLine: true } },
{ text: "Hydrophobic heme pocket:", options: { bold: true, color: WHITE, breakLine: true } },
{ text: "• Formed by folding of the helices", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• Located near surface of subunit", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• Accommodates one heme group", options: { color: LIGHTGREY, breakLine: true } },
{ text: " ", options: { breakLine: true } },
{ text: "Similar to myoglobin", options: { bold: true, color: WHITE, breakLine: true } },
{ text: "but Hb is a tetramer with cooperativity", options: { color: LIGHTGREY, breakLine: true } },
], {
x: 5.2, y: 1.6, w: 4.3, h: 3.2,
fontSize: 11.5, fontFace: "Calibri", margin: 0, lineSpacingMultiple: 1.3
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 4 — Heme Group
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
headerBar(s, "The Heme Group", "Protoporphyrin IX with Fe²⁺");
footerBar(s);
// Central circle to represent heme ring
s.addShape("ellipse", {
x: 3.8, y: 1.6, w: 2.4, h: 2.4,
fill: { color: "1E3A5F" }, line: { color: ACCENT, pt: 3 }
});
s.addText("Fe²⁺", {
x: 3.8, y: 2.55, w: 2.4, h: 0.5,
fontSize: 22, bold: true, color: ACCENT, fontFace: "Calibri", align: "center", margin: 0
});
s.addText("Heme", {
x: 3.8, y: 3.1, w: 2.4, h: 0.3,
fontSize: 11, color: SUBTEXT, fontFace: "Calibri", align: "center", margin: 0
});
// 4 pyrrole nitrogen indicators
const pyrrolePositions = [
{ x: 4.3, y: 1.35, label: "N" },
{ x: 5.6, y: 2.35, label: "N" },
{ x: 4.3, y: 3.45, label: "N" },
{ x: 3.0, y: 2.35, label: "N" }
];
pyrrolePositions.forEach(p => {
s.addShape("ellipse", { x: p.x, y: p.y, w: 0.35, h: 0.35, fill: { color: ACCENT2 }, line: { type: "none" } });
s.addText(p.label, { x: p.x, y: p.y, w: 0.35, h: 0.35, fontSize: 10, bold: true, color: DARK_BG, fontFace: "Calibri", align: "center", margin: 0 });
});
// Proximal His marker
s.addShape("ellipse", { x: 4.7, y: 4.25, w: 0.6, h: 0.35, fill: { color: "8060C0" }, line: { type: "none" } });
s.addText("His F8", { x: 4.7, y: 4.25, w: 0.6, h: 0.35, fontSize: 9, color: WHITE, fontFace: "Calibri", align: "center", margin: 0 });
s.addShape("line", { x: 5.0, y: 3.95, w: 0, h: 0.3, line: { color: "8060C0", pt: 2 } });
// O2 binding indicator
s.addShape("ellipse", { x: 4.7, y: 1.0, w: 0.6, h: 0.35, fill: { color: RED_ACCENT }, line: { type: "none" } });
s.addText("O₂", { x: 4.7, y: 1.0, w: 0.6, h: 0.35, fontSize: 9, bold: true, color: WHITE, fontFace: "Calibri", align: "center", margin: 0 });
s.addShape("line", { x: 5.0, y: 1.35, w: 0, h: 0.25, line: { color: RED_ACCENT, pt: 2, dashType: "dash" } });
// Right side info
card(s, 6.5, 1.1, 3.2, 4.1);
s.addText("6 Coordination Bonds of Fe²⁺", {
x: 6.6, y: 1.15, w: 3.0, h: 0.4,
fontSize: 12, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0
});
s.addText([
{ text: "① – ④", options: { bold: true, color: ACCENT2 } },
{ text: " 4 pyrrole N of porphyrin ring", options: { color: LIGHTGREY, breakLine: true } },
{ text: "⑤", options: { bold: true, color: "8060C0" } },
{ text: " Proximal His (F8)", options: { color: LIGHTGREY, breakLine: true } },
{ text: "⑥", options: { bold: true, color: RED_ACCENT } },
{ text: " O₂ (reversible bond)", options: { color: LIGHTGREY, breakLine: true } },
{ text: " ", options: { breakLine: true } },
{ text: "Key points:", options: { bold: true, color: WHITE, breakLine: true } },
{ text: "• Must remain Fe²⁺ (ferrous)", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• Fe³⁺ = methaemoglobin (no O₂ carry)", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• Distal His (E7) stabilises bound O₂", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• Prevents Fe²⁺ → Fe³⁺ oxidation", options: { color: LIGHTGREY, breakLine: true } },
{ text: " ", options: { breakLine: true } },
{ text: "Synthesis:", options: { bold: true, color: WHITE, breakLine: true } },
{ text: "Succinyl-CoA + Glycine → ALA → Porphobilinogen → Protoporphyrin IX → Heme", options: { color: SUBTEXT, breakLine: true } },
], {
x: 6.6, y: 1.65, w: 3.0, h: 3.3,
fontSize: 10.5, fontFace: "Calibri", margin: 0, lineSpacingMultiple: 1.3
});
// Left annotation
s.addText("4 Heme groups per Hb molecule\nOne per globin chain", {
x: 0.3, y: 3.5, w: 3.2, h: 0.7,
fontSize: 11, color: LIGHTGREY, fontFace: "Calibri", align: "center", margin: 0, italic: true
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 5 — Quaternary Structure (tetramer image)
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
headerBar(s, "Quaternary Structure", "The α₂β₂ Tetramer");
footerBar(s);
if (tetramerImg) {
s.addImage({
data: tetramerImg,
x: 0.25, y: 1.1, w: 4.7, h: 4.1,
});
} else {
card(s, 0.25, 1.1, 4.7, 4.1);
s.addText("[Tetramer diagram]", { x: 0.25, y: 2.7, w: 4.7, h: 0.5, fontSize: 12, color: SUBTEXT, align: "center", margin: 0 });
}
// Right info
card(s, 5.2, 1.1, 4.55, 1.85);
s.addText("Two αβ Dimers", { x: 5.35, y: 1.15, w: 4.3, h: 0.38, fontSize: 13, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0 });
s.addText([
{ text: "α₁β₁ contact (strong, stabilising):", options: { bold: true, color: ACCENT2, breakLine: true } },
{ text: " Primarily hydrophobic interactions", options: { color: LIGHTGREY, breakLine: true } },
{ text: "α₁β₂ contact (functional):", options: { bold: true, color: ACCENT, breakLine: true } },
{ text: " Weaker polar bonds — allows movement during O₂ loading/unloading", options: { color: LIGHTGREY, breakLine: true } },
], { x: 5.35, y: 1.6, w: 4.3, h: 1.2, fontSize: 10.5, fontFace: "Calibri", margin: 0, lineSpacingMultiple: 1.35 });
card(s, 5.2, 3.1, 4.55, 2.05);
s.addText("Contact Interface Summary", { x: 5.35, y: 3.15, w: 4.3, h: 0.38, fontSize: 13, bold: true, color: ACCENT2, fontFace: "Calibri", margin: 0 });
s.addTable([
[
{ text: "Interface", options: { bold: true, color: WHITE, fill: { color: MID_BG } } },
{ text: "Bond Type", options: { bold: true, color: WHITE, fill: { color: MID_BG } } },
{ text: "Role", options: { bold: true, color: WHITE, fill: { color: MID_BG } } }
],
[
{ text: "α₁β₁", options: { color: LIGHTGREY, fill: { color: CARD_BG } } },
{ text: "Hydrophobic", options: { color: LIGHTGREY, fill: { color: CARD_BG } } },
{ text: "Stabilising", options: { color: LIGHTGREY, fill: { color: CARD_BG } } }
],
[
{ text: "α₁β₂", options: { color: LIGHTGREY, fill: { color: "162C40" } } },
{ text: "Polar / ionic", options: { color: LIGHTGREY, fill: { color: "162C40" } } },
{ text: "Functional (T↔R)", options: { color: LIGHTGREY, fill: { color: "162C40" } } }
],
], {
x: 5.35, y: 3.6, w: 4.3, h: 1.3,
border: { pt: 0.5, color: "2A4A6A" },
colW: [1.1, 1.5, 1.7],
fontSize: 10
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 6 — T and R Forms (conformational change)
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
headerBar(s, "Conformational States: T Form ↔ R Form", "The Molecular Basis of Cooperativity");
footerBar(s);
if (trFormImg) {
s.addImage({
data: trFormImg,
x: 0.25, y: 1.1, w: 9.5, h: 3.3,
});
}
// Summary boxes below image
card(s, 0.25, 4.52, 4.6, 0.72, "1A2E45");
s.addShape("rect", { x: 0.25, y: 4.52, w: 0.08, h: 0.72, fill: { color: SUBTEXT }, line: { type: "none" } });
s.addText("T form (Taut/Deoxy)", { x: 0.45, y: 4.53, w: 4.2, h: 0.3, fontSize: 11, bold: true, color: LIGHTGREY, fontFace: "Calibri", margin: 0 });
s.addText("Low O₂ affinity • Fe²⁺ out-of-plane • Stabilised by H⁺, CO₂, 2,3-BPG", {
x: 0.45, y: 4.83, w: 4.2, h: 0.3, fontSize: 9.5, color: SUBTEXT, fontFace: "Calibri", margin: 0
});
card(s, 5.15, 4.52, 4.6, 0.72, "1A2E45");
s.addShape("rect", { x: 5.15, y: 4.52, w: 0.08, h: 0.72, fill: { color: ACCENT }, line: { type: "none" } });
s.addText("R form (Relaxed/Oxy)", { x: 5.35, y: 4.53, w: 4.2, h: 0.3, fontSize: 11, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0 });
s.addText("High O₂ affinity • Fe²⁺ in-plane • Inter-dimer polar bonds broken", {
x: 5.35, y: 4.83, w: 4.2, h: 0.3, fontSize: 9.5, color: SUBTEXT, fontFace: "Calibri", margin: 0
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 7 — Developmental Variants
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
headerBar(s, "Developmental Haemoglobin Variants", "Sequential Globin Gene Expression");
footerBar(s);
const variants = [
{ stage: "Embryonic", name: "HbGower 1", chains: "ζ₂ε₂", feature: "Yolk sac; replaced by 8 weeks", col: ACCENT },
{ stage: "Embryonic", name: "HbGower 2", chains: "α₂ε₂", feature: "Yolk sac; early gestation", col: ACCENT },
{ stage: "Embryonic", name: "HbPortland", chains: "ζ₂γ₂", feature: "Transitional embryonic form", col: ACCENT },
{ stage: "Fetal", name: "HbF", chains: "α₂γ₂", feature: "High O₂ affinity; poor 2,3-BPG binding → placental O₂ transfer", col: ACCENT2 },
{ stage: "Adult", name: "HbA", chains: "α₂β₂", feature: "~97% of adult Hb; main O₂ transporter", col: "5ABD82" },
{ stage: "Adult", name: "HbA₂", chains: "α₂δ₂", feature: "~2.5% of adult Hb; elevated in β-thalassaemia", col: "5ABD82" },
];
s.addTable([
[
{ text: "Stage", options: { bold: true, color: WHITE, fill: { color: MID_BG } } },
{ text: "Type", options: { bold: true, color: WHITE, fill: { color: MID_BG } } },
{ text: "Chains", options: { bold: true, color: WHITE, fill: { color: MID_BG } } },
{ text: "Key Feature", options: { bold: true, color: WHITE, fill: { color: MID_BG } } },
],
...variants.map(v => [
{ text: v.stage, options: { color: v.col, fill: { color: CARD_BG }, bold: true } },
{ text: v.name, options: { color: WHITE, fill: { color: CARD_BG }, bold: true } },
{ text: v.chains, options: { color: ACCENT2, fill: { color: CARD_BG } } },
{ text: v.feature, options: { color: LIGHTGREY, fill: { color: CARD_BG } } },
])
], {
x: 0.3, y: 1.1, w: 9.4, h: 4.2,
border: { pt: 0.5, color: "2A4A6A" },
colW: [1.4, 1.4, 1.3, 5.3],
fontSize: 11,
rowH: 0.58,
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 8 — Functions: O₂ Transport & Cooperativity
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
headerBar(s, "Function 1: Oxygen Transport & Cooperativity", "Sigmoidal Dissociation Curve");
footerBar(s);
// Simulated O2 dissociation curve using shapes
card(s, 0.25, 1.1, 5.5, 4.05);
s.addText("O₂ Dissociation Curve", {
x: 0.35, y: 1.15, w: 5.2, h: 0.35, fontSize: 13, bold: true, color: ACCENT, fontFace: "Calibri", margin: 0
});
// Axes
s.addShape("line", { x: 0.7, y: 1.65, w: 0, h: 3.1, line: { color: LIGHTGREY, pt: 1.5 } }); // y-axis
s.addShape("line", { x: 0.7, y: 4.75, w: 4.8, h: 0, line: { color: LIGHTGREY, pt: 1.5 } }); // x-axis
s.addText("% O₂ Saturation", { x: 0.3, y: 1.7, w: 0.3, h: 2.8, fontSize: 9, color: LIGHTGREY, rotate: 270, margin: 0 });
s.addText("pO₂ (mmHg)", { x: 2.5, y: 4.82, w: 2.5, h: 0.25, fontSize: 9, color: LIGHTGREY, align: "center", margin: 0 });
// Axis labels
["0","25","50","75","100"].forEach((v, i) => {
s.addText(v, { x: 0.35, y: 4.72 - i * 0.65, w: 0.3, h: 0.22, fontSize: 8, color: SUBTEXT, align: "right", margin: 0 });
});
["0","20","40","60","80","100"].forEach((v, i) => {
s.addText(v, { x: 0.65 + i * 0.79, y: 4.78, w: 0.4, h: 0.22, fontSize: 8, color: SUBTEXT, align: "center", margin: 0 });
});
// Sigmoidal curve (Hb) - approximate using rectangles as dots
const hbPoints = [
[0.7, 4.75], [1.1, 4.72], [1.5, 4.6], [1.9, 4.35], [2.3, 3.9],
[2.7, 3.3], [3.1, 2.65], [3.5, 2.2], [3.9, 1.95], [4.3, 1.8],
[4.7, 1.72], [5.1, 1.69]
];
for (let i = 0; i < hbPoints.length - 1; i++) {
const [x1, y1] = hbPoints[i];
const [x2, y2] = hbPoints[i + 1];
s.addShape("line", { x: x1, y: y1, w: x2 - x1, h: y2 - y1, line: { color: ACCENT, pt: 2.5 } });
}
s.addText("Hb (sigmoidal)", { x: 4.4, y: 1.6, w: 1.1, h: 0.3, fontSize: 8, color: ACCENT, fontFace: "Calibri", margin: 0 });
// Myoglobin curve (hyperbolic) for comparison
const mbPoints = [
[0.7, 4.75], [1.1, 4.55], [1.5, 4.2], [1.9, 3.8], [2.3, 3.4],
[2.7, 3.05], [3.1, 2.8], [3.5, 2.62], [3.9, 2.5], [4.3, 2.42],
[4.7, 2.37], [5.1, 2.33]
];
for (let i = 0; i < mbPoints.length - 1; i++) {
const [x1, y1] = mbPoints[i];
const [x2, y2] = mbPoints[i + 1];
s.addShape("line", { x: x1, y: y1, w: x2 - x1, h: y2 - y1, line: { color: ACCENT2, pt: 1.5, dashType: "sysDash" } });
}
s.addText("Mb (hyperbolic)", { x: 4.4, y: 2.25, w: 1.15, h: 0.3, fontSize: 8, color: ACCENT2, fontFace: "Calibri", margin: 0 });
// Right panel
card(s, 5.95, 1.1, 3.8, 4.05);
s.addText("Key Points", {
x: 6.1, y: 1.15, w: 3.5, h: 0.35, fontSize: 13, bold: true, color: ACCENT2, fontFace: "Calibri", margin: 0
});
s.addText([
{ text: "Cooperative Binding:", options: { bold: true, color: WHITE, breakLine: true } },
{ text: "• Each O₂ bound increases affinity for next", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• Basis: T→R conformational shift", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• Result: sigmoidal curve (not hyperbolic)", options: { color: LIGHTGREY, breakLine: true } },
{ text: " ", options: { breakLine: true } },
{ text: "Physiological Advantage:", options: { bold: true, color: WHITE, breakLine: true } },
{ text: "• Efficient O₂ loading in lungs (high pO₂)", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• Efficient unloading in tissues (low pO₂)", options: { color: LIGHTGREY, breakLine: true } },
{ text: " ", options: { breakLine: true } },
{ text: "Capacity:", options: { bold: true, color: WHITE, breakLine: true } },
{ text: "• 1.34 mL O₂ per gram Hb", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• ~20 mL O₂ per 100 mL blood", options: { color: LIGHTGREY, breakLine: true } },
{ text: "• vs 0.3 mL without Hb (dissolved only)", options: { color: SUBTEXT, breakLine: true } },
], {
x: 6.1, y: 1.6, w: 3.5, h: 3.3,
fontSize: 10.5, fontFace: "Calibri", margin: 0, lineSpacingMultiple: 1.3
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 9 — Allosteric Regulation
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
headerBar(s, "Function 2: Allosteric Regulation of O₂ Affinity", "Bohr Effect & 2,3-BPG");
footerBar(s);
const regulators = [
{
title: "Bohr Effect (H⁺ & CO₂)",
color: RED_ACCENT,
lines: [
"In tissues: ↑ CO₂ → ↑ H⁺ via carbonic anhydrase",
"H⁺ binds histidine residues on globin chains",
"Stabilises T form → O₂ released to tissues",
"In lungs: CO₂ expelled → ↓ H⁺ → R form → O₂ loaded",
"Effect: right-shifts O₂ dissociation curve"
]
},
{
title: "2,3-Bisphosphoglycerate (2,3-BPG)",
color: ACCENT,
lines: [
"Produced in RBCs via Rapoport–Luebering shunt",
"Binds in central cavity between β-chains of T form",
"Forms ionic bonds → reduces O₂ affinity",
"Elevated at high altitude & chronic anaemia",
"HbF binds 2,3-BPG poorly → higher O₂ affinity"
]
},
{
title: "Temperature & Cl⁻",
color: ACCENT2,
lines: [
"↑ Temperature → ↓ O₂ affinity (right shift)",
"Active tissues generate heat → aids O₂ release",
"Cl⁻ ions also stabilise the T form",
"CO binds Fe²⁺ with 250× affinity vs O₂ (toxic)"
]
}
];
regulators.forEach((reg, i) => {
const y = 1.1 + i * 1.44;
card(s, 0.3, y, 9.4, 1.32);
s.addShape("rect", { x: 0.3, y, w: 0.08, h: 1.32, fill: { color: reg.color }, line: { type: "none" } });
s.addText(reg.title, { x: 0.55, y: y + 0.07, w: 9.0, h: 0.33, fontSize: 12.5, bold: true, color: reg.color, fontFace: "Calibri", margin: 0 });
const textItems = reg.lines.map((l, li) => ({
text: "• " + l,
options: { color: LIGHTGREY, breakLine: li < reg.lines.length - 1 }
}));
s.addText(textItems, { x: 0.55, y: y + 0.43, w: 9.0, h: 0.8, fontSize: 10.5, fontFace: "Calibri", margin: 0, lineSpacingMultiple: 1.2 });
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 10 — CO₂ Transport & Buffering
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
headerBar(s, "Functions 3–5: CO₂ Transport, Buffering & NO Carriage", "Beyond Oxygen Transport");
footerBar(s);
const fns = [
{
num: "3",
title: "CO₂ Transport",
color: ACCENT2,
text: [
"~20–23% of CO₂ carried as carbamino-Hb (CO₂ binds N-terminal amino groups of globin chains as carbamate)",
"Deoxygenated Hb has higher carbamino-forming capacity",
"Remainder: dissolved in plasma or as HCO₃⁻ (via carbonic anhydrase)"
]
},
{
num: "4",
title: "Blood Buffering (Haldane Effect)",
color: ACCENT,
text: [
"Hb is a major blood buffer — histidine side chains (imidazole, pKa ~6.0) can accept/donate H⁺",
"Deoxyhaemoglobin (T form) has higher affinity for H⁺ than oxyhaemoglobin",
"Carries H⁺ from tissues to lungs where it is expelled as H₂O (with HCO₃⁻)"
]
},
{
num: "5",
title: "Nitric Oxide (NO) Transport",
color: "5ABD82",
text: [
"Hb binds NO at Fe²⁺ of heme (forming nitrosyl-Hb) → scavenges NO",
"Also binds NO at Cys β-93 (forming S-nitrosyl-Hb) → delivers NO to vasculature",
"Modulates vascular tone and local blood flow distribution"
]
}
];
fns.forEach((fn, i) => {
const y = 1.1 + i * 1.44;
card(s, 0.3, y, 9.4, 1.32);
s.addShape("ellipse", { x: 0.32, y: y + 0.27, w: 0.5, h: 0.5, fill: { color: fn.color }, line: { type: "none" } });
s.addText(fn.num, { x: 0.32, y: y + 0.27, w: 0.5, h: 0.5, fontSize: 16, bold: true, color: DARK_BG, fontFace: "Calibri", align: "center", margin: 0 });
s.addText(fn.title, { x: 0.95, y: y + 0.07, w: 8.5, h: 0.33, fontSize: 13, bold: true, color: fn.color, fontFace: "Calibri", margin: 0 });
const textItems = fn.text.map((l, li) => ({
text: "• " + l,
options: { color: LIGHTGREY, breakLine: li < fn.text.length - 1 }
}));
s.addText(textItems, { x: 0.95, y: y + 0.44, w: 8.5, h: 0.8, fontSize: 10.5, fontFace: "Calibri", margin: 0, lineSpacingMultiple: 1.2 });
});
}
// ════════════════════════════════════════════════════════════════
// SLIDE 11 — Summary Table
// ════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.background = { color: DARK_BG };
headerBar(s, "Summary", "Structure & Functions at a Glance");
footerBar(s);
s.addTable([
[
{ text: "Property", options: { bold: true, color: WHITE, fill: { color: MID_BG } } },
{ text: "Detail", options: { bold: true, color: WHITE, fill: { color: MID_BG } } }
],
[
{ text: "Molecular weight", options: { color: LIGHTGREY, fill: { color: CARD_BG }, bold: true } },
{ text: "~64,500 Da", options: { color: LIGHTGREY, fill: { color: CARD_BG } } }
],
[
{ text: "Subunit composition", options: { color: LIGHTGREY, fill: { color: "162C40" }, bold: true } },
{ text: "α₂β₂ (HbA, adult) | α₂γ₂ (HbF, fetal)", options: { color: LIGHTGREY, fill: { color: "162C40" } } }
],
[
{ text: "Prosthetic group", options: { color: LIGHTGREY, fill: { color: CARD_BG }, bold: true } },
{ text: "Heme (Fe²⁺-protoporphyrin IX) — 4 per molecule", options: { color: LIGHTGREY, fill: { color: CARD_BG } } }
],
[
{ text: "O₂ binding", options: { color: LIGHTGREY, fill: { color: "162C40" }, bold: true } },
{ text: "4 O₂ per molecule; sigmoidal (cooperative) curve", options: { color: LIGHTGREY, fill: { color: "162C40" } } }
],
[
{ text: "T form (deoxy)", options: { color: LIGHTGREY, fill: { color: CARD_BG }, bold: true } },
{ text: "Low O₂ affinity; stabilised by H⁺, CO₂, 2,3-BPG, Cl⁻, ↑ temp", options: { color: LIGHTGREY, fill: { color: CARD_BG } } }
],
[
{ text: "R form (oxy)", options: { color: LIGHTGREY, fill: { color: "162C40" }, bold: true } },
{ text: "High O₂ affinity; Fe²⁺ in-plane; inter-dimer polar bonds broken", options: { color: LIGHTGREY, fill: { color: "162C40" } } }
],
[
{ text: "Key functions", options: { color: LIGHTGREY, fill: { color: CARD_BG }, bold: true } },
{ text: "O₂ transport | CO₂ transport | Blood buffering (Bohr/Haldane) | 2,3-BPG regulation | NO carriage", options: { color: LIGHTGREY, fill: { color: CARD_BG } } }
],
], {
x: 0.3, y: 1.12, w: 9.4, h: 4.05,
border: { pt: 0.5, color: "2A4A6A" },
colW: [2.6, 6.8],
fontSize: 11,
rowH: 0.47,
});
}
// ── Write file ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/haemoglobin-ppt/Haemoglobin_Structure_Functions.pptx" })
.then(() => console.log("Done: Haemoglobin_Structure_Functions.pptx"))
.catch(err => { console.error(err); process.exit(1); });
cd /home/daytona/workspace/haemoglobin-ppt && node build.js 2>&1