2  Overview of SM

# Load required libraries
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.2.1     ✔ readr     2.2.0
✔ forcats   1.0.1     ✔ stringr   1.6.0
✔ ggplot2   4.0.3     ✔ tibble    3.3.1
✔ lubridate 1.9.5     ✔ tidyr     1.3.2
✔ purrr     1.2.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(knitr)
library(kableExtra)

Attaching package: 'kableExtra'

The following object is masked from 'package:dplyr':

    group_rows
library(gt)

# Table 1: WHO Classification of Mastocytosis
who_classification <- tibble(
  Category = c("Cutaneous mastocytosis", 
               "Maculopapular CM (MPCM)", 
               "Diffuse CM", 
               "Mastocytoma of skin",
               "Systemic mastocytosis",
               "Non-advanced SM",
               "Advanced SM",
               "Mast cell sarcoma"),
  Subtypes = c("—",
               "Polymorphic/Monomorphic forms",
               "—",
               "—",
               "—",
               "Bone marrow mastocytosis, Indolent SM, Smouldering SM",
               "SM-AHN, Aggressive SM, Mast cell leukaemia",
               "—"),
  `Prevalence (%)` = c(0.01, 0.01, 0.0001, 0.02, 0.005, 0.002, 0.001, "<0.0001"),
  `KIT D816V (%)` = c("—", "20-80", "<10", "Unknown", "—", "80-95", "70-95", "<5")
)

# Table 2: Diagnostic Criteria for SM
sm_criteria <- tibble(
  Type = c("Major criterion",
           rep("Minor criteria", 4)),
  Criteria = c("Multifocal packed aggregates of mast cells (>15 cells per aggregate) in bone marrow and/or extracutaneous organ",
               ">25% of mast cells are atypical (type I or II) in bone marrow smears",
               "KIT-activating point mutation detected in bone marrow or extracutaneous organ",
               "Mast cells express CD2 and/or CD25 and/or CD30",
               "Baseline serum tryptase >20 ng/ml")
)

# Table 3: Mediator-Related Symptoms
mediator_symptoms <- tibble(
  System = c("Skin", "Cardiovascular", "Gastrointestinal", 
             "Bone", "Constitutional", "Neurological"),
  Symptoms = c("Flushing, itching, urticaria",
               "Tachycardia, hypotension, syncope",
               "Diarrhea, nausea, vomiting, cramping, GERD",
               "Osteopenia, osteoporosis, musculoskeletal pain",
               "Fatigue, night sweats, anaphylaxis",
               "Brain fog, depression, headache"),
  Mediators = c("Histamine, PGD2, cysLTs",
                "Histamine, PAF",
                "Histamine, PGD2",
                "RANKL, cytokines",
                "TNF, IL-6, VEGF",
                "Various")
)

# Table 4: SM Variants and Prognosis
sm_variants <- tibble(
  Variant = c("Bone marrow mastocytosis",
              "Indolent SM",
              "Smouldering SM",
              "Aggressive SM",
              "Acute MCL",
              "Chronic MCL"),
  `B-findings` = c("0", "0-1", "2-3", "0-3", "0-3", "0-3"),
  `C-findings` = c("0", "0", "0", "≥1", "≥1", "0"),
  `Mast cells in BM (%)` = c("<5", "<5", "<5", "<5", "≥20", "≥20"),
  Prognosis = c("Excellent", "Excellent", "Intermediate", "Poor", "Very poor", "Poor")
)

# Table 5: Treatment Options
treatment_options <- tibble(
  `Disease Stage` = c("Non-advanced SM",
                      "Non-advanced SM",
                      "Non-advanced SM",
                      "Advanced SM",
                      "Advanced SM"),
  `Treatment Type` = c("Trigger avoidance",
                       "Anti-mediator therapy",
                       "Osteoporosis management",
                       "KIT inhibitors",
                       "Chemotherapy/HSCT"),
  `Specific Treatments` = c("Avoid heat, friction, alcohol, NSAIDs",
                           "H1/H2 blockers, cromolyn, montelukast",
                           "Bisphosphonates, vitamin D, calcium",
                           "Midostaurin, avapritinib",
                           "Cladribine, interferon-α, HSCT"),
  `Key Points` = c("Patient-specific triggers",
                   "Symptom control",
                   "Prevent fractures",
                   "Target KIT D816V mutation",
                   "For resistant disease")
)

