Hey orris can you make a general bacteriology lab diagnosis pdf with information about some specific bacterias
Which bacteria would you like covered in the PDF? · Who is this for? · What sections should each bacterium include?
So now compile the pdf
mkdir -p /tmp/workspace/bacteriology-pdf && ls /tmp/workspace/bacteriology-pdf/
Make it in pieces but make it fast
~/bacteriology-pdf/generate.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
OUTPUT = "/tmp/workspace/bacteriology-pdf/Bacteriology_Lab_Diagnosis.pdf"
# ── colour palette ──────────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#1a3a5c")
MID_BLUE = colors.HexColor("#2563a8")
LIGHT_BLUE = colors.HexColor("#dbeafe")
ACCENT = colors.HexColor("#e74c3c")
GRAM_POS = colors.HexColor("#fff3cd") # warm yellow for gram+
GRAM_NEG = colors.HexColor("#d1ecf1") # cool teal for gram-
SPECIAL = colors.HexColor("#f3e5f5") # lavender for special
HEADER_ROW = colors.HexColor("#1a3a5c")
ALT_ROW = colors.HexColor("#f0f4ff")
WHITE = colors.white
TABLE_GRID = colors.HexColor("#b0c4de")
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.8*cm, rightMargin=1.8*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="Bacteriology Lab Diagnosis",
author="Orris Medical Education"
)
styles = getSampleStyleSheet()
# Custom styles
S = {
"cover_title": ParagraphStyle("cover_title", fontSize=28, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_CENTER, spaceAfter=10),
"cover_sub": ParagraphStyle("cover_sub", fontSize=14, textColor=LIGHT_BLUE,
fontName="Helvetica", alignment=TA_CENTER, spaceAfter=6),
"cover_note": ParagraphStyle("cover_note", fontSize=10, textColor=LIGHT_BLUE,
fontName="Helvetica-Oblique", alignment=TA_CENTER),
"section": ParagraphStyle("section", fontSize=16, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_LEFT, spaceAfter=4, spaceBefore=4,
leftIndent=6, leading=22),
"subsection": ParagraphStyle("subsection", fontSize=11, textColor=DARK_BLUE,
fontName="Helvetica-Bold", spaceAfter=3, spaceBefore=6),
"body": ParagraphStyle("body", fontSize=9.5, textColor=colors.black,
fontName="Helvetica", spaceAfter=3, leading=14, alignment=TA_JUSTIFY),
"bullet": ParagraphStyle("bullet", fontSize=9.5, textColor=colors.black,
fontName="Helvetica", spaceAfter=2, leading=13, leftIndent=14,
bulletIndent=4),
"toc_entry": ParagraphStyle("toc_entry", fontSize=10.5, textColor=DARK_BLUE,
fontName="Helvetica", spaceAfter=5, leftIndent=10),
"toc_head": ParagraphStyle("toc_head", fontSize=14, textColor=DARK_BLUE,
fontName="Helvetica-Bold", spaceAfter=12, alignment=TA_CENTER),
"footer_note": ParagraphStyle("footer_note", fontSize=7.5, textColor=colors.grey,
fontName="Helvetica-Oblique", alignment=TA_CENTER),
"label": ParagraphStyle("label", fontSize=8.5, textColor=DARK_BLUE,
fontName="Helvetica-Bold"),
"cell_body": ParagraphStyle("cell_body", fontSize=8.5, textColor=colors.black,
fontName="Helvetica", leading=12),
"cell_header": ParagraphStyle("cell_header", fontSize=9, textColor=WHITE,
fontName="Helvetica-Bold", alignment=TA_CENTER),
}
# ── helpers ─────────────────────────────────────────────────────────
def section_banner(name, gram_type="special"):
color_map = {"pos": colors.HexColor("#8b0000"),
"neg": colors.HexColor("#1a5276"),
"special": colors.HexColor("#4a235a"),
"anaerobe": colors.HexColor("#145a32")}
bg = color_map.get(gram_type, DARK_BLUE)
data = [[Paragraph(name, S["section"])]]
t = Table(data, colWidths=[17*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("ROUNDEDCORNERS", [6]),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 10),
]))
return t
def info_table(rows, bg=LIGHT_BLUE):
"""rows = list of (label, value) tuples"""
data = [[Paragraph(l, S["label"]), Paragraph(v, S["cell_body"])] for l,v in rows]
t = Table(data, colWidths=[4.5*cm, 12.5*cm])
ts = TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("GRID", (0,0), (-1,-1), 0.4, TABLE_GRID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
])
# alternate row colours
for i in range(0, len(data), 2):
ts.add("BACKGROUND", (0,i), (-1,i), bg)
for i in range(1, len(data), 2):
ts.add("BACKGROUND", (0,i), (-1,i), ALT_ROW)
t.setStyle(ts)
return t
def sensitivity_table(headers, rows):
data = [[Paragraph(h, S["cell_header"]) for h in headers]]
for row in rows:
data.append([Paragraph(str(c), S["cell_body"]) for c in row])
col_w = 17*cm / len(headers)
t = Table(data, colWidths=[col_w]*len(headers))
ts = TableStyle([
("BACKGROUND", (0,0), (-1,0), HEADER_ROW),
("GRID", (0,0), (-1,-1), 0.4, TABLE_GRID),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("ALIGN", (0,0), (-1,-1), "CENTER"),
])
for i in range(1, len(data), 2):
ts.add("BACKGROUND", (0,i), (-1,i), ALT_ROW)
t.setStyle(ts)
return t
def hr():
return HRFlowable(width="100%", thickness=0.5, color=TABLE_GRID, spaceAfter=4, spaceBefore=4)
def sp(n=6):
return Spacer(1, n)
# ═══════════════════════════════════════════════════════════════════
# BACTERIA DATA
# ═══════════════════════════════════════════════════════════════════
bacteria = [
# ── GRAM POSITIVE ──────────────────────────────────────────────
{
"name": "1. Staphylococcus aureus",
"gram": "pos",
"bg": GRAM_POS,
"basics": [
("Kingdom / Class", "Bacteria – Firmicutes – Bacilli"),
("Gram Stain", "Gram-POSITIVE cocci in clusters (grape-like)"),
("Shape / Arrangement", "Spherical cocci, 0.5–1.5 µm; non-motile, non-spore-forming"),
("Capsule", "Present in virulent strains (polysaccharide)"),
("Oxygen Requirement", "Facultative anaerobe"),
],
"culture": [
("Routine Media", "Blood Agar (BAP): large, round, golden/yellow colonies; β-haemolysis"),
("Selective Media", "Mannitol Salt Agar (MSA): ferments mannitol → yellow halo"),
("Chromogenic Agar", "MRSA chromogenic agar: mauve/pink colonies for MRSA"),
("Special Feature", "Golden pigment (staphyloxanthin); β-haemolysin causes clear zones on BAP"),
("Growth Temp", "Optimal 37°C; halotolerant (grows in 7.5% NaCl)"),
("Incubation", "18–24 hours; colonies 1–3 mm"),
],
"biochem": [
("Catalase", "POSITIVE (differentiates from Streptococcus)"),
("Coagulase", "POSITIVE (bound + free) — key differentiating test from CoNS"),
("Mannitol fermentation", "POSITIVE (aerobic & anaerobic)"),
("DNase", "POSITIVE"),
("Phosphatase", "POSITIVE"),
("Haemolysin", "α, β, γ, δ haemolysins; β-haemolysis on BAP"),
("Protein A", "POSITIVE (IgG binding)"),
("CAMP test", "Negative"),
("Oxidase", "Negative"),
("Novobiocin", "Sensitive"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Penicillin", "Usually Resistant", "β-lactamase production ~95% of strains"),
("Flucloxacillin/Nafcillin", "Sensitive (MSSA)", "Drug of choice for MSSA"),
("Vancomycin", "Sensitive", "DOC for MRSA; VISA/VRSA emerging"),
("Linezolid", "Sensitive", "Alternative for MRSA"),
("Daptomycin", "Sensitive", "For bacteraemia/endocarditis"),
("Clindamycin", "Variable", "Check inducible resistance (D-zone test)"),
("Co-trimoxazole", "Often Sensitive", "Used for community MRSA"),
("Fusidic acid", "Sensitive", "Skin infections; resistance develops rapidly"),
],
"clinical": (
"Causes: skin/soft tissue infections (furuncles, carbuncles, impetigo), bacteraemia, "
"endocarditis, pneumonia, osteomyelitis, septic arthritis, food poisoning (pre-formed "
"heat-stable enterotoxin), toxic shock syndrome (TSST-1), scalded skin syndrome (exfoliatin). "
"MRSA is a major healthcare-associated pathogen. Virulence factors: coagulase, protein A, "
"leukocidin (PVL), exotoxins."
),
},
{
"name": "2. Streptococcus pneumoniae",
"gram": "pos",
"bg": GRAM_POS,
"basics": [
("Kingdom / Class", "Bacteria – Firmicutes – Bacilli"),
("Gram Stain", "Gram-POSITIVE lancet-shaped diplococci"),
("Shape / Arrangement", "Oval cocci in pairs (diplococci), occasionally short chains"),
("Capsule", "LARGE polysaccharide capsule — major virulence factor (84 serotypes)"),
("Oxygen Requirement", "Facultative anaerobe; capnophilic (5% CO₂ enhances growth)"),
],
"culture": [
("Routine Media", "Blood Agar: small, grey, α-haemolytic colonies (green zone); umbilicated/draughtsman appearance due to autolysis"),
("Selective Media", "Gentamicin blood agar; chocolate agar"),
("Key Tests", "Optochin (P-disc) sensitivity: SENSITIVE (zone ≥14 mm) — differentiates from viridans strep"),
("Bile Solubility", "POSITIVE — colonies dissolve in 10% sodium deoxycholate"),
("CO₂", "Enhanced growth in 5% CO₂"),
("Incubation", "35–37°C, 18–24 h; colonies 0.5–1.5 mm"),
],
"biochem": [
("Catalase", "Negative"),
("Optochin", "SENSITIVE (key test)"),
("Bile solubility", "POSITIVE"),
("Inulin fermentation", "POSITIVE"),
("Haemolysis", "α-haemolysis (partial, green)"),
("Quellung reaction", "POSITIVE — capsular swelling with specific antisera"),
("Coagulase", "Negative"),
("CAMP test", "Negative"),
("Serotyping", "Capsular polysaccharide typing (1–84)"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Penicillin G", "Sensitive / Intermediate / Resistant", "MIC-based breakpoints; MDR strains increasing"),
("Amoxicillin", "Sensitive (most)", "High-dose for non-meningitic disease"),
("Ceftriaxone", "Sensitive", "DOC for meningitis"),
("Vancomycin", "Sensitive", "Used for penicillin-resistant meningitis"),
("Moxifloxacin", "Sensitive", "Respiratory quinolone"),
("Chloramphenicol", "Variable", "Used in resource-limited settings"),
("Erythromycin", "Variable resistance", "Macrolide resistance rising globally"),
],
"clinical": (
"Leading cause of community-acquired pneumonia, bacterial meningitis, otitis media, and "
"sinusitis. Commonly colonises the nasopharynx. Risk groups: elderly, asplenic, "
"immunocompromised, sickle cell. Virulence: polysaccharide capsule (antiphagocytic), "
"pneumolysin, IgA protease, autolysin. Diagnosis: sputum Gram stain + culture, blood "
"culture, urinary antigen (UAg) test. Vaccines: PCV13/PCV15/PCV20, PPSV23."
),
},
{
"name": "3. Streptococcus pyogenes (Group A Strep)",
"gram": "pos",
"bg": GRAM_POS,
"basics": [
("Kingdom / Class", "Bacteria – Firmicutes – Bacilli"),
("Gram Stain", "Gram-POSITIVE cocci in chains"),
("Shape / Arrangement", "Spherical cocci 0.6–1.0 µm; chains of variable length"),
("Capsule", "Hyaluronic acid capsule (anti-phagocytic)"),
("Oxygen Requirement", "Facultative anaerobe"),
],
"culture": [
("Routine Media", "Blood Agar: translucent, grey-white colonies; LARGE zone of β-haemolysis (complete)"),
("Selective Media", "Sheep blood agar; SXT-resistant phenotype aids selection"),
("Key Disc Tests", "Bacitracin (A-disc): SENSITIVE (zone ≥10 mm) — differentiates Group A from other β-haemolytic strep"),
("PYR test", "POSITIVE (pyrrolidonyl arylamidase)"),
("Incubation", "35–37°C, 18–24 h; 5% CO₂ enhances haemolysis"),
],
"biochem": [
("Catalase", "Negative"),
("Haemolysis", "β-haemolysis (complete, clear zone)"),
("Bacitracin", "SENSITIVE (A-disc)"),
("PYR test", "POSITIVE"),
("CAMP test", "Negative"),
("Lancefield grouping", "Group A (Lancefield carbohydrate antigen)"),
("Streptolysin O", "POSITIVE — basis of ASO titre (rises in post-strep disease)"),
("Hyaluronidase", "POSITIVE"),
("Streptokinase", "POSITIVE"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Penicillin V/G", "ALWAYS Sensitive", "Drug of choice; no documented resistance"),
("Amoxicillin", "Sensitive", "Oral treatment of pharyngitis"),
("Cephalosporins", "Sensitive", "Alternative to penicillin"),
("Clindamycin", "Usually Sensitive", "Used for invasive/necrotising infections"),
("Erythromycin", "Variable resistance", "Alternative for penicillin allergy"),
("Azithromycin", "Variable resistance", "~5–10% resistance in some regions"),
("Vancomycin", "Sensitive", "Reserve for allergy/severe cases"),
],
"clinical": (
"Causes: pharyngitis (strep throat), scarlet fever, impetigo, erysipelas, cellulitis, "
"necrotising fasciitis, streptococcal toxic shock syndrome. Post-infectious: acute rheumatic "
"fever (M-protein molecular mimicry) and post-streptococcal glomerulonephritis. Virulence: "
"M protein (antiphagocytic), streptolysin O & S, DNase B, streptokinase, erythrogenic "
"toxins (A/B/C). ASO titre useful for rheumatic fever diagnosis."
),
},
{
"name": "4. Corynebacterium diphtheriae",
"gram": "pos",
"bg": GRAM_POS,
"basics": [
("Kingdom / Class", "Bacteria – Actinobacteria – Actinobacteria"),
("Gram Stain", "Gram-POSITIVE pleomorphic rods; club-shaped (Chinese letter / palisade arrangement)"),
("Shape / Arrangement", "Non-motile, non-spore-forming rods; V/L/Y palisade arrangements"),
("Capsule", "None"),
("Oxygen Requirement", "Aerobe / Facultative anaerobe"),
],
"culture": [
("Routine Media", "Blood Agar: small, grey-white colonies"),
("Selective Media", "Loeffler's serum slope: rapid growth; metachromatic granules visible with Albert's/Neisser's stain"),
("Selective/Differential", "Tellurite medium (McLeod's / Hoyle's): grey-black colonies (tellurite reduced to metallic tellurium); three biotypes: gravis (grey, daisy-head), mitis (black, smooth), intermedius"),
("Tinsdale Medium", "Brown/black halo around colonies due to cystinase activity"),
("Albert's Stain", "Metachromatic (volutin) granules stain blue-black (Babes-Ernst granules)"),
("Incubation", "35–37°C, 18–24 h"),
],
"biochem": [
("Catalase", "POSITIVE"),
("Urease", "Negative"),
("Nitrate reduction", "POSITIVE"),
("Cystinase", "POSITIVE (Tinsdale halo)"),
("Pyrazinamidase", "Negative"),
("Glucose fermentation", "POSITIVE (acid, no gas)"),
("Sucrose", "Negative (mitis positive)"),
("Metachromatic granules", "POSITIVE (Albert's/Neisser's stain)"),
("Elek test", "Immunodiffusion for diphtheria toxin — gold standard for toxigenicity"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Penicillin G", "Sensitive", "Bactericidal; must combine with antitoxin"),
("Erythromycin", "Sensitive", "Drug of choice for elimination of carriage"),
("Diphtheria Antitoxin", "N/A (immunological)", "Given immediately on clinical suspicion — MOST IMPORTANT"),
("Amoxicillin", "Sensitive", "Alternative"),
("Clindamycin", "Sensitive", "Alternative"),
("Rifampicin", "Sensitive", "Carrier eradication"),
],
"clinical": (
"Causes diphtheria: tough grey pseudomembrane on pharynx/larynx (fibrin, bacteria, necrotic "
"cells) causing airway obstruction. Exotoxin (A-B toxin) inhibits EF-2 (elongation factor 2) "
"via ADP-ribosylation → protein synthesis arrest → myocarditis, neuropathy. Bull-neck "
"appearance from cervical lymphadenopathy. Cutaneous diphtheria also occurs. Diagnosis: "
"throat swab on Loeffler's + Elek test for toxin. Prevention: DTP vaccine."
),
},
# ── GRAM NEGATIVE ─────────────────────────────────────────────
{
"name": "5. Neisseria meningitidis",
"gram": "neg",
"bg": GRAM_NEG,
"basics": [
("Kingdom / Class", "Bacteria – Proteobacteria – β-Proteobacteria"),
("Gram Stain", "Gram-NEGATIVE diplococci (kidney/coffee-bean shape, pairs facing each other)"),
("Shape / Arrangement", "Non-motile; adjacent flattened sides; 0.6–0.8 µm"),
("Capsule", "LARGE polysaccharide capsule — 13 serogroups (A,B,C,W135,Y most common)"),
("Oxygen Requirement", "Aerobe; capnophilic"),
],
"culture": [
("Routine Media", "Blood agar: small, grey, translucent, non-haemolytic colonies"),
("Selective Media", "Thayer-Martin (VCN) agar: inhibits normal flora with vancomycin, colistin, nystatin"),
("Chocolate Agar", "Preferred — provides X and V growth factors; 5% CO₂ at 37°C"),
("Incubation", "35–37°C, 5% CO₂, 18–24 h; fastidious, dies quickly → process immediately"),
("CSF specimen", "Transport at 37°C (cold kills the organism)"),
],
"biochem": [
("Oxidase", "POSITIVE (key test for Neisseria)"),
("Catalase", "POSITIVE"),
("Glucose fermentation", "POSITIVE (acid only)"),
("Maltose fermentation", "POSITIVE — differentiates from N. gonorrhoeae"),
("Lactose", "Negative"),
("Sucrose", "Negative"),
("DNase", "Negative"),
("Serogroup typing", "Capsular polysaccharide (A, B, C, W135, Y, X)"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Penicillin G / Ampicillin", "Usually Sensitive", "DOC for meningococcal meningitis"),
("Ceftriaxone", "Sensitive", "DOC for empiric bacterial meningitis"),
("Cefotaxime", "Sensitive", "Alternative third-gen cephalosporin"),
("Chloramphenicol", "Sensitive", "Used in resource-limited settings"),
("Rifampicin", "Sensitive", "Chemoprophylaxis for close contacts"),
("Ciprofloxacin", "Sensitive", "Single-dose prophylaxis for contacts"),
("Ceftriaxone IM", "Sensitive", "Preferred prophylaxis in pregnant contacts"),
],
"clinical": (
"Causes meningococcal meningitis and meningococcaemia. Presents with sudden fever, "
"headache, photophobia, neck stiffness and a NON-BLANCHING petechial/purpuric rash "
"(meningococcaemia). Waterhouse-Friderichsen syndrome: bilateral adrenal haemorrhage, "
"DIC, shock. Primarily affects children and young adults; spread by respiratory droplets. "
"Serogroup B vaccine (Bexsero), ACWY vaccines available."
),
},
{
"name": "6. Neisseria gonorrhoeae",
"gram": "neg",
"bg": GRAM_NEG,
"basics": [
("Kingdom / Class", "Bacteria – Proteobacteria – β-Proteobacteria"),
("Gram Stain", "Gram-NEGATIVE diplococci intracellularly within PMNs (urethral discharge)"),
("Shape / Arrangement", "Kidney-shaped pairs; 0.6–0.8 µm; non-motile, non-capsulate (in vitro)"),
("Capsule", "Minimal / transient"),
("Oxygen Requirement", "Aerobe; capnophilic"),
],
"culture": [
("Routine Media", "Chocolate agar with CO₂"),
("Selective Media", "Thayer-Martin / Modified Thayer-Martin / New York City (NYC) agar — essential for genital specimens with normal flora"),
("Colony Morphology", "Small, grey-white, convex, glistening colonies; 4 colony types (T1–T4); T1 & T2 piliated and virulent"),
("Incubation", "35–37°C, 5–10% CO₂, 24–48 h; transport media (Amies/Stuart's) if delay"),
("NAAT", "Nucleic Acid Amplification Test — most sensitive; used for urine, swabs"),
],
"biochem": [
("Oxidase", "POSITIVE"),
("Catalase", "POSITIVE"),
("Glucose fermentation", "POSITIVE"),
("Maltose fermentation", "NEGATIVE — distinguishes from N. meningitidis"),
("Lactose", "Negative"),
("Sucrose", "Negative"),
("DNase", "Negative"),
("Superoxol (30% H₂O₂)", "Strong POSITIVE reaction"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Ceftriaxone 500mg IM", "Sensitive", "Current WHO/CDC first-line for uncomplicated gonorrhoea"),
("Cefixime", "Sensitive (decreasing)", "Oral alternative; increasing resistance"),
("Azithromycin", "Increasing resistance", "No longer recommended as monotherapy"),
("Ciprofloxacin", "RESISTANT in most regions", "Fluoroquinolone resistance widespread"),
("Penicillin", "RESISTANT", "β-lactamase (PPNG) and chromosomal resistance"),
("Spectinomycin", "Sensitive", "Used for cephalosporin allergy"),
("Dual therapy", "Recommended", "Ceftriaxone + azithromycin (where resistance allows)"),
],
"clinical": (
"Causes gonorrhoea: urethritis (purulent discharge, dysuria), cervicitis, pelvic "
"inflammatory disease (PID), epididymo-orchitis, rectal/pharyngeal infection, "
"ophthalmia neonatorum (leading cause of preventable neonatal blindness), "
"disseminated gonococcal infection (DGI: migratory polyarthritis, dermatitis, "
"tenosynovitis). Diagnosis: Gram stain (intracellular GNDCs in urethral discharge ~95% "
"sensitive in men; ~50% in women) + culture + NAAT. Antibiotic resistance is a growing concern."
),
},
{
"name": "7. Haemophilus influenzae",
"gram": "neg",
"bg": GRAM_NEG,
"basics": [
("Kingdom / Class", "Bacteria – Proteobacteria – γ-Proteobacteria"),
("Gram Stain", "Gram-NEGATIVE small pleomorphic coccobacilli (tiny rods)"),
("Shape / Arrangement", "Very small (0.2–0.3 × 0.5–2 µm); non-motile; pleomorphic"),
("Capsule", "Types a–f polysaccharide capsule; type b (Hib) most virulent (polyribitol phosphate)"),
("Oxygen Requirement", "Facultative anaerobe"),
],
"culture": [
("Growth Factors", "Requires BOTH X factor (haemin) AND V factor (NAD) — neither is in blood agar alone"),
("Chocolate Agar", "PREFERRED medium — heat-lyses RBCs, releasing X and V factors; colonies small, grey, convex"),
("Satellite Phenomenon", "On BAP near Staph aureus (which provides V factor) — forms satellite colonies around Staph streak"),
("Levinthal's Agar", "Transparent medium; capsulated strains show iridescence"),
("Factor test strips", "X-only, V-only, XV discs on nutrient agar — growth only around XV strip"),
("Incubation", "35–37°C, 5% CO₂, 18–24 h"),
],
"biochem": [
("Oxidase", "POSITIVE"),
("Catalase", "POSITIVE"),
("X factor requirement", "POSITIVE (needs haemin)"),
("V factor requirement", "POSITIVE (needs NAD)"),
("Indole", "Variable by biotype (I–VIII)"),
("Urease", "Variable"),
("Capsule typing", "Antisera slide agglutination (a–f)"),
("β-lactamase", "Often POSITIVE — TEM-1 enzyme confers ampicillin resistance"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Amoxicillin-Clavulanate", "Sensitive", "DOC for non-meningitic disease if β-lactamase positive"),
("Ceftriaxone", "Sensitive", "DOC for meningitis"),
("Ampicillin", "Resistant (~30%)", "β-lactamase production common"),
("Azithromycin", "Sensitive", "For respiratory infections"),
("Chloramphenicol", "Sensitive", "Alternative in meningitis (low-resource)"),
("Ciprofloxacin", "Sensitive", "Adult respiratory infections"),
("Rifampicin", "Sensitive", "Hib prophylaxis for contacts"),
],
"clinical": (
"Non-typeable H. influenzae (NTHi): most common cause of otitis media, sinusitis, "
"bronchitis, exacerbations of COPD. H. influenzae type b (Hib): pre-vaccine was leading "
"cause of bacterial meningitis in children <5 yrs; also causes epiglottitis (thumb sign on "
"lateral X-ray), septic arthritis, pneumonia, cellulitis. Hib vaccine (conjugate) has "
"dramatically reduced type b disease. Virulence: capsule (antiphagocytic), IgA protease."
),
},
{
"name": "8. Escherichia coli",
"gram": "neg",
"bg": GRAM_NEG,
"basics": [
("Kingdom / Class", "Bacteria – Proteobacteria – γ-Proteobacteria (Enterobacteriaceae)"),
("Gram Stain", "Gram-NEGATIVE straight rods (bacilli), 1–3 µm"),
("Shape / Arrangement", "Single rods; motile (peritrichous flagella) except some strains"),
("Capsule", "Variable (K antigen — acidic polysaccharide)"),
("Oxygen Requirement", "Facultative anaerobe"),
],
"culture": [
("Routine Media", "Blood Agar: large, grey, often β-haemolytic colonies (EHEC/UPEC strains)"),
("MacConkey Agar", "PINK/RED lactose-fermenting colonies — key differential; characteristic metallic sheen on EMB agar"),
("EMB Agar (Eosin Methylene Blue)", "Metallic GREEN SHEEN colonies — highly characteristic for E. coli"),
("SMAC (Sorbitol-MacConkey)", "SORBITOL NON-FERMENTER = colourless colony = O157:H7 EHEC screening"),
("Chromogenic agar", "Pink colonies on chromogenic UTI agar"),
("Incubation", "35–37°C, 18–24 h; rapid grower"),
],
"biochem": [
("Oxidase", "NEGATIVE"),
("Catalase", "POSITIVE"),
("Lactose fermentation", "POSITIVE (distinguishes from Salmonella/Shigella)"),
("Indole", "POSITIVE (most strains) — key IMViC test"),
("Methyl Red", "POSITIVE"),
("Voges-Proskauer", "NEGATIVE"),
("Citrate", "NEGATIVE (Simmons') — IMViC = +/+/-/-"),
("H₂S production", "NEGATIVE"),
("Urease", "NEGATIVE"),
("TSI slant", "A/A (acid/acid, no H₂S, no gas or gas)"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Nitrofurantoin", "Sensitive (UTI)", "Uncomplicated lower UTI"),
("Co-trimoxazole", "Variable (20–30% resistant)", "Check local resistance rates"),
("Ciprofloxacin", "Variable resistance", "Fluoroquinolone resistance increasing"),
("Amoxicillin-Clavulanate", "Often Sensitive", "For non-ESBL strains"),
("Ceftriaxone", "Sensitive (ESBL negative)", "Hospital-acquired: test for ESBL"),
("Carbapenems", "Sensitive (non-CRE)", "Reserve for ESBL/AmpC strains"),
("Fosfomycin", "Sensitive", "UTI due to ESBL E. coli"),
],
"clinical": (
"Most common cause of UTI (uropathogenic UPEC). Pathotypes: UPEC (UTI), ETEC (travellers' "
"diarrhoea — LT/ST toxins), EPEC (infant diarrhoea), EHEC O157:H7 (haemorrhagic colitis, "
"HUS via Shiga toxin), EIEC (dysentery-like), EAEC (persistent diarrhoea). Also causes "
"neonatal meningitis (K1 capsule), bacteraemia, pneumonia. Antibiotic resistance (ESBL, "
"carbapenemase) is a global public health crisis."
),
},
{
"name": "9. Salmonella typhi",
"gram": "neg",
"bg": GRAM_NEG,
"basics": [
("Kingdom / Class", "Bacteria – Proteobacteria – γ-Proteobacteria (Enterobacteriaceae)"),
("Gram Stain", "Gram-NEGATIVE straight rods, 2–3 µm × 0.6 µm; bipolar staining in blood cultures"),
("Shape / Arrangement", "Single rods; motile (peritrichous); flagella H antigen"),
("Capsule", "Vi (virulence) antigen — polysaccharide capsule; inhibits phagocytosis"),
("Oxygen Requirement", "Facultative anaerobe"),
],
"culture": [
("Enrichment Broth", "Selenite F broth or Tetrathionate broth (suppresses coliforms for 12–24 h pre-culture)"),
("Selective Media", "MacConkey agar: NON-LACTOSE FERMENTER — colourless colonies"),
("Selective/Differential", "XLD (Xylose Lysine Deoxycholate) / DCA (Deoxycholate Citrate) / SS agar: black-centred colonies due to H₂S"),
("Brilliant Green Agar", "Selective for Salmonella (except S. typhi)"),
("Blood Culture", "BEST in first week of illness (bacteraemia phase)"),
("Bone marrow culture", "Most sensitive at any stage (>90%); remains positive after antibiotics"),
("Stool culture", "Week 2–3 (intestinal phase)"),
("Widal test", "Agglutination of O (somatic) and H (flagellar) antigens — supportive, not confirmatory"),
],
"biochem": [
("Oxidase", "NEGATIVE"),
("Catalase", "POSITIVE"),
("Lactose", "NEGATIVE"),
("Glucose", "POSITIVE (acid + gas) — S. typhi NO GAS (unique)"),
("H₂S", "POSITIVE (but less than S. typhimurium)"),
("Urease", "NEGATIVE"),
("Indole", "NEGATIVE"),
("Citrate", "NEGATIVE"),
("TSI", "K/A (alkaline slant, acid butt, H₂S positive, no gas for typhi)"),
("Vi agglutination", "POSITIVE for S. typhi"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Ceftriaxone", "Sensitive", "DOC for severe typhoid; IV 7–14 days"),
("Azithromycin", "Sensitive", "DOC for uncomplicated typhoid; oral"),
("Ciprofloxacin", "Decreasing sensitivity (MDR)", "Nalidixic acid resistance = reduced fluoroquinolone sensitivity; avoid in Asia"),
("Chloramphenicol", "Sensitive (classical)", "Historical DOC; bone marrow suppression; MDR emerging"),
("Ampicillin", "Variable MDR resistance", "Classical drug; MDR strains common in Asia"),
("Co-trimoxazole", "Variable MDR resistance", "Used in susceptible strains"),
("Carbapenems", "Sensitive (XDR)", "For extensively drug-resistant (XDR) typhoid"),
],
"clinical": (
"Causes typhoid (enteric) fever: insidious onset, step-ladder fever, relative bradycardia, "
"rose spots (trunk), hepatosplenomegaly, Faget sign. Transmitted faeco-orally via "
"contaminated water/food. Complications: intestinal haemorrhage/perforation (week 3), "
"encephalopathy, myocarditis. Chronic carrier state (gallbladder colonisation with Vi "
"antigen). Diagnosis: blood culture (week 1), bone marrow (gold standard), Widal test "
"(limited specificity). Vaccines: Ty21a (oral live), Vi polysaccharide, typhoid conjugate (TCV)."
),
},
{
"name": "10. Vibrio cholerae",
"gram": "neg",
"bg": GRAM_NEG,
"basics": [
("Kingdom / Class", "Bacteria – Proteobacteria – γ-Proteobacteria (Vibrionaceae)"),
("Gram Stain", "Gram-NEGATIVE curved rods (comma-shaped, 'vibrio')"),
("Shape / Arrangement", "Single curved rods 1.5–3 µm; highly motile — single polar flagellum; 'shooting star' motility"),
("Capsule", "Absent (O139 has a capsule)"),
("Oxygen Requirement", "Facultative anaerobe; aerophilic"),
],
"culture": [
("Alkaline Peptone Water", "ENRICHMENT — pH 8.6 selects Vibrio; incubate 6–8 h before subculture"),
("TCBS Agar", "Thiosulfate Citrate Bile Salts Sucrose — YELLOW colonies (sucrose fermenter) for V. cholerae O1/O139"),
("MacConkey Agar", "Pale/non-lactose fermenting colonies"),
("Gelatin Agar", "Shows proteolytic liquefaction"),
("Incubation", "35–37°C, 18–24 h; pH 8.5 optimal"),
("Oxidase test", "String test: positive mucoid string with 0.5% sodium deoxycholate"),
],
"biochem": [
("Oxidase", "POSITIVE — immediate reaction"),
("Catalase", "POSITIVE"),
("Indole", "POSITIVE"),
("String test (0.5% DOC)", "POSITIVE (mucoid string)"),
("TCBS", "YELLOW colonies — sucrose fermenter"),
("Cholera Red (Pfeffer's) reaction", "POSITIVE (sulphuric acid on culture = red colour)"),
("Agglutination", "O1 (Classical + El Tor biotypes) / O139 (Bengal); slide agglutination with polyvalent antisera"),
("El Tor vs Classical", "El Tor: VP positive, haemolysin+; Classical: VP neg"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Oral Rehydration Therapy (ORT)", "MAINSTAY", "IV/oral fluids — corrects fluid/electrolyte loss; primary treatment"),
("Doxycycline", "Sensitive", "Single dose DOC; reduces stool output & duration"),
("Azithromycin", "Sensitive", "Preferred for children and pregnancy"),
("Ciprofloxacin", "Sensitive (mostly)", "Fluoroquinolone; resistance emerging"),
("Co-trimoxazole", "Variable resistance", "Resistance widespread in many regions"),
("Tetracycline", "Sensitive", "Alternative adult treatment"),
],
"clinical": (
"Causes cholera: profuse, painless rice-water diarrhoea (loss of up to 1 L/h), vomiting, "
"rapid dehydration, hypokalaemia, metabolic acidosis, muscle cramps. Can lead to hypovolaemic "
"shock and death within hours. Pathogenesis: cholera toxin (AB₅) activates adenylyl cyclase → "
"↑cAMP → Cl⁻ secretion, Na⁺ absorption inhibited. Pandemic O1 El Tor (7th pandemic), "
"O139 Bengal. Faeco-oral transmission. Diagnosis: dark-field microscopy (shooting star), "
"stool culture on TCBS, rapid dipstick tests. Oral cholera vaccines (OCV) available."
),
},
{
"name": "11. Yersinia pestis",
"gram": "neg",
"bg": GRAM_NEG,
"basics": [
("Kingdom / Class", "Bacteria – Proteobacteria – γ-Proteobacteria (Enterobacteriaceae)"),
("Gram Stain", "Gram-NEGATIVE coccobacilli; characteristic BIPOLAR STAINING (safety-pin appearance) with Giemsa/Wayson stain"),
("Shape / Arrangement", "Oval coccobacilli 0.5–0.8 × 1–2 µm; non-motile at 37°C, motile at 25°C"),
("Capsule", "F1 (fraction 1) antigen at 37°C — antiphagocytic"),
("Oxygen Requirement", "Facultative anaerobe"),
],
"culture": [
("Routine Media", "Blood agar / Brain Heart Infusion agar — SLOW-GROWING (48–72 h); rough, irregular colonies"),
("MacConkey Agar", "Non-lactose fermenting; small, irregular colonies at 28°C"),
("Special Feature", "Grows better at 28°C (flea gut temperature) than 37°C; 'fried egg' colonies on BHI agar"),
("BSL-3 Required", "All work must be done in BSL-3 laboratory (category A bioterrorism agent)"),
("Wayson/Giemsa Stain", "Bipolar 'safety pin' staining pattern from smears/tissue"),
],
"biochem": [
("Oxidase", "NEGATIVE"),
("Catalase", "POSITIVE"),
("Urease", "NEGATIVE"),
("Lactose", "NEGATIVE"),
("H₂S", "NEGATIVE or weakly positive"),
("Motility", "Non-motile at 37°C; motile at 22–25°C"),
("F1 antigen", "POSITIVE at 37°C (capsule) — detected by FA, ELISA"),
("PCR", "Rapid confirmatory test; most sensitive and specific"),
("DFP stain", "Direct fluorescent antibody — rapid identification"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Streptomycin", "Sensitive", "Traditional DOC for plague; IM administration"),
("Gentamicin", "Sensitive", "Alternative aminoglycoside; often used in US"),
("Doxycycline", "Sensitive", "Oral treatment and post-exposure prophylaxis"),
("Ciprofloxacin", "Sensitive", "Post-exposure prophylaxis; alternative treatment"),
("Chloramphenicol", "Sensitive", "For plague meningitis (CNS penetration)"),
("Co-trimoxazole", "Sensitive", "Prophylaxis in endemic areas"),
],
"clinical": (
"Causes plague: three forms — bubonic plague (bubo = tender, enlarged inguinal/axillary "
"lymph node from flea bite), septicaemic plague (primary or secondary bacteraemia; "
"'black death' skin haemorrhages), pneumonic plague (most deadly; person-to-person "
"droplet transmission). Reservoir: rodents (rats, prairie dogs); vector: rat flea "
"(Xenopsylla cheopis). Case fatality rate >50% untreated. BSL-3 pathogen. "
"Category A bioterrorism agent. Diagnosis: smear (Giemsa/Wayson), culture, PCR, F1 antigen ELISA."
),
},
# ── ANAEROBES / SPORE-FORMERS ──────────────────────────────────
{
"name": "12. Clostridium perfringens",
"gram": "pos",
"bg": GRAM_POS,
"basics": [
("Kingdom / Class", "Bacteria – Firmicutes – Clostridia"),
("Gram Stain", "Gram-POSITIVE large boxcar-shaped rods; spore rarely seen in tissue"),
("Shape / Arrangement", "Large (4–8 × 1–1.5 µm) rectangular rods; non-motile (unique among Clostridium)"),
("Spores", "Subterminal oval spores; rarely seen in clinical specimens"),
("Oxygen Requirement", "Obligate anaerobe"),
],
"culture": [
("Blood Agar (Anaerobic)", "Double zone of haemolysis: inner complete β-haemolysis (θ-toxin) + outer partial haemolysis (α-toxin)"),
("Egg Yolk Agar (Nagler Plate)", "Lecithinase (α-toxin/phospholipase C) → opaque precipitate around colonies; INHIBITED by specific antitoxin on one side = Nagler reaction"),
("Litmus Milk", "Stormy clot fermentation — rapid acid production disrupts casein clot"),
("Robertson's Cooked Meat Medium", "Blackening with putrid smell — anaerobic growth"),
("Incubation", "37°C, strict anaerobic conditions, 24–48 h"),
],
"biochem": [
("Lecithinase", "POSITIVE (α-toxin) — Nagler reaction"),
("Lipase", "Negative"),
("Stormy clot (litmus milk)", "POSITIVE"),
("Motility", "NON-MOTILE (unique feature)"),
("Haemolysis", "Double zone β-haemolysis"),
("Glucose/Lactose/Sucrose", "POSITIVE (acid + gas)"),
("H₂S", "POSITIVE"),
("Typing", "Toxin types A–E based on major toxin production; Type A most common human pathogen"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Penicillin G", "Sensitive", "DOC for gas gangrene with surgical debridement"),
("Clindamycin", "Sensitive", "Anti-toxin effect; added to penicillin for gas gangrene"),
("Metronidazole", "Sensitive", "For anaerobic coverage; used in combination"),
("Carbapenems", "Sensitive", "Broad-spectrum option"),
("Cephalosporins", "Sensitive", "Variable coverage"),
("Surgical debridement", "Essential", "Antibiotics alone insufficient for gas gangrene"),
],
"clinical": (
"Type A toxin causes: (1) Gas gangrene (myonecrosis) — traumatic wound infection with "
"rapidly spreading necrosis, gas in tissue, foul smell, crepitus; (2) Food poisoning — "
"heat-resistant spores survive cooking, germinate, produce enterotoxin → watery diarrhoea "
"8–24 h after ingestion (no vomiting); (3) Necrotising enteritis (Pigbel disease — Type C). "
"α-toxin (phospholipase C/lecithinase) is the main toxin — destroys cell membranes. "
"Diagnosis: Gram stain of wound exudate (large boxcar GP rods), anaerobic culture, Nagler reaction."
),
},
{
"name": "13. Clostridium tetani",
"gram": "pos",
"bg": GRAM_POS,
"basics": [
("Kingdom / Class", "Bacteria – Firmicutes – Clostridia"),
("Gram Stain", "Gram-POSITIVE thin rods (may decolorise to Gram-negative with age)"),
("Shape / Arrangement", "Slender rods 0.5 × 2–5 µm; motile (peritrichous)"),
("Spores", "TERMINAL ROUND spores → classic DRUMSTICK / TENNIS RACKET appearance"),
("Oxygen Requirement", "Obligate anaerobe; strict"),
],
"culture": [
("Blood Agar (Anaerobic)", "Thin spreading ('swarming') film over the plate; fine delicate colonies; β-haemolysis"),
("Broth Culture", "Robertson's Cooked Meat Medium: blackening; putrefaction"),
("Special Note", "Lab diagnosis is rarely needed — tetanus is a CLINICAL DIAGNOSIS"),
("Mouse Protection Test", "Gold standard for tetanospasmin (neurotoxin) detection in research settings"),
("Incubation", "37°C, strictly anaerobic, 48–72 h"),
],
"biochem": [
("Indole", "POSITIVE"),
("Motility", "POSITIVE (motility agar) — swarming"),
("Proteolysis", "POSITIVE (liquefies gelatin)"),
("Haemolysis", "β-haemolysis (tetanolysin)"),
("Glucose fermentation", "NEGATIVE (non-saccharolytic)"),
("H₂S", "POSITIVE"),
("Neurotoxin", "Tetanospasmin (TeNT) — one of most potent toxins known (1 ng/kg lethal)"),
("Lipase", "NEGATIVE"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Metronidazole", "Sensitive", "DOC — preferred over penicillin (GABA antagonism concern)"),
("Penicillin G", "Sensitive", "Previously DOC; may potentiate tetanus symptoms (competes with GABA)"),
("Human Tetanus Immunoglobulin (HTIG)", "N/A (passive immunisation)", "Neutralises unbound toxin — give immediately"),
("TT Booster (Vaccine)", "N/A", "Tetanus toxoid — active immunisation"),
("Diazepam/Midazolam", "N/A (adjunct)", "Muscle relaxants for spasms"),
("Wound debridement", "Essential", "Removes source of toxin production"),
],
"clinical": (
"Tetanus is an exclusively toxin-mediated disease. Tetanospasmin blocks inhibitory "
"neurotransmitter release (GABA and glycine) in the spinal cord → unopposed motor "
"neuron firing → spastic paralysis. Manifestations: trismus ('lockjaw'), risus sardonicus "
"(sardonic smile), opisthotonos (arched back), laryngeal spasm (fatal). Forms: "
"generalised (most common), localised, cephalic, neonatal (tetanus neonatorum — "
"umbilical stump contamination). Incubation: 3–21 days. Prevention: DTP vaccine; "
"wound management with HTIG + booster."
),
},
# ── SPECIAL / ATYPICAL ─────────────────────────────────────────
{
"name": "14. Mycobacterium tuberculosis",
"gram": "special",
"bg": SPECIAL,
"basics": [
("Kingdom / Class", "Bacteria – Actinobacteria – Actinobacteria (Mycobacteriaceae)"),
("Gram Stain", "DOES NOT STAIN with Gram stain — thick waxy mycolic acid cell wall"),
("Preferred Stain", "Ziehl-Neelsen (ZN): acid-fast bacilli (AFB) — RED rods on blue background; Auramine-rhodamine (fluorescent)"),
("Shape / Arrangement", "Slender, slightly curved rods 1–4 × 0.3–0.6 µm; non-motile; non-spore-forming"),
("Cell Wall", "High lipid content (mycolic acids, cord factor, wax D) — responsible for acid-fastness and resistance"),
("Oxygen Requirement", "Obligate aerobe; concentrated at lung apices"),
],
"culture": [
("Solid Media", "Lowenstein-Jensen (LJ) medium: buff-coloured, rough, dry, crumbly EUGONIC colonies ('cauliflower' appearance); SLOW GROWTH — 3–8 weeks"),
("Liquid Media", "MGIT (Mycobacterial Growth Indicator Tube): fluorescence-based; detects in 1–2 weeks; BACTEC 460 radiometric"),
("Middlebrook 7H10/7H11", "Agar-based; observe microcolonies under microscope from 5–7 days"),
("Niacin test", "POSITIVE — accumulates niacin; differentiates from other mycobacteria"),
("Egg-based media", "LJ, Ogawa, Petragnani — traditional"),
("BSL-3", "Culture must be performed in BSL-3 laboratory"),
],
"biochem": [
("Acid-fast", "POSITIVE (ZN stain — retains carbol fuchsin after acid decolorisation)"),
("Niacin accumulation", "POSITIVE (unique to M. tuberculosis complex)"),
("Nitrate reduction", "POSITIVE"),
("Catalase (68°C)", "NEGATIVE (heat-labile; loses catalase at 68°C — differentiates from NTM)"),
("Pyrazinamidase", "POSITIVE"),
("TCH sensitivity", "SENSITIVE to thiophen-2-carboxylic acid hydrazide (differentiates M. bovis — resistant)"),
("Urease", "POSITIVE"),
("Growth rate", "SLOW — 3–8 weeks on solid media"),
("Cord factor", "POSITIVE — serpentine cording pattern on microscopy"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Isoniazid (H)", "First-line", "Bactericidal; inhibits mycolic acid synthesis"),
("Rifampicin (R)", "First-line", "Bactericidal; inhibits RNA polymerase"),
("Pyrazinamide (Z)", "First-line", "Bactericidal in acidic environment"),
("Ethambutol (E)", "First-line", "Bacteriostatic; inhibits arabinosyl transferase"),
("HRZE (2 months) + HR (4 months)", "Standard regimen", "DOTS strategy"),
("Streptomycin", "Reserve", "Formerly first-line; used in some regimens"),
("MDR-TB drugs", "Bedaquiline, linezolid, clofazimine", "For RIF + INH resistant MDR-TB"),
("XDR-TB", "Extensive resistance", "Resistant to fluoroquinolones + injectables"),
],
"clinical": (
"Leading infectious disease killer globally. Pulmonary TB: productive cough >2 weeks, "
"haemoptysis, night sweats, weight loss, low-grade fever. Primary TB: Ghon focus + "
"hilar lymphadenopathy = Ghon complex. Miliary TB: haematogenous dissemination. "
"Extrapulmonary: lymphadenopathy, pleural effusion, meningitis, spinal (Pott's disease), "
"renal, peritoneal. Latent TB: TST (Mantoux) or IGRA (QuantiFERON). Diagnosis: "
"AFB smear + culture + GeneXpert MTB/RIF (NAAT — detects TB + rifampicin resistance in 2 hours). "
"BCG vaccine for prevention."
),
},
{
"name": "15. Treponema pallidum",
"gram": "special",
"bg": SPECIAL,
"basics": [
("Kingdom / Class", "Bacteria – Spirochaetes – Spirochaetia"),
("Gram Stain", "TOO THIN to visualise on Gram stain; not culturable in vitro"),
("Morphology", "Tightly coiled spirochaete; 6–20 µm long × 0.1–0.18 µm wide; 6–14 regular coils; corkscrew motility"),
("Capsule", "Outer membrane with lipoproteins; mimics host cell membrane"),
("Oxygen Requirement", "Microaerophile; cannot be cultured on artificial media"),
],
"culture": [
("In vitro culture", "NOT POSSIBLE — obligate human pathogen; cannot grow on standard media"),
("Animal inoculation", "Rabbit testes (testicular inoculation) — reference standard for research"),
("Dark-field Microscopy", "PRIMARY diagnosis for primary syphilis — observe corkscrew motility of live treponemes from chancre exudate"),
("Direct Fluorescent Antibody (DFA-TP)", "Specific monoclonal antibody staining of smear from lesion"),
("Warthin-Starry / Levaditi stain", "Silver impregnation stain for tissue sections"),
],
"biochem": [
("Dark-field microscopy", "POSITIVE — corkscrew motility from primary chancre"),
("Non-treponemal tests", "VDRL and RPR — measure anticardiolipin antibodies (reagin); REACTIVE in active syphilis; titre correlates with disease activity; used for screening and monitoring treatment"),
("Treponemal tests", "TPHA, FTA-ABS, TPPA, EIA/CLIA — specific anti-treponemal antibodies; REMAIN POSITIVE for life after infection (not used to monitor treatment)"),
("PCR", "POSITIVE — highly sensitive for primary lesions, CSF neurosyphilis"),
("Prozone phenomenon", "False-negative VDRL/RPR in secondary syphilis due to antibody excess"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Benzathine Penicillin G", "ALWAYS Sensitive — no resistance", "DOC for all stages; single IM dose 2.4 MU for primary/secondary"),
("Procaine Penicillin", "Sensitive", "Neurosyphilis: high-dose IV or IM"),
("Doxycycline", "Sensitive", "Alternative for penicillin allergy (non-pregnant)"),
("Ceftriaxone", "Sensitive", "Alternative; used for neurosyphilis"),
("Azithromycin", "RESISTANCE EMERGING", "Not recommended; chromosomal A2058G mutation in 23S rRNA"),
("Jarisch-Herxheimer reaction", "Not drug resistance", "Febrile reaction 2–8 h after treatment; treat with antipyretics"),
],
"clinical": (
"Causes syphilis — stages: (1) Primary: painless indurated CHANCRE + painless regional "
"lymphadenopathy (3–90 days); (2) Secondary: maculopapular rash on palms + soles, "
"condylomata lata, mucous patches, lymphadenopathy (6–12 weeks); (3) Latent: "
"asymptomatic; (4) Tertiary: gummas (granulomas), cardiovascular syphilis (aortitis, "
"aortic aneurysm), neurosyphilis (Argyll Robertson pupil, tabes dorsalis, general paresis). "
"Congenital syphilis: interstitial keratitis, Hutchinson's teeth, saddlenose, sensorineural deafness. "
"Transmitted sexually; transplacental."
),
},
{
"name": "16. Chlamydia trachomatis",
"gram": "special",
"bg": SPECIAL,
"basics": [
("Kingdom / Class", "Bacteria – Chlamydiae – Chlamydiia (obligate intracellular)"),
("Gram Stain", "DOES NOT STAIN on Gram stain (no peptidoglycan in cell wall)"),
("Morphology", "Two forms: Elementary body (EB) — infectious, metabolically inactive (0.3 µm); Reticulate body (RB) — intracellular, metabolically active (1 µm)"),
("Cell Wall", "No peptidoglycan; outer membrane complex (MOMP); β-lactam antibiotics ineffective"),
("Oxygen Requirement", "Obligate intracellular parasite; aerobic (uses host cell ATP)"),
],
"culture": [
("Cell Culture", "McCoy cells or HeLa 229 cells; centrifugation (shell vial assay) enhances sensitivity"),
("Inclusions", "Intracytoplasmic inclusion bodies — Giemsa stain: dark blue/purple; Iodine stain: brown (glycogen-rich inclusions)"),
("NAAT", "GOLD STANDARD — PCR/TMA on urine, endocervical, urethral, rectal swabs; sensitivity >95%"),
("Direct Fluorescent Antibody (DFA)", "FITC-labelled monoclonal antibodies visualise EBs in smear"),
("Serology", "MIF (Micro-immunofluorescence): serovars A–C (trachoma), D–K (STI), L1–L3 (LGV)"),
],
"biochem": [
("Oxidase/Catalase", "Not applicable (obligate intracellular)"),
("Giemsa stain", "POSITIVE — intracytoplasmic inclusions (dark blue)"),
("Iodine stain", "POSITIVE — glycogen inclusions (brown)"),
("NAAT (PCR)", "GOLD STANDARD — detects ompA gene"),
("Serovars", "A–C: trachoma (hyperendemic); D–K: urogenital STI; L1–L3: Lymphogranuloma venereum (LGV)"),
("Complement fixation", "Group antigen — detects genus Chlamydia"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Azithromycin 1g", "Sensitive", "Single oral dose — DOC for uncomplicated urogenital Chlamydia"),
("Doxycycline 100mg BD × 7d", "Sensitive", "Alternative first-line; preferred for LGV (21 days)"),
("Erythromycin", "Sensitive", "Used in pregnancy as alternative"),
("Ofloxacin / Levofloxacin", "Sensitive", "Alternative for urogenital infection"),
("β-lactams (penicillins)", "INEFFECTIVE", "No peptidoglycan → no β-lactam target"),
("Tetracycline", "Sensitive", "Historical treatment; doxycycline preferred"),
],
"clinical": (
"Most common bacterial STI worldwide. Urogenital: urethritis, cervicitis, PID, "
"epididymo-orchitis, infertility (silent disease in up to 70% of women). Neonatal: "
"ophthalmia neonatorum (conjunctivitis 5–12 days after birth), neonatal pneumonia. "
"Trachoma: serovars A–C; leading infectious cause of preventable blindness — conjunctival "
"scarring → entropion → corneal abrasion. LGV (serovars L1–L3): painful inguinal "
"lymphadenopathy (bubo) + proctitis in MSM. Reactive arthritis (Reiter's syndrome): "
"urethritis + arthritis + conjunctivitis + mouth ulcers."
),
},
{
"name": "17. Rickettsia species",
"gram": "special",
"bg": SPECIAL,
"basics": [
("Kingdom / Class", "Bacteria – Proteobacteria – α-Proteobacteria (obligate intracellular)"),
("Gram Stain", "Gram-NEGATIVE but poorly stained; Giemsa / Gimenez stain preferred"),
("Morphology", "Small pleomorphic coccobacilli 0.3–0.5 × 1–2 µm; non-motile"),
("Cell Wall", "Gram-negative type; lipopolysaccharide; intracellular"),
("Oxygen Requirement", "Obligate intracellular aerobe; uses host cell ATP"),
],
"culture": [
("Cell Culture", "Vero cells, L929 cells, embryonated eggs (yolk sac); BSL-2/3 depending on species"),
("Gimenez Stain", "Red/pink organisms on green background — preferred for tissue/cell smears"),
("Giemsa Stain", "Purple intracellular coccobacilli"),
("NOT culturable", "Routine lab media — will not grow; requires living cells"),
("Serology (Weil-Felix)", "HISTORICAL screening test — cross-reaction with Proteus OX strains (OX2, OX19, OXK); low specificity"),
("IFA (Indirect Fluorescent Antibody)", "GOLD STANDARD serology — specific anti-rickettsial antibodies"),
],
"biochem": [
("Weil-Felix (Proteus agglutination)", "OX19+/OX2+ = Spotted Fever Group; OX19+ = Typhus Group; OXK+ = Scrub typhus (Orientia)"),
("IFA serology", "GOLD STANDARD — 4-fold rise in titre between acute & convalescent sera"),
("PCR", "Highly sensitive and specific; detects OmpA / OmpB genes in blood or biopsy"),
("Immunohistochemistry", "Detects rickettsiae in skin biopsy from rash/eschar"),
("Biopsy (eschar/rash)", "Histology + IHC or PCR on rash biopsy from spotted fevers"),
],
"sensitivity": [
("Drug", "Pattern", "Notes"),
("Doxycycline", "ALWAYS Sensitive — DOC for ALL rickettsioses", "100mg BD × 7 days; start empirically before serology confirmed"),
("Chloramphenicol", "Sensitive", "Alternative in pregnancy or children <8 yrs (risk of grey baby syndrome)"),
("Azithromycin", "Sensitive", "Mild disease or pregnancy"),
("β-lactams / Aminoglycosides", "INEFFECTIVE", "Cannot penetrate intracellular compartment"),
("Rifampicin", "Sensitive", "Used in special circumstances"),
],
"clinical": (
"Key species: Rickettsia rickettsii (Rocky Mountain Spotted Fever — RMSF): fever, headache, "
"centripetal rash starting on palms/soles; Rickettsia prowazekii (epidemic louse-borne "
"typhus): classic Brill-Zinsser recurrence; Rickettsia typhi (endemic murine typhus, flea); "
"Orientia tsutsugamushi (scrub typhus, chigger mite): pathognomonic ESCHAR at bite site. "
"All cause fever, headache, myalgia, rash (except scrub typhus — may be faint). Vasculitis "
"of small vessels (replicate in endothelial cells). Vectors: ticks, lice, fleas, mites. "
"Diagnosis is primarily CLINICAL + serology (IFA). Empiric doxycycline should not be delayed."
),
},
]
# ═══════════════════════════════════════════════════════════════════
# BUILD DOCUMENT
# ═══════════════════════════════════════════════════════════════════
story = []
# ── COVER PAGE ──────────────────────────────────────────────────
cover_data = [[Paragraph("BACTERIOLOGY", S["cover_title"])]]
cover_t = Table(cover_data, colWidths=[17*cm], rowHeights=[3.5*cm])
cover_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("ROUNDEDCORNERS", [10]),
("TOPPADDING", (0,0), (-1,-1), 30),
("BOTTOMPADDING", (0,0), (-1,-1), 0),
]))
story.append(sp(40))
story.append(cover_t)
sub_data = [[Paragraph("Laboratory Diagnosis Reference Guide", S["cover_sub"])]]
sub_t = Table(sub_data, colWidths=[17*cm], rowHeights=[1.2*cm])
sub_t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), MID_BLUE),
("ROUNDEDCORNERS", [0]),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
]))
story.append(sub_t)
story.append(sp(20))
story.append(Paragraph("Morphology • Culture • Biochemistry • Sensitivity • Clinical Significance", S["cover_note"]))
story.append(sp(10))
story.append(Paragraph("17 Clinically Important Bacteria | Medical Students Edition", S["cover_note"]))
story.append(sp(10))
# Colour legend on cover
legend_data = [
[Paragraph("🟡 Gram-Positive", ParagraphStyle("l", fontSize=9, textColor=colors.HexColor("#7b4f00"), fontName="Helvetica-Bold")),
Paragraph("🔵 Gram-Negative", ParagraphStyle("l", fontSize=9, textColor=colors.HexColor("#1a5276"), fontName="Helvetica-Bold")),
Paragraph("🟣 Special / Atypical", ParagraphStyle("l", fontSize=9, textColor=colors.HexColor("#4a235a"), fontName="Helvetica-Bold")),
Paragraph("🟢 Anaerobes", ParagraphStyle("l", fontSize=9, textColor=colors.HexColor("#145a32"), fontName="Helvetica-Bold"))],
]
lt = Table(legend_data, colWidths=[4.25*cm]*4)
lt.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LIGHT_BLUE),
("BOX", (0,0), (-1,-1), 0.5, TABLE_GRID),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("ALIGN", (0,0), (-1,-1), "CENTER"),
]))
story.append(lt)
story.append(sp(20))
story.append(Paragraph("Sources: Medical Microbiology 9e (Murray), Jawetz Melnick & Adelbergs Medical Microbiology 28E, "
"Quick Compendium of Clinical Pathology 5e, Tietz Textbook of Laboratory Medicine 7e, Sherris & Ryan Medical Microbiology 8e",
S["footer_note"]))
story.append(PageBreak())
# ── TABLE OF CONTENTS ────────────────────────────────────────────
story.append(Paragraph("TABLE OF CONTENTS", S["toc_head"]))
story.append(hr())
story.append(sp(6))
gram_cat = {
"Gram-Positive Cocci": ["1. Staphylococcus aureus", "2. Streptococcus pneumoniae", "3. Streptococcus pyogenes (Group A Strep)"],
"Gram-Positive Rods": ["4. Corynebacterium diphtheriae", "12. Clostridium perfringens", "13. Clostridium tetani"],
"Gram-Negative Cocci": ["5. Neisseria meningitidis", "6. Neisseria gonorrhoeae"],
"Gram-Negative Rods (Enterobacteriaceae)": ["8. Escherichia coli", "9. Salmonella typhi", "11. Yersinia pestis"],
"Gram-Negative Rods (Other)": ["7. Haemophilus influenzae", "10. Vibrio cholerae"],
"Special / Atypical Bacteria": ["14. Mycobacterium tuberculosis", "15. Treponema pallidum",
"16. Chlamydia trachomatis", "17. Rickettsia species"],
}
for cat, items in gram_cat.items():
story.append(Paragraph(f"<b>{cat}</b>", ParagraphStyle("toc_cat", fontSize=11, textColor=MID_BLUE,
fontName="Helvetica-Bold", spaceAfter=4, spaceBefore=8, leftIndent=0)))
for item in items:
story.append(Paragraph(f" • {item}", S["toc_entry"]))
story.append(sp(10))
story.append(hr())
story.append(sp(6))
story.append(Paragraph(
"Each entry covers: Gram stain & morphology • Culture media & colony characteristics • "
"Biochemical tests • Antibiotic sensitivity patterns • Clinical significance",
ParagraphStyle("toc_footer", fontSize=9, textColor=colors.grey, fontName="Helvetica-Oblique",
alignment=TA_CENTER, spaceAfter=4)
))
story.append(PageBreak())
# ── EACH BACTERIUM ───────────────────────────────────────────────
for b in bacteria:
bg = b["bg"]
gram = b["gram"]
# Header banner
story.append(section_banner(b["name"], gram))
story.append(sp(6))
# ---- Morphology & Classification ----
story.append(KeepTogether([
Paragraph("MORPHOLOGY & CLASSIFICATION", S["subsection"]),
info_table(b["basics"], bg=bg),
sp(8),
]))
# ---- Culture Characteristics ----
story.append(KeepTogether([
Paragraph("CULTURE CHARACTERISTICS", S["subsection"]),
info_table(b["culture"], bg=bg),
sp(8),
]))
# ---- Biochemical Tests ----
story.append(KeepTogether([
Paragraph("BIOCHEMICAL IDENTIFICATION", S["subsection"]),
info_table(b["biochem"], bg=bg),
sp(8),
]))
# ---- Sensitivity ----
story.append(Paragraph("ANTIBIOTIC SENSITIVITY PATTERNS", S["subsection"]))
headers = b["sensitivity"][0]
rows = b["sensitivity"][1:]
# Colour-code sensitivity cells
raw_data = [[Paragraph(str(c), S["cell_header"]) for c in headers]]
for row in rows:
raw_data.append([Paragraph(str(c), S["cell_body"]) for c in row])
col_w = [5.5*cm, 5.5*cm, 6*cm]
sens_t = Table(raw_data, colWidths=col_w)
ts2 = TableStyle([
("BACKGROUND", (0,0), (-1,0), HEADER_ROW),
("GRID", (0,0), (-1,-1), 0.4, TABLE_GRID),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("ALIGN", (0,0), (-1,0), "CENTER"),
])
for i in range(1, len(raw_data), 2):
ts2.add("BACKGROUND", (0,i), (-1,i), ALT_ROW)
sens_t.setStyle(ts2)
story.append(sens_t)
story.append(sp(8))
# ---- Clinical Significance ----
story.append(KeepTogether([
Paragraph("CLINICAL SIGNIFICANCE", S["subsection"]),
Paragraph(b["clinical"], S["body"]),
sp(4),
hr(),
sp(6),
]))
story.append(PageBreak())
# ── QUICK REFERENCE COMPARISON TABLE ────────────────────────────
story.append(Paragraph("QUICK REFERENCE COMPARISON TABLE", S["toc_head"]))
story.append(hr())
story.append(sp(4))
qr_headers = ["Organism", "Gram", "Key Media", "Diagnostic Test", "DOC"]
qr_rows = [
["S. aureus", "+ve cocci", "MSA / BAP", "Coagulase +ve", "Flucloxacillin (MSSA)\nVancomycin (MRSA)"],
["S. pneumoniae", "+ve diplococci", "Blood agar", "Optochin S / Bile soluble", "Ceftriaxone"],
["S. pyogenes", "+ve cocci chains", "Blood agar", "Bacitracin S / PYR +ve", "Penicillin"],
["C. diphtheriae", "+ve rods", "Loeffler / Tellurite", "Elek test / Metachromatic granules", "Erythromycin + Antitoxin"],
["N. meningitidis", "−ve diplococci", "Thayer-Martin / CHOC", "Oxidase +ve / Maltose +ve", "Ceftriaxone"],
["N. gonorrhoeae", "−ve diplococci", "Thayer-Martin", "Oxidase +ve / Maltose −ve", "Ceftriaxone 500mg IM"],
["H. influenzae", "−ve coccobacilli", "Chocolate agar", "X+V factor requirement", "Amox-Clavulanate / Ceftriaxone"],
["E. coli", "−ve rods", "MacConkey / EMB", "Metallic green sheen / IMViC++--", "Nitrofurantoin (UTI)"],
["S. typhi", "−ve rods", "XLD / Blood culture", "Bone marrow culture / Widal", "Ceftriaxone / Azithromycin"],
["V. cholerae", "−ve curved rods", "TCBS (yellow)", "String test / Shooting star", "ORT + Doxycycline"],
["Y. pestis", "−ve coccobacilli", "BHI / Blood agar", "Bipolar safety-pin / F1 antigen", "Streptomycin / Doxycycline"],
["C. perfringens", "+ve rods (anaerobe)", "Egg yolk (Nagler)", "Nagler reaction / Stormy clot", "Penicillin + Clindamycin"],
["C. tetani", "+ve rods (anaerobe)", "Blood agar (anaerobic)", "Drumstick spores / Clinical Dx", "Metronidazole + HTIG"],
["M. tuberculosis", "AFB (special)", "LJ medium / MGIT", "ZN stain / GeneXpert", "HRZE (2m) + HR (4m)"],
["T. pallidum", "Spirochaete", "Not culturable", "Dark-field microscopy / VDRL / FTA-ABS", "Benzathine Pen G"],
["C. trachomatis", "Intracellular", "McCoy cells / NAAT", "NAAT (PCR) Gold standard", "Azithromycin 1g stat"],
["Rickettsia spp.", "Intracellular", "Vero cells / IFA serology", "IFA / Weil-Felix / PCR", "Doxycycline"],
]
qr_data = [[Paragraph(h, S["cell_header"]) for h in qr_headers]]
col_widths = [3.8*cm, 2.6*cm, 3.5*cm, 4.1*cm, 3*cm]
for row in qr_rows:
qr_data.append([Paragraph(c, ParagraphStyle("qrc", fontSize=7.5, fontName="Helvetica", leading=10)) for c in row])
qr_t = Table(qr_data, colWidths=col_widths)
qr_ts = TableStyle([
("BACKGROUND", (0,0), (-1,0), HEADER_ROW),
("GRID", (0,0), (-1,-1), 0.4, TABLE_GRID),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 4),
("RIGHTPADDING", (0,0), (-1,-1), 4),
("ALIGN", (0,0), (-1,0), "CENTER"),
("FONTSIZE", (0,1), (-1,-1), 7.5),
])
for i in range(1, len(qr_data), 2):
qr_ts.add("BACKGROUND", (0,i), (-1,i), ALT_ROW)
qr_t.setStyle(qr_ts)
story.append(qr_t)
story.append(sp(16))
story.append(hr())
story.append(Paragraph(
"This document is intended for medical education only. Always consult current institutional guidelines and sensitivity data for clinical decision-making. "
"Compiled by Orris AI • Bacteriology Lab Diagnosis Reference 2026",
S["footer_note"]))
# ── BUILD ────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF saved to {OUTPUT}")
cd /tmp/workspace/bacteriology-pdf && python generate.py 2>&1
ls -lh /tmp/workspace/bacteriology-pdf/Bacteriology_Lab_Diagnosis.pdf
Bacteriology Lab Diagnosis
PDF Document · PDF
Now can you make a pdf also for virus in microbiology with their lab diagnosis specifically
Which viruses should be covered? · What sections per virus?
Make it in parts but make it fast
Make it fast