Based on information in this pdf make easy to learn notes for md dermatology exam, on biologics in atoimmune blistering disorder with diagrammatic representation showing site of action of the drug
mkdir -p /tmp/workspace/derm-biologics && cd /tmp/workspace/derm-biologics && python3 -c " import pdfplumber with pdfplumber.open('/tmp/workspace/attachments/54fbcb12-ea03-48a1-9c36-cc9085d24484/Biologics.pdf') as pdf: print('Pages:', len(pdf.pages)) for i, page in enumerate(pdf.pages): text = page.extract_text() or '' print(f'--- PAGE {i+1} ---') print(text) " > extracted.txt 2>&1 wc -l extracted.txt
"Figure 1" in ~/derm-biologics/extracted.txt
"mechanism of action" in ~/derm-biologics/extracted.txt
"Figure 2:" in ~/derm-biologics/extracted.txt
"mucous membrane pemphigoid" in ~/derm-biologics/extracted.txt
mkdir -p /tmp/workspace/derm-biologics/output && cd /tmp/workspace/derm-biologics && python3 << 'EOF' import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.patches as mpatches from matplotlib.patches import FancyBboxPatch, FancyArrowPatch import matplotlib.lines as mlines # ---------- DIAGRAM 1: PEMPHIGUS ---------- fig, ax = plt.subplots(figsize=(11, 14)) ax.set_xlim(0, 10) ax.set_ylim(0, 16) ax.axis('off') ax.set_title("Site of Action of Biologics in PEMPHIGUS", fontsize=16, fontweight='bold', pad=10) def box(x, y, w, h, text, fc, ec='black', fs=10, weight='normal'): b = FancyBboxPatch((x, y), w, h, boxstyle="round,pad=0.08", linewidth=1.4, edgecolor=ec, facecolor=fc) ax.add_patch(b) ax.text(x+w/2, y+h/2, text, ha='center', va='center', fontsize=fs, weight=weight, wrap=True) def arrow(x1,y1,x2,y2, color='black', style='-|>'): a = FancyArrowPatch((x1,y1),(x2,y2), arrowstyle=style, mutation_scale=18, color=color, linewidth=1.6) ax.add_patch(a) def drug_label(x, y, text, color): ax.annotate(text, xy=(x, y), fontsize=9.5, color=color, weight='bold', ha='left', va='center') # Main pathogenesis pipeline (center column) box(3.2, 14.4, 3.6, 1.0, "Naive B cell\n(pre-B -> mature B)", '#eaf4ff') box(3.2, 12.6, 3.6, 1.0, "B-cell activation via\nBCR signalling\n(BTK, PLC, NFkB, MAPK, PI3K)", '#eaf4ff') box(3.2, 10.8, 3.6, 1.0, "Autoreactive Plasma cell /\nPlasmablast (long-lived)", '#eaf4ff') box(3.2, 9.0, 3.6, 1.0, "Anti-Desmoglein (Dsg1/3)\nIgG autoantibody", '#fff6d8') box(3.2, 7.2, 3.6, 1.0, "Binding of IgG to\nDesmoglein on keratinocyte", '#fff6d8') box(3.2, 5.4, 3.6, 1.0, "Loss of cell-cell adhesion\n(ACANTHOLYSIS)", '#f0f0f0') box(3.2, 3.6, 3.6, 1.0, "Intraepidermal blister\n(Suprabasal / subcorneal)", '#e8e8e8') for (x1,y1,x2,y2) in [(5,14.4,5,13.6),(5,12.6,5,11.8),(5,10.8,5,10.0), (5,9.0,5,8.2),(5,7.2,5,6.4),(5,5.4,5,4.6)]: arrow(x1,y1,x2,y2) # Left side: B-cell/plasma cell targeting drugs (light green box per article) box(0.1, 13.6, 2.7, 1.6, "ANTI-CD20 mAb\nRituximab, Ofatumumab,\nVeltuzumab, Obinutuzumab", '#d9f2d0', fs=8.5) arrow(2.8,14.4,3.2,14.4, color='#2e7d32') box(0.1, 11.4, 2.7, 1.6, "ANTI-CD19 mAb\nInebilizumab,\nBlinatumomab\n(kills plasmablasts)", '#d9f2d0', fs=8.5) arrow(2.8,12.2,3.2,11.3, color='#2e7d32') box(0.1, 9.4, 2.7, 1.4, "BAFF inhibitor\nIanalumab (VAY736)\n-> B cell/plasma cell death", '#d9f2d0', fs=8.5) arrow(2.8,10.1,3.2,10.6, color='#2e7d32') box(0.1, 7.6, 2.7, 1.4, "BTK inhibitors\nIbrutinib, Rilzabrutinib\n-> block BCR signalling", '#d9f2d0', fs=8.5) arrow(2.8,8.3,3.2,13.0, color='#2e7d32') box(0.1, 5.7, 2.7, 1.3, "CAAR-T cells /\nDsg3-CAR-T\n-> selective B-cell kill", '#d9f2d0', fs=8.5) arrow(2.8,6.35,3.2,11.2, color='#2e7d32') # Right side: antibody half-life reduction (light yellow box) box(7.1, 8.4, 2.8, 1.6, "FcRn antagonists\nEfgartigimod,\nALXN1830 (SYNT001)\n-> reduce IgG half-life", '#fff2b0', fs=8.5) arrow(7.1,9.2,6.8,9.0, color='#b8860b') box(7.1, 6.4, 2.8, 1.6, "IVIg / Immunoadsorption\n-> neutralise & remove\npathogenic IgG", '#fff2b0', fs=8.5) arrow(7.1,7.2,6.8,7.7, color='#b8860b') # Cholinomimetics act at acantholysis level (gray box) box(7.1, 4.6, 2.8, 1.3, "Cholinomimetics\nPyridostigmine, Pilocarpine\n-> strengthen desmosomes,\nreduce acantholysis", '#e0e0e0', fs=8.5) arrow(7.1,5.25,6.8,5.9, color='#555555') # IL-4 inhibitor (dark yellow box) acting on inflammatory milieu box(7.1, 2.6, 2.8, 1.3, "IL-4 inhibitor\n(e.g. Dupilumab - trialled)\n-> reduce Th2 inflammatory\ncytokine support to B cells", '#e6c200', fs=8.5) arrow(7.1,3.25,6.8,4.0, color='#7a6100') # Legend ax.text(0.1, 1.6, "Legend:", fontsize=10, weight='bold') legend_items = [("Green = B cell / plasma cell modulation", '#d9f2d0'), ("Yellow = Reduces IgG half-life", '#fff2b0'), ("Gray = Acts at acantholysis level", '#e0e0e0'), ("Dark yellow = Interleukin inhibition", '#e6c200')] for i,(txt,c) in enumerate(legend_items): ax.add_patch(mpatches.Rectangle((0.1, 1.2-0.35*i), 0.3, 0.25, facecolor=c, edgecolor='black')) ax.text(0.5, 1.32-0.35*i, txt, fontsize=8.5, va='center') plt.tight_layout() plt.savefig('output/fig1_pemphigus.png', dpi=160, bbox_inches='tight') print("saved fig1") EOF
cd /tmp/workspace/derm-biologics && python3 << 'EOF' import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.patches as mpatches from matplotlib.patches import FancyBboxPatch, FancyArrowPatch fig, ax = plt.subplots(figsize=(11, 14)) ax.set_xlim(0, 10) ax.set_ylim(0, 16) ax.axis('off') ax.set_title("Site of Action of Biologics in BULLOUS PEMPHIGOID", fontsize=15, fontweight='bold', pad=10) def box(x, y, w, h, text, fc, ec='black', fs=9.5, weight='normal'): b = FancyBboxPatch((x, y), w, h, boxstyle="round,pad=0.08", linewidth=1.4, edgecolor=ec, facecolor=fc) ax.add_patch(b) ax.text(x+w/2, y+h/2, text, ha='center', va='center', fontsize=fs, weight=weight) def arrow(x1,y1,x2,y2, color='black'): a = FancyArrowPatch((x1,y1),(x2,y2), arrowstyle='-|>', mutation_scale=18, color=color, linewidth=1.6) ax.add_patch(a) # Central pathogenesis pipeline box(3.0, 14.4, 4.0, 1.0, "Autoreactive B cell", '#eaf4ff') box(3.0, 12.7, 4.0, 1.1, "Plasma cell -> Anti-BP180 (BPAG2) /\nAnti-BP230 (BPAG1) IgG + IgE", '#eaf4ff') box(3.0, 10.9, 4.0, 1.1, "Autoantibody binds hemidesmosome\nantigens at DEJ", '#fff6d8') box(3.0, 9.1, 4.0, 1.1, "Complement activation (C3, C5)\n+ Fc receptor engagement", '#f5d9d9') box(3.0, 7.3, 4.0, 1.1, "Th2 response: IL-4, IL-5, IL-13\nrelease; eosinophil chemotaxis\n(eotaxin), mast cell activation", '#e0f2e0') box(3.0, 5.5, 4.0, 1.1, "Neutrophil/eosinophil recruitment,\nrelease of MMP-9 & neutrophil\nelastase", '#f0f0f0') box(3.0, 3.7, 4.0, 1.0, "Dermo-epidermal separation\nSUBEPIDERMAL BLISTER", '#e8e8e8') for (x1,y1,x2,y2) in [(5,14.4,5,13.8),(5,12.7,5,12.0),(5,10.9,5,10.2), (5,9.1,5,8.4),(5,7.3,5,6.6),(5,5.5,5,4.7)]: arrow(x1,y1,x2,y2) # Left column drugs box(0.1, 13.6, 2.7, 1.4, "Anti-CD20 mAb\nRituximab\n-> B cell depletion", '#d9f2d0', fs=8.5) arrow(2.8,14.3,3.0,14.6, color='#2e7d32') box(0.1, 11.4, 2.7, 1.4, "Anti-IgE mAb\nOmalizumab, Ligelizumab\n-> blocks IgE-FceR binding", '#d9f2d0', fs=8.5) arrow(2.8,12.1,3.0,13.0, color='#2e7d32') box(0.1, 9.6, 2.7, 1.4, "Complement inhibitors\nAvdoralimab (anti-C5aR1),\nNomacopan (C5+LTB4),\nSutimlimab (anti-C1s)", '#f6c9c9', fs=8) arrow(2.8,10.3,3.0,9.6, color='#b03030') box(0.1, 7.6, 2.7, 1.5, "Anti-IL-4 mAb\nDupilumab\n-> blocks IL-4/IL-13,\nreduces B cell proliferation\n& eosinophil chemotaxis", '#c7e8c7', fs=8) arrow(2.8,8.35,3.0,7.9, color='#1b5e20') box(0.1, 5.7, 2.7, 1.5, "IL-5 inhibitors\nMepolizumab, Reslizumab,\nBenralizumab\n-> block eosinophil\nrecruitment/activation", '#c7e8c7', fs=8) arrow(2.8,6.45,3.0,6.5, color='#1b5e20') # Right column drugs box(7.2, 5.6, 2.8, 1.6, "Eotaxin-1 inhibitor\nBertilimumab\n-> reduces eosinophil\nmigration to skin", '#c7e8c7', fs=8.5) arrow(7.2,6.4,7.0,6.4, color='#1b5e20') box(7.2, 3.7, 2.8, 1.6, "IL-17/IL-23 inhibitors\nSecukinumab, Ixekizumab,\nUstekinumab, Tildrakizumab\n-> reduce MMP-9 &\nneutrophil elastase", '#e0e0e0', fs=8) arrow(7.2,4.5,7.0,4.7, color='#555555') # Legend ax.text(0.1, 2.6, "Legend:", fontsize=10, weight='bold') legend_items = [("Green = B cell / antibody / Th2-IL4 pathway", '#d9f2d0'), ("Pink = Complement pathway inhibition", '#f6c9c9'), ("Light green = IL-5 / eosinophil axis", '#c7e8c7'), ("Gray = IL-17/23, neutrophil-mediated tissue damage", '#e0e0e0')] for i,(txt,c) in enumerate(legend_items): ax.add_patch(mpatches.Rectangle((0.1, 2.2-0.35*i), 0.3, 0.25, facecolor=c, edgecolor='black')) ax.text(0.5, 2.32-0.35*i, txt, fontsize=8.5, va='center') plt.tight_layout() plt.savefig('output/fig2_bp.png', dpi=160, bbox_inches='tight') print("saved fig2") EOF
cd /tmp/workspace/derm-biologics && python3 << 'EOF' from docx import Document from docx.shared import Inches, Pt, RGBColor from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.enum.table import WD_TABLE_ALIGNMENT doc = Document() def h1(text): p = doc.add_heading(text, level=1) return p def h2(text): p = doc.add_heading(text, level=2) return p def para(text, bold=False, italic=False, size=11): p = doc.add_paragraph() r = p.add_run(text) r.bold = bold r.italic = italic r.font.size = Pt(size) return p def bullet(text): p = doc.add_paragraph(text, style='List Bullet') return p doc.add_heading('BIOLOGICS IN AUTOIMMUNE BLISTERING DISORDERS', level=0) para('MD Dermatology - Quick Exam Notes | Source: Choudhary R, Gupta V, Khandpur S. "Updates on the Management of Autoimmune Bullous Diseases." Indian Dermatol Online J 2024;15:758-69.', italic=True, size=10) h1('1. Why Biologics? (Rationale)') for t in [ "Conventional therapy (systemic corticosteroids + steroid-sparing immunosuppressants) has broad, non-specific immunosuppressive action and long-term toxicity.", "Biologics/novel agents target specific steps in disease pathogenesis -> more precise, potentially safer, steroid-sparing therapy.", "Drugs are classified by SITE OF ACTION in the pathogenic cascade -- this is the key exam concept."]: bullet(t) h1('2. PEMPHIGUS (Intraepidermal blistering - anti-Desmoglein IgG)') para('Pathogenic cascade: B cell activation -> autoreactive plasma cell -> anti-Dsg1/Dsg3 IgG -> antibody binds desmoglein -> loss of keratinocyte adhesion (acantholysis) -> intraepidermal blister.', size=10) doc.add_picture('output/fig1_pemphigus.png', width=Inches(6.0)) doc.paragraphs[-1].alignment = WD_ALIGN_PARAGRAPH.CENTER para('Fig 1. Site of action of drugs in pemphigus (adapted from Choudhary et al., 2024)', italic=True, size=9) h2('2a. Drugs acting at B cell / plasma cell level') table = doc.add_table(rows=1, cols=4) table.style = 'Light Grid Accent 1' hdr = table.rows[0].cells for i, t in enumerate(['Class', 'Drug(s)', 'Mechanism', 'Key point / Evidence']): hdr[i].text = t for r in hdr[i].paragraphs[0].runs: r.bold = True rows_data = [ ["Anti-CD20 mAb", "Rituximab (1st line)\nOfatumumab, Veltuzumab,\nObinutuzumab, Tositumomab", "Antibody + complement-dependent B-cell lysis (Type I); Type II mAbs cause direct cell death/'tragocytosis'", "Rituximab = most effective steroid-sparing agent; recommended 1st-line in moderate-severe PV. CD20 absent on plasma cells & pro-B cells -> relapse possible via B-cell repopulation"], ["Anti-CD19 mAb", "Inebilizumab, Blinatumomab", "Kills long-lived plasmablasts producing anti-Dsg IgG", "Not yet tried in pemphigus (theoretical)"], ["BAFF inhibitor", "Ianalumab (VAY736)", "Blocks B-cell activating factor -> eliminates autoreactive B cells, reduces plasma cell longevity", "Phase 2 PV trial terminated early but showed dose-dependent fall in PDAI/ABSIS scores"], ["BTK inhibitors", "Ibrutinib (irreversible)\nRilzabrutinib (reversible, oral)", "Block Bruton tyrosine kinase in BCR signalling pathway -> reduced antibody & cytokine production", "Rilzabrutinib better safety profile, no B-cell depletion; Phase 3 trial did not beat placebo"], ["CAAR-T / CAR-T cells", "Dsg3-CAR-T, Tisagenlecleucel", "Chimeric antigen receptor T-cells selectively target and kill anti-Dsg B cells", "Phase 1 trial for mucosal PV ongoing (expected 2026)"], ] for row in rows_data: cells = table.add_row().cells for i, val in enumerate(row): cells[i].text = val h2('2b. Drugs reducing autoantibody half-life') bullet("FcRn antagonists - Efgartigimod, ALXN1830 (SYNT001): block neonatal Fc receptor (FcRn) that normally recycles IgG -> increases IgG degradation -> rapid fall in pathogenic anti-Dsg antibodies. Efgartigimod showed disease control in 90% within median 17 days.") bullet("IVIg: neutralises pathogenic antibodies, saturates FcRn (competitively blocks IgG recycling), suppresses antibody production, modulates immune system.") bullet("Immunoadsorption: physically removes circulating IgG; combined with best medical treatment reduces cumulative steroid dose but more serious adverse effects.") h2('2c. Drug acting at level of acantholysis') bullet("Cholinomimetics - Oral pyridostigmine, topical pilocarpine: strengthen desmosomal adhesion / counter acetylcholine-related loss of keratinocyte adhesion -> reduce acantholysis. Limited evidence, small open-label studies.") h2('2d. Interleukin inhibition') bullet("IL-4 inhibitor (e.g. dupilumab, being explored): dampens Th2-driven inflammatory support to B cells.") h1('3. BULLOUS PEMPHIGOID (Subepidermal blistering - anti-BP180/BP230)') para('Pathogenic cascade: Autoreactive B cell -> plasma cell -> anti-BP180 (BPAG2)/anti-BP230 (BPAG1) IgG & IgE -> antibody binds hemidesmosomal antigen at dermo-epidermal junction -> complement activation (C3, C5) + Fc receptor engagement -> Th2 response (IL-4, IL-5, IL-13) with eosinophil chemotaxis & mast cell activation -> neutrophil/eosinophil recruitment, release of MMP-9 & neutrophil elastase -> dermo-epidermal separation -> subepidermal blister.', size=10) doc.add_picture('output/fig2_bp.png', width=Inches(6.0)) doc.paragraphs[-1].alignment = WD_ALIGN_PARAGRAPH.CENTER para('Fig 2. Site of action of drugs in bullous pemphigoid (adapted from Choudhary et al., 2024)', italic=True, size=9) table2 = doc.add_table(rows=1, cols=4) table2.style = 'Light Grid Accent 1' hdr2 = table2.rows[0].cells for i, t in enumerate(['Class', 'Drug(s)', 'Mechanism', 'Key point / Evidence']): hdr2[i].text = t for r in hdr2[i].paragraphs[0].runs: r.bold = True rows2 = [ ["Anti-CD20 mAb", "Rituximab", "B-cell depletion (antibody + complement-dependent lysis)", "No RCTs; case series: 70.5% complete remission. Included as 3rd-line in EADV S2K guidelines"], ["Anti-IgE mAb", "Omalizumab (most studied)\nLigelizumab", "Blocks IgE binding to FceRI -> reduced Th2/mast cell activation", "Omalizumab: case reports/series show improvement (approved for asthma/urticaria, repurposed). Ligelizumab failed phase 2 primary endpoint"], ["Anti-IL-4 mAb", "Dupilumab", "Blocks IL-4/IL-13 receptor -> down-regulates B-cell proliferation, eosinophil chemotaxis, Th2 chemokines", "Case reports/series show improvement; increasingly used off-label in recalcitrant BP"], ["Complement inhibitors", "Avdoralimab (anti-C5aR1)\nNomacopan (anti-C5 + anti-LTB4)\nSutimlimab (anti-C1s)", "Blocks complement cascade -> reduced granulocyte migration & inflammation", "Nomacopan: positive Phase 2, Phase 3 ongoing. Sutimlimab has FDA orphan drug status for BP"], ["IL-5 inhibitors", "Mepolizumab, Reslizumab, Benralizumab", "Block eosinophil recruitment/activation/survival", "Reslizumab: excellent (case reports). Mepolizumab failed RCT primary endpoint. Benralizumab in ongoing phase 3"], ["Eotaxin-1 inhibitor", "Bertilimumab", "Blocks eotaxin-1 -> reduced eosinophil migration to skin", "Phase 2 open-label promising; double-blind RCT results awaited"], ["IL-17 / IL-23 inhibitors", "Secukinumab, Ixekizumab,\nUstekinumab, Tildrakizumab", "Reduce secretion of MMP-9 and neutrophil elastase", "Mixed results - secukinumab case report improvement; ixekizumab failed phase 2"], ] for row in rows2: cells = table2.add_row().cells for i, val in enumerate(row): cells[i].text = val h1('4. Exam Quick-Recall Table (Drug -> Target -> One-liner)') table3 = doc.add_table(rows=1, cols=3) table3.style = 'Light Grid Accent 1' h3 = table3.rows[0].cells for i,t in enumerate(['Drug','Target','One-liner']): h3[i].text = t for r in h3[i].paragraphs[0].runs: r.bold = True quick = [ ["Rituximab","CD20 on B cells","1st line steroid-sparing biologic in PV (both pemphigus & BP)"], ["Efgartigimod","FcRn","Rapid antibody clearance; fast disease control in PV/PF"], ["Rilzabrutinib","BTK","Oral, no B-cell depletion; safer than ibrutinib"], ["Ianalumab (VAY736)","BAFF","Kills autoreactive B cells & shortens plasma cell survival"], ["Omalizumab","IgE - FceRI","Repurposed anti-asthma drug for BP"], ["Dupilumab","IL-4/IL-13R","Blocks Th2 axis; used in both PV (trial) and BP"], ["Nomacopan","C5 + LTB4","Dual complement/leukotriene block, promising in BP"], ["Bertilimumab","Eotaxin-1","Reduces eosinophil skin infiltration in BP"], ["Pyridostigmine/Pilocarpine","Cholinergic pathway","Reduces acantholysis directly (non-immune site)"], ] for row in quick: cells = table3.add_row().cells for i,val in enumerate(row): cells[i].text = val h1('5. High-Yield One-Liners for Viva') for t in [ "Rituximab is the only biologic recommended as FIRST-LINE in moderate-to-severe pemphigus vulgaris.", "Efgartigimod (FcRn antagonist) achieves the FASTEST disease control among emerging pemphigus drugs.", "CD20 is absent on plasma cells and pro-B cells -> explains relapse after rituximab (from B-cell repopulation).", "No biologic is yet FDA-approved for bullous pemphigoid; all current biologic use in BP is off-label/repurposed.", "BP pathogenesis has a dual antibody-mediated (complement) AND Th2/eosinophil-mediated arm -> two separate drug target groups.", "Sutimlimab (anti-C1s) has FDA orphan drug status specifically for BP.", "Cholinomimetics are unique - they act directly at the acantholysis step, not on the immune system."]: bullet(t) doc.save('output/Biologics_in_AIBD_Exam_Notes.docx') print("saved docx") EOF ls -la /tmp/workspace/derm-biologics/output/
Biologics in AIBD Exam Notes
Word Document · DOCX
fig1 pemphigus
Image · PNG
fig2 bp
Image · PNG