# Table 6: KIT Mutations in Mastocytosis
kit_mutations <- tibble(
  `Mutation Type` = c("D816V", "D816A/F/H/I/Y", "Del419", "ITD502-503", 
                      "K509I", "F522C", "V560G"),
  `Location` = c("Kinase domain", "Kinase domain", "Extracellular",
                 "Juxtamembrane", "Extracellular", "Transmembrane",
                 "Juxtamembrane"),
  `Frequency` = c(">80% in SM", "Rare", "10-20% in pediatric CM",
                  "3-5%", "<3%", "<3%", "<3%"),
  `TKI Sensitivity` = c("Resistant to imatinib",
                        "Variable",
                        "May respond to imatinib",
                        "May respond to imatinib",
                        "Unknown",
                        "May respond to imatinib",
                        "May respond to imatinib")
)

# Table 7: Prognostic Scoring Systems
prognostic_scores <- tibble(
  System = c("MAPS", "REMA", "MARS", "GPSM"),
  `Applicable to` = c("Indolent/Smouldering SM",
                      "Indolent SM only",
                      "Advanced SM only",
                      "All SM variants"),
  `Key Parameters` = c("Age ≥60, platelets <150, ALP >ULN, mutations",
                       "Mutations with VAF ≥1%",
                       "S/A/R mutations",
                       "Age, Hb, ALP, tryptase"),
  `Risk Categories` = c("Very low to very high (5 levels)",
                        "Very low to high (4 levels)",
                        "Low/high (2 levels)",
                        "Low/intermediate/high (3 levels)")
)

# Create formatted tables using gt
who_table <- who_classification %>%
  gt() %>%
  tab_header(
    title = "WHO Classification of Mastocytosis",
    subtitle = "Prevalence and KIT D816V mutation frequency"
  ) %>%
  tab_style(
    style = cell_fill(color = "lightblue"),
    locations = cells_body(columns = Category, rows = c(1, 5, 8))
  ) %>%
  fmt_percent(columns = `Prevalence (%)`, decimals = 3, scale_values = FALSE)

criteria_table <- sm_criteria %>%
  gt() %>%
  tab_header(title = "Diagnostic Criteria for Systemic Mastocytosis") %>%
  tab_style(
    style = cell_text(weight = "bold"),
    locations = cells_body(columns = Type, rows = 1)
  )

symptoms_table <- mediator_symptoms %>%
  gt() %>%
  tab_header(
    title = "Mediator-Related Symptoms in Mastocytosis",
    subtitle = "Organized by organ system"
  ) %>%
  tab_style(
    style = cell_fill(color = "#f0f0f0"),
    locations = cells_body(rows = c(1, 3, 5))
  )

variants_table <- sm_variants %>%
  gt() %>%
  tab_header(title = "SM Variants: Clinical Features and Prognosis") %>%
  tab_style(
    style = cell_fill(color = scales::alpha("red", 0.3)),
    locations = cells_body(
      columns = Prognosis,
      rows = Prognosis %in% c("Poor", "Very poor")
    )
  )

treatment_table <- treatment_options %>%
  gt() %>%
  tab_header(title = "Treatment Strategies for Mastocytosis") %>%
  tab_row_group(
    label = "Advanced Disease",
    rows = 4:5
  ) %>%
  tab_row_group(
    label = "Non-advanced Disease",
    rows = 1:3
  )

mutations_table <- kit_mutations %>%
  gt() %>%
  tab_header(
    title = "KIT Mutations in Mastocytosis",
    subtitle = "Location, frequency, and therapeutic implications"
  ) %>%
  tab_style(
    style = cell_fill(color = "yellow", alpha = 0.3),
    locations = cells_body(
      columns = `Mutation Type`,
      rows = 1
    )
  ) %>%
  tab_footnote(
    footnote = "Most common mutation in systemic mastocytosis",
    locations = cells_body(columns = `Mutation Type`, rows = 1)
  )

scores_table <- prognostic_scores %>%
  gt() %>%
  tab_header(title = "Prognostic Scoring Systems in Mastocytosis") %>%
  cols_width(
    System ~ px(100),
    `Applicable to` ~ px(200),
    `Key Parameters` ~ px(300),
    `Risk Categories` ~ px(250)
  )

