Kreb cycle
Krebs cycle steps enzymes NADH FADH2 overview biochemistry

| Step | Reaction | Enzyme | Products |
|---|---|---|---|
| 1 | Oxaloacetate + Acetyl-CoA → Citrate | Citrate synthase | CoA released |
| 2 | Citrate → cis-Aconitate → Isocitrate | Aconitase | H2O removed, then added |
| 3 | Isocitrate → Oxalosuccinate → α-Ketoglutarate | Isocitrate dehydrogenase | 2H (→ NADH), CO2 |
| 4 | α-Ketoglutarate → Succinyl-CoA | α-Ketoglutarate dehydrogenase | 2H (→ NADH), CO2 |
| 5 | Succinyl-CoA → Succinate | Succinyl-CoA synthase | GTP (= ATP) |
| 6 | Succinate → Fumarate | Succinate dehydrogenase | 2H (→ FADH2) |
| 7 | Fumarate → Malate | Fumarase | H2O added |
| 8 | Malate → Oxaloacetate | Malate dehydrogenase | 2H (→ NADH) |
| Product | Amount | Fate |
|---|---|---|
| CO2 | 2 molecules | Expired via lungs |
| NADH | 3 molecules | Oxidative phosphorylation → ~7.5 ATP |
| FADH2 | 1 molecule | Oxidative phosphorylation → ~1.5 ATP |
| GTP/ATP | 1 molecule | Direct energy |
| Stage | ATP yield |
|---|---|
| Glycolysis | 2 ATP (net) |
| Pyruvate → Acetyl-CoA | ~5 ATP (via 2 NADH) |
| Krebs cycle (2 turns) | ~20 ATP (via NADH, FADH2) + 2 GTP |
| Total | ~30-32 ATP |
Create a visual study guide/poster on the 8 Krebs cycle enzymes
A detailed visual study guide poster titled "The 8 Enzymes of the Krebs Cycle" showing a circular biochemical pathway diagram in the center with all 8 steps labeled. The cycle shows: Step 1 - Citrate Synthase (Oxaloacetate + Acetyl-CoA → Citrate), Step 2 - Aconitase (Citrate → Isocitrate via cis-Aconitate), Step 3 - Isocitrate Dehydrogenase (Isocitrate → α-Ketoglutarate, releases CO2, produces NADH), Step 4 - α-Ketoglutarate Dehydrogenase (α-Ketoglutarate → Succinyl-CoA, releases CO2, produces NADH), Step 5 - Succinyl-CoA Synthetase (Succinyl-CoA → Succinate, produces GTP/ATP), Step 6 - Succinate Dehydrogenase (Succinate → Fumarate, produces FADH2), Step 7 - Fumarase (Fumarate → Malate), Step 8 - Malate Dehydrogenase (Malate → Oxaloacetate, produces NADH). Each enzyme has a color-coded callout box with the enzyme name, substrates, products, and cofactors. Energy carriers NADH, FADH2, GTP are highlighted in gold/yellow. CO2 releases marked in red. Regulatory enzymes (Citrate Synthase, Isocitrate Dehydrogenase, α-Ketoglutarate Dehydrogenase) are marked with a star. Location label: Mitochondrial Matrix. Clean dark blue and white scientific poster style, suitable for medical students.

| # | Enzyme | Substrate → Product | Cofactor/Product | Notes |
|---|---|---|---|---|
| 1 | Citrate Synthase | Oxaloacetate + Acetyl-CoA → Citrate | CoA released | ⭐ Regulatory; inhibited by ATP, NADH, citrate |
| 2 | Aconitase | Citrate → Isocitrate | - | Goes via cis-Aconitate intermediate |
| 3 | Isocitrate Dehydrogenase | Isocitrate → α-Ketoglutarate | NADH, CO2 | ⭐ Regulatory; activated by ADP/Ca2+ |
| 4 | α-Ketoglutarate Dehydrogenase | α-Ketoglutarate → Succinyl-CoA | NADH, CO2 | ⭐ Regulatory; requires B vitamins (thiamine, lipoate) |
| 5 | Succinyl-CoA Synthetase | Succinyl-CoA → Succinate | GTP | Only step producing direct ATP equivalent |
| 6 | Succinate Dehydrogenase | Succinate → Fumarate | FADH2 | Embedded in inner mitochondrial membrane; also Complex II of ETC |
| 7 | Fumarase | Fumarate → Malate | H2O added | Simple hydration reaction |
| 8 | Malate Dehydrogenase | Malate → Oxaloacetate | NADH | Regenerates oxaloacetate to restart the cycle |
Citrus Are In A Sunny South Florida Most days (Citrate synthase - Aconitase - Isocitrate DH - Alpha-KG DH - Succinyl-CoA synthetase - Succinate DH - Fumarase - Malate DH)
Regulation of blood ph biochemistry
regulation of blood pH biochemistry buffer systems bicarbonate respiratory renal
| Parameter | Normal Value |
|---|---|
| Arterial blood pH | 7.36 - 7.44 (mean 7.40) |
| [H+] at pH 7.4 | ~40 nEq/L (4 × 10⁻⁸ mol/L) |
| Compatible range for life | 6.8 - 7.8 |
| Intracellular pH | ~7.1 (range 6.9 - 7.4) |

