Differentials of myasthenia gravis and their differentiating points

Reading File
Finding Sources
Finding Sources
Searching PubMed

"myasthenia gravis" AND "differential diagnosis"

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
I now have comprehensive data. Let me compile the full, well-organized answer:

Differentials of Myasthenia Gravis and Their Differentiating Points

Myasthenia gravis (MG) has been called "the great imitator" because its symptoms — fatigable ptosis, diplopia, bulbar weakness, and proximal limb weakness — can overlap with many other neuromuscular conditions. The differentials fall into four broad categories.

1. Lambert-Eaton Myasthenic Syndrome (LEMS)

The most important and closest mimic of MG.
FeatureMyasthenia GravisLambert-Eaton Syndrome
PathophysiologyAutoimmune attack on postsynaptic nicotinic AChR (or MuSK/LRP4)Autoimmune attack on presynaptic P/Q-type voltage-gated calcium channels (VGCC)
AntibodiesAnti-AChR (~85%), anti-MuSK (~40% seronegative), anti-LRP4Anti-VGCC (>95%), SOX1 (paraneoplastic)
Weakness distributionOcular and bulbar > proximal limbProximal limb (especially legs) > ocular/bulbar
Ocular involvementPtosis and diplopia very prominentEye movements usually spared; pupillary reflexes may be sluggish
Effect of exerciseWeakness worsens with sustained activityWeakness transiently improves with brief exercise (post-tetanic potentiation)
Deep tendon reflexesNormal or mildly reducedReduced at rest but improve after exercise
Autonomic dysfunctionAbsentProminent: dry mouth, hypohidrosis, impotence, orthostasis, constipation
Repetitive nerve stimulation (EMG)Decremental response at low-frequency (2–3 Hz) stimulation (>10% decrease)Incremental response (>100% increase) at high-frequency stimulation or after brief exercise
Association with malignancyThymoma (10–15%)Small cell lung cancer (40–62%); may precede cancer by years
TreatmentPyridostigmine, immunosuppression, thymectomy3,4-diaminopyridine (amifampridine) first-line; treat underlying cancer
— Goldman-Cecil Medicine; Tintinalli's Emergency Medicine; Miller's Anesthesia, 10e

2. Botulism

FeatureMyasthenia GravisBotulism
MechanismPostsynaptic AChR blockadePresynaptic blockade of ACh release by botulinum toxin
OnsetChronic, fluctuatingAcute (hours to days) after ingestion of suspect food or wound infection
Paralysis directionVariable; often starts ocular/bulbarDescending flaccid paralysis (cranial nerves → limbs → respiratory)
PupilsNormalDilated, poorly reactive (autonomic involvement)
GI symptomsAbsentNausea, vomiting, diarrhea early; constipation later
Response to anticholinesterasesImproves with pyridostigmine/edrophoniumNo improvement
SensoryNormalNormal (cognition preserved)
DTRsNormalDiminished or absent
DiagnosisSerology, EMG, edrophonium testBotulinum toxin in serum/stool/food; culture
TreatmentPyridostigmine, immunosuppressionHeptavalent antitoxin (early); supportive care
— Goldman-Cecil Medicine; Morgan & Mikhail's Anesthesiology, 7e; Red Book 2021

3. Congenital Myasthenic Syndromes (CMS)

FeatureMyasthenia GravisCongenital Myasthenic Syndromes
EtiologyAcquired autoimmuneGenetic mutations of pre/synaptic/postsynaptic machinery
Age of onsetAny age (bimodal: young women, older men)Birth or early childhood (severe forms); some (slow-channel) present in adulthood
SerologyAChR or MuSK antibodies often positiveAntibodies absent (seronegative)
Response to immunosuppressionResponds wellDoes not respond — immunosuppression ineffective/harmful
Additional featuresThymoma associationMay have intellectual disability, seizures (presynaptic mutations)
Key diagnostic testAntibody serology + EMGGenetic analysis (distinguishes from seronegative MG)
TreatmentImmunotherapy, thymectomyPyridostigmine, 3,4-DAP, salbutamol, fluoxetine (slow-channel); depends on genetic subtype
— Goldman-Cecil Medicine; Harrison's 22e

4. Ocular Muscle Disease (Mimics of Ocular MG)

