Make a detailed powerpoint presentations on complement system pathways deficiencies with key highlights and flowcharts
mkdir -p /home/daytona/workspace/complement-pptx && ls /home/daytona/workspace/
Where is the ppt
Why is it taking so much time
~/complement-pptx/build.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE";
pres.title = "Complement System Pathways & Deficiencies";
// ─── THEME COLORS ───────────────────────────────────────────────────────────
const C = {
navy: "0D2B55",
teal: "0E7C7B",
amber: "E8A838",
red: "C0392B",
green: "1A7A4A",
purple: "5B2C8D",
ltBlue: "D6EAF8",
ltTeal: "D1F2EB",
ltAmber: "FEF9E7",
ltRed: "FDEDEC",
ltPurple:"F0EBFF",
white: "FFFFFF",
offWhite:"F4F6F9",
gray: "7F8C8D",
darkGray:"2C3E50",
};
// ─── HELPERS ────────────────────────────────────────────────────────────────
function titleSlide(slide, title, subtitle) {
slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color: C.navy} });
slide.addShape(pres.ShapeType.rect, { x:0, y:5.8, w:13.3, h:1.7, fill:{color: C.teal} });
slide.addShape(pres.ShapeType.rect, { x:0.5, y:2.2, w:0.12, h:2.0, fill:{color: C.amber} });
slide.addText(title, { x:0.8, y:1.8, w:11.5, h:2.4, fontSize:40, bold:true, color:C.white, fontFace:"Calibri", valign:"middle" });
if (subtitle) slide.addText(subtitle, { x:0.8, y:4.3, w:11.5, h:0.9, fontSize:20, color:"C8D8E8", fontFace:"Calibri", italic:true });
slide.addText("Nelson Textbook of Pediatrics 2024 | Chapter 173", { x:0.5, y:6.2, w:12, h:0.5, fontSize:12, color:C.white, fontFace:"Calibri", align:"center" });
}
function sectionDivider(slide, num, label, color) {
color = color || C.teal;
slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color: C.darkGray} });
slide.addShape(pres.ShapeType.rect, { x:0, y:3.0, w:13.3, h:1.5, fill:{color: color} });
slide.addText("SECTION " + num, { x:0, y:3.05, w:13.3, h:0.5, fontSize:13, color:C.white, fontFace:"Calibri", align:"center", charSpacing:8 });
slide.addText(label, { x:0, y:3.55, w:13.3, h:0.85, fontSize:30, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
}
function slideHeader(slide, title, color) {
color = color || C.navy;
slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.75, fill:{color: color} });
slide.addShape(pres.ShapeType.rect, { x:0, y:0.75, w:13.3, h:0.06, fill:{color: C.amber} });
slide.addText(title, { x:0.3, y:0, w:12.7, h:0.75, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
slide.addShape(pres.ShapeType.rect, { x:0, y:7.2, w:13.3, h:0.3, fill:{color: C.navy} });
slide.addText("Complement System | Chapter 173 – Nelson 2024", { x:0, y:7.2, w:13.3, h:0.3, fontSize:9, color:"A0B4C8", fontFace:"Calibri", align:"center", margin:0 });
}
function box(slide, x, y, w, h, text, fillColor, textColor, fontSize, bold) {
slide.addShape(pres.ShapeType.roundRect, { x, y, w, h, fill:{color: fillColor}, line:{color:C.darkGray, width:0.5}, rectRadius:0.05 });
slide.addText(text, { x, y, w, h, fontSize: fontSize||11, color: textColor||C.darkGray, fontFace:"Calibri", align:"center", valign:"middle", bold: bold||false, margin:3 });
}
function arrow(slide, x1, y1, x2, y2) {
slide.addShape(pres.ShapeType.line, { x:x1, y:y1, w:x2-x1, h:y2-y1, line:{color:C.gray, width:1.5, endArrowType:"arrow"} });
}
function arrowV(slide, x, y1, y2) { arrow(slide, x, y1, x, y2); }
function arrowH(slide, x1, x2, y) { arrow(slide, x1, y, x2, y); }
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE
// ═══════════════════════════════════════════════════════════════════════════
let s = pres.addSlide();
titleSlide(s, "Complement System\nPathways & Deficiencies", "Immunology | Innate Immune System | Pediatrics");
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 2 – TABLE OF CONTENTS
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Contents at a Glance");
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
const sections = [
["01", "Overview of Complement System", C.navy],
["02", "Classical & Lectin Pathway Flowchart", C.teal],
["03", "Alternative Pathway Flowchart", C.green],
["04", "Terminal Pathway & MAC", C.purple],
["05", "Pathway Deficiencies (Table 173.4)", C.red],
["06", "Regulator & Receptor Deficiencies (Table 173.5)", C.amber],
["07", "Hereditary Angioedema (HAE)", C.teal],
["08", "aHUS & PNH", C.red],
["09", "Complement Evaluation & Lab Screening", C.navy],
["10", "Management of Complement Deficiencies", C.green],
];
sections.forEach(([num, label, color], i) => {
const col = i < 5 ? 0 : 1;
const row = i % 5;
const x = col === 0 ? 0.5 : 6.9;
const y = 1.1 + row * 1.05;
s.addShape(pres.ShapeType.roundRect, { x, y, w:5.9, h:0.85, fill:{color: color}, line:{color:color, width:0}, rectRadius:0.1 });
s.addText(num, { x, y, w:0.7, h:0.85, fontSize:20, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle" });
s.addText(label, { x: x+0.7, y, w:5.2, h:0.85, fontSize:14, color:C.white, fontFace:"Calibri", valign:"middle" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 3 – SECTION DIVIDER
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
sectionDivider(s, "01", "Overview of the Complement System", C.navy);
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 4 – OVERVIEW
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "What Is the Complement System?");
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// Left panel
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.0, w:5.8, h:5.8, fill:{color: C.white}, line:{color:C.navy, width:0.8} });
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.0, w:5.8, h:0.45, fill:{color: C.navy} });
s.addText("KEY FUNCTIONS", { x:0.3, y:1.0, w:5.8, h:0.45, fontSize:13, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
const funcs = [
"● Opsonization – promotes phagocytosis of pathogens",
"● Lysis – membrane attack complex (MAC) destroys pathogens",
"● Chemotaxis – recruits immune cells via C3a & C5a",
"● Inflammation – histamine release from mast cells",
"● Immune complex clearance via C3b & CR1",
"● B-cell activation co-stimulation via iC3b / CR2",
"● Brain synapse pruning via C1q on microglia",
"● Links innate AND adaptive immunity",
];
s.addText(funcs.map(f => ({ text: f, options: { breakLine: true } })), {
x:0.45, y:1.55, w:5.5, h:5.1, fontSize:12, color:C.darkGray, fontFace:"Calibri", valign:"top"
});
// Right panel
s.addShape(pres.ShapeType.rect, { x:6.5, y:1.0, w:6.5, h:5.8, fill:{color: C.white}, line:{color:C.teal, width:0.8} });
s.addShape(pres.ShapeType.rect, { x:6.5, y:1.0, w:6.5, h:0.45, fill:{color: C.teal} });
s.addText("THREE ACTIVATION PATHWAYS", { x:6.5, y:1.0, w:6.5, h:0.45, fontSize:13, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
const paths = [
["Classical Pathway (CP)", "Initiated by C1q binding to IgM/IgG on antigen surface. CRP & natural IgM also activate.", C.navy, C.ltBlue],
["Lectin Pathway (LP)", "MBL or Ficolins bind mannose-rich carbohydrates on pathogens; MASPs cleave C4 & C2.", C.teal, C.ltTeal],
["Alternative Pathway (AP)", "Spontaneous C3 hydrolysis ('tick-over'); stabilized by Properdin; amplification loop.", C.green, C.ltTeal],
];
paths.forEach(([title, desc, hdr, bg], i) => {
const y = 1.6 + i * 1.65;
s.addShape(pres.ShapeType.rect, { x:6.65, y, w:6.2, h:1.45, fill:{color: bg}, line:{color:hdr, width:0.5} });
s.addShape(pres.ShapeType.rect, { x:6.65, y, w:6.2, h:0.38, fill:{color: hdr} });
s.addText(title, { x:6.65, y, w:6.2, h:0.38, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
s.addText(desc, { x:6.75, y:y+0.42, w:6.0, h:0.95, fontSize:11, color:C.darkGray, fontFace:"Calibri", valign:"middle" });
});
s.addText("All three converge at C3 → C5 → Terminal Pathway → MAC", {
x:6.55, y:6.6, w:6.3, h:0.35, fontSize:11, bold:true, color:C.navy, fontFace:"Calibri", align:"center",
fill:{color:"EBF5FB"}, line:{color:C.navy, width:0.5}
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 5 – NOMENCLATURE TABLE
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Nomenclature & Components (Tables 173.1 & 173.2)");
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// Table 173.1
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.0, w:5.9, h:0.4, fill:{color: C.navy} });
s.addText("TABLE 173.1 – Nomenclature Rules", { x:0.3, y:1.0, w:5.9, h:0.4, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
const nom = [
["CP components", "C + number (C1, C2, C4)"],
["AP components", "Letters (B, P, D)"],
["Called 'factors'", "Factor B, Factor D"],
["Activated complex", "Bar over symbol (C4bC2a)"],
["Cleavage fragments", "Small letter (C3a, C3b)"],
["Membrane receptors", "CR1, CR2, CR3, CR4"],
];
nom.forEach(([rule, ex], i) => {
const y = 1.45 + i * 0.52;
const bg = i % 2 === 0 ? C.white : C.ltBlue;
s.addShape(pres.ShapeType.rect, { x:0.3, y, w:3.5, h:0.50, fill:{color: bg}, line:{color:"CCD9E8", width:0.3} });
s.addShape(pres.ShapeType.rect, { x:3.8, y, w:2.4, h:0.50, fill:{color: bg}, line:{color:"CCD9E8", width:0.3} });
s.addText(rule, { x:0.35, y, w:3.4, h:0.50, fontSize:11, color:C.darkGray, fontFace:"Calibri", valign:"middle" });
s.addText(ex, { x:3.85, y, w:2.3, h:0.50, fontSize:11, bold:true, color:C.navy, fontFace:"Calibri", valign:"middle" });
});
// Table 173.2 – right side
s.addShape(pres.ShapeType.rect, { x:6.6, y:1.0, w:6.4, h:0.4, fill:{color: C.teal} });
s.addText("TABLE 173.2 – Core Components of Complement System", { x:6.6, y:1.0, w:6.4, h:0.4, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
const comps = [
[C.navy, "Classical Pathway", "C1q, C1r, C1s, C4, C2, C3"],
[C.green, "Alternative Pathway", "Factor B, Factor D, Properdin"],
[C.teal, "Lectin Pathway", "MBL, Ficolin 1/2/3, MASP-1/2/3"],
[C.purple, "MAC (Terminal)", "C5, C6, C7, C8, C9"],
[C.amber, "Enhancing Regulator", "Properdin (stabilises C3bBb)"],
[C.red, "Downreg. Regulators", "C1-INH, C4bp, Factor H, Factor I,\nVitronectin, Clusterin, Carboxypeptidase N"],
[C.gray, "Membrane Regulators", "CR1(CD35), MCP(CD46), DAF(CD55), CD59"],
[C.darkGray,"Membrane Receptors", "CR1–CR4, C3aR, C5aR, C1qR, CRIg"],
];
comps.forEach(([color, label, val], i) => {
const y = 1.45 + i * 0.67;
s.addShape(pres.ShapeType.rect, { x:6.6, y, w:6.4, h:0.62, fill:{color: color+"22"}, line:{color: color, width:0.5} });
s.addShape(pres.ShapeType.rect, { x:6.6, y, w:0.18, h:0.62, fill:{color: color} });
s.addText(label, { x:6.85, y, w:2.5, h:0.62, fontSize:11, bold:true, color: color, fontFace:"Calibri", valign:"middle" });
s.addText(val, { x:9.4, y, w:3.5, h:0.62, fontSize:10, color:C.darkGray, fontFace:"Calibri", valign:"middle" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 6 – SECTION DIVIDER
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
sectionDivider(s, "02 & 03", "Complement Pathway Flowcharts", C.teal);
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 7 – CLASSICAL & LECTIN PATHWAY FLOWCHART
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Classical & Lectin Pathway – Activation Flowchart");
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// CLASSICAL column x=0.4
box(s, 0.3, 1.05, 3.4, 0.6, "IgM / IgG Immune Complexes", C.navy, C.white, 11, true);
arrowV(s, 2.0, 1.65, 2.15);
box(s, 0.3, 2.15, 3.4, 0.6, "C1q Binds Fc of Antibody", C.ltBlue, C.navy, 11);
arrowV(s, 2.0, 2.75, 2.9);
box(s, 0.3, 2.9, 3.4, 0.6, "C1r & C1s Activated\n→ C1 Esterase", C.ltBlue, C.navy, 10);
arrowV(s, 2.0, 3.5, 3.65);
// LECTIN column x=5.0
box(s, 4.9, 1.05, 3.4, 0.6, "Mannose-Rich Surfaces\n(Pathogens / DAMPs)", C.teal, C.white, 11, true);
arrowV(s, 6.6, 1.65, 2.15);
box(s, 4.9, 2.15, 3.4, 0.6, "MBL / Ficolins Bind\nCarbohydrate Patterns", C.ltTeal, C.teal, 11);
arrowV(s, 6.6, 2.75, 2.9);
box(s, 4.9, 2.9, 3.4, 0.6, "MASP-1 & MASP-2 Activated", C.ltTeal, C.teal, 10);
arrowV(s, 6.6, 3.5, 3.65);
// Merge box
box(s, 1.5, 3.65, 7.4, 0.65, "Cleavage of C4 → C4a + C4b & C2 → C2a + C2b\nFormation of C3 Convertase: C4bC2a", C.amber, C.darkGray, 11, true);
arrowV(s, 5.2, 4.3, 4.45);
box(s, 2.5, 4.45, 5.4, 0.6, "C3 Cleaved → C3a (anaphylatoxin) + C3b (opsonin)", "FEF9C3", C.darkGray, 11);
arrowV(s, 5.2, 5.05, 5.2);
box(s, 2.5, 5.2, 5.4, 0.6, "C3b + C4bC2a = C5 Convertase (C4bC2aC3b)", C.ltAmber, C.darkGray, 11);
arrowV(s, 5.2, 5.8, 5.95);
box(s, 2.5, 5.95, 5.4, 0.55, "C5 Cleaved → C5a + C5b → Terminal Pathway", C.purple, C.white, 11, true);
// C1-INH note
s.addShape(pres.ShapeType.rect, { x:9.7, y:2.9, w:3.3, h:0.6, fill:{color: C.ltRed}, line:{color:C.red, width:0.8} });
s.addText("⛔ C1-INH inhibits C1r & C1s\n(also inhibits MASP-2)", { x:9.7, y:2.9, w:3.3, h:0.6, fontSize:10, color:C.red, fontFace:"Calibri", valign:"middle", align:"center" });
// Factor H/I note
s.addShape(pres.ShapeType.rect, { x:9.7, y:4.45, w:3.3, h:0.6, fill:{color: C.ltRed}, line:{color:C.red, width:0.8} });
s.addText("⛔ C4bp & Factor I\ncleave C4b (regulation)", { x:9.7, y:4.45, w:3.3, h:0.6, fontSize:10, color:C.red, fontFace:"Calibri", valign:"middle", align:"center" });
s.addText("CP", { x:0.3, y:0.85, w:0.6, h:0.2, fontSize:9, bold:true, color:C.navy, fontFace:"Calibri" });
s.addText("LP", { x:4.9, y:0.85, w:0.6, h:0.2, fontSize:9, bold:true, color:C.teal, fontFace:"Calibri" });
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 8 – ALTERNATIVE PATHWAY FLOWCHART
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Alternative Pathway – Activation & Amplification Flowchart", C.green);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
box(s, 0.4, 1.0, 4.0, 0.6, "Spontaneous C3 Hydrolysis\nC3 → C3(H₂O) 'Tick-Over'", C.green, C.white, 11, true);
arrowV(s, 2.4, 1.6, 1.75);
box(s, 0.4, 1.75, 4.0, 0.6, "C3(H₂O) + Factor B → Factor D\ncleaves B → Bb\nFluid Phase C3 Convertase: C3(H₂O)Bb", C.ltTeal, C.darkGray, 10);
arrowV(s, 2.4, 2.35, 2.5);
box(s, 0.4, 2.5, 4.0, 0.6, "C3b deposited on pathogen surface", C.ltTeal, C.darkGray, 11);
arrowV(s, 2.4, 3.1, 3.25);
box(s, 0.4, 3.25, 4.0, 0.6, "C3b + Factor B → Factor D cleaves\nSurface C3 Convertase: C3bBb", C.ltTeal, C.darkGray, 10);
arrowV(s, 2.4, 3.85, 4.0);
box(s, 0.4, 4.0, 4.0, 0.6, "Properdin (P) STABILISES C3bBb\n(positive regulator, X-linked)", "D5F5E3", C.green, 11, true);
arrowV(s, 2.4, 4.6, 4.75);
box(s, 0.4, 4.75, 4.0, 0.6, "AMPLIFICATION LOOP\nMore C3b deposited", C.amber, C.darkGray, 11, true);
arrowV(s, 2.4, 5.35, 5.5);
box(s, 0.4, 5.5, 4.0, 0.6, "C5 Convertase: C3bBbC3b\n→ C5a + C5b → Terminal Pathway", C.purple, C.white, 11, true);
// Regulation boxes on right
s.addShape(pres.ShapeType.rect, { x:5.0, y:1.0, w:7.9, h:6.1, fill:{color: C.white}, line:{color:C.red, width:0.8} });
s.addShape(pres.ShapeType.rect, { x:5.0, y:1.0, w:7.9, h:0.38, fill:{color: C.red} });
s.addText("CONTROL MECHANISMS OF THE ALTERNATIVE PATHWAY", { x:5.0, y:1.0, w:7.9, h:0.38, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
const controls = [
["Factor H", C.red, "Binds C3b in fluid phase → cofactor for Factor I to cleave C3b → iC3b. Also displaces Bb from C3bBb (decay acceleration). High concentration (500 µg/mL) in plasma."],
["Factor I", C.red, "Serine protease; cleaves C3b → iC3b (with cofactors: Factor H, MCP, CR1, C4bp). Limits AP amplification loop."],
["MCP (CD46)", C.purple,"Membrane cofactor protein on host cells; cofactor for Factor I-mediated cleavage of surface C3b & C4b. Protects host cells."],
["DAF (CD55)", C.purple,"Decay-accelerating factor; dissociates C3 convertases (C3bBb & C4bC2a) from cell surfaces. Cromer blood group antigen."],
["CD59", C.purple, "Membrane inhibitor of reactive lysis (MIRL); blocks C9 polymerisation → prevents MAC insertion into host cells."],
["Carboxypep-\ntidase N", C.amber,"Cleaves C-terminal Arg from C3a, C4a, C5a → inactivates anaphylatoxins in circulation."],
];
controls.forEach(([name, color, desc], i) => {
const y = 1.45 + i * 0.93;
s.addShape(pres.ShapeType.roundRect, { x:5.1, y, w:7.7, h:0.82, fill:{color: color+"15"}, line:{color:color, width:0.5}, rectRadius:0.05 });
s.addShape(pres.ShapeType.rect, { x:5.1, y, w:1.5, h:0.82, fill:{color: color+"40"} });
s.addText(name, { x:5.1, y, w:1.5, h:0.82, fontSize:11, bold:true, color:color, fontFace:"Calibri", align:"center", valign:"middle" });
s.addText(desc, { x:6.65, y:y+0.05, w:6.1, h:0.72, fontSize:10, color:C.darkGray, fontFace:"Calibri", valign:"middle" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 9 – TERMINAL PATHWAY & MAC
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Terminal Pathway & Membrane Attack Complex (MAC)", C.purple);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// Flowchart left
box(s, 0.3, 1.0, 3.8, 0.55, "C5 Convertase cleaves C5\n→ C5a (anaphylatoxin) + C5b", C.purple, C.white, 11, true);
arrowV(s, 2.2, 1.55, 1.7);
box(s, 0.3, 1.7, 3.8, 0.55, "C5b binds C6 → C5b6 complex", "EDE7F6", C.purple, 11);
arrowV(s, 2.2, 2.25, 2.4);
box(s, 0.3, 2.4, 3.8, 0.55, "C5b6 + C7 → C5b67\n(amphiphilic, inserts in membrane)", "EDE7F6", C.purple, 11);
arrowV(s, 2.2, 2.95, 3.1);
box(s, 0.3, 3.1, 3.8, 0.55, "C5b67 + C8 → C5b678\n(stable membrane pore nucleus)", "E8DAEF", C.purple, 11);
arrowV(s, 2.2, 3.65, 3.8);
box(s, 0.3, 3.8, 3.8, 0.55, "C5b678 + C9 (×12–18)\n→ Poly-C9 transmembrane channel", "D7BDE2", C.purple, 11);
arrowV(s, 2.2, 4.35, 4.5);
box(s, 0.3, 4.5, 3.8, 0.65, "MAC = C5b-C9\nOsmotic lysis of pathogen / host cell", C.purple, C.white, 12, true);
// Effects column
s.addShape(pres.ShapeType.rect, { x:4.5, y:1.0, w:4.0, h:5.5, fill:{color: C.white}, line:{color:C.purple, width:0.8} });
s.addShape(pres.ShapeType.rect, { x:4.5, y:1.0, w:4.0, h:0.38, fill:{color: C.purple} });
s.addText("EFFECTS OF ANAPHYLATOXINS", { x:4.5, y:1.0, w:4.0, h:0.38, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
const ana = [
["C3a", "Mast cell degranulation → histamine release; mild anaphylaxis; vascular permeability"],
["C4a", "Weak anaphylatoxin; limited clinical significance"],
["C5a", "MOST POTENT: neutrophil chemotaxis, oxidative burst, upregulation of CR1/CR3, vascular permeability, mast cell activation"],
];
ana.forEach(([mol, desc], i) => {
const y = 1.45 + i * 1.6;
s.addShape(pres.ShapeType.roundRect, { x:4.65, y, w:3.7, h:1.4, fill:{color: C.ltPurple}, line:{color:C.purple, width:0.5}, rectRadius:0.08 });
s.addText(mol, { x:4.65, y, w:3.7, h:0.38, fontSize:14, bold:true, color:C.purple, fontFace:"Calibri", align:"center", valign:"middle" });
s.addText(desc, { x:4.75, y:y+0.38, w:3.5, h:1.0, fontSize:10, color:C.darkGray, fontFace:"Calibri", valign:"top" });
});
// MAC regulation column
s.addShape(pres.ShapeType.rect, { x:8.9, y:1.0, w:4.1, h:5.5, fill:{color: C.white}, line:{color:C.red, width:0.8} });
s.addShape(pres.ShapeType.rect, { x:8.9, y:1.0, w:4.1, h:0.38, fill:{color: C.red} });
s.addText("MAC REGULATION", { x:8.9, y:1.0, w:4.1, h:0.38, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
const macReg = [
["CD59 (MIRL)", "Blocks C9 polymerisation → key regulator on host cells. Absent in PNH."],
["Vitronectin\n(S-protein)", "Binds C5b67, prevents membrane insertion of MAC."],
["Clusterin", "Binds C5b678 & C9, inhibits C5b-9 complex formation."],
["Carboxypep-\ntidase N", "Cleaves anaphylatoxins C3a, C4a, C5a → inactivates them in blood."],
];
macReg.forEach(([name, desc], i) => {
const y = 1.45 + i * 1.22;
s.addShape(pres.ShapeType.roundRect, { x:9.05, y, w:3.8, h:1.1, fill:{color: C.ltRed}, line:{color:C.red, width:0.5}, rectRadius:0.06 });
s.addText(name, { x:9.05, y, w:3.8, h:0.35, fontSize:11, bold:true, color:C.red, fontFace:"Calibri", align:"center", valign:"middle" });
s.addText(desc, { x:9.15, y:y+0.35, w:3.6, h:0.72, fontSize:10, color:C.darkGray, fontFace:"Calibri", valign:"top" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 10 – UNIFIED FLOWCHART (all 3 pathways)
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Integrated Complement Activation – All Three Pathways (Overview)");
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// Row 1 – triggers
box(s, 0.2, 1.0, 3.1, 0.55, "IgM/IgG + Ag\n(Immune Complexes)", C.navy, C.white, 10, true);
box(s, 5.1, 1.0, 3.1, 0.55, "MBL / Ficolins\n(Mannose surfaces)", C.teal, C.white, 10, true);
box(s, 10.0, 1.0, 3.1, 0.55, "Bacteria / Pathogens\n(Spontaneous C3 hydrolysis)", C.green, C.white, 10, true);
arrowV(s, 1.75, 1.55, 1.7); arrowV(s, 6.65, 1.55, 1.7); arrowV(s, 11.55, 1.55, 1.7);
box(s, 0.2, 1.7, 3.1, 0.55, "C1q → C1r, C1s\n→ C1 Esterase", C.navy+"CC", C.white, 10);
box(s, 5.1, 1.7, 3.1, 0.55, "MASPs activated\n(MASP-1, MASP-2)", C.teal+"CC", C.white, 10);
box(s, 10.0, 1.7, 3.1, 0.55, "Factor D cleaves B\n→ C3bBb + Properdin", C.green+"CC", C.white, 10);
arrowV(s, 1.75, 2.25, 2.4); arrowV(s, 6.65, 2.25, 2.4);
// Merge CP+LP
box(s, 1.0, 2.4, 7.3, 0.55, "C4 → C4a + C4b; C2 → C2a + C2b → C3 Convertase: C4bC2a", C.amber, C.darkGray, 11, true);
arrowV(s, 4.65, 2.95, 3.1); arrowV(s, 11.55, 2.25, 3.1);
// C3
box(s, 2.5, 3.1, 8.3, 0.55, "C3 CONVERTASE cleaves C3 → C3a (anaphylatoxin) + C3b (opsonin)", "FEF5CC", C.darkGray, 11, true);
arrowV(s, 6.65, 3.65, 3.8);
box(s, 2.5, 3.8, 8.3, 0.55, "C5 CONVERTASE → C5a (chemotaxis, inflammation) + C5b", C.ltPurple, C.purple, 11, true);
arrowV(s, 6.65, 4.35, 4.5);
// Terminal
box(s, 2.5, 4.5, 8.3, 0.55, "TERMINAL PATHWAY: C5b + C6 + C7 + C8 + C9(×12–18)", C.purple, C.white, 11, true);
arrowV(s, 6.65, 5.05, 5.2);
box(s, 2.5, 5.2, 8.3, 0.65, "MEMBRANE ATTACK COMPLEX (MAC) C5b-9\n→ Osmotic lysis of target cell", C.navy, C.white, 12, true);
// Side effects
s.addShape(pres.ShapeType.rect, { x:0.2, y:3.8, w:2.0, h:0.55, fill:{color:"FFF0D0"}, line:{color:C.amber, width:0.5} });
s.addText("C3b: Opsonization\nPhagocytosis ↑", { x:0.2, y:3.8, w:2.0, h:0.55, fontSize:9, color:C.darkGray, fontFace:"Calibri", align:"center", valign:"middle" });
s.addShape(pres.ShapeType.rect, { x:11.1, y:3.8, w:2.0, h:0.55, fill:{color:"EDE7F6"}, line:{color:C.purple, width:0.5} });
s.addText("C5a: Chemotaxis\nNeutrophil recruitment", { x:11.1, y:3.8, w:2.0, h:0.55, fontSize:9, color:C.purple, fontFace:"Calibri", align:"center", valign:"middle" });
s.addText("CP", { x:1.65, y:0.88, w:0.5, h:0.15, fontSize:8, bold:true, color:C.navy, fontFace:"Calibri", align:"center" });
s.addText("LP", { x:6.55, y:0.88, w:0.5, h:0.15, fontSize:8, bold:true, color:C.teal, fontFace:"Calibri", align:"center" });
s.addText("AP", { x:11.45, y:0.88, w:0.5, h:0.15, fontSize:8, bold:true, color:C.green, fontFace:"Calibri", align:"center" });
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 11 – SECTION DIVIDER
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
sectionDivider(s, "04 & 05", "Complement Pathway & Regulator Deficiencies", C.red);
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 12 – TABLE 173.4 (Pathway Deficiencies)
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Pathway Deficiencies of the Complement System (Table 173.4)");
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// Table headers
const thY = 1.0;
const cols = [0.2, 3.6, 5.3, 13.0];
[C.navy, C.navy, C.navy].forEach((c, i) => {
s.addShape(pres.ShapeType.rect, { x:cols[i]+0.05, y:thY, w:cols[i+1]-cols[i]-0.1, h:0.42, fill:{color:C.navy} });
});
s.addText("DEFICIENCY", { x:0.25, y:thY, w:3.3, h:0.42, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addText("INHERITANCE", { x:3.65, y:thY, w:1.6, h:0.42, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addText("ASSOCIATED SYMPTOMS / DISORDERS", { x:5.35, y:thY, w:7.6, h:0.42, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
const rows = [
["C1q, C1r/s (combined), C2, C4\n(Classical Pathway)", "AR", "SLE, systemic infections with encapsulated organisms (S. pneumoniae, H. influenzae, N. meningitidis). Heterozygous C2 deficiency may have reduced CH50 but remain asymptomatic.", C.navy, C.ltBlue],
["C4A or C4B isoforms", "Complex", "Susceptibility to infections and/or autoimmunity (SLE); mostly asymptomatic.", C.navy, C.ltBlue],
["C3 (most important component!)", "AR", "Pyogenic infections (S. pneumoniae, H. influenzae), neisserial infections, glomerulonephritis, AMD. Partial deficiency = hypomorphic C3.", C.teal, C.ltTeal],
["C3 GOF (Gain of Function)", "AD", "Atypical HUS (aHUS) – 2–10% of cases. Dysregulated C3 activation.", C.teal, C.ltTeal],
["C5, C6, C7, C8α-γ/C8β\n(Terminal Components)", "AR", "Neisserial infections, recurrent meningitis. Onset of symptoms ~17 yr (vs 3 yr in immunocompromised). Milder course, may be recurrent.", C.purple, C.ltPurple],
["C9", "AR", "Neisserial infections – mostly asymptomatic. More common in East Asian populations (Japan, Korea).", C.purple, C.ltPurple],
["Factor B", "AR*", "Neisserial & pneumococcal infections. aHUS (1–4% of cases). GOF variants associated with aHUS & endothelial damage.", C.green, C.ltTeal],
["Factor D", "AR", "Bacterial infections. Very rare. First AP-specific component to be identified.", C.green, C.ltTeal],
["MBL", "Polymorphism", "Bacterial infections (mostly asymptomatic); susceptibility to autoimmunity. 5–7% of population in white populations have MBL deficiency.", C.amber, C.ltAmber],
["Ficolin-3 (H-ficolin)", "Polymorphism", "Various clinical phenotypes – susceptibility to infections and necrotising enterocolitis.", C.amber, C.ltAmber],
["MASP-1", "AR", "3MC syndrome (Malpuech, Michels, Mingarelli, Carnevale): facial dysmorphia, cleft lip/palate, skeletal anomalies, cognitive impairment.", C.red, C.ltRed],
["MASP-2", "AR", "Respiratory infections, mostly asymptomatic. Frequency ~6/10,000.", C.red, C.ltRed],
];
const rowH = 0.46;
rows.forEach(([def, inh, sym, color, bg], i) => {
const y = 1.45 + i * rowH;
s.addShape(pres.ShapeType.rect, { x:0.2, y, w:3.3, h:rowH-0.02, fill:{color:bg}, line:{color:color, width:0.5} });
s.addShape(pres.ShapeType.rect, { x:3.6, y, w:1.6, h:rowH-0.02, fill:{color:bg}, line:{color:color, width:0.5} });
s.addShape(pres.ShapeType.rect, { x:5.3, y, w:7.75, h:rowH-0.02, fill:{color:bg}, line:{color:color, width:0.5} });
s.addShape(pres.ShapeType.rect, { x:0.2, y, w:0.12, h:rowH-0.02, fill:{color:color} });
s.addText(def, { x:0.38, y, w:3.1, h:rowH-0.02, fontSize:9.5, bold:true, color:color, fontFace:"Calibri", valign:"middle" });
s.addText(inh, { x:3.65, y, w:1.5, h:rowH-0.02, fontSize:9.5, color:C.darkGray, fontFace:"Calibri", valign:"middle", align:"center" });
s.addText(sym, { x:5.38, y, w:7.55, h:rowH-0.02, fontSize:9, color:C.darkGray, fontFace:"Calibri", valign:"middle" });
});
s.addText("AR = Autosomal Recessive | AD = Autosomal Dominant | * = AR non-codominant | aHUS = Atypical Haemolytic Uraemic Syndrome | AMD = Aging Macular Degeneration | SLE = Systemic Lupus Erythematosus", {
x:0.2, y:7.05, w:12.9, h:0.2, fontSize:7.5, color:C.gray, fontFace:"Calibri", italic:true
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 13 – CLASSICAL PATHWAY DEFICIENCIES deep-dive
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Classical Pathway Deficiencies – Clinical Focus", C.navy);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
const cpDefs = [
{
title: "C1q Deficiency", color: C.navy,
highlights: ["Prone to autoimmune connective tissue diseases (SLE)", "Impaired clearance of apoptotic debris & immune complexes", "Some C1q-deficient children have serious infections (septicaemia, meningitis)", "C1q produced mainly by myeloid cells — bone marrow transplant may be curative", "Poor prognosis compared to other CP deficiencies"],
},
{
title: "C2 Deficiency (most common CP deficiency in whites)", color: C.navy,
highlights: ["Frequency 1/10,000 in White population", "Autoimmunity in 10–42% (lowest among CP)", "Risk of life-threatening septicaemic illness (pneumococci)", "75% have antinuclear antibodies; 25–55% have C1/C4 deficiency antibodies", "Anti-dsDNA in 20%; heterozygous C2 deficiency — reduced CH50 but asymptomatic"],
},
{
title: "C4 Deficiency (C4A or C4B isoforms)", color: C.teal,
highlights: ["C4A: higher affinity for amino group-containing antigens (immune complexes)", "C4B: higher affinity for hydroxyl group-containing antigens", "Homozygous C4A deficiency → increased SLE frequency", "Homozygous C4B deficiency → increased susceptibility to bacterial & viral infections", "C4A/C4B genes on chromosome 6; partial depression of Factor B can occur"],
},
{
title: "C3 Deficiency (central to ALL pathways)", color: C.red,
highlights: ["Highest serum concentration of any complement component", "Cleavage by C3 convertase of CP, AP, or LP", "Severe pyogenic infections early in life (pneumonia, meningitis, osteomyelitis)", "C3-opsonised bacteria require C3b binding to CR1 for efficient phagocytosis", "Membranoproliferative glomerulonephritis (MPGN) in ~30% of C3 deficiency"],
},
];
cpDefs.forEach((def, i) => {
const col = i < 2 ? 0 : 1;
const row = i % 2;
const x = col === 0 ? 0.3 : 6.75;
const y = 1.0 + row * 2.95;
s.addShape(pres.ShapeType.rect, { x, y, w:6.2, h:2.85, fill:{color:C.white}, line:{color:def.color, width:0.8} });
s.addShape(pres.ShapeType.rect, { x, y, w:6.2, h:0.38, fill:{color:def.color} });
s.addText(def.title, { x:x+0.05, y, w:6.1, h:0.38, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:3 });
s.addText(def.highlights.map(h => ({ text: "▸ "+h, options: { breakLine: true } })),
{ x:x+0.15, y:y+0.42, w:5.9, h:2.35, fontSize:10, color:C.darkGray, fontFace:"Calibri", valign:"top" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 14 – TERMINAL COMPONENT DEFICIENCIES
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Terminal Component Deficiencies (C5–C9) & Alternative Pathway Deficiencies", C.purple);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// Left – terminal
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.0, w:6.2, h:0.4, fill:{color:C.purple} });
s.addText("TERMINAL COMPONENT DEFICIENCIES (C5, C6, C7, C8, C9)", { x:0.3, y:1.0, w:6.2, h:0.4, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
const termDefs = [
["Key Fact", "Markedly increased susceptibility to Neisseria (N. meningitidis, N. gonorrhoeae). Shared by ALL terminal pathway deficiencies."],
["Age at Onset", "~17 years (vs 3 years in immunocompromised). Later onset reflects partial protection."],
["Clinical Course", "Generally lower mortality than immunocompromised; may be recurrent; milder. Rarely SLE or autoimmune disorders."],
["C6 Deficiency", "More frequent in African Americans & South Africans. Two variants: C6SD (smaller protein, less efficient) & combined C6/C7."],
["C7 Deficiency", "Rare; varied clinical presentations."],
["C8β Deficiency", "More common in White populations. 1 in 1000 carries homozygous C9 nonsense variant (Japan, Korea)."],
["C9 Deficiency", "Most often asymptomatic. CH50 is diminished but not absent. Lytic activity can occur without C9."],
["Clinical Flag", "Family history of meningococcal infections or recurrent neisserial infections → suspect terminal deficiency. Serotype W-135, X, Y, Z less common in healthy individuals."],
];
termDefs.forEach(([label, desc], i) => {
const y = 1.45 + i * 0.65;
const bg = i % 2 === 0 ? C.ltPurple : C.white;
s.addShape(pres.ShapeType.rect, { x:0.3, y, w:1.5, h:0.60, fill:{color:C.purple+"40"}, line:{color:C.purple, width:0.4} });
s.addShape(pres.ShapeType.rect, { x:1.8, y, w:4.7, h:0.60, fill:{color:bg}, line:{color:C.purple, width:0.4} });
s.addText(label, { x:0.3, y, w:1.5, h:0.60, fontSize:9.5, bold:true, color:C.purple, fontFace:"Calibri", align:"center", valign:"middle" });
s.addText(desc, { x:1.88, y, w:4.55, h:0.60, fontSize:9.5, color:C.darkGray, fontFace:"Calibri", valign:"middle" });
});
// Right – AP deficiencies
s.addShape(pres.ShapeType.rect, { x:6.8, y:1.0, w:6.2, h:0.4, fill:{color:C.green} });
s.addText("ALTERNATIVE PATHWAY DEFICIENCIES", { x:6.8, y:1.0, w:6.2, h:0.4, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
const apDefs = [
{name:"Properdin\n(Factor P)", inh:"X-linked recessive (only X-linked complement deficiency)", clin:"Susceptibility to meningococcal disease. Particularly high fatality rate vs terminal component deficiency (early death). Type I: absent; Type II: partial; Type III: dysfunctional. Complicated by sepsis, most commonly in adolescence."},
{name:"Factor D", inh:"AR", clin:"Described in few cases. Neisseria infections. Systemic streptococcal infections also identified."},
{name:"Factor B", inh:"AR non-codominant", clin:"Neisserial & pneumococcal infections. GOF pathogenic variants in Factor B associated with aHUS."},
{name:"MBL", inh:"Polymorphism (not classic AR/AD)", clin:"5–7% of White populations have MBL deficiency. Mostly asymptomatic. Combination with other factors → more severe sepsis and fatal outcomes. Associated with MBL deficiency as additional severity influence for CVID, CF, and hepatitis."},
];
apDefs.forEach((d, i) => {
const y = 1.45 + i * 1.4;
s.addShape(pres.ShapeType.roundRect, { x:6.9, y, w:6.0, h:1.3, fill:{color:C.ltTeal}, line:{color:C.green, width:0.6}, rectRadius:0.07 });
s.addShape(pres.ShapeType.rect, { x:6.9, y, w:6.0, h:0.34, fill:{color:C.green} });
s.addText(d.name, { x:6.95, y, w:2.5, h:0.34, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", valign:"middle" });
s.addText("Inheritance: "+d.inh, { x:9.5, y, w:3.35, h:0.34, fontSize:9.5, color:C.white, fontFace:"Calibri", valign:"middle", italic:true });
s.addText(d.clin, { x:7.0, y:y+0.37, w:5.8, h:0.87, fontSize:9.5, color:C.darkGray, fontFace:"Calibri", valign:"top" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 15 – LECTIN PATHWAY DEFICIENCIES
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Lectin Pathway Deficiencies (MBL, Ficolins, MASPs)", C.teal);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// Intro box
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:1.0, w:12.7, h:0.7, fill:{color:C.ltTeal}, line:{color:C.teal, width:0.8}, rectRadius:0.08 });
s.addText("The Lectin Pathway (LP) recognises repetitive carbohydrate patterns on microbial surfaces. Pattern Recognition Molecules (PRMs) include MBL, Ficolin-1, Ficolin-2, Ficolin-3, Collectin-10, and Collectin-11. MASPs act like C1r/C1s to cleave C4 and C2, activating C3 convertase.", {
x:0.5, y:1.02, w:12.3, h:0.64, fontSize:11, color:C.darkGray, fontFace:"Calibri", valign:"middle"
});
const lpCards = [
{name:"MBL Deficiency", color:C.teal, bg:C.ltTeal, inh:"Polymorphism (common)", clin:[
"5–7% of White populations have MBL deficiency",
"LP impairment → insufficient production of MASP components",
"Common, can be associated with no clear clinical phenotype",
"Associated with more severe forms of sepsis and fatal outcomes",
"MBL deficiency has been associated as additional severity influence for CVID, cystic fibrosis, and hepatitis",
"Low MBL levels described as PROTECTIVE for mycobacterial infection",
"Combination with other factor deficiencies increases severity",
]},
{name:"MASP-1 Deficiency\n(3MC Syndrome)", color:C.amber, bg:C.ltAmber, inh:"AR (MASP1/3; COLEC11; COLEC10 genes)", clin:[
"3MC = Malpuech, Michels, Mingarelli, Carnevale syndrome",
"Developmental delay and facial dysmorphia",
"Cleft lip and palate, postnatal growth deficiency",
"Cognitive impairment and hearing loss",
"Skeletal anomalies",
"Excess or unusual infections & autoimmunity not yet described in this syndrome",
"Proposed mechanism: role in curing neural crest cell migration",
]},
{name:"MASP-2 Deficiency", color:C.green, bg:C.ltTeal, inh:"AR", clin:[
"Initially described in a patient with serious infections & autoimmune disease",
"Now classified as a primary immunodeficiency",
"Frequency: ~6/10,000 (asymptomatic individuals described)",
"Healthy individuals homozygous for p.D120G found by chance in genetic association studies",
"Increased levels of MBL or MASP-2 → poor disease outcome associated with mycobacterial infections or pneumococcal meningitis",
"MASP-2 deficiency phenotype may be mild at normal levels",
]},
{name:"Ficolin-3 (H-Ficolin)\nDeficiency", color:C.purple, bg:C.ltPurple, inh:"Polymorphism (complete ficolin-3 = AR)", clin:[
"Various clinical phenotypes",
"Complete ficolin-3 deficiency initially associated with susceptibility to infections & necrotising enterocolitis",
"Heterogeneous range of clinical manifestations",
"Respiratory and nervous system involvement reported",
"FCN3 deficiency raises awareness regarding significance of ficolin-3 in respiratory and nervous immunity",
]},
];
lpCards.forEach((c, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = col === 0 ? 0.3 : 6.8;
const y = 1.85 + row * 2.6;
s.addShape(pres.ShapeType.rect, { x, y, w:6.25, h:2.5, fill:{color:c.bg}, line:{color:c.color, width:0.8} });
s.addShape(pres.ShapeType.rect, { x, y, w:6.25, h:0.38, fill:{color:c.color} });
s.addText(c.name, { x:x+0.05, y, w:4.5, h:0.38, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:3 });
s.addText(c.inh, { x:x+4.5, y, w:1.7, h:0.38, fontSize:9, color:C.white, fontFace:"Calibri", valign:"middle", align:"right", margin:3, italic:true });
s.addText(c.clin.map(l => ({ text:"▸ "+l, options:{breakLine:true} })),
{ x:x+0.15, y:y+0.42, w:5.95, h:2.0, fontSize:9.5, color:C.darkGray, fontFace:"Calibri", valign:"top" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 16 – SECTION DIVIDER
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
sectionDivider(s, "06", "Regulator & Receptor Deficiencies", C.amber);
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 17 – TABLE 173.5
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Protein Regulator & Receptor Deficiencies (Table 173.5)");
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
const t5cols = [0.2, 3.0, 4.8, 13.1];
s.addShape(pres.ShapeType.rect, { x:0.2, y:1.0, w:2.75, h:0.40, fill:{color:C.darkGray} });
s.addShape(pres.ShapeType.rect, { x:3.0, y:1.0, w:1.75, h:0.40, fill:{color:C.darkGray} });
s.addShape(pres.ShapeType.rect, { x:4.8, y:1.0, w:8.3, h:0.40, fill:{color:C.darkGray} });
s.addText("DEFICIENCY", { x:0.25, y:1.0, w:2.7, h:0.40, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addText("INHERITANCE", { x:3.05, y:1.0, w:1.7, h:0.40, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
s.addText("ASSOCIATED SYMPTOMS / DISORDERS", { x:4.85, y:1.0, w:8.2, h:0.40, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:0 });
const t5rows = [
["C1 Inhibitor (C1-INH)", "AD", "Hereditary Angioedema (HAE). Type I: low quantity; Type II: low function. Recurrent angioedema episodes without wheals.", C.navy, C.ltBlue],
["C4-Binding Protein", "Unknown", "Atypical Morbus Behçet, angioedema, protein S deficit.", C.navy, C.ltBlue],
["Properdin (Factor P)", "X-linked recessive", "Meningitis (Neisseria). High fatality rate from meningococcal disease.", C.green, C.ltTeal],
["Factor H", "AR", "Membranoproliferative glomerulonephritis, AMD, aHUS (20–30% of cases). Deficiency → uncontrolled AP activation → secondary C3 depletion.", C.red, C.ltRed],
["Factor I", "AR", "Pyogenic infections, neisserial infections, glomerulonephritis, aHUS (5–10%), CNS inflammation. Uncontrolled AP → secondary C3 deficiency.", C.red, C.ltRed],
["CFHR1 (FHR3)", "Complex", "aHUS, C3 glomerulopathy (C3G), AMD, Rheumatoid Arthritis, SLE.", C.amber, C.ltAmber],
["Thrombomodulin (CD141)", "AD", "aHUS (3–5% of cases).", C.amber, C.ltAmber],
["CD46 / MCP", "Heterozygous or compound heterozygous", "aHUS (10–15% of cases). Renal transplantation may be successful.", C.purple, C.ltPurple],
["CD55 / DAF", "AR", "Protein-losing enteropathy. RBCs lack DAF (Cromer blood group – Inab phenotype).", C.teal, C.ltTeal],
["CD55 (DAF) or CD59", "AR", "Paroxysmal Nocturnal Haemoglobinuria (PNH) – diagnosed by flow cytometry for CD55/CD59.", C.teal, C.ltTeal],
["CD59", "AR", "Chronic haemolytic anaemia, recurrent stroke, Guillain-Barré-like neurologic symptoms with haemolysis.", C.teal, C.ltTeal],
["CR2 (CD21)", "AR", "Infections associated with Common Variable Immunodeficiency (CVID).", C.gray, C.offWhite],
["CR3/CR4 (CD18/CD11b/c)", "AR", "Leukocyte Adhesion Deficiency (LAD) – delayed umbilical cord separation, recurrent bacterial/fungal infections, impaired pus formation, heavy mortality.", C.darkGray, C.offWhite],
];
const rH = 0.44;
t5rows.forEach(([def, inh, sym, color, bg], i) => {
const y = 1.43 + i * rH;
s.addShape(pres.ShapeType.rect, { x:0.2, y, w:2.75, h:rH-0.02, fill:{color:bg}, line:{color:color, width:0.4} });
s.addShape(pres.ShapeType.rect, { x:3.0, y, w:1.75, h:rH-0.02, fill:{color:bg}, line:{color:color, width:0.4} });
s.addShape(pres.ShapeType.rect, { x:4.8, y, w:8.3, h:rH-0.02, fill:{color:bg}, line:{color:color, width:0.4} });
s.addShape(pres.ShapeType.rect, { x:0.2, y, w:0.10, h:rH-0.02, fill:{color:color} });
s.addText(def, { x:0.33, y, w:2.58, h:rH-0.02, fontSize:9, bold:true, color:color, fontFace:"Calibri", valign:"middle" });
s.addText(inh, { x:3.04, y, w:1.68, h:rH-0.02, fontSize:8.5, color:C.darkGray, fontFace:"Calibri", valign:"middle", align:"center" });
s.addText(sym, { x:4.87, y, w:8.18, h:rH-0.02, fontSize:9, color:C.darkGray, fontFace:"Calibri", valign:"middle" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 18 – FACTOR H & FACTOR I DEFICIENCIES
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Factor H & Factor I Deficiencies – Clinical Deep Dive", C.red);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// Factor H
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.0, w:6.2, h:6.1, fill:{color:C.white}, line:{color:C.red, width:0.9} });
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.0, w:6.2, h:0.42, fill:{color:C.red} });
s.addText("Factor H (CFH) Deficiency", { x:0.35, y:1.0, w:6.1, h:0.42, fontSize:14, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:3 });
const fhPoints = [
"High concentration in plasma: 500 µg/mL",
"Works in BOTH liquid and solid phases of the AP",
"Acts as cofactor for Factor I in cleavage of C3b & C4b",
"Multifunctional decay acceleration + complement activation regulation",
"Main disease phenotypes: MPGN, glomerulonephritis, aHUS, AMD",
"Infections due to secondary C3 consumption with partial deficiency",
"Diagnosis: reduced CH50 AND AP50 with normal C3 suggest Factor H deficiency",
"Antigenic levels of Factor H typically LOW",
"Several patients with MPGN: CFH deficiency found to be underlying basis for aHUS pathophysiology (15–30% of patients)",
"CFH possibly protects fenestrated endothelium in glomerulus from complement-mediated damage",
"aHUS: both autosomal recessive and heterozygous pathogenic variants described",
"Common tyrosine-histidine polymorphism of Factor H → higher risk of AMD & blindness",
"Factor H-related proteins (FHR1–FHR5) also have regulatory roles",
];
s.addText(fhPoints.map(p => ({ text:"▸ "+p, options:{breakLine:true} })),
{ x:0.45, y:1.47, w:5.9, h:5.5, fontSize:10, color:C.darkGray, fontFace:"Calibri", valign:"top" });
// Factor I
s.addShape(pres.ShapeType.rect, { x:6.8, y:1.0, w:6.2, h:6.1, fill:{color:C.white}, line:{color:"C0392B", width:0.9} });
s.addShape(pres.ShapeType.rect, { x:6.8, y:1.0, w:6.2, h:0.42, fill:{color:"C0392B"} });
s.addText("Factor I Deficiency", { x:6.85, y:1.0, w:6.1, h:0.42, fontSize:14, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:3 });
const fiPoints = [
"Factor I is a KEY REGULATOR of the AP",
"Deficiency → uncontrolled AP activation → secondary C3 deficiency",
"Reduction in circulating factor H levels also occurs",
"When Factor I is lacking, C3bBb continues to cleave C3 → secondary C3 deficiency",
"Susceptibility to infections relates to role as cofactor for C3bBb dissociation",
"Neisserial infections, infections with encapsulated organisms (S. pneumoniae, H. influenzae)",
"aHUS and MPGN II also associated with Factor I deficiency",
"Pathogenic variants inactivate binding sites: surface-bound C3b, polyanion surfaces (e.g. fenestrated endothelium of glomerulus) → exposes basement membrane",
"Three clinical phenotypes: 1) Infection susceptibility, 2) Inflammatory/renal disease, 3) Autoinflammatory (CNS inflammation reported)",
"Partial Factor I deficiency: recurrent tonsillitis, urinary infections, otitis, pyelonephritis, severe meningitis, sepsis",
"Factor I deficiency is DIFFICULT TO IDENTIFY because complement studies often give normal results; C3 may be depressed but not necessarily affected",
];
s.addText(fiPoints.map(p => ({ text:"▸ "+p, options:{breakLine:true} })),
{ x:6.95, y:1.47, w:5.9, h:5.5, fontSize:10, color:C.darkGray, fontFace:"Calibri", valign:"top" });
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 19 – SECTION DIVIDER
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
sectionDivider(s, "07", "Hereditary Angioedema (HAE)", C.navy);
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 20 – HAE
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Hereditary Angioedema (HAE) – C1-INH Deficiency", C.navy);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// Overview
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:1.0, w:12.7, h:0.7, fill:{color:C.ltBlue}, line:{color:C.navy, width:0.7}, rectRadius:0.07 });
s.addText("HAE = recurrent angioedema WITHOUT wheals (autosomal dominant inheritance). C1-INH (SERPING1 gene) inhibits C1r, C1s (CP) and MASP-2 (LP) and kallikrein (contact system). Deficiency → uncontrolled bradykinin generation → angioedema of skin & mucosa. First HAE episodes occur at mean age 10 years.", {
x:0.5, y:1.02, w:12.3, h:0.64, fontSize:11, color:C.darkGray, fontFace:"Calibri", valign:"middle"
});
// Types
const haeTypes = [
["TYPE I\n(85% of cases)", C.navy, "Low quantity AND function of C1-INH. C4 levels decreased; C1q normal. Attacks triggered by stress, trauma, hormones (estrogen), infections."],
["TYPE II\n(15% of cases)", C.teal, "Normal quantity but decreased functional C1-INH values. C4 decreased. Clinically identical to Type I. Both types treated the same way."],
["TYPE III\n(HAE with normal C1-INH)", C.amber, "Normal serum C1-INH levels and functional activity. Primarily in females. Mutations in Factor XII (FXII-HAE), Plasminogen, ANGPT1, KNG1, MYOF, or heparan sulfate-glucosamine 3-O-sulfotransferase 6 genes."],
["ACQUIRED C1-INH Def.\n(not hereditary)", C.red, "Onset in life >40 years. Associated with B-cell malignancies, autoimmune gammopathies. Anti-C1-INH in ~70% of cases. C1q levels DIMINISHED (differs from hereditary HAE)."],
];
haeTypes.forEach(([ title, color, desc], i) => {
const col = i % 2;
const row = Math.floor(i/2);
const x = col === 0 ? 0.3 : 6.8;
const y = 1.83 + row * 2.55;
s.addShape(pres.ShapeType.rect, { x, y, w:6.2, h:2.42, fill:{color:C.white}, line:{color, width:0.8} });
s.addShape(pres.ShapeType.rect, { x, y, w:6.2, h:0.38, fill:{color} });
s.addText(title, { x:x+0.05, y, w:6.1, h:0.38, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:3 });
s.addText(desc, { x:x+0.15, y:y+0.42, w:5.9, h:1.95, fontSize:11, color:C.darkGray, fontFace:"Calibri", valign:"top" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 21 – HAE TREATMENT TABLE
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "HAE Treatment – Therapies for C1-INH Deficiency (Table 173.6)", C.navy);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
const txSections = [
{
label:"LONG-TERM PROPHYLAXIS (LTP)", color:C.navy, x:0.2, y:1.0, w:6.0,
items:[
["pdC1-INH nanofiltrated", "≥12 yr: 1000 IU; 6–12 yr: 500 IU q3–4 days IV"],
["SC pdC1-INH nanofiltrated", "60 IU/kg twice weekly, >12 yr, SC"],
["Lanadelumab", "300 mg q2 wk; after 6 mo if no attacks: 300 mg q4 wk, >12 yr, SC"],
["Berotralstat", "150 mg/day oral, ≥12 yr"],
["Antifibrinolytics\n(Tranexamic acid)", "10 mg/kg/day bid to 25 mg/kg/day tid, max 3 g/day oral"],
["Androgens (Danazol)\n[avoid use if possible]", "If necessary: Danazol 10 mg/kg/day (max 200 mg/day) oral"],
]
},
{
label:"SHORT-TERM PROPHYLAXIS (STP)", color:C.teal, x:0.2, y:4.5, w:6.0,
items:[
["pdC1-INH nanofiltrated", "20 IU/kg IV (no age limits) 1–6 hr before procedure"],
["rhC1-INH / conestat alfa", "50 IU/kg (max 4200 IU) IV, ≥12 yr"],
["Fresh-frozen plasma", "10 mL/kg IV, no age limits (if other STP not available)"],
]
},
{
label:"ON-DEMAND THERAPY", color:C.red, x:6.5, y:1.0, w:6.6,
items:[
["pdC1-INH nanofiltrated", "20 IU/kg IV, no age limits"],
["rhC1-INH / conestat alfa", "50 IU/kg (max 4200 IU) IV, ≥12 yr"],
["Ecallantide\n(Kallikrein inhibitor)", "30 mg SC, ≥12 yr. Self-administration NOT allowed (anaphylaxis risk)"],
["Icatibant\n(Bradykinin B₂ antagonist)", "30 mg/3 mL SC, ≥18 yr (≥2 yr in some countries). Dose adjust for children <65 kg"],
["Fresh-frozen plasma", "10 mL/kg IV, no age limits (if other OD medications unavailable)"],
["HAE with normal C1-INH\n(on-demand + STP)", "Same as above. LTP: tranexamic acid and progestins show improvement"],
["PNH / aHUS Treatment", "Eculizumab (anti-C5 monoclonal antibody) – prevents MAC C5b9 generation; effective for both PNH and aHUS"],
]
},
];
txSections.forEach(sec => {
const secH = sec.items.length * 0.47 + 0.45;
s.addShape(pres.ShapeType.rect, { x:sec.x, y:sec.y, w:sec.w, h:secH, fill:{color:C.white}, line:{color:sec.color, width:0.8} });
s.addShape(pres.ShapeType.rect, { x:sec.x, y:sec.y, w:sec.w, h:0.38, fill:{color:sec.color} });
s.addText(sec.label, { x:sec.x+0.05, y:sec.y, w:sec.w-0.1, h:0.38, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:3 });
sec.items.forEach(([drug, dose], i) => {
const y = sec.y + 0.42 + i * 0.47;
const bg = i % 2 === 0 ? sec.color+"18" : C.white;
s.addShape(pres.ShapeType.rect, { x:sec.x+0.05, y, w:sec.w-0.1, h:0.44, fill:{color:bg} });
s.addText(drug, { x:sec.x+0.12, y, w:2.3, h:0.44, fontSize:9.5, bold:true, color:sec.color, fontFace:"Calibri", valign:"middle" });
s.addText(dose, { x:sec.x+2.5, y, w:sec.w-2.6, h:0.44, fontSize:9.5, color:C.darkGray, fontFace:"Calibri", valign:"middle" });
});
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 22 – aHUS & PNH
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "aHUS & PNH – Complement-Mediated Disorders", C.red);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// aHUS
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.0, w:6.1, h:6.1, fill:{color:C.white}, line:{color:C.red, width:0.9} });
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.0, w:6.1, h:0.42, fill:{color:C.red} });
s.addText("aHUS – Atypical Haemolytic Uraemic Syndrome", { x:0.35, y:1.0, w:6.0, h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:3 });
const ahusPoints = [
"Thrombotic microangiopathy: haemolytic anaemia + thrombocytopaenia + renal failure",
"\"Atypical\" = lacks Shiga toxin trigger (differs from typical HUS)",
"CFH deficiency: underlying basis in 15–30% of aHUS patients",
"~50% of aHUS patients have genetic pathogenic variants of Factor H, Factor I, C3, Factor B, and/or MCP, and deletion of complement Factor H-related proteins 1 and 3 (CFHR1/CFHR3)",
"~20% of patients with aHUS have pathologic variants in >1 gene",
"Patients with autoantibodies to regulatory proteins also comprise significant subset",
"Majority of aHUS cases are sporadic; occur without prior family history; penetrance incomplete",
"Thrombomodulin (CD141) also has regulatory role and binds Factor H and C3b",
"CFH deficiency: protects fenestrated endothelium of glomerulus from complement-mediated damage",
"Recurrent aHUS: seen with anti-Factor H antibodies (acquired form)",
"Diagnosis: both AR and heterozygous pathogenic variants; young age at onset; mortality not uncommon",
"Treatment: ECULIZUMAB (anti-C5 monoclonal IgG2/4) → prevents MAC C5b-9 generation",
];
s.addText(ahusPoints.map(p => ({ text:"▸ "+p, options:{breakLine:true} })),
{ x:0.45, y:1.47, w:5.8, h:5.5, fontSize:9.5, color:C.darkGray, fontFace:"Calibri", valign:"top" });
// PNH
s.addShape(pres.ShapeType.rect, { x:6.7, y:1.0, w:6.3, h:6.1, fill:{color:C.white}, line:{color:C.teal, width:0.9} });
s.addShape(pres.ShapeType.rect, { x:6.7, y:1.0, w:6.3, h:0.42, fill:{color:C.teal} });
s.addText("PNH – Paroxysmal Nocturnal Haemoglobinuria", { x:6.75, y:1.0, w:6.2, h:0.42, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:3 });
const pnhPoints = [
"Acquired somatic mutation in PIG-A (phosphatidylinositol glycan class A) or PIG-M gene in a clone of bone marrow progenitor cells",
"PIG-A anchors GPI-anchored proteins: C8-binding protein, DAF (CD55), and CD59",
"GPI-anchored proteins protect haematopoietic cells from complement-mediated lysis",
"PNH: recurrent haemoglobinuria secondary to intravascular haemolysis",
"Associated with thrombosis and aplastic anaemia",
"Red cells are most vulnerable — cannot repair membrane damage",
"Cells from variant-bearing progenitor lack all GPI-anchored membrane proteins",
"Key features relate to LOSS OF CD59 (and DAF/CD55)",
"Diagnosis: FLOW CYTOMETRY for CD59 or CD55 (DAF) on red blood cells",
"CD59 deficiency: isolated → chronic haemolytic anaemia, recurrent stroke, Guillain-Barré-like neurologic symptoms",
"CD55/DAF or CD59 combined deficiency → PNH",
"Treatment: ECULIZUMAB (anti-C5 monoclonal antibody, humanized IgG2/4) → prevents MAC C5b-9 generation → effective for PNH and aHUS",
];
s.addText(pnhPoints.map(p => ({ text:"▸ "+p, options:{breakLine:true} })),
{ x:6.85, y:1.47, w:6.0, h:5.5, fontSize:9.5, color:C.darkGray, fontFace:"Calibri", valign:"top" });
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 23 – SECTION DIVIDER
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
sectionDivider(s, "08", "Complement Evaluation & Lab Screening", C.teal);
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 24 – LAB EVALUATION
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Laboratory Evaluation of Complement Deficiencies (Table 173.3)", C.teal);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
// Table 173.3
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.0, w:6.1, h:0.4, fill:{color:C.teal} });
s.addShape(pres.ShapeType.rect, { x:6.6, y:1.0, w:6.4, h:0.4, fill:{color:C.teal} });
s.addText("COMPLEMENT EVALUATION", { x:0.3, y:1.0, w:6.1, h:0.4, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
s.addText("EXAMPLES", { x:6.6, y:1.0, w:6.4, h:0.4, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0 });
const evalRows = [
["Total complement activity", "CH50 (classical/lectin), AP50 (alternative) – haemolytic assays; both together = 'CS screen'", C.navy, C.ltBlue],
["Quantification of single components", "C3, C4, MBL, Properdin – ELISA or immunochemical tests after CH50/AP50", C.teal, C.ltTeal],
["Functional activity of single components", "Functional C1 Inhibitor (functional assay is NOT substituted by C4 measurement alone)", C.teal, C.ltTeal],
["Products of complement activation", "C3d, C3dg – detection of iC3b binding fragments via flow cytometry on red cells", C.green, C.ltTeal],
["Autoantibodies to complement components", "Anti-C1q (associated with hypocomplementaemic urticarial vasculitis, SLE nephritis); Nephritic Factor", C.amber, C.ltAmber],
["Cell surface expression of receptors/regulators", "CD55 (DAF), CD59, CR3/4 – flow cytometry; diagnosis of PNH (CD55/CD59 loss)", C.amber, C.ltAmber],
["Tissue deposition of complement proteins", "Deposition of C3 or Factor H in injury/burns – immunohistochemistry", C.purple, C.ltPurple],
["Genetic evaluation", "Next generation sequencing or specific gene panels (CFH, CFI, MCP, C3, Factor B); direct genetic analysis for aHUS/AMD", C.red, C.ltRed],
];
evalRows.forEach(([eval_, ex, color, bg], i) => {
const y = 1.45 + i * 0.63;
s.addShape(pres.ShapeType.rect, { x:0.3, y, w:6.1, h:0.60, fill:{color:bg}, line:{color:color, width:0.4} });
s.addShape(pres.ShapeType.rect, { x:6.6, y, w:6.4, h:0.60, fill:{color:bg}, line:{color:color, width:0.4} });
s.addShape(pres.ShapeType.rect, { x:0.3, y, w:0.1, h:0.60, fill:{color:color} });
s.addText(eval_, { x:0.45, y, w:5.85, h:0.60, fontSize:10, bold:true, color:color, fontFace:"Calibri", valign:"middle" });
s.addText(ex, { x:6.68, y, w:6.25, h:0.60, fontSize:10, color:C.darkGray, fontFace:"Calibri", valign:"middle" });
});
// Screening flowchart box
s.addShape(pres.ShapeType.rect, { x:0.3, y:6.55, w:12.7, h:0.55, fill:{color:"EBF5FB"}, line:{color:C.teal, width:0.6} });
s.addText("Screening Strategy: CH50 (↓) → test CP/LP components (C1q, C1r/s, C2, C4, MBL, MASP2). AP50 (↓) → test AP components (Factor B, Factor D). Both ↓ → check C3, C5–C9. Screening with haemolytic assays is NOT adequate for C9, properdin, MBL, or MASP-2 deficiencies.", {
x:0.45, y:6.55, w:12.45, h:0.55, fontSize:9.5, color:C.darkGray, fontFace:"Calibri", valign:"middle", italic:true
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 25 – SECTION DIVIDER
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
sectionDivider(s, "09", "Management of Complement Deficiencies", C.green);
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 26 – MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Management of Complement Deficiencies", C.green);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
const mgmt = [
{
title:"Prophylactic Antibiotics", color:C.navy, icon:"💊",
points:[
"Additional protection from serious infection",
"With unexplained fever: cultures + urgent antibiotics",
"Less stringent thresholds than unaffected children",
"Written action plan for parents/school/camp/emergency departments",
"Usually directed against encapsulated bacteria (S. pneumoniae, H. influenzae)",
]
},
{
title:"Vaccination", color:C.teal, icon:"💉",
points:[
"Vaccinate against encapsulated organisms (pneumococcal, meningococcal, Hib)",
"Terminal deficiency, Factor D, and Properdin: high antibody titers may partially compensate for complement deficiency",
"Repeat immunisation advisable (blunted or shorter-lived antibody response in complement deficiency)",
"Immunise household members to reduce exposure risk",
"Meningococcal ACWY and B vaccines particularly important",
]
},
{
title:"Specific Interventions", color:C.purple, icon:"🏥",
points:[
"C1q deficiency: bone marrow transplantation has been curative (C1q produced mainly by myeloid cells) — poor prognosis otherwise",
"Eculizumab (anti-C5 monoclonal IgG2/4) for PNH and aHUS — prevents MAC C5b-9 generation",
"HAE: C1-INH concentrate, ecallantide, icatibant (on-demand); LTP with lanadelumab, berotralstat",
"MBL: plasma/recombinant MBL administered in trials; role in significant infections not well-established",
"Renal transplant may be successful in MCP/CD46 deficiency (local defect)",
]
},
{
title:"Additional Considerations", color:C.amber, icon:"⚠️",
points:[
"SLE + complement defect: respond as well to therapy as those without complement deficiency; require more vigilance for infection",
"Cardiac risk factors: heightened importance in early complement component-deficient individuals (accelerated atherosclerosis)",
"C4 levels: screening test for C1-INH deficiency in HAE — C4 persistently low; functional evaluation of C1-INH needed for confirmation",
"Immunosuppression: patients on immunosuppressive therapy need more vigilance for severe infection",
"Flow cytometry: standard technique for PNH diagnosis (CD55, CD59 levels on blood cells)",
]
},
];
mgmt.forEach((item, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = col === 0 ? 0.3 : 6.8;
const y = 1.0 + row * 3.0;
s.addShape(pres.ShapeType.rect, { x, y, w:6.2, h:2.85, fill:{color:C.white}, line:{color:item.color, width:0.8} });
s.addShape(pres.ShapeType.rect, { x, y, w:6.2, h:0.40, fill:{color:item.color} });
s.addText(item.icon + " " + item.title, { x:x+0.05, y, w:6.1, h:0.40, fontSize:12, bold:true, color:C.white, fontFace:"Calibri", valign:"middle", margin:3 });
s.addText(item.points.map(p => ({ text:"▸ "+p, options:{breakLine:true} })),
{ x:x+0.15, y:y+0.44, w:5.9, h:2.35, fontSize:10, color:C.darkGray, fontFace:"Calibri", valign:"top" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 27 – KEY HIGHLIGHTS / SUMMARY
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
slideHeader(s, "Key Highlights & Clinical Pearls", C.amber);
s.addShape(pres.ShapeType.rect, { x:0, y:0.81, w:13.3, h:6.39, fill:{color: C.offWhite} });
const pearls = [
["CP/LP Convergence", C.navy, "Both CP and LP converge at C4bC2a (C3 convertase) → C3b → C5b → MAC. MASPs (LP) act like C1r/C1s (CP)."],
["Most Common CP Deficiency", C.navy, "C2 deficiency is the most common complement deficiency in white populations (1/10,000). Associated with autoimmunity (10–42%) and risk of encapsulated bacteria infections."],
["C3 – The Central Component", C.red, "C3 has the highest serum concentration. Its cleavage is the most crucial step biologically. C3 deficiency → severe pyogenic infections early in life."],
["Terminal Pathway (C5–C9)", C.purple, "Specifically required for defence against Neisseria. Deficiency presents ~17 yr (milder/recurrent vs immunocompromised ~3 yr). C9 deficiency common in East Asian populations."],
["Properdin – Only X-linked Deficiency", C.green, "Only X-linked complement deficiency. Stabilises alternative pathway C3 convertase. Deficiency → high fatality from meningococcal disease, especially in adolescent males."],
["Factor H – Key AP Regulator", C.red, "Most important negative regulator of AP. CFH gene variants → MPGN, AMD, aHUS. Common polymorphism (Y402H) → highest single genetic risk factor for AMD."],
["PNH – Acquired, Not Inherited", C.teal, "Acquired somatic PIG-A/PIG-M mutation. Loss of GPI-anchored CD55 + CD59 → intravascular haemolysis, thrombosis. Diagnosed by flow cytometry. Treated with eculizumab."],
["HAE – Bradykinin NOT Histamine", C.navy, "C1-INH deficiency → uncontrolled kallikrein → excess bradykinin → angioedema WITHOUT wheals. Antihistamines do NOT work. Treat with C1-INH concentrate, icatibant, or ecallantide."],
["Screening Strategy", C.teal, "CH50 screens CP+LP; AP50 screens AP. Both low → suspect C3 or terminal component deficiency. CH50 normal but LP deficient → MBL/MASP deficiency. Use haemolytic assay NOT adequate for C9/properdin/MBL."],
["Autoimmunity Link", C.amber, "Early CP deficiencies (C1q, C2, C4) → impaired clearance of apoptotic debris & immune complexes → SLE-like autoimmune disease. C1q deficiency: 90% develop SLE or SLE-like syndrome."],
];
pearls.forEach(([title, color, desc], i) => {
const col = i < 5 ? 0 : 1;
const row = i % 5;
const x = col === 0 ? 0.3 : 6.8;
const y = 1.0 + row * 1.12;
s.addShape(pres.ShapeType.roundRect, { x, y, w:6.2, h:1.05, fill:{color:C.white}, line:{color:color, width:0.6}, rectRadius:0.06 });
s.addShape(pres.ShapeType.rect, { x, y, w:0.14, h:1.05, fill:{color:color} });
s.addText(title, { x:x+0.22, y:y+0.04, w:5.85, h:0.28, fontSize:11, bold:true, color:color, fontFace:"Calibri", valign:"middle" });
s.addText(desc, { x:x+0.22, y:y+0.32, w:5.85, h:0.70, fontSize:9.5, color:C.darkGray, fontFace:"Calibri", valign:"top" });
});
// ═══════════════════════════════════════════════════════════════════════════
// SLIDE 28 – THANK YOU
// ═══════════════════════════════════════════════════════════════════════════
s = pres.addSlide();
titleSlide(s, "Thank You", "Nelson Textbook of Pediatrics 2024 · Chapter 173 · Anete Sevciovic Grumach");
// ─── WRITE FILE ─────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/complement-pptx/Complement_System_Pathways_Deficiencies.pptx" })
.then(() => console.log("SUCCESS: file written"))
.catch(e => { console.error("ERROR:", e); process.exit(1); });
cd /home/daytona/workspace/complement-pptx && node build.js 2>&1
cd /home/daytona/workspace/complement-pptx && \ sed -i "s/color\+\"22\"/color/g;…
ls -lh /home/daytona/workspace/complement-pptx/
Complement System Pathways Deficiencies
Presentation · PPTX
| Slide(s) | Content |
|---|---|
| 1–2 | Title slide + Visual Table of Contents |
| 3–5 | Overview – Complement system functions, 3 pathways, nomenclature & component tables (173.1 & 173.2) |
| 6–10 | Flowcharts – Classical & Lectin pathway flowchart; Alternative pathway + control mechanisms; Terminal pathway & MAC; Integrated 3-pathway overview diagram |
| 11–15 | Pathway Deficiencies – Full Table 173.4 (C1q through MASP-2 with inheritance & disorders); Deep-dives on CP deficiencies (C1q, C2, C4, C3); Terminal & AP deficiencies; Lectin pathway (MBL, Ficolins, MASP-1/2) |
| 16–18 | Regulator & Receptor Deficiencies – Full Table 173.5 (C1-INH through CR3/CR4); Factor H & Factor I deep-dives |
| 19–21 | HAE – Types I/II/III/Acquired + full treatment table (LTP, STP, on-demand therapy - Table 173.6) |
| 22 | aHUS & PNH – pathogenesis, genetics, eculizumab |
| 23–24 | Lab Evaluation – Table 173.3, CH50/AP50 screening strategy |
| 25–26 | Management – antibiotics, vaccines, specific interventions |
| 27–28 | Key Highlights / Clinical Pearls (10 high-yield points) + Thank You |