# Display tables
who_table
WHO Classification of Mastocytosis
Prevalence and KIT D816V mutation frequency
Category Subtypes Prevalence (%) KIT D816V (%)
Cutaneous mastocytosis — 0.01 —
Maculopapular CM (MPCM) Polymorphic/Monomorphic forms 0.01 20-80
Diffuse CM — 1e-04 <10
Mastocytoma of skin — 0.02 Unknown
Systemic mastocytosis — 0.005 —
Non-advanced SM Bone marrow mastocytosis, Indolent SM, Smouldering SM 0.002 80-95
Advanced SM SM-AHN, Aggressive SM, Mast cell leukaemia 0.001 70-95
Mast cell sarcoma — <0.0001 <5
criteria_table
Diagnostic Criteria for Systemic Mastocytosis
Type Criteria
Major criterion Multifocal packed aggregates of mast cells (>15 cells per aggregate) in bone marrow and/or extracutaneous organ
Minor criteria >25% of mast cells are atypical (type I or II) in bone marrow smears
Minor criteria KIT-activating point mutation detected in bone marrow or extracutaneous organ
Minor criteria Mast cells express CD2 and/or CD25 and/or CD30
Minor criteria Baseline serum tryptase >20 ng/ml
symptoms_table
Mediator-Related Symptoms in Mastocytosis
Organized by organ system
System Symptoms Mediators
Skin Flushing, itching, urticaria Histamine, PGD2, cysLTs
Cardiovascular Tachycardia, hypotension, syncope Histamine, PAF
Gastrointestinal Diarrhea, nausea, vomiting, cramping, GERD Histamine, PGD2
Bone Osteopenia, osteoporosis, musculoskeletal pain RANKL, cytokines
Constitutional Fatigue, night sweats, anaphylaxis TNF, IL-6, VEGF
Neurological Brain fog, depression, headache Various
variants_table
SM Variants: Clinical Features and Prognosis
Variant B-findings C-findings Mast cells in BM (%) Prognosis
Bone marrow mastocytosis 0 0 <5 Excellent
Indolent SM 0-1 0 <5 Excellent
Smouldering SM 2-3 0 <5 Intermediate
Aggressive SM 0-3 ≥1 <5 Poor
Acute MCL 0-3 ≥1 ≥20 Very poor
Chronic MCL 0-3 0 ≥20 Poor
treatment_table
Treatment Strategies for Mastocytosis
Disease Stage Treatment Type Specific Treatments Key Points
Non-advanced Disease
Non-advanced SM Trigger avoidance Avoid heat, friction, alcohol, NSAIDs Patient-specific triggers
Non-advanced SM Anti-mediator therapy H1/H2 blockers, cromolyn, montelukast Symptom control
Non-advanced SM Osteoporosis management Bisphosphonates, vitamin D, calcium Prevent fractures
Advanced Disease
Advanced SM KIT inhibitors Midostaurin, avapritinib Target KIT D816V mutation
Advanced SM Chemotherapy/HSCT Cladribine, interferon-α, HSCT For resistant disease
mutations_table
KIT Mutations in Mastocytosis
Location, frequency, and therapeutic implications
Mutation Type Location Frequency TKI Sensitivity
D816V1 Kinase domain >80% in SM Resistant to imatinib
D816A/F/H/I/Y Kinase domain Rare Variable
Del419 Extracellular 10-20% in pediatric CM May respond to imatinib
ITD502-503 Juxtamembrane 3-5% May respond to imatinib
K509I Extracellular <3% Unknown
F522C Transmembrane <3% May respond to imatinib
V560G Juxtamembrane <3% May respond to imatinib
1 Most common mutation in systemic mastocytosis
scores_table
Prognostic Scoring Systems in Mastocytosis
System Applicable to Key Parameters Risk Categories
MAPS Indolent/Smouldering SM Age ≥60, platelets <150, ALP >ULN, mutations Very low to very high (5 levels)
REMA Indolent SM only Mutations with VAF ≥1% Very low to high (4 levels)
MARS Advanced SM only S/A/R mutations Low/high (2 levels)
GPSM All SM variants Age, Hb, ALP, tryptase Low/intermediate/high (3 levels)
# Create a summary statistics table
summary_stats <- tibble(
  Parameter = c("Annual incidence", 
                "Prevalence",
                "Median age at diagnosis",
                "Male:Female ratio",
                "Anaphylaxis lifetime prevalence",
                "Osteoporosis prevalence",
                "5-year mortality (advanced SM)"),
  Value = c("1-10 per 100,000",
            "1-3 per 10,000",
            "~50 years",
            "~1:1",
            "30-40% in SM",
            "~30% in SM",
            "~50%")
)

summary_table <- summary_stats %>%
  gt() %>%
  tab_header(title = "Key Epidemiological Data") %>%
  tab_style(
    style = cell_fill(color = "#e8f4fd"),
    locations = cells_body()
  )

summary_table
Key Epidemiological Data
Parameter Value
Annual incidence 1-10 per 100,000
Prevalence 1-3 per 10,000
Median age at diagnosis ~50 years
Male:Female ratio ~1:1
Anaphylaxis lifetime prevalence 30-40% in SM
Osteoporosis prevalence ~30% in SM
5-year mortality (advanced SM) ~50%