4a. Thyroid Ophthalmopathy (Graves' Disease)

  • Proptosis, lid retraction, chemosis — absent in MG
  • Restricts specific muscles (inferior rectus most common → limited upgaze)
  • Confirmed by forced duction test (restriction) vs. MG (no restriction)
  • Orbital CT/MRI shows enlarged extraocular muscles
  • May be euthyroid or hypothyroid at time of presentation
  • Associated with anti-TSH receptor antibodies

4b. Oculopharyngeal Muscular Dystrophy

  • Autosomal dominant, typically onset >50 years
  • Slowly progressive ptosis + dysphagia (similar pattern to MG)
  • No diurnal fluctuation, no fatigability
  • EMG shows myopathic pattern; muscle biopsy shows rimmed vacuoles
  • PABPN1 gene mutation

4c. Mitochondrial Myopathy (Chronic Progressive External Ophthalmoplegia / Kearns-Sayre Syndrome)

  • Progressive, painless, symmetric bilateral ptosis and ophthalmoplegia
  • No fatigability — fixed, gradual
  • Associated with pigmentary retinopathy, heart block (Kearns-Sayre)
  • Muscle biopsy: ragged-red fibers (Gomori trichrome stain)
  • Maternal or sporadic inheritance (mitochondrial DNA deletion)
— Adams & Victor's Principles of Neurology, 12e; Harrison's 22e

5. Other Neuromuscular Junction Disorders

Organophosphate / Cholinesterase Inhibitor Toxicity

  • Mimics cholinergic crisis (not MG itself), but can cause weakness
  • Distinguished by SLUDGE syndrome (salivation, lacrimation, urination, defecation, GI distress, emesis) — cholinergic excess features
  • History of exposure; responds to atropine + pralidoxime

Drug-Induced Myasthenia

  • Agents: penicillamine, aminoglycosides, quinolones, procainamide, chloroquine, immune checkpoint inhibitors (nivolumab, pembrolizumab, ipilimumab)
  • ICI-related MG: associated with concomitant myositis and myocarditis; usually after first/second treatment cycle
  • Resolves or improves on drug withdrawal

6. CNS / Structural Causes (Mimics of Bulbar/Ocular MG)

ConditionKey Differentiating Features
Stroke (brainstem/cortical)Sudden onset; sensory deficits, UMN signs, abnormal imaging
Intracranial aneurysm (CN III palsy)Painful, fixed dilated pupil; sudden onset; urgent imaging
Cavernous sinus syndromeMultiple CN palsies (III, IV, V₁, VI, Horner); proptosis; imaging shows lesion
Basilar meningitisFever, meningismus, CSF pleocytosis; TB/fungal/sarcoid etiologies
Demyelinating disease (MS)INO (internuclear ophthalmoplegia), sensory symptoms, white matter lesions on MRI, relapses
Horner syndromePtosis + miosis + anhidrosis (partial); pupil involvement distinguishes from MG ptosis

Summary: Key EMG Patterns

ConditionLow-Frequency RNSHigh-Frequency RNS
MGDecremental (>10%)Normalizes or further decrements
LEMSDecremental (baseline CMAP reduced)Incremental (>100%)
BotulismSimilar to LEMS (incremental at high frequency)Incremental
Congenital MGVariable decrementalVariable

Quick Reference Mnemonic

For fatigable ptosis + weakness — ask:
  1. Antibodies? → AChR/MuSK (MG) vs. VGCC (LEMS)
  2. Reflexes improve with exercise? → LEMS
  3. Pupils dilated? → Botulism
  4. No fluctuation, genetic history? → Congenital MG / mitochondrial myopathy
  5. Proptosis, restricted duction? → Thyroid eye disease
  6. Sensory, UMN signs, imaging abnormal? → CNS cause

Sources: Morgan & Mikhail's Clinical Anesthesiology, 7e | Goldman-Cecil Medicine, International Ed. | Harrison's Principles of Internal Medicine, 22e | Tintinalli's Emergency Medicine | Adams & Victor's Principles of Neurology, 12e

Motor neuron disease vs myasthenia

Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
I now have all the material needed. Let me compile the comprehensive comparison:

Motor Neuron Disease vs. Myasthenia Gravis

These two conditions can overlap clinically — both cause dysarthria, dysphagia, and limb weakness — but their underlying pathology, examination findings, and investigations are fundamentally different.

Pathophysiology

Motor Neuron Disease (ALS)Myasthenia Gravis (MG)
Site of lesionUpper and/or lower motor neurons (anterior horn cells, corticospinal tracts)Neuromuscular junction — postsynaptic AChR (or MuSK/LRP4)
MechanismProgressive degeneration of motor neurons — neurogenic muscle lossAutoimmune antibody-mediated AChR blockade → failed neuromuscular transmission
Sensory involvementNone (or trivial distal loss late)Absent
Autonomic involvementNoneAbsent
PrognosisRelentlessly progressive; 50% die within 3 years, 90% within 6 yearsFluctuating; remissions possible; treatable

Clinical Comparison

FeatureMotor Neuron Disease (ALS)Myasthenia Gravis
OnsetInsidious, progressive, no remissionsFluctuating; worsens with activity, improves with rest
FatigabilityAbsent (weakness is constant, not fatigue-related)Cardinal feature — fatigable weakness worsening through the day
Ocular involvementAbsent — eye movements are classically spared until very late (if at all)Prominent — ptosis and diplopia are the most common presenting symptoms
PtosisNot a featureVery common
Facial weaknessCan occur (bulbar/pseudobulbar palsy)Can occur
TongueAtrophic, fasciculating — a hallmark findingNormal in appearance
DysarthriaPresent (harsh, strained voice in ALS; nasal in bulbar palsy)Nasal, fatigable dysarthria
DysphagiaPresent, progressivePresent, fluctuating
Limb weakness distributionVariable: distal, proximal, or mixed; asymmetricPredominantly proximal; symmetric
Muscle wasting / atrophyProminent (denervation atrophy)Absent — no structural muscle loss
FasciculationsPresent — a hallmark of LMN diseaseAbsent
Muscle toneIncreased (UMN) and/or decreased (LMN) — combinationNormal
Deep tendon reflexesBrisk/hyperreflexic (UMN component) despite wasted muscles — classic paradox; or depressed (pure LMN)Normal
Babinski signPresent (UMN involvement)Absent
Jaw jerkHyperactive (pseudobulbar palsy)Normal
Respiratory weaknessOccurs late; diaphragmatic involvement commonMyasthenic crisis can cause acute respiratory failure
Sensory examNormal (pure motor disease)Normal
CognitionIntact (5–20% may have frontotemporal dementia overlap)Intact

The Diagnostic Key: UMN + LMN Signs Together

The pathognomonic paradox of ALS is coexistence of UMN and LMN signs in the same patient or even the same limb:
  • Wasted, fasciculating muscles + brisk reflexes
  • Tongue atrophy + hyperactive jaw jerk
  • Foot drop (LMN) + Babinski sign (UMN)
This combination is never seen in MG.

Investigations

InvestigationMotor Neuron DiseaseMyasthenia Gravis
SerologyNegative (no disease-specific antibody)Anti-AChR (~85%), anti-MuSK (~40% seronegative), anti-LRP4
Repetitive nerve stimulation (EMG)Normal NMJ transmission; fibrillations and fasciculations at rest; enlarged motor units (reinnervation)Decremental response (>10%) at 2–3 Hz stimulation; no fibrillations
Single-fibre EMGAbnormal (increased jitter due to reinnervation) — but different patternMarkedly increased jitter — highly sensitive for MG
Nerve conduction velocityMotor NCV normal or mildly slowed; amplitude reduced in LMN typeNormal
Edrophonium/neostigmine testNo responseTransient objective improvement in weakness
Ice testNo responseImprovement in ptosis
CT chestNot specific (may show aspiration changes)Screen for thymoma
MRI brain/spineCan show corticospinal tract changes; useful to exclude cervical myelopathy/spondylosisNormal
Muscle biopsyGrouped angular atrophy (denervation pattern)Normal
CSFNormal (or mildly elevated protein)Normal

Bulbar Palsy: The Most Difficult Overlap

Both ALS (bulbar-onset) and MG can present with dysarthria and dysphagia alone, without obvious limb weakness. Key differentiators:
ALS Bulbar PalsyMG Bulbar Symptoms
TongueAtrophic, fasciculatingNormal
Jaw jerkExaggerated (pseudobulbar component)Normal
Voice qualityHarsh, strained + slurred (mixed UMN/LMN)Nasal, fatigable
Ptosis/diplopiaAbsentOften present
Worsens through dayNoYes
Emotional labilityPresent (pseudobulbar affect)Absent
Response to pyridostigmineNoneImprovement
"Myasthenia with dysarthria and dysphagia but without ptosis or obvious strabismus may be confused with... motor neuron disease. Testing with an anticholinesterase inhibitor, single-fiber and repetitive stimulation recording, and measurement of antibodies usually clarifies the matter." — Adams & Victor's Principles of Neurology, 12e

Summary Table

MGALS / MND
Lesion siteNMJ (postsynaptic)Upper + lower motor neurons
HallmarkFatigable weakness, ptosis, diplopiaUMN + LMN signs in same patient
Ocular signsProminentAbsent
TongueNormalAtrophic + fasciculating
ReflexesNormalBrisk (or absent in pure LMN)
BabinskiAbsentPresent (UMN type)
FasciculationsAbsentPresent
WastingAbsentProminent
FatigabilityYesNo
AChR antibodiesYes (85%)No
RNS EMGDecrementalNormal NMJ; fibrillations
Response to neostigmineYesNo
PrognosisTreatable, remissions possibleUniformly progressive, fatal

Sources: Adams & Victor's Principles of Neurology, 12e | Goldman-Cecil Medicine, International Ed. | Bradley & Daroff's Neurology in Clinical Practice | Rosen's Emergency Medicine | Robbins & Kumar Basic Pathology

How to differentiate from GBS

Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Excellent — all the key data is in hand. Here is the comprehensive comparison:

GBS vs. Myasthenia Gravis — How to Differentiate

Both GBS and MG can present with acute flaccid weakness, bulbar involvement, and respiratory failure — making them potentially difficult to distinguish at onset. The Miller Fisher variant of GBS (ophthalmoplegia + ataxia + areflexia) most closely mimics ocular MG.

Pathophysiology

Guillain-Barré Syndrome (GBS)Myasthenia Gravis (MG)
Site of lesionPeripheral nerve / nerve roots (demyelinating or axonal)Neuromuscular junction (postsynaptic AChR)
MechanismPost-infectious molecular mimicry → autoimmune attack on peripheral nerve myelin or axonsIgG antibodies against AChR, MuSK, or LRP4 → impaired neuromuscular transmission
TriggerPreceding infection (Campylobacter, CMV, EBV, Zika) 2–4 weeks before onsetNo identifiable precipitant (may worsen with infection, surgery, medications)
CourseMonophasic — peaks at 2–4 weeks, then plateau, then recoveryFluctuating — worsens with activity, improves with rest; exacerbations and remissions

Clinical Comparison

FeatureGBSMyasthenia Gravis
Onset patternAcute (days–weeks), ascending weaknessUsually subacute; fluctuating throughout the day
Direction of weaknessAscending — legs → arms → bulbar → respiratoryNo fixed direction; often starts ocular/bulbar
FatigabilityAbsent — weakness is constantCardinal feature — worsens with sustained activity
Ocular signs (ptosis/diplopia)Usually absent in classic GBS; present in Miller Fisher variantProminent — most common presenting symptom
Pupillary abnormalitiesCan occur in Miller Fisher syndromeAbsent — pupils always spared in MG
AtaxiaPresent in Miller Fisher variant (sensory/cerebellar)Absent
Sensory symptomsPresent — paresthesias, tingling, back painAbsent — purely motor disease
Deep tendon reflexesAbsent/areflexia — hallmarkNormal
Facial weaknessComplete, often asymmetric bilateral facial palsyCan occur but typically with ptosis/diplopia
Autonomic dysfunctionPresent in ~65% (tachycardia, BP swings, urinary retention, ileus)Absent
PainBack pain, limb pain commonAbsent
Preceding illnessYes — URI or gastroenteritis 2–4 weeks priorNo
Jaw / hanging headNot typicalHanging jaw and head drop — suggestive of MG
Respiratory failureCommon (1/3 of patients)Myasthenic crisis — occurs but less predictably
"A hanging jaw and hanging head are indicative of myasthenia, whereas complete or asymmetric facial paresis is typical of GBS." — Adams & Victor's Principles of Neurology, 12e

Miller Fisher Syndrome vs. Ocular MG — The Closest Mimic

FeatureMiller Fisher Syndrome (GBS variant)Ocular/Bulbar MG
Classic triadOphthalmoplegia + Ataxia + AreflexiaPtosis + diplopia (no ataxia, reflexes normal)
PtosisMay be presentProminent
PupilsMay be abnormalNormal
AtaxiaPresentAbsent
ReflexesAbsentNormal
Sensory symptomsMay have mild paresthesiasAbsent
FatigabilityAbsentPresent
Response to anticholinesteraseNoneImprovement
AntibodyAnti-GQ1b (>85%)Anti-AChR / anti-MuSK
NCVNormal in MFS (unlike classic GBS)Normal
"The oculopharyngeal-brachial variants of GBS in the early stages have many features of myasthenia, including ptosis, that may be partially responsive to anticholinesterase drugs. The loss of tendon reflexes, acral paresthesias, and areflexia make the diagnosis of GBS at once apparent." — Adams & Victor, 12e

Investigations

InvestigationGBSMyasthenia Gravis
CSFCytoalbuminologic (albuminocytologic) dissociation — high protein (>45 mg/dL), few cells (<5 WBC/mm³)Normal
CSF cells<10 (if >50, think HIV/Lyme/sarcoid)Normal
Nerve conduction studiesDemyelinating pattern — slowed NCV, prolonged F-waves, conduction block (AIDP); reduced amplitudes (axonal)Normal NCV and F-waves
EMG (repetitive nerve stimulation)Normal NMJ transmission; fibrillations/positive waves (axonal type)Decremental response (>10% at 2–3 Hz)
SerologyAnti-GQ1b (Miller Fisher); anti-GM1, anti-GD1a (axonal); no AChR antibodiesAnti-AChR (~85%), anti-MuSK (~40% of seronegative)
Edrophonium/neostigmine testNo responsePositive — objective improvement
MRI spineMay show nerve root enhancementNormal
Anti-AChR antibodiesNegativePositive (85%)

Summary Comparison Table

GBSMG
LesionPeripheral nerveNeuromuscular junction
TriggerPost-infectiousNone specific
CourseMonophasic, ascendingFluctuating, fatigable
ReflexesAbsentNormal
Sensory lossPresentAbsent
AutonomicCommonAbsent
AtaxiaMFS variantNever
PupilsAbnormal (MFS)Always normal
CSFHigh protein, few cellsNormal
NCVSlow (AIDP) / low amplitude (axonal)Normal
RNS EMGNormal NMJDecremental
Specific antibodyAnti-GQ1b (MFS)Anti-AChR / MuSK
Neostigmine testNo responseImproves
TreatmentIVIg / plasmapheresisPyridostigmine, immunosuppression, thymectomy

Practical Tip

The three fastest bedside differentiators are:
  1. Reflexes — absent in GBS, normal in MG
  2. Sensory symptoms — present in GBS, absent in MG
  3. Fatigability — absent in GBS, the defining feature of MG

Sources: Goldman-Cecil Medicine, International Ed. | Adams & Victor's Principles of Neurology, 12e | Tintinalli's Emergency Medicine | Bradley & Daroff's Neurology in Clinical Practice | Washington Manual of Medical Therapeutics

Make a chart of all these differentials with myasthenia

Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace not found"

Running Command

mkdir -p /home/daytona/workspace/mg-differentials && cat > /home/daytona/workspa…

Writing File

~/mg-differentials/make_chart.py

import openpyxl
from openpyxl.styles import PatternFill, Font, Alignment, Border, Side
from openpyxl.utils import get_column_letter

wb = openpyxl.Workbook()
ws = wb.active
ws.title = "MG Differentials"

# Colors
MG_HEADER   = "1F4E79"
DIFF_HEADER = "2E75B6"
ROW_HEADER  = "BDD7EE"
ALT_ROW1    = "FFFFFF"
ALT_ROW2    = "EBF3FB"
TITLE_BG    = "1F4E79"
WHITE       = "FFFFFF"
BLACK       = "000000"
DARK_FONT   = "1F4E79"

thin = Side(border_style="thin", color="A0A0A0")
border_thin = Border(left=thin, right=thin, top=thin, bottom=thin)

def fill(hex_color):
    return PatternFill("solid", fgColor=hex_color)

def font(bold=False, color=BLACK, size=10, italic=False):
    return Font(bold=bold, color=color, size=size, italic=italic, name="Calibri")

def align(wrap=True, h="center", v="center"):
    return Alignment(horizontal=h, vertical=v, wrap_text=wrap)

columns = [
    "Feature",
    "Myasthenia Gravis",
    "Lambert-Eaton\nSyndrome (LEMS)",
    "Botulism",
    "Congenital\nMyasthenic\nSyndromes",
    "GBS (AIDP)",
    "Miller Fisher\nSyndrome",
    "ALS / Motor\nNeuron Disease",
    "Thyroid\nOphthalmopathy",
    "Oculopharyngeal\nMuscular Dystrophy",
    "Mitochondrial\nMyopathy (CPEO)",
]

rows = [
    ("Pathophysiology",
     "Autoimmune; postsynaptic AChR blockade at NMJ",
     "Autoimmune; presynaptic VGCC blockade at NMJ",
     "Botulinum toxin blocks presynaptic ACh release at NMJ",
     "Genetic mutations of NMJ machinery (pre/syn/post-synaptic)",
     "Post-infectious demyelination of peripheral nerve roots",
     "Post-infectious; anti-GQ1b; cranial nerve variant of GBS",
     "Progressive degeneration of upper and lower motor neurons",
     "Autoimmune orbital inflammation; extraocular muscle infiltration",
     "PABPN1 gene mutation; autosomal dominant myopathy",
     "Mitochondrial DNA deletion; POLG1/Twinkle mutations"),

    ("Site of Lesion",
     "NMJ (postsynaptic)",
     "NMJ (presynaptic)",
     "NMJ (presynaptic)",
     "NMJ (pre/syn/post)",
     "Peripheral nerve / nerve roots",
     "Peripheral nerve (cranial nerves dominant)",
     "Upper + lower motor neurons",
     "Orbit / extraocular muscles",
     "Skeletal muscle",
     "Skeletal muscle (mitochondria)"),

    ("Onset / Course",
     "Subacute; fluctuating; remissions possible",
     "Subacute; progressive; less fluctuation than MG",
     "Acute (hours to days) after contaminated food or wound",
     "Birth or early childhood (severe forms); adulthood (slow-channel)",
     "Acute ascending over days to weeks; monophasic",
     "Acute; monophasic",
     "Insidious; relentlessly progressive; no remissions",
     "Chronic; slowly progressive",
     "Chronic; slowly progressive; onset usually >50 yrs",
     "Chronic; slowly progressive; symmetric bilateral"),

    ("Fatigability (Hallmark of MG)",
     "YES - Cardinal feature; worsens with activity, improves with rest",
     "NO - Less prominent; strength paradoxically improves briefly with exercise",
     "NO - Absent",
     "NO - Weakness is constant",
     "NO - Weakness is constant",
     "NO - Weakness is constant",
     "NO - Weakness is constant",
     "NO - Absent",
     "NO - Absent",
     "NO - Absent"),

    ("Ptosis",
     "YES - Prominent; asymmetric; fatigable",
     "NO - Uncommon; eye usually spared",
     "YES - Present; fixed; non-fatigable; descending",
     "YES - May be present",
     "NO - Absent in classic GBS",
     "YES - May be present",
     "NO - Eye movements classically spared",
     "YES - With proptosis and lid lag",
     "YES - Slowly progressive bilateral",
     "YES - Slowly progressive bilateral"),

    ("Diplopia / Ophthalmoplegia",
     "YES - Common presenting symptom; fatigable",
     "NO - Eye movements usually spared",
     "YES - Fixed; non-fatigable; descending",
     "YES - May occur",
     "NO - Absent in classic GBS",
     "YES - Ophthalmoplegia is a defining feature",
     "NO - Eye movements classically spared",
     "YES - Restricted (mechanical); inferior/medial rectus",
     "YES - Slowly progressive",
     "YES - Progressive external ophthalmoplegia is hallmark"),

    ("Pupils",
     "Normal - always spared",
     "Sluggish (autonomic involvement)",
     "Dilated and poorly reactive - KEY differentiator",
     "Normal",
     "Normal",
     "May be abnormal (autonomic)",
     "Normal",
     "Normal",
     "Normal",
     "Normal"),

    ("Deep Tendon Reflexes",
     "Normal",
     "Reduced at rest; improve after exercise",
     "Diminished or absent",
     "Variable",
     "Absent / areflexia - HALLMARK",
     "Absent / areflexia - HALLMARK",
     "Brisk (UMN) despite wasting; or reduced (LMN) - pathognomonic paradox",
     "Normal",
     "Normal",
     "Normal"),

    ("Muscle Wasting / Atrophy",
     "Absent",
     "Absent",
     "Absent",
     "Can occur (progressive forms)",
     "Absent",
     "Absent",
     "Prominent - denervation atrophy",
     "Absent",
     "Temporalis and pharyngeal wasting",
     "Absent"),

    ("Fasciculations",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Present - LMN hallmark",
     "Absent",
     "Absent",
     "Absent"),

    ("Sensory Symptoms",
     "Absent",
     "Paresthesias; metallic taste (autonomic overlap)",
     "Absent",
     "Absent",
     "Paresthesias and back pain - common",
     "Mild paresthesias possible",
     "Absent (trivial distal loss very late)",
     "Absent",
     "Absent",
     "Absent"),

    ("Autonomic Dysfunction",
     "Absent",
     "Prominent - dry mouth, impotence, constipation, orthostasis, hypohidrosis",
     "Prominent - dilated pupils, dry mouth, constipation, orthostatic hypotension",
     "Absent",
     "Present in ~65% - BP swings, tachycardia, urinary retention",
     "Less prominent",
     "Absent",
     "Absent",
     "Absent",
     "Cardiac conduction defects in Kearns-Sayre"),

    ("Preceding Trigger",
     "None specific",
     "None (paraneoplastic: small cell lung cancer)",
     "Contaminated food or wound (10 hrs to 5 days before)",
     "Genetic / congenital",
     "URI or gastroenteritis 2-4 weeks prior",
     "Same as GBS - post-infectious",
     "None",
     "None",
     "Genetic",
     "Genetic / maternal inheritance"),

    ("Malignancy Association",
     "Thymoma (10-15%)",
     "Small cell lung cancer (40-62%); may precede cancer by years",
     "None",
     "None",
     "None",
     "None",
     "None",
     "None",
     "None",
     "None"),

    ("Proptosis",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Present - KEY feature",
     "Absent",
     "Absent"),

    ("Ataxia",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Present - defining feature of MFS triad",
     "Absent",
     "Absent",
     "Absent",
     "Gait ataxia in Kearns-Sayre syndrome"),

    ("Babinski Sign / UMN Signs",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Present (UMN component) - pathognomonic paradox with wasting",
     "Absent",
     "Absent",
     "Absent"),

    ("Tongue Findings",
     "Normal in appearance",
     "Normal",
     "Normal",
     "Normal",
     "Normal",
     "Normal",
     "Atrophic and fasciculating - hallmark of ALS",
     "Normal",
     "Pharyngeal involvement (dysphagia)",
     "Normal"),

    ("CSF",
     "Normal",
     "Normal",
     "Normal",
     "Normal",
     "High protein; normal cells (<5 WBC/mm3) - cytoalbuminologic dissociation",
     "Normal (or mildly raised protein)",
     "Normal (or mildly elevated protein late)",
     "Normal",
     "Normal",
     "Raised lactate in Kearns-Sayre"),

    ("Nerve Conduction Studies",
     "Normal",
     "Normal NCV; reduced CMAP amplitude at baseline",
     "Similar to LEMS",
     "Variable",
     "Slowed NCV; prolonged F-waves; conduction block (AIDP); reduced amplitude (axonal)",
     "Normal NCV (unlike AIDP)",
     "Normal or mildly slowed NCV; reduced amplitude (LMN)",
     "Normal",
     "Normal",
     "Normal"),

    ("Repetitive Nerve Stimulation",
     "Decremental response >10% at 2-3 Hz - HALLMARK",
     "Incremental response >100% at high frequency or post-exercise - HALLMARK",
     "Incremental (similar to LEMS)",
     "Decremental (variable)",
     "Normal NMJ; fibrillations in axonal type",
     "Normal NMJ transmission",
     "Fibrillations; fasciculations; enlarged motor units; normal NMJ",
     "Normal",
     "Myopathic pattern",
     "Myopathic pattern"),

    ("Specific Antibodies / Genetics",
     "Anti-AChR (85%); Anti-MuSK (~40% of seronegative); Anti-LRP4",
     "Anti-VGCC P/Q-type (>95%); SOX1 (paraneoplastic form)",
     "Botulinum toxin detected in serum, stool, or food",
     "Genetic mutation - no antibodies (seronegative for AChR/MuSK)",
     "Anti-ganglioside (GM1, GD1a); anti-GQ1b rare",
     "Anti-GQ1b (>85%) - highly specific",
     "None",
     "Anti-TSH receptor antibody; thyroid function tests",
     "PABPN1 gene mutation (GCG repeat expansion)",
     "Mitochondrial DNA deletion; POLG1 mutation"),

    ("Response to Anticholinesterase\n(Pyridostigmine / Neostigmine)",
     "YES - Objective improvement",
     "Partial / minimal response",
     "No response",
     "Variable (some CMS subtypes improve)",
     "No response",
     "No response",
     "No response",
     "No response",
     "No response",
     "No response"),

    ("Ice Test / Rest Test",
     "Positive - ptosis improves",
     "Not applicable",
     "Not applicable",
     "Variable",
     "Not applicable",
     "Not applicable",
     "Not applicable",
     "Not applicable",
     "Not applicable",
     "Not applicable"),

    ("Forced Duction Test",
     "Negative - no mechanical restriction",
     "Negative",
     "Negative",
     "Negative",
     "Negative",
     "Negative",
     "Negative",
     "Positive - mechanical restriction of extraocular muscles",
     "Negative",
     "Negative"),

    ("Muscle Biopsy",
     "Normal (mild fiber atrophy possible)",
     "Normal",
     "Normal",
     "Abnormal NMJ on electron microscopy",
     "Normal",
     "Normal",
     "Grouped angular atrophy (denervation pattern)",
     "Normal",
     "Rimmed vacuoles - characteristic",
     "Ragged-red fibers on Gomori trichrome - HALLMARK"),

    ("Imaging",
     "CT chest - screen for thymoma",
     "CT/PET chest - screen for SCLC",
     "Normal",
     "Normal",
     "MRI spine: nerve root enhancement and thickening",
     "Normal",
     "Normal (MRI may show corticospinal tract T2 changes late)",
     "CT/MRI orbit: enlarged extraocular muscles; proptosis",
     "Normal",
     "MRI brain: white matter lesions in Kearns-Sayre"),

    ("Treatment",
     "Pyridostigmine; immunosuppression (steroids, azathioprine); thymectomy; IVIg/PLEX",
     "3,4-DAP (amifampridine) first-line; treat SCLC; IVIg/PLEX; immunosuppression",
     "Heptavalent botulinum antitoxin; ventilatory support",
     "Genetic-guided: pyridostigmine; 3,4-DAP; salbutamol; fluoxetine (slow-channel)",
     "IVIg or plasmapheresis; respiratory monitoring and support",
     "IVIg or plasmapheresis; supportive care",
     "Riluzole / edaravone; respiratory support; multidisciplinary; palliative",
     "Teprotumumab; steroids; orbital decompression; prism glasses",
     "Supportive; ptosis surgery; cricopharyngeal myotomy for dysphagia",
     "CoQ10; manage cardiac conduction defects; supportive"),
]

# Build sheet
# Row 1 - Title
ws.merge_cells(start_row=1, start_column=1, end_row=1, end_column=len(columns))
title_cell = ws.cell(row=1, column=1)
title_cell.value = "Differential Diagnosis of Myasthenia Gravis — Comprehensive Comparison Chart"
title_cell.font = Font(bold=True, color=WHITE, size=14, name="Calibri")
title_cell.fill = fill(TITLE_BG)
title_cell.alignment = align(h="center", v="center")
ws.row_dimensions[1].height = 32

# Row 2 - Column headers
for col_idx, col_name in enumerate(columns, start=1):
    cell = ws.cell(row=2, column=col_idx, value=col_name)
    if col_idx == 1:
        cell.fill = fill(ROW_HEADER)
        cell.font = font(bold=True, color=DARK_FONT, size=10)
    elif col_idx == 2:
        cell.fill = fill(MG_HEADER)
        cell.font = font(bold=True, color=WHITE, size=10)
    else:
        cell.fill = fill(DIFF_HEADER)
        cell.font = font(bold=True, color=WHITE, size=10)
    cell.alignment = align(h="center", v="center")
    cell.border = border_thin
ws.row_dimensions[2].height = 48

# Data rows
for row_idx, row_data in enumerate(rows, start=3):
    bg = ALT_ROW1 if (row_idx % 2 == 0) else ALT_ROW2
    for col_idx, value in enumerate(row_data, start=1):
        cell = ws.cell(row=row_idx, column=col_idx, value=value)
        if col_idx == 1:
            cell.fill = fill(ROW_HEADER)
            cell.font = font(bold=True, color=DARK_FONT, size=9)
            cell.alignment = align(h="left", v="center")
        else:
            cell.fill = fill(bg)
            v = str(value)
            if v.startswith("YES"):
                cell.font = Font(color="1F6B2E", size=9, name="Calibri", bold=False)
            elif v.startswith("NO"):
                cell.font = Font(color="C00000", size=9, name="Calibri", bold=False)
            elif "HALLMARK" in v or "KEY" in v:
                cell.font = Font(color="7030A0", size=9, name="Calibri", bold=True)
            elif v.startswith("Absent"):
                cell.font = Font(color="595959", size=9, name="Calibri")
            elif v.startswith("Normal"):
                cell.font = Font(color="595959", size=9, name="Calibri")
            else:
                cell.font = font(size=9, color=BLACK)
            cell.alignment = align(h="left", v="center")
        cell.border = border_thin
    ws.row_dimensions[row_idx].height = 48

# Column widths
widths = [28, 30, 27, 27, 26, 26, 24, 28, 26, 27, 28]
for col_idx, w in enumerate(widths, start=1):
    ws.column_dimensions[get_column_letter(col_idx)].width = w

# Freeze panes
ws.freeze_panes = "B3"

# Legend
legend_row = len(rows) + 4
ws.merge_cells(start_row=legend_row, start_column=1,
               end_row=legend_row, end_column=len(columns))
leg = ws.cell(row=legend_row, column=1,
              value="Legend:  GREEN = Present/Positive   RED = Absent/Negative   PURPLE = Hallmark/Key feature   NMJ = Neuromuscular Junction   AChR = Acetylcholine Receptor   VGCC = Voltage-Gated Calcium Channel   CMAP = Compound Muscle Action Potential   SCLC = Small Cell Lung Cancer   CPEO = Chronic Progressive External Ophthalmoplegia   CMS = Congenital Myasthenic Syndromes   MFS = Miller Fisher Syndrome   PLEX = Plasma Exchange   IVIg = Intravenous Immunoglobulin   3,4-DAP = 3,4-Diaminopyridine")
leg.font = Font(italic=True, size=9, color="595959", name="Calibri")
leg.fill = fill("F2F2F2")
leg.alignment = Alignment(horizontal="left", vertical="center", wrap_text=True)
ws.row_dimensions[legend_row].height = 35

out = "/home/daytona/workspace/mg-differentials/MG_Differentials_Chart.xlsx"
wb.save(out)
print(f"Saved: {out}")
Editing File

~/mg-differentials/make_chart.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/mg-differentials/make_chart.py'
Running Command

rm /home/daytona/workspace/mg-differentials/make_chart.py

Writing File

~/mg-differentials/make_chart.py

import openpyxl
from openpyxl.styles import PatternFill, Font, Alignment, Border, Side
from openpyxl.utils import get_column_letter

wb = openpyxl.Workbook()
ws = wb.active
ws.title = "MG Differentials"

MG_HEADER   = "1F4E79"
DIFF_HEADER = "2E75B6"
ROW_HEADER  = "BDD7EE"
ALT_ROW1    = "FFFFFF"
ALT_ROW2    = "EBF3FB"
TITLE_BG    = "1F4E79"
WHITE       = "FFFFFF"
BLACK       = "000000"
DARK_FONT   = "1F4E79"

thin = Side(border_style="thin", color="A0A0A0")
border_thin = Border(left=thin, right=thin, top=thin, bottom=thin)

def fill(hex_color):
    return PatternFill("solid", fgColor=hex_color)

def mkfont(bold=False, color="000000", size=10):
    return Font(bold=bold, color=color, size=size, name="Calibri")

def align(wrap=True, h="center", v="center"):
    return Alignment(horizontal=h, vertical=v, wrap_text=wrap)

columns = [
    "Feature",
    "Myasthenia Gravis",
    "Lambert-Eaton\nSyndrome (LEMS)",
    "Botulism",
    "Congenital\nMyasthenic\nSyndromes",
    "GBS (AIDP)",
    "Miller Fisher\nSyndrome",
    "ALS / Motor\nNeuron Disease",
    "Thyroid\nOphthalmopathy",
    "Oculopharyngeal\nMuscular Dystrophy",
    "Mitochondrial\nMyopathy (CPEO)",
]

rows = [
    ("Pathophysiology",
     "Autoimmune; postsynaptic AChR blockade at NMJ",
     "Autoimmune; presynaptic VGCC blockade at NMJ",
     "Botulinum toxin blocks presynaptic ACh release",
     "Genetic mutations of NMJ machinery (pre/syn/post-synaptic)",
     "Post-infectious demyelination of peripheral nerve roots",
     "Post-infectious; anti-GQ1b; cranial nerve variant of GBS",
     "Progressive degeneration of upper and lower motor neurons",
     "Autoimmune orbital inflammation; extraocular muscle infiltration",
     "PABPN1 gene mutation; autosomal dominant myopathy",
     "Mitochondrial DNA deletion; POLG1/Twinkle mutations"),

    ("Site of Lesion",
     "NMJ (postsynaptic)",
     "NMJ (presynaptic)",
     "NMJ (presynaptic)",
     "NMJ (pre/syn/post)",
     "Peripheral nerve / nerve roots",
     "Peripheral nerve (cranial nerves dominant)",
     "Upper + lower motor neurons",
     "Orbit / extraocular muscles",
     "Skeletal muscle",
     "Skeletal muscle (mitochondria)"),

    ("Onset / Course",
     "Subacute; fluctuating; remissions possible",
     "Subacute; progressive; less fluctuation",
     "Acute (hours to days) after contaminated food or wound",
     "Birth or early childhood (severe); adulthood (slow-channel)",
     "Acute ascending over days to weeks; monophasic",
     "Acute; monophasic",
     "Insidious; relentlessly progressive; no remissions",
     "Chronic; slowly progressive",
     "Chronic; slowly progressive; onset usually >50 yrs",
     "Chronic; slowly progressive; symmetric bilateral"),

    ("Fatigability",
     "YES - Cardinal feature; worsens with activity, improves with rest",
     "NO - Paradoxically improves briefly with short exercise",
     "NO - Absent; weakness is constant",
     "NO - Weakness is constant",
     "NO - Weakness is constant",
     "NO - Weakness is constant",
     "NO - Weakness is constant",
     "NO - Absent",
     "NO - Absent",
     "NO - Absent"),

    ("Ptosis",
     "YES - Prominent; asymmetric; fatigable",
     "NO - Uncommon; eye usually spared",
     "YES - Present; fixed; non-fatigable; descending",
     "YES - May be present",
     "NO - Absent in classic GBS",
     "YES - May be present",
     "NO - Eye movements classically spared",
     "YES - With proptosis and lid lag",
     "YES - Slowly progressive bilateral",
     "YES - Slowly progressive bilateral"),

    ("Diplopia / Ophthalmoplegia",
     "YES - Common presenting symptom; fatigable",
     "NO - Eye movements usually spared",
     "YES - Fixed; non-fatigable; descending",
     "YES - May occur",
     "NO - Absent in classic GBS",
     "YES - HALLMARK of MFS; ophthalmoplegia is defining",
     "NO - Eye movements classically spared until very late",
     "YES - Restricted (mechanical); inferior/medial rectus",
     "YES - Slowly progressive",
     "YES - Progressive external ophthalmoplegia is HALLMARK"),

    ("Pupils",
     "Normal - always spared in MG",
     "Sluggish (autonomic involvement)",
     "Dilated and poorly reactive - KEY differentiator from MG",
     "Normal",
     "Normal",
     "May be abnormal",
     "Normal",
     "Normal",
     "Normal",
     "Normal"),

    ("Deep Tendon Reflexes",
     "Normal",
     "Reduced at rest; improve after exercise (post-tetanic)",
     "Diminished or absent",
     "Variable",
     "Absent / areflexia - HALLMARK of GBS",
     "Absent / areflexia - HALLMARK of MFS",
     "Brisk (UMN) despite wasting or reduced (LMN) - paradox",
     "Normal",
     "Normal",
     "Normal"),

    ("Muscle Wasting / Atrophy",
     "Absent - no structural muscle loss",
     "Absent",
     "Absent",
     "Can occur in progressive forms",
     "Absent",
     "Absent",
     "Prominent - denervation atrophy",
     "Absent",
     "Temporalis and pharyngeal wasting",
     "Absent"),

    ("Fasciculations",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Present - LMN HALLMARK",
     "Absent",
     "Absent",
     "Absent"),

    ("Sensory Symptoms",
     "Absent - purely motor",
     "Paresthesias; metallic taste (autonomic overlap)",
     "Absent",
     "Absent",
     "Paresthesias and back pain - common",
     "Mild paresthesias possible",
     "Absent (trivial distal loss very late)",
     "Absent",
     "Absent",
     "Absent"),

    ("Autonomic Dysfunction",
     "Absent",
     "Prominent - dry mouth, impotence, constipation, orthostasis",
     "Prominent - dry mouth, dilated pupils, constipation, orthostasis",
     "Absent",
     "Present in ~65% - BP swings, tachycardia, urinary retention",
     "Less prominent than classic GBS",
     "Absent",
     "Absent",
     "Absent",
     "Cardiac conduction defects in Kearns-Sayre"),

    ("Preceding Trigger",
     "None specific",
     "None (paraneoplastic: small cell lung cancer)",
     "Contaminated food or wound (10 hrs to 5 days prior)",
     "Genetic / congenital - no trigger",
     "URI or gastroenteritis 2-4 weeks prior",
     "Same as GBS - post-infectious",
     "None",
     "None",
     "Genetic",
     "Genetic / maternal inheritance"),

    ("Malignancy Association",
     "Thymoma (10-15%)",
     "Small cell lung cancer (40-62%); may precede cancer by years",
     "None",
     "None",
     "None",
     "None",
     "None",
     "None",
     "None",
     "None"),

    ("Proptosis",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Present - KEY distinguishing feature",
     "Absent",
     "Absent"),

    ("Ataxia",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Present - HALLMARK of MFS triad (ophthalmoplegia + ataxia + areflexia)",
     "Absent",
     "Absent",
     "Absent",
     "Gait ataxia in Kearns-Sayre syndrome"),

    ("Babinski Sign / UMN Signs",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Absent",
     "Present (UMN) - pathognomonic paradox with muscle wasting",
     "Absent",
     "Absent",
     "Absent"),

    ("Tongue Findings",
     "Normal in appearance",
     "Normal",
     "Normal",
     "Normal",
     "Normal",
     "Normal",
     "Atrophic and fasciculating - HALLMARK of ALS",
     "Normal",
     "Pharyngeal involvement causing dysphagia",
     "Normal"),

    ("CSF",
     "Normal",
     "Normal",
     "Normal",
     "Normal",
     "High protein; normal cells - cytoalbuminologic dissociation",
     "Normal or mildly raised protein",
     "Normal (or mildly elevated protein late)",
     "Normal",
     "Normal",
     "Raised lactate in Kearns-Sayre"),

    ("Nerve Conduction Studies",
     "Normal NCV and amplitudes",
     "Normal NCV; reduced CMAP amplitude at baseline",
     "Similar to LEMS pattern",
     "Variable",
     "Slowed NCV; prolonged F-waves; conduction block (AIDP)",
     "Normal NCV - unlike classic AIDP",
     "Normal or mildly slowed NCV; reduced amplitude (LMN type)",
     "Normal",
     "Normal",
     "Normal"),

    ("Repetitive Nerve Stimulation",
     "Decremental response >10% at 2-3 Hz - HALLMARK of MG",
     "Incremental response >100% at high frequency/post-exercise - HALLMARK",
     "Incremental at high frequency (similar to LEMS)",
     "Decremental (variable by subtype)",
     "Normal NMJ; fibrillations in axonal variant",
     "Normal NMJ transmission",
     "Fibrillations + fasciculations + enlarged motor units; normal NMJ",
     "Normal",
     "Myopathic pattern",
     "Myopathic pattern"),

    ("Specific Antibodies / Genetics",
     "Anti-AChR (85%); Anti-MuSK (~40% of seronegative); Anti-LRP4",
     "Anti-VGCC P/Q-type (>95%); SOX1 antibody (paraneoplastic)",
     "Botulinum toxin in serum, stool, or food",
     "Genetic mutation identified; seronegative for AChR/MuSK",
     "Anti-ganglioside GM1, GD1a (axonal); anti-GQ1b rare",
     "Anti-GQ1b (>85%) - HIGHLY SPECIFIC",
     "No disease-specific antibody",
     "Anti-TSH receptor; thyroid function abnormalities",
     "PABPN1 gene mutation (GCG repeat expansion)",
     "Mitochondrial DNA deletion; POLG1 / Twinkle gene mutation"),

    ("Response to Anticholinesterase\n(Pyridostigmine / Neostigmine)",
     "YES - Objective, measurable improvement",
     "Partial / minimal",
     "No response",
     "Variable - depends on subtype",
     "No response",
     "No response",
     "No response",
     "No response",
     "No response",
     "No response"),

    ("Ice Test / Rest Test",
     "Positive - ptosis measurably improves",
     "Not applicable",
     "Not applicable",
     "Variable",
     "Not applicable",
     "Not applicable",
     "Not applicable",
     "Not applicable",
     "Not applicable",
     "Not applicable"),

    ("Forced Duction Test",
     "Negative - no mechanical restriction",
     "Negative",
     "Negative",
     "Negative",
     "Negative",
     "Negative",
     "Negative",
     "Positive - HALLMARK of mechanical restriction",
     "Negative",
     "Negative"),

    ("Muscle Biopsy",
     "Normal (mild fiber atrophy possible)",
     "Normal",
     "Normal",
     "Abnormal NMJ on electron microscopy",
     "Normal",
     "Normal",
     "Grouped angular atrophy (denervation pattern)",
     "Normal",
     "Rimmed vacuoles - characteristic",
     "Ragged-red fibers on Gomori trichrome - HALLMARK"),

    ("Imaging",
     "CT chest - screen for thymoma",
     "CT/PET chest - screen for SCLC",
     "Normal",
     "Normal",
     "MRI spine: nerve root enhancement and thickening",
     "Normal brain/spine imaging",
     "Normal; MRI may show corticospinal tract T2 changes late",
     "CT/MRI orbit: enlarged extraocular muscles; proptosis",
     "Normal",
     "MRI brain: white matter lesions in Kearns-Sayre"),

    ("Treatment",
     "Pyridostigmine; immunosuppression (steroids, azathioprine); thymectomy; IVIg/PLEX",
     "3,4-DAP (amifampridine) first-line; treat SCLC; immunosuppression; IVIg/PLEX",
     "Heptavalent botulinum antitoxin; ventilatory support; do NOT delay for tests",
     "Genetic-guided: pyridostigmine; 3,4-DAP; salbutamol; fluoxetine (slow-channel)",
     "IVIg or plasmapheresis; respiratory monitoring and support",
     "IVIg or plasmapheresis; supportive care",
     "Riluzole / edaravone; multidisciplinary respiratory support; palliative care",
     "Teprotumumab; steroids; orbital decompression; prism glasses",
     "Supportive; ptosis surgery; cricopharyngeal myotomy for dysphagia",
     "CoQ10; pacemaker for cardiac block in Kearns-Sayre; supportive"),
]

# Row 1 - Title
ws.merge_cells(start_row=1, start_column=1, end_row=1, end_column=len(columns))
tc = ws.cell(row=1, column=1)
tc.value = "Differential Diagnosis of Myasthenia Gravis — Comprehensive Comparison Chart"
tc.font = Font(bold=True, color=WHITE, size=14, name="Calibri")
tc.fill = fill(TITLE_BG)
tc.alignment = align(h="center", v="center")
ws.row_dimensions[1].height = 32

# Row 2 - Column headers
for ci, cn in enumerate(columns, start=1):
    cell = ws.cell(row=2, column=ci, value=cn)
    if ci == 1:
        cell.fill = fill(ROW_HEADER)
        cell.font = mkfont(bold=True, color=DARK_FONT, size=10)
    elif ci == 2:
        cell.fill = fill(MG_HEADER)
        cell.font = mkfont(bold=True, color=WHITE, size=10)
    else:
        cell.fill = fill(DIFF_HEADER)
        cell.font = mkfont(bold=True, color=WHITE, size=10)
    cell.alignment = align(h="center", v="center")
    cell.border = border_thin
ws.row_dimensions[2].height = 48

# Data rows
for ri, row_data in enumerate(rows, start=3):
    bg = ALT_ROW1 if (ri % 2 == 0) else ALT_ROW2
    for ci, value in enumerate(row_data, start=1):
        cell = ws.cell(row=ri, column=ci, value=value)
        if ci == 1:
            cell.fill = fill(ROW_HEADER)
            cell.font = mkfont(bold=True, color=DARK_FONT, size=9)
            cell.alignment = align(h="left", v="center")
        else:
            cell.fill = fill(bg)
            v = str(value)
            if v.startswith("YES"):
                cell.font = Font(color="1F6B2E", size=9, name="Calibri")
            elif v.startswith("NO"):
                cell.font = Font(color="C00000", size=9, name="Calibri")
            elif "HALLMARK" in v or "KEY" in v or "HIGHLY SPECIFIC" in v:
                cell.font = Font(color="7030A0", size=9, name="Calibri", bold=True)
            elif v in ("Absent", "Normal", "Normal NCV and amplitudes", "Normal NMJ transmission", "Normal brain/spine imaging"):
                cell.font = Font(color="595959", size=9, name="Calibri")
            else:
                cell.font = mkfont(size=9, color=BLACK)
            cell.alignment = align(h="left", v="center")
        cell.border = border_thin
    ws.row_dimensions[ri].height = 48

# Column widths
widths = [28, 30, 27, 27, 26, 26, 24, 28, 26, 27, 28]
for ci, w in enumerate(widths, start=1):
    ws.column_dimensions[get_column_letter(ci)].width = w

ws.freeze_panes = "B3"

# Legend
lr = len(rows) + 4
ws.merge_cells(start_row=lr, start_column=1, end_row=lr, end_column=len(columns))
leg = ws.cell(row=lr, column=1,
    value=("Legend:  GREEN = Present/Positive   RED = Absent/Negative   PURPLE = Hallmark/Key feature   "
           "NMJ = Neuromuscular Junction   AChR = Acetylcholine Receptor   VGCC = Voltage-Gated Calcium Channel   "
           "CMAP = Compound Muscle Action Potential   SCLC = Small Cell Lung Cancer   "
           "CPEO = Chronic Progressive External Ophthalmoplegia   CMS = Congenital Myasthenic Syndromes   "
           "MFS = Miller Fisher Syndrome   PLEX = Plasma Exchange   IVIg = Intravenous Immunoglobulin   "
           "3,4-DAP = 3,4-Diaminopyridine (Amifampridine)"))
leg.font = Font(italic=True, size=9, color="595959", name="Calibri")
leg.fill = fill("F2F2F2")
leg.alignment = Alignment(horizontal="left", vertical="center", wrap_text=True)
ws.row_dimensions[lr].height = 35

out = "/home/daytona/workspace/mg-differentials/MG_Differentials_Chart.xlsx"
wb.save(out)
print("Saved: " + out)
Running Command

mkdir -p /home/daytona/workspace/mg-differentials && ls /home/daytona/workspace/…

Running Command

ls /home/daytona/workspace/ && ls /home/daytona/workspace/mg-differentials/ 2>/d…

Running Command

ls /home/daytona/ && mkdir -p /home/daytona/workspace && mkdir -p /home/daytona/…

Running Command

ls -la /home/daytona/workspace && mkdir -p /home/daytona/workspace/mg-differenti…

Running Command

python3 -c "import os; print(os.path.exists('/home/daytona/workspace')); print(o…

Running Command

python3 -c "import os; p='/home/daytona/workspace'; print(type(os.stat(p)), os.s…

Running Command

python3 -c "import os; print(os.readlink('/home/daytona/workspace'))"

Running Command

python3 -c " import os, openpyxl from openpyxl.styles import PatternFill, Font, …

Running Command

python3 -c " import os, shutil # find the actual workspace path home = '/home/da…

Running Command

python3 -c " import openpyxl wb = openpyxl.load_workbook('/tmp/mg/MG_Differentia…

The Excel file is complete and valid. Here's your download:

What's in the chart

The spreadsheet contains 28 rows × 11 columns covering:
10 Differentials vs. Myasthenia Gravis:
#Differential
1Myasthenia Gravis (reference column)
2Lambert-Eaton Myasthenic Syndrome (LEMS)
3Botulism
4Congenital Myasthenic Syndromes
5GBS – AIDP
6Miller Fisher Syndrome
7ALS / Motor Neuron Disease
8Thyroid Ophthalmopathy
9Oculopharyngeal Muscular Dystrophy
10Mitochondrial Myopathy (CPEO)
28 Differentiating Parameters: Pathophysiology · Site of lesion · Onset/course · Fatigability · Ptosis · Diplopia/ophthalmoplegia · Pupils · Deep tendon reflexes · Muscle wasting · Fasciculations · Sensory symptoms · Autonomic dysfunction · Preceding trigger · Malignancy association · Proptosis · Ataxia · Babinski/UMN signs · Tongue findings · CSF · Nerve conduction studies · Repetitive nerve stimulation · Specific antibodies/genetics · Response to anticholinesterase · Ice test · Forced duction test · Muscle biopsy · Imaging · Treatment
Formatting: Green = Present/YES · Red = Absent/NO · Purple bold = Hallmark/key feature · Frozen panes (scroll while keeping headers and feature labels visible) · Alternating row shading · Legend at bottom

Remove 9 and 10

Running Command

python3 -c " import openpyxl from openpyxl.styles import PatternFill, Font, Alig…

Running Command

python3 -c " import openpyxl from openpyxl.styles import PatternFill, Font, Alig…

Done. Here's the updated file:
Oculopharyngeal Muscular Dystrophy and Mitochondrial Myopathy (CPEO) have been removed. The chart now has 9 columns — Feature + MG + 7 differentials:
  1. Myasthenia Gravis
  2. Lambert-Eaton Syndrome (LEMS)
  3. Botulism
  4. Congenital Myasthenic Syndromes
  5. GBS (AIDP)
  6. Miller Fisher Syndrome
  7. ALS / Motor Neuron Disease
  8. Thyroid Ophthalmopathy

Generate a quick reference PDF summary of MG vs differentials

Reading File
Running Command

python3 -c " from reportlab.lib import colors from reportlab.lib.pagesizes impor…

Running Command

python3 -c " from pypdf import PdfReader r = PdfReader('/tmp/mg/MG_Quick_Referen…

Running Command

python3 -c " from pypdf import PdfReader r = PdfReader('/tmp/mg/MG_Quick_Referen…

27/28 rows present — "Response to Anticholinesterase" text is there but the row label is truncated differently. All content is accounted for across the 2 pages. The PDF is complete.

What's in the PDF:
  • Page 1 — Full A3 landscape comparison table with all 28 differentiating parameters across MG vs. 7 differentials (LEMS, Botulism, Congenital MG Syndromes, GBS, Miller Fisher Syndrome, ALS/MND, Thyroid Ophthalmopathy)
  • Page 2 — Colour legend + full abbreviations key + source citations
Design features:
  • 🟦 Navy header row with white text
  • 🟩 Green = Present/YES entries
  • 🟥 Red = Absent/NO entries
  • 🟣 Purple bold = Hallmark / key differentiator entries
  • Alternating row shading for readability
  • MG as the anchor reference column
  • Sources cited at bottom (Harrison's 22e, Goldman-Cecil, Adams & Victor 12e, Tintinalli's, Bradley & Daroff, Morgan & Mikhail)
This is a shared conversation. Sign in to Orris to start your own chat.