CO₂ + H₂O ⇌ H₂CO₃ ⇌ HCO₃⁻ + H⁺

| Condition | Lungs respond by |
|---|---|
| Metabolic acidosis | Hyperventilation (↓ PaCO₂) |
| Metabolic alkalosis | Hypoventilation (↑ PaCO₂) |
| Location | Transporter | Details |
|---|---|---|
| Proximal tubule | Na⁺-H⁺ exchanger (NHE3) | Secondary active; driven by Na⁺ gradient from Na/K ATPase |
| Distal tubule / Collecting duct | H⁺-ATPase (proton pump) | Primary active; Na⁺-independent; stimulated by aldosterone |
| Disorder | Primary Change | Compensation |
|---|---|---|
| Metabolic Acidosis | ↓ HCO₃⁻ | ↑ Ventilation (↓ PaCO₂) |
| Metabolic Alkalosis | ↑ HCO₃⁻ | ↓ Ventilation (↑ PaCO₂) |
| Respiratory Acidosis | ↑ PaCO₂ | Kidneys retain HCO₃⁻, excrete H⁺ |
| Respiratory Alkalosis | ↓ PaCO₂ | Kidneys excrete HCO₃⁻, retain H⁺ |
| Buffer System | Location | pKa | Regulated By |
|---|---|---|---|
| Bicarbonate/H₂CO₃ | ECF/blood | 6.1 | Lungs + Kidneys |
| Hemoglobin | RBCs | 6.7 | O₂/CO₂ exchange |
| Phosphate | ICF, urine | 6.8 | Kidneys |
| Proteins | ICF, plasma | ~6-7 | Metabolism |
Generate a clinical practice guide on ABG interpretation
ls -la /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/abg-guide
~/abg-guide/abg_guide.js
const pptxgen = require("pptxgenjs");
let pres = new pptxgen();
pres.layout = 'LAYOUT_16x9';
pres.title = 'ABG Interpretation Clinical Practice Guide';
pres.author = 'Orris Clinical Reference';
// Color palette
const C = {
darkBlue: "0D2137", // dominant dark
midBlue: "1A3A5C",
accent: "00C9A7", // teal accent
accentWarm: "FF6B6B", // red for acidosis
accentAlk: "4FC3F7", // blue for alkalosis
yellow: "FFD93D", // highlight
white: "FFFFFF",
lightGray: "E8F0F7",
textDark: "1A1A2E",
textMid: "334155",
green: "22C55E",
orange: "F97316",
};
// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 1: Title
// ─────────────────────────────────────────────────────────────────────────────
let s1 = pres.addSlide();
s1.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBlue } });
// accent bar
s1.addShape(pres.ShapeType.rect, { x: 0, y: 4.8, w: 10, h: 0.825, fill: { color: C.accent } });
s1.addText("ABG INTERPRETATION", {
x: 0.5, y: 0.6, w: 9, h: 1.1,
fontSize: 44, bold: true, color: C.white,
fontFace: "Calibri", align: "center", charSpacing: 5,
});
s1.addText("Clinical Practice Guide", {
x: 0.5, y: 1.65, w: 9, h: 0.7,
fontSize: 26, color: C.accent, fontFace: "Calibri", align: "center",
});
s1.addText("Arterial Blood Gas • Acid-Base Disorders • Compensation • Clinical Cases", {
x: 0.5, y: 2.4, w: 9, h: 0.5,
fontSize: 14, color: "A0BACE", fontFace: "Calibri", align: "center",
});
// decorative circles
s1.addShape(pres.ShapeType.ellipse, { x: 7.8, y: 0.2, w: 2.2, h: 2.2, fill: { color: "1A3A5C" }, line: { color: C.accent, width: 2 } });
s1.addShape(pres.ShapeType.ellipse, { x: 8.2, y: 0.6, w: 1.4, h: 1.4, fill: { color: C.accent } });
s1.addText("Reference • Rosen's Emergency Medicine 10e • Frameworks for Internal Medicine\nGanong's Medical Physiology 26e • Basic Medical Biochemistry 6e", {
x: 0.5, y: 4.9, w: 9, h: 0.6,
fontSize: 9, color: C.darkBlue, fontFace: "Calibri", align: "center",
});
// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 2: Normal ABG Values + Key Parameters
// ─────────────────────────────────────────────────────────────────────────────
let s2 = pres.addSlide();
s2.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray } });
// header bar
s2.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.darkBlue } });
s2.addText("NORMAL ABG VALUES & KEY PARAMETERS", {
x: 0.3, y: 0.05, w: 9.4, h: 0.65, fontSize: 18, bold: true, color: C.accent,
fontFace: "Calibri", valign: "middle",
});
// 6 parameter cards
const params = [
{ label: "pH", normal: "7.35 – 7.45", acidosis: "< 7.35", alkalosis: "> 7.45", color: C.midBlue },
{ label: "PaCO₂", normal: "35 – 45 mmHg", acidosis: "> 45 (resp. acid)", alkalosis: "< 35 (resp. alk)", color: C.midBlue },
{ label: "HCO₃⁻", normal: "22 – 26 mEq/L", acidosis: "< 22 (met. acid)", alkalosis: "> 26 (met. alk)", color: C.midBlue },
{ label: "PaO₂", normal: "80 – 100 mmHg", acidosis: "< 80: hypoxemia", alkalosis: "", color: C.midBlue },
{ label: "SaO₂", normal: "95 – 100%", acidosis: "< 90%: critical", alkalosis: "", color: C.midBlue },
{ label: "Base Excess", normal: "-2 to +2 mEq/L", acidosis: "< -2: acidosis", alkalosis: "> +2: alkalosis", color: C.midBlue },
];
params.forEach((p, i) => {
const col = i % 3;
const row = Math.floor(i / 3);
const x = 0.25 + col * 3.25;
const y = 1.0 + row * 2.15;
s2.addShape(pres.ShapeType.rect, { x, y, w: 3.1, h: 1.9, fill: { color: C.white }, line: { color: C.accent, width: 1.5 }, shadow: { type: "outer", blur: 4, offset: 2, angle: 45, color: "AAAAAA", opacity: 0.3 } });
s2.addShape(pres.ShapeType.rect, { x, y, w: 3.1, h: 0.4, fill: { color: p.color }, line: { color: p.color, width: 0 } });
s2.addText(p.label, { x, y, w: 3.1, h: 0.4, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
s2.addText([
{ text: "Normal: ", options: { bold: true, color: C.green } },
{ text: p.normal + "\n", options: { color: C.textDark } },
{ text: p.acidosis ? "↓ " + p.acidosis + "\n" : "", options: { color: C.accentWarm } },
{ text: p.alkalosis ? "↑ " + p.alkalosis : "", options: { color: C.accentAlk } },
], { x: x + 0.1, y: y + 0.44, w: 2.9, h: 1.42, fontSize: 10.5, fontFace: "Calibri", valign: "top" });
});
// Henderson-Hasselbalch box
s2.addShape(pres.ShapeType.rect, { x: 0.25, y: 4.65, w: 9.5, h: 0.75, fill: { color: C.darkBlue }, line: { color: C.accent, width: 1 } });
s2.addText([
{ text: "Henderson-Hasselbalch: ", options: { bold: true, color: C.accent } },
{ text: "pH = 6.1 + log([HCO₃⁻] / 0.03 × PaCO₂) ", options: { color: C.white } },
{ text: "Normal ratio HCO₃⁻ : PaCO₂ = 20:1 → pH 7.4", options: { color: C.yellow } },
], { x: 0.4, y: 4.7, w: 9.2, h: 0.6, fontSize: 12, fontFace: "Calibri", align: "center", valign: "middle" });
// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 3: 5-Step ABG Interpretation Method
// ─────────────────────────────────────────────────────────────────────────────
let s3 = pres.addSlide();
s3.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBlue } });
s3.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.accent } });
s3.addText("5-STEP ABG INTERPRETATION METHOD", {
x: 0.3, y: 0.05, w: 9.4, h: 0.65, fontSize: 18, bold: true, color: C.darkBlue,
fontFace: "Calibri", valign: "middle",
});
const steps = [
{
num: "1", title: "Assess pH",
desc: "pH < 7.35 → Acidemia\npH 7.35–7.45 → Normal (may still have disorder)\npH > 7.45 → Alkalemia",
},
{
num: "2", title: "Identify Primary Disorder",
desc: "PaCO₂ ↑ + pH ↓ → Respiratory Acidosis\nPaCO₂ ↓ + pH ↑ → Respiratory Alkalosis\nHCO₃⁻ ↓ + pH ↓ → Metabolic Acidosis\nHCO₃⁻ ↑ + pH ↑ → Metabolic Alkalosis",
},
{
num: "3", title: "Check Compensation",
desc: "Is the secondary parameter moving in the expected\ndirection? (See compensation formulas on next slide)\nIf not → mixed disorder present",
},
{
num: "4", title: "Calculate Anion Gap (if met. acidosis)",
desc: "AG = Na⁺ – (Cl⁻ + HCO₃⁻)\nNormal: 9–15 mEq/L\nHigh AG (>15): MUDPILES | Normal AG: HARDUPS",
},
{
num: "5", title: "Assess Oxygenation",
desc: "PaO₂ 80–100 mmHg = Normal\nA-a gradient = PAO₂ – PaO₂ (normal < 15 mmHg)\nLow PaO₂ + high A-a → intrinsic lung disease",
},
];
steps.forEach((st, i) => {
const y = 0.9 + i * 0.9;
// number circle
s3.addShape(pres.ShapeType.ellipse, { x: 0.25, y: y + 0.05, w: 0.65, h: 0.65, fill: { color: C.accent } });
s3.addText(st.num, { x: 0.25, y: y + 0.05, w: 0.65, h: 0.65, fontSize: 18, bold: true, color: C.darkBlue, align: "center", valign: "middle", fontFace: "Calibri" });
// step content box
s3.addShape(pres.ShapeType.rect, { x: 1.05, y, w: 8.7, h: 0.78, fill: { color: C.midBlue }, line: { color: C.accent, width: 0.75 } });
s3.addText([
{ text: "STEP " + st.num + " — " + st.title + ": ", options: { bold: true, color: C.yellow } },
{ text: st.desc, options: { color: C.white } },
], { x: 1.15, y: y + 0.03, w: 8.5, h: 0.72, fontSize: 10.5, fontFace: "Calibri", valign: "middle" });
});
// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 4: Compensation Formulas
// ─────────────────────────────────────────────────────────────────────────────
let s4 = pres.addSlide();
s4.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray } });
s4.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.midBlue } });
s4.addText("COMPENSATION FORMULAS (Expected Values)", {
x: 0.3, y: 0.05, w: 9.4, h: 0.65, fontSize: 18, bold: true, color: C.accent,
fontFace: "Calibri", valign: "middle",
});
const compRows = [
{ disorder: "Metabolic Acidosis", formula: "Expected PaCO₂ = (1.5 × HCO₃⁻) + 8 ± 2 [Winter's Formula]", note: "PaCO₂ > expected → concomitant resp. acidosis\nPaCO₂ < expected → concomitant resp. alkalosis", type: "acid" },
{ disorder: "Metabolic Alkalosis", formula: "Expected PaCO₂ = (0.7 × HCO₃⁻) + 21 ± 2", note: "Compensation limited — PaCO₂ rarely exceeds 55 mmHg", type: "alk" },
{ disorder: "Respiratory Acidosis (Acute)", formula: "Expected HCO₃⁻ = 24 + 0.1 × (PaCO₂ – 40) [↑ 1 per 10 CO₂]", note: "Acute = minutes-hours; kidney not yet compensated", type: "acid" },
{ disorder: "Respiratory Acidosis (Chronic)", formula: "Expected HCO₃⁻ = 24 + 0.35 × (PaCO₂ – 40) [↑ 3.5 per 10 CO₂]", note: "Chronic = days; full renal compensation", type: "acid" },
{ disorder: "Respiratory Alkalosis (Acute)", formula: "Expected HCO₃⁻ = 24 – 0.2 × (40 – PaCO₂) [↓ 2 per 10 CO₂]", note: "Acute hyperventilation (anxiety, pain, altitude)", type: "alk" },
{ disorder: "Respiratory Alkalosis (Chronic)", formula: "Expected HCO₃⁻ = 24 – 0.5 × (40 – PaCO₂) [↓ 5 per 10 CO₂]", note: "Chronic: pregnancy, high altitude acclimatization", type: "alk" },
];
compRows.forEach((row, i) => {
const y = 0.9 + i * 0.77;
const bgColor = row.type === "acid" ? "FFF0EE" : "EBF5FF";
const labelColor = row.type === "acid" ? C.accentWarm : C.accentAlk;
s4.addShape(pres.ShapeType.rect, { x: 0.2, y, w: 9.6, h: 0.68, fill: { color: bgColor }, line: { color: row.type === "acid" ? C.accentWarm : C.accentAlk, width: 1 } });
s4.addText([
{ text: row.disorder + " | ", options: { bold: true, color: labelColor } },
{ text: row.formula + "\n", options: { bold: false, color: C.textDark } },
{ text: row.note, options: { italic: true, color: C.textMid, fontSize: 9 } },
], { x: 0.35, y: y + 0.04, w: 9.3, h: 0.6, fontSize: 10.5, fontFace: "Calibri", valign: "top" });
});
// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 5: Anion Gap + MUDPILES / HARDUPS
// ─────────────────────────────────────────────────────────────────────────────
let s5 = pres.addSlide();
s5.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBlue } });
s5.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.accentWarm } });
s5.addText("METABOLIC ACIDOSIS — ANION GAP ANALYSIS", {
x: 0.3, y: 0.05, w: 9.4, h: 0.65, fontSize: 18, bold: true, color: C.white,
fontFace: "Calibri", valign: "middle",
});
// AG formula box
s5.addShape(pres.ShapeType.rect, { x: 0.3, y: 0.85, w: 9.4, h: 0.65, fill: { color: C.midBlue }, line: { color: C.yellow, width: 1.5 } });
s5.addText([
{ text: "Anion Gap = Na⁺ – (Cl⁻ + HCO₃⁻) ", options: { bold: true, color: C.yellow } },
{ text: "Normal: 9–15 mEq/L ", options: { color: C.white } },
{ text: "Corrected AG = AG + 2.5 × (4 – albumin g/dL)", options: { color: "A0BACE", fontSize: 10 } },
], { x: 0.4, y: 0.88, w: 9.2, h: 0.55, fontSize: 12, fontFace: "Calibri", align: "center", valign: "middle" });
// Two columns: MUDPILES vs HARDUPS
// MUDPILES
s5.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.6, w: 4.5, h: 3.75, fill: { color: C.midBlue }, line: { color: C.accentWarm, width: 1.5 } });
s5.addShape(pres.ShapeType.rect, { x: 0.3, y: 1.6, w: 4.5, h: 0.45, fill: { color: C.accentWarm } });
s5.addText("HIGH ANION GAP — MUDPILES", { x: 0.3, y: 1.6, w: 4.5, h: 0.45, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
const mudpiles = [
["M", "Methanol / Metformin / Muscle injury"],
["U", "Uremia (renal failure)"],
["D", "DKA, alcoholic ketoacidosis, starvation"],
["P", "Propylene glycol / Paraldehyde"],
["I", "Isoniazid / Iron poisoning"],
["L", "Lactic acidosis (type A/B)"],
["E", "Ethylene glycol / Ethanol"],
["S", "Salicylates / Short gut syndrome"],
];
mudpiles.forEach(([letter, desc], i) => {
const y = 2.13 + i * 0.38;
s5.addShape(pres.ShapeType.rect, { x: 0.45, y, w: 0.38, h: 0.3, fill: { color: C.accentWarm } });
s5.addText(letter, { x: 0.45, y, w: 0.38, h: 0.3, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
s5.addText(desc, { x: 0.9, y, w: 3.8, h: 0.3, fontSize: 10, color: C.white, valign: "middle", fontFace: "Calibri" });
});
// HARDUPS (Normal AG)
s5.addShape(pres.ShapeType.rect, { x: 5.2, y: 1.6, w: 4.5, h: 3.75, fill: { color: C.midBlue }, line: { color: C.accentAlk, width: 1.5 } });
s5.addShape(pres.ShapeType.rect, { x: 5.2, y: 1.6, w: 4.5, h: 0.45, fill: { color: "1565C0" } });
s5.addText("NORMAL ANION GAP — HARDUPS", { x: 5.2, y: 1.6, w: 4.5, h: 0.45, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
const hardups = [
["H", "Hyperalimentation / Hyperchloremia"],
["A", "Addison's disease (adrenal insufficiency)"],
["R", "Renal tubular acidosis (RTA types 1,2,4)"],
["D", "Diarrhea (GI HCO₃⁻ loss)"],
["U", "Ureteral diversion (ileal conduit)"],
["P", "Pancreatic fistula / Post-transplant"],
["S", "Saline infusion (hyperchloremic)"],
];
hardups.forEach(([letter, desc], i) => {
const y = 2.13 + i * 0.43;
s5.addShape(pres.ShapeType.rect, { x: 5.35, y, w: 0.38, h: 0.32, fill: { color: "1565C0" } });
s5.addText(letter, { x: 5.35, y, w: 0.38, h: 0.32, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
s5.addText(desc, { x: 5.8, y, w: 3.8, h: 0.32, fontSize: 10, color: C.white, valign: "middle", fontFace: "Calibri" });
});
// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 6: Causes of the 4 Disorders
// ─────────────────────────────────────────────────────────────────────────────
let s6 = pres.addSlide();
s6.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray } });
s6.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.midBlue } });
s6.addText("CAUSES OF THE FOUR ACID-BASE DISORDERS", {
x: 0.3, y: 0.05, w: 9.4, h: 0.65, fontSize: 18, bold: true, color: C.accent,
fontFace: "Calibri", valign: "middle",
});
const quadrants = [
{
title: "METABOLIC ACIDOSIS", color: C.accentWarm, textColor: C.white, x: 0.2, y: 0.85,
causes: ["↑ acid production: DKA, lactic acidosis, toxins", "↓ acid excretion: renal failure, RTA", "↑ HCO₃⁻ loss: diarrhea, GI fistula, RTA type 2"],
},
{
title: "METABOLIC ALKALOSIS", color: "1565C0", textColor: C.white, x: 5.1, y: 0.85,
causes: ["H⁺ loss: vomiting, NG suction, diuretics", "HCO₃⁻ retention: antacid excess, milk-alkali", "Volume contraction (↑ aldosterone, Cl⁻ responsive)"],
},
{
title: "RESPIRATORY ACIDOSIS", color: "7B341E", textColor: C.white, x: 0.2, y: 3.15,
causes: ["Central hypoventilation: opioids, CNS injury, obesity-hypoventilation", "Neuromuscular: GBS, MG, ALS", "Obstructive: COPD, severe asthma", "Restrictive/mechanical: PTX, flail chest"],
},
{
title: "RESPIRATORY ALKALOSIS", color: "0D5C8C", textColor: C.white, x: 5.1, y: 3.15,
causes: ["Hypoxemia (altitude, PE, pneumonia)", "Anxiety / pain / hyperventilation", "Pregnancy (progesterone effect)", "Salicylate toxicity (early), hepatic failure, sepsis"],
},
];
quadrants.forEach((q) => {
s6.addShape(pres.ShapeType.rect, { x: q.x, y: q.y, w: 4.7, h: 2.15, fill: { color: q.color }, line: { color: C.white, width: 0 } });
s6.addText(q.title, { x: q.x + 0.1, y: q.y + 0.05, w: 4.5, h: 0.38, fontSize: 12, bold: true, color: C.white, fontFace: "Calibri", charSpacing: 1 });
q.causes.forEach((c, i) => {
s6.addText("• " + c, { x: q.x + 0.15, y: q.y + 0.48 + i * 0.5, w: 4.4, h: 0.45, fontSize: 10, color: C.white, fontFace: "Calibri" });
});
});
// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 7: Worked Clinical Examples
// ─────────────────────────────────────────────────────────────────────────────
let s7 = pres.addSlide();
s7.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: "0B1E33" } });
s7.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.yellow } });
s7.addText("WORKED CLINICAL EXAMPLES", {
x: 0.3, y: 0.05, w: 9.4, h: 0.65, fontSize: 18, bold: true, color: C.darkBlue,
fontFace: "Calibri", valign: "middle",
});
const cases = [
{
label: "Case 1: DKA", bg: "1A2F1F",
abg: "pH 7.18 | PaCO₂ 22 mmHg | HCO₃⁻ 8 mEq/L | Na 138 | Cl 100",
ans: [
"pH 7.18 → Acidemia",
"HCO₃⁻ ↓ → Primary Metabolic Acidosis",
"Winter's: PaCO₂ expected = (1.5×8)+8±2 = 18–22 ✓ Appropriate compensation",
"AG = 138–(100+8) = 30 → High AG Metabolic Acidosis",
"Diagnosis: High AG Metabolic Acidosis (DKA) + appropriate respiratory compensation",
],
color: C.green,
},
{
label: "Case 2: COPD Exacerbation", bg: "2A1515",
abg: "pH 7.28 | PaCO₂ 70 mmHg | HCO₃⁻ 32 mEq/L",
ans: [
"pH 7.28 → Acidemia",
"PaCO₂ ↑ → Primary Respiratory Acidosis",
"HCO₃⁻ ↑ 32 → Chronic compensation: expected HCO₃⁻ = 24 + 0.35×(70–40) = 34.5 ≈ ✓",
"Diagnosis: Chronic Respiratory Acidosis (COPD) with appropriate metabolic compensation",
],
color: C.accentWarm,
},
{
label: "Case 3: Vomiting + Hypokalemia", bg: "0D1E33",
abg: "pH 7.52 | PaCO₂ 48 mmHg | HCO₃⁻ 38 mEq/L",
ans: [
"pH 7.52 → Alkalemia",
"HCO₃⁻ ↑ → Primary Metabolic Alkalosis",
"Expected PaCO₂ = (0.7×38)+21±2 = 47–51 ✓ Appropriate compensation",
"Diagnosis: Metabolic Alkalosis from vomiting (H⁺/Cl⁻ loss) + appropriate hypoventilation",
],
color: C.accentAlk,
},
];
cases.forEach((c, i) => {
const y = 0.88 + i * 1.55;
s7.addShape(pres.ShapeType.rect, { x: 0.2, y, w: 9.6, h: 1.42, fill: { color: c.bg }, line: { color: c.color, width: 1.5 } });
s7.addText(c.label, { x: 0.3, y: y + 0.04, w: 3, h: 0.32, fontSize: 11, bold: true, color: c.color, fontFace: "Calibri" });
s7.addText("ABG: " + c.abg, { x: 0.3, y: y + 0.35, w: 9.3, h: 0.25, fontSize: 10, color: C.yellow, fontFace: "Calibri", italic: true });
s7.addText(c.ans.map((a, j) => (j + 1) + ". " + a).join(" "), {
x: 0.35, y: y + 0.63, w: 9.25, h: 0.7, fontSize: 9.5, color: C.white, fontFace: "Calibri", valign: "top",
});
});
// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 8: Quick Reference Summary Card
// ─────────────────────────────────────────────────────────────────────────────
let s8 = pres.addSlide();
s8.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray } });
s8.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.darkBlue } });
s8.addText("QUICK REFERENCE SUMMARY CARD", {
x: 0.3, y: 0.05, w: 9.4, h: 0.65, fontSize: 18, bold: true, color: C.accent,
fontFace: "Calibri", valign: "middle",
});
// Table
const tHeaders = ["Disorder", "pH", "PaCO₂", "HCO₃⁻", "Compensation", "Key Causes"];
const tRows = [
["Met. Acidosis", "↓ <7.35", "↓ (comp.)", "↓ PRIMARY", "↓ PaCO₂ (Winter's)", "DKA, lactic acidosis, renal failure, diarrhea"],
["Met. Alkalosis", "↑ >7.45", "↑ (comp.)", "↑ PRIMARY", "↑ PaCO₂ (hypovent.)", "Vomiting, diuretics, Conn syndrome"],
["Resp. Acidosis", "↓ <7.35", "↑ PRIMARY", "↑ (comp.)", "↑ HCO₃⁻ (renal)", "COPD, opioids, neuromuscular disease"],
["Resp. Alkalosis", "↑ >7.45", "↓ PRIMARY", "↓ (comp.)", "↓ HCO₃⁻ (renal)", "Anxiety, pregnancy, PE, altitude, sepsis"],
];
// header row
const colW = [1.6, 0.75, 0.9, 0.85, 1.85, 3.05];
const colX = [0.2, 1.8, 2.55, 3.45, 4.3, 6.15];
tHeaders.forEach((h, j) => {
s8.addShape(pres.ShapeType.rect, { x: colX[j], y: 0.85, w: colW[j], h: 0.38, fill: { color: C.midBlue }, line: { color: C.white, width: 0.5 } });
s8.addText(h, { x: colX[j], y: 0.85, w: colW[j], h: 0.38, fontSize: 9.5, bold: true, color: C.white, align: "center", valign: "middle", fontFace: "Calibri" });
});
const rowColors = ["FFF0EE", "EBF5FF", "FFF0EE", "EBF5FF"];
tRows.forEach((row, i) => {
row.forEach((cell, j) => {
s8.addShape(pres.ShapeType.rect, { x: colX[j], y: 1.23 + i * 0.48, w: colW[j], h: 0.46, fill: { color: rowColors[i] }, line: { color: "CCCCCC", width: 0.5 } });
const isBold = j === 0;
const cellColor = (cell.includes("↓") && (j === 1 || j === 2 || j === 3)) ? C.accentWarm : (cell.includes("↑") && (j === 1 || j === 2 || j === 3)) ? "1565C0" : C.textDark;
s8.addText(cell, { x: colX[j] + 0.05, y: 1.25 + i * 0.48, w: colW[j] - 0.1, h: 0.42, fontSize: 9, bold: isBold, color: cellColor, fontFace: "Calibri", valign: "middle", align: j === 0 ? "left" : "center", wrap: true });
});
});
// Oxygenation section
s8.addShape(pres.ShapeType.rect, { x: 0.2, y: 3.22, w: 9.6, h: 0.55, fill: { color: C.midBlue }, line: { color: C.accent, width: 1 } });
s8.addText([
{ text: "OXYGENATION: ", options: { bold: true, color: C.yellow } },
{ text: "PAO₂ = (FiO₂ × [Patm – PH₂O]) – (PaCO₂/0.8) | ", options: { color: C.white } },
{ text: "A-a gradient = PAO₂ – PaO₂ Normal: < 15 mmHg (↑ with age: age/4 + 4)", options: { color: "A0BACE" } },
], { x: 0.3, y: 3.25, w: 9.4, h: 0.46, fontSize: 10, fontFace: "Calibri", valign: "middle" });
// Delta-delta box
s8.addShape(pres.ShapeType.rect, { x: 0.2, y: 3.85, w: 9.6, h: 0.9, fill: { color: "FFFDE7" }, line: { color: C.yellow, width: 1.5 } });
s8.addText([
{ text: "DELTA-DELTA RATIO (AG gap / HCO₃ gap): ", options: { bold: true, color: C.textDark } },
{ text: "Δ-Δ = (AG – 12) / (24 – HCO₃⁻)\n", options: { color: C.textDark } },
{ text: "< 1 = Mixed high AG + normal AG metabolic acidosis | ", options: { color: C.textMid, fontSize: 9 } },
{ text: "1–2 = Pure high AG metabolic acidosis | ", options: { color: C.textMid, fontSize: 9 } },
{ text: "> 2 = High AG metabolic acidosis + metabolic alkalosis", options: { color: C.textMid, fontSize: 9 } },
], { x: 0.35, y: 3.88, w: 9.3, h: 0.84, fontSize: 10.5, fontFace: "Calibri", valign: "top" });
// VBG vs ABG note
s8.addShape(pres.ShapeType.rect, { x: 0.2, y: 4.83, w: 9.6, h: 0.62, fill: { color: C.darkBlue } });
s8.addText([
{ text: "VBG vs ABG: ", options: { bold: true, color: C.accent } },
{ text: "VBG pH ≈ ABG pH – 0.03 | VBG PvCO₂ ≈ PaCO₂ + 5–9 mmHg | PvCO₂ < 45 mmHg rules out hypercapnia with ~100% NPV | PvO₂ does NOT correlate with PaO₂", options: { color: C.white } },
], { x: 0.35, y: 4.86, w: 9.3, h: 0.55, fontSize: 9.5, fontFace: "Calibri", valign: "middle" });
// Save
pres.writeFile({ fileName: "/home/daytona/workspace/abg-guide/ABG_Clinical_Practice_Guide.pptx" })
.then(() => console.log("PPTX created successfully"))
.catch(err => console.error("Error:", err));
cd /home/daytona/workspace/abg-guide && node abg_guide.js
ls -lh /home/daytona/workspace/abg-guide/
ABG Clinical Practice Guide
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 - Title | Cover slide with sources cited |
| 2 - Normal Values | Reference cards for pH, PaCO₂, HCO₃⁻, PaO₂, SaO₂, Base Excess + Henderson-Hasselbalch equation |
| 3 - 5-Step Method | Systematic step-by-step ABG interpretation framework |
| 4 - Compensation Formulas | All 6 formulas: Winter's, metabolic alkalosis, acute/chronic resp. acidosis/alkalosis |
| 5 - Anion Gap Analysis | AG formula + full MUDPILES vs HARDUPS mnemonics |
| 6 - Causes | All 4 disorders in a color-coded quad layout with key etiologies |
| 7 - Worked Cases | 3 clinical examples (DKA, COPD exacerbation, vomiting) with step-by-step analysis |
| 8 - Quick Reference | Master summary table + A-a gradient formula + Delta-Delta ratio + VBG vs ABG comparison |