OSCR

A standardized framework resolves ambiguity in motor neuron loss across neurodegenerative diseases.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R · 681 lines · 20 KB · no license

  1. library(tidyverse)
  2. library(meta)
  3. library(metafor)
  4. library(dmetar)
  5. library(openxlsx)
  6. library(esc)
  7. library(data.table)
  8. library(weightr)
  9. library(car)
  10. library(clubSandwich)
  11. library(stringr)
  12. library(patchwork)
  13. library(brms)
  14. library(tidybayes)
  15. library(ggridges)
  16. library(posterior)
  17. library(bayesplot)
  18. library(dplyr)
  19. library(stringr)
  20. library(grid)
  21. library(ggplot2)
  22. # Extraction of data from excel spreadsheet and visualization
  23. sma_comp <- read.xlsx("D7_Raw.xlsx")
  24. glimpse(sma_comp)
  25. view(sma_comp)
  26. # Power Analysis conducted: 54 studies and an estimated 4 animals per group
  27. # Moderate heterogeneity suspected
  28. power.analysis(d = -2.0,
  29. k = 54,
  30. n1 = 4,
  31. n2 = 4,
  32. p = 0.05,
  33. heterogeneity = "moderate")
  34. # Ensuring data is read correctly from excel
  35. sma_comp$First.Author <- trimws(sma_comp$First.Author)
  36. sma_comp$Segment.Taken <- trimws(sma_comp$Segment.Taken)
  37. # Creating effect size with hedges g
  38. escalc_data <- escalc(
  39. measure = "SMD",
  40. m1i = sma_comp$mean.e,
  41. sd1i = sma_comp$sd.e,
  42. n1i = sma_comp$n.e,
  43. m2i = sma_comp$mean.c,
  44. sd2i = sma_comp$sd.c,
  45. n2i = sma_comp$n.c,
  46. data = sma_comp,
  47. vtype = "UB"
  48. )
  49. # Enable L1-L2 to appear appropriately in Multi-Subgroup results instead of intercept
  50. escalc_data$Segment.Taken <- factor(escalc_data$Segment.Taken)
  51. escalc_data$Segment.Taken <- relevel(escalc_data$Segment.Taken, ref = "L1-L2")
  52. # Multilevel analysis created
  53. m.ml.base <- rma.mv(
  54. yi = yi,
  55. V = vi,
  56. random = ~1 | First.Author/Segment.Taken,
  57. method = "REML",
  58. data = escalc_data
  59. )
  60. # Multilevel with Subgroup
  61. m.ml.mod <- rma.mv(
  62. yi = yi,
  63. V = vi,
  64. mods = ~ Segment.Taken,
  65. random = ~1 | First.Author/Segment.Taken,
  66. method = "REML",
  67. data = escalc_data
  68. )
  69. # --- I² Calculation Function for Multilevel rma.mv Models ---
  70. compute_I2_partitioned <- function(model, vi_vector) {
  71. k <- length(vi_vector)
  72. W <- 1 / vi_vector
  73. total_variance <- sum(model$sigma2) + (k / sum(W)) # between + within + sampling
  74. I2_components <- 100 * model$sigma2 / total_variance
  75. names(I2_components) <- names(model$sigma2)
  76. I2_total <- sum(I2_components)
  77. cat("I² Estimates by Level:\n")
  78. for (i in seq_along(I2_components)) {
  79. cat(" -", names(I2_components)[i], ": ", round(I2_components[i], 1), "%\n", sep = "")
  80. }
  81. cat("Total I²: ", round(I2_total, 1), "%\n\n", sep = "")
  82. }
  83. # I² BEFORE moderators
  84. cat("### I² for Base Model (no moderators) ###\n")
  85. compute_I2_partitioned(m.ml.base, escalc_data$vi)
  86. # I² AFTER moderators
  87. cat("### I² for Model with Moderators ###\n")
  88. compute_I2_partitioned(m.ml.mod, escalc_data$vi)
  89. # view multilevel
  90. summary(m.ml.base)
  91. # view multilevel with subgroup test of moderators
  92. summary(m.ml.mod)
  93. # Compare the heterogeneity of multilevel with and without moderators
  94. tau2_base <- sum(m.ml.base$sigma2)
  95. tau2_mod <- sum(m.ml.mod$sigma2)
  96. pseudo_R2 <- 100 * (tau2_base - tau2_mod) / tau2_base
  97. # Comparing the model fit of both models to excel data
  98. logLik(m.ml.base)
  99. logLik(m.ml.mod)
  100. AIC(m.ml.base)
  101. AIC(m.ml.mod)
  102. BIC(m.ml.base)
  103. BIC(m.ml.mod)
  104. # Testing residual heterogeneity
  105. m.ml.base$QE
  106. m.ml.mod$QE
  107. # Likelihood ratio test
  108. anova(m.ml.base, m.ml.mod, refit = TRUE)
  109. # Influence testing with leave-out-one analysis
  110. loo_results <- lapply(1:nrow(escalc_data), function(i) {
  111. dat_loo <- escalc_data[-i, ]
  112. model_loo <- tryCatch(
  113. rma.mv(yi, vi, random = ~1 | First.Author/Segment.Taken, method = "REML", data = dat_loo),
  114. error = function(e) NULL
  115. )
  116. if (!is.null(model_loo)) {
  117. return(c(logLik = as.numeric(logLik(model_loo)), tau2 = model_loo$sigma2[1]))
  118. } else {
  119. return(c(logLik = NA, tau2 = NA))
  120. }
  121. })
  122. loo_df <- as.data.frame(do.call(rbind, loo_results))
  123. loo_df$Study <- escalc_data$First.Author
  124. # Leave-out-one plotted with tau squared
  125. ggplot(loo_df, aes(x = reorder(Study, tau2), y = tau2)) +
  126. geom_point(size = 3, color = "#1f78b4") +
  127. coord_flip() +
  128. labs(
  129. title = "Influence of Studies on Heterogeneity (τ²)",
  130. x = "Study Removed",
  131. y = "Estimated τ² (leave-one-out)"
  132. ) +
  133. theme_minimal(base_size = 13)
  134. # Leave-out-one plotted per study
  135. ggplot(loo_df, aes(x = reorder(Study, logLik), y = logLik)) +
  136. geom_point(size = 3, color = "#e31a1c") +
  137. coord_flip() +
  138. labs(
  139. title = "Influence of Studies on Model Fit (log-likelihood)",
  140. x = "Study Removed",
  141. y = "Log-Likelihood"
  142. ) +
  143. theme_minimal(base_size = 13)
  144. # Running Egger's test with funnel plot
  145. escalc_data$sei <- sqrt(escalc_data$vi)
  146. egger_model <- rma(yi = yi, sei = sei, mods = ~ sei, method = "FE", data = escalc_data)
  147. summary(egger_model)
  148. metafor::funnel(
  149. x = escalc_data$yi,
  150. sei = sqrt(escalc_data$vi),
  151. main = "Funnel Plot (Multilevel Model)",
  152. xlab = "Effect Size (Hedges' g)",
  153. ylab = "Standard Error"
  154. )
  155. ###Comparison of spinal segments to each other###
  156. # Pairwise comparisons between L1-L2 and other segments
  157. linearHypothesis(m.ml.mod, "Segment.TakenL3-L6 = 0") # L1-L2 vs L3-L6
  158. linearHypothesis(m.ml.mod, "Segment.TakenL5 Med = 0") # L1-L2 vs L5 Med
  159. linearHypothesis(m.ml.mod, "Segment.TakenLumbar = 0") # L1-L2 vs Lumbar
  160. # Comparisons between other non-reference segments
  161. linearHypothesis(m.ml.mod, "Segment.TakenL3-L6 = Segment.TakenL5 Med") # L3-L6 vs L5 Med
  162. linearHypothesis(m.ml.mod, "Segment.TakenL3-L6 = Segment.TakenLumbar") # L3-L6 vs Lumbar
  163. linearHypothesis(m.ml.mod, "Segment.TakenL5 Med = Segment.TakenLumbar") # L5 Med vs Lumbar
  164. # Creating a plot for Linear Hypothesis comparison
  165. contrast_list <- list(
  166. "L1-L2 vs L3-L6" = "Segment.TakenL3-L6 = 0",
  167. "L1-L2 vs L5 Med" = "Segment.TakenL5 Med = 0",
  168. "L1-L2 vs Lumbar" = "Segment.TakenLumbar = 0",
  169. "L3-L6 vs L5 Med" = "Segment.TakenL3-L6 = Segment.TakenL5 Med",
  170. "L3-L6 vs Lumbar" = "Segment.TakenL3-L6 = Segment.TakenLumbar",
  171. "L5 Med vs Lumbar" = "Segment.TakenL5 Med = Segment.TakenLumbar"
  172. )
  173. # Extract p-values from each contrast
  174. contrast_df <- purrr::map_dfr(names(contrast_list), function(name) {
  175. res <- linearHypothesis(m.ml.mod, contrast_list[[name]])
  176. data.frame(
  177. Comparison = name,
  178. Chisq = res$Chisq[2],
  179. pval = res$`Pr(>Chisq)`[2]
  180. )
  181. })
  182. # Split into pairs for plotting
  183. contrast_df <- contrast_df %>%
  184. separate(Comparison, into = c("Segment1", "Segment2"), sep = " vs ") %>%
  185. mutate(Significant = ifelse(pval < 0.05, "*", ""))
  186. # Plot as heatmap
  187. ggplot(contrast_df, aes(x = Segment1, y = Segment2, fill = pval)) +
  188. geom_tile(color = "white") +
  189. geom_text(aes(label = paste0("p=", round(pval, 3), Significant)), size = 4) +
  190. scale_fill_gradient(low = "#f7fbff", high = "#08306b", name = "p-value") +
  191. theme_minimal(base_size = 14) +
  192. labs(title = "Pairwise Comparisons Between Spinal Segments",
  193. x = NULL, y = NULL)
  194. #### Printing the Forest Plot####
  195. # Load and prepare data
  196. sma_comp <- read.xlsx("D7_Raw.xlsx")
  197. sma_comp <- sma_comp[, !duplicated(names(sma_comp))]
  198. sma_comp$First.Author <- trimws(sma_comp$First.Author)
  199. sma_comp$Segment.Taken <- trimws(sma_comp$Segment.Taken)
  200. # Plain year (no superscript)
  201. sma_comp$AuthorName <- word(sma_comp$First.Author, 1)
  202. sma_comp$AuthorYear <- str_extract(sma_comp$First.Author, "\\d{4}")
  203. sma_comp$StudyLabel <- paste0(sma_comp$AuthorName, " ", sma_comp$AuthorYear)
  204. # Compute effect sizes
  205. escalc_data <- escalc(
  206. measure = "SMD",
  207. m1i = sma_comp$mean.e,
  208. sd1i = sma_comp$sd.e,
  209. n1i = sma_comp$n.e,
  210. m2i = sma_comp$mean.c,
  211. sd2i = sma_comp$sd.c,
  212. n2i = sma_comp$n.c,
  213. data = sma_comp,
  214. vtype = "UB"
  215. )
  216. sma_comp$yi <- escalc_data$yi
  217. sma_comp$vi <- escalc_data$vi
  218. sma_comp$se <- sqrt(sma_comp$vi)
  219. library(grid)
  220. plot_segment_forest <- function(segment_name) {
  221. segment_data <- sma_comp %>%
  222. filter(Segment.Taken == segment_name) %>%
  223. droplevels()
  224. # Run meta-analysis
  225. meta_obj <- metagen(
  226. TE = segment_data$yi,
  227. seTE = segment_data$se,
  228. studlab = segment_data$StudyLabel,
  229. sm = "SMD",
  230. method.tau = "REML",
  231. method.random.ci = "HK",
  232. common = FALSE,
  233. random = TRUE
  234. )
  235. # Create formatted SMD + CI string
  236. ci_labels <- sprintf("%.2f [%.2f, %.2f]",
  237. meta_obj$TE,
  238. meta_obj$lower,
  239. meta_obj$upper)
  240. meta_obj$SMD_CI <- ci_labels
  241. # Open new graphics device
  242. dev.new(width = 12, height = 10)
  243. # Suppress heterogeneity stats from forest() and print only study info
  244. forest(
  245. meta_obj,
  246. layout = "JAMA",
  247. common = FALSE,
  248. random = TRUE,
  249. print.byvar = FALSE,
  250. print.I2 = FALSE, # suppress default
  251. print.Q = FALSE,
  252. print.tau2 = FALSE,
  253. xlim = c(-20, 5),
  254. at = seq(-20, 5, by = 5),
  255. xlab = "Hedges' g (95% CI)",
  256. col.square = "black",
  257. col.diamond = "blue",
  258. col.diamond.lines = "black",
  259. fontsize = 9,
  260. leftcols = c("studlab", "SMD_CI"),
  261. leftlabs = c("Study", "SMD [95% CI]"),
  262. rightcols = FALSE
  263. )
  264. # Add main title
  265. grid::grid.text(
  266. label = paste("Segment:", segment_name),
  267. x = unit(0.5, "npc"),
  268. y = unit(0.98, "npc"),
  269. gp = grid::gpar(fontsize = 18, fontface = "bold")
  270. )
  271. # Add heterogeneity stats manually at consistent font size
  272. het_text <- sprintf(
  273. "Heterogeneity: I² = %.1f%%, τ² = %.2f, Q = %.2f (df = %d, p = %.3f)",
  274. meta_obj$I2, meta_obj$tau2, meta_obj$Q, meta_obj$df.Q, meta_obj$pval.Q
  275. )
  276. grid::grid.text(
  277. label = het_text,
  278. x = unit(0.02, "npc"),
  279. y = unit(0.02, "npc"),
  280. just = "left",
  281. gp = grid::gpar(fontsize = 9)
  282. )
  283. }
  284. # Run plots (one by one to view clearly)
  285. plot_segment_forest("Lumbar")
  286. plot_segment_forest("L1-L2")
  287. plot_segment_forest("L3-L6")
  288. plot_segment_forest("L5 Med")
  289. #### Summary Effect Graph (Formatted Like Forest Plots) ####
  290. library(meta)
  291. library(openxlsx)
  292. library(metafor)
  293. library(dplyr)
  294. library(ggplot2)
  295. library(grid)
  296. # Load and prepare data
  297. sma_comp <- read.xlsx("D7_Raw.xlsx")
  298. sma_comp <- sma_comp[, !duplicated(names(sma_comp))]
  299. sma_comp$Segment.Taken <- trimws(sma_comp$Segment.Taken)
  300. # Compute effect sizes
  301. escalc_data <- escalc(
  302. measure = "SMD",
  303. m1i = sma_comp$mean.e,
  304. sd1i = sma_comp$sd.e,
  305. n1i = sma_comp$n.e,
  306. m2i = sma_comp$mean.c,
  307. sd2i = sma_comp$sd.c,
  308. n2i = sma_comp$n.c,
  309. data = sma_comp,
  310. vtype = "UB"
  311. )
  312. sma_comp$yi <- escalc_data$yi
  313. sma_comp$vi <- escalc_data$vi
  314. sma_comp$se <- sqrt(escalc_data$vi)
  315. # Segment-wise meta-analysis
  316. segment_summaries <- sma_comp %>%
  317. group_by(Segment.Taken) %>%
  318. group_map(~ {
  319. meta_obj <- metagen(
  320. TE = .x$yi,
  321. seTE = .x$se,
  322. sm = "SMD",
  323. method.tau = "REML",
  324. method.random.ci = "HK",
  325. studlab = .x$First.Author
  326. )
  327. data.frame(
  328. Segment = unique(.x$Segment.Taken),
  329. TE = meta_obj$TE.random,
  330. lower = meta_obj$lower.random,
  331. upper = meta_obj$upper.random,
  332. I2 = meta_obj$I2,
  333. tau2 = meta_obj$tau2,
  334. Q = meta_obj$Q,
  335. df = meta_obj$df.Q,
  336. p = meta_obj$pval.Q
  337. )
  338. }, .keep = TRUE) %>%
  339. bind_rows()
  340. # Order and label segments
  341. segment_summaries$Segment <- factor(segment_summaries$Segment,
  342. levels = c("L1-L2", "L3-L6", "L5 Med", "Lumbar"))
  343. # Format heterogeneity stats
  344. segment_summaries$Heterogeneity <- sprintf(
  345. "I² = %.1f%%, τ² = %.2f\nQ = %.2f (df = %d, p = %.3f)",
  346. segment_summaries$I2,
  347. segment_summaries$tau2,
  348. segment_summaries$Q,
  349. segment_summaries$df,
  350. segment_summaries$p
  351. )
  352. # Start plot
  353. ggplot(segment_summaries, aes(x = Segment, y = TE)) +
  354. geom_point(size = 4, shape = 15) +
  355. geom_errorbar(aes(ymin = lower, ymax = upper), width = 0.15) +
  356. geom_hline(yintercept = 0, linetype = "dashed", color = "gray40") +
  357. geom_text(aes(y = lower - 0.6, label = Heterogeneity), hjust = 0.5, size = 3.6) +
  358. coord_flip(clip = "off") +
  359. labs(
  360. title = "Summary Effect Sizes by Spinal Segment",
  361. y = "Hedges' g (95% CI)",
  362. x = NULL
  363. ) +
  364. theme_minimal(base_size = 14) +
  365. theme(
  366. plot.margin = margin(10, 20, 30, 10),
  367. axis.text.y = element_text(size = 10)
  368. ) +
  369. ylim(min(segment_summaries$lower) - 1.8,
  370. max(segment_summaries$upper) + 0.6)
  371. ### Bayesian Analysis due to wide I² confidence Interval ###
  372. # Ensure factors are set appropriately
  373. # Ensure Segment.Taken is properly factored (should already be done)
  374. escalc_data$Segment.Taken <- factor(escalc_data$Segment.Taken)
  375. escalc_data$Segment.Taken <- relevel(escalc_data$Segment.Taken, ref = "L1-L2")
  376. # Fit Bayesian multilevel model
  377. brm_model <- brm(
  378. formula = yi | se(sqrt(vi)) ~ 0 + Segment.Taken + (1 | First.Author/Segment.Taken),
  379. data = escalc_data,
  380. prior = c(
  381. prior(normal(0, 2), class = "b"),
  382. prior(cauchy(0, 1), class = "sd")
  383. ),
  384. sample_prior = "yes",
  385. iter = 4000,
  386. warmup = 1000,
  387. chains = 4,
  388. cores = 4,
  389. control = list(adapt_delta = 0.99),
  390. backend = "rstan",
  391. file = "brm_model_fit"
  392. )
  393. # View summary of Bayesian model
  394. summary(brm_model)
  395. # Compute pairwise contrasts (posterior distributions)
  396. pairwise_contrasts <- hypothesis(brm_model, c(
  397. "Segment.TakenL3ML6 - Segment.TakenL1ML2 = 0",
  398. "Segment.TakenL5Med - Segment.TakenL1ML2 = 0",
  399. "Segment.TakenLumbar - Segment.TakenL1ML2 = 0",
  400. "Segment.TakenL3ML6 - Segment.TakenL5Med = 0",
  401. "Segment.TakenL3ML6 - Segment.TakenLumbar = 0",
  402. "Segment.TakenL5Med - Segment.TakenLumbar = 0"
  403. ))
  404. print(pairwise_contrasts, digits = 3)
  405. # Extract posterior draws for I² calculation and heterogeneity plots
  406. posterior_draws <- as_draws_df(brm_model)
  407. # Save posterior draws to file for later use in posterior probability step
  408. saveRDS(posterior_draws, file = "brms_bayesian_model_output.rds")
  409. # Compute posterior probabilities from draws
  410. post_probs <- posterior_draws %>%
  411. transmute(
  412. diff_L3_vs_L1 = b_Segment.TakenL3ML6 - b_Segment.TakenL1ML2,
  413. diff_L5_vs_L1 = b_Segment.TakenL5Med - b_Segment.TakenL1ML2,
  414. diff_Lumbar_vs_L1 = b_Segment.TakenLumbar - b_Segment.TakenL1ML2,
  415. diff_L3_vs_L5 = b_Segment.TakenL3ML6 - b_Segment.TakenL5Med,
  416. diff_L3_vs_Lumbar = b_Segment.TakenL3ML6 - b_Segment.TakenLumbar,
  417. diff_L5_vs_Lumbar = b_Segment.TakenL5Med - b_Segment.TakenLumbar
  418. ) %>%
  419. summarise(
  420. `P(L3-L6 > L1-L2)` = mean(diff_L3_vs_L1 > 0),
  421. `P(L5 Med > L1-L2)` = mean(diff_L5_vs_L1 > 0),
  422. `P(Lumbar > L1-L2)` = mean(diff_Lumbar_vs_L1 > 0),
  423. `P(L3-L6 > L5 Med)` = mean(diff_L3_vs_L5 > 0),
  424. `P(L3-L6 > Lumbar)` = mean(diff_L3_vs_Lumbar > 0),
  425. `P(L5 Med > Lumbar)` = mean(diff_L5_vs_Lumbar > 0)
  426. )
  427. # Print posterior probabilities
  428. print(post_probs, digits = 3)
  429. # Plot posterior means and 95% CrI per segment
  430. brm_model %>%
  431. spread_draws(b_Segment.TakenL1ML2, b_Segment.TakenL3ML6, b_Segment.TakenL5Med, b_Segment.TakenLumbar) %>%
  432. pivot_longer(cols = everything(), names_to = "Segment", values_to = "Estimate") %>%
  433. mutate(Segment = dplyr::recode(Segment,
  434. "b_Segment.TakenL1ML2" = "L1-L2",
  435. "b_Segment.TakenL3ML6" = "L3-L6",
  436. "b_Segment.TakenL5Med" = "L5 Med",
  437. "b_Segment.TakenLumbar" = "Lumbar"
  438. )) %>%
  439. group_by(Segment) %>%
  440. summarise(
  441. Mean = mean(Estimate),
  442. Lower = quantile(Estimate, 0.025),
  443. Upper = quantile(Estimate, 0.975),
  444. .groups = "drop"
  445. ) %>%
  446. ggplot(aes(x = Segment, y = Mean)) +
  447. geom_point(size = 4) +
  448. geom_errorbar(aes(ymin = Lower, ymax = Upper), width = 0.2) +
  449. geom_hline(yintercept = 0, linetype = "dashed", color = "gray40") +
  450. coord_flip() +
  451. labs(
  452. title = "Bayesian Posterior Estimates by Spinal Segment",
  453. y = "Posterior Mean (95% Credible Interval)",
  454. x = NULL
  455. ) +
  456. theme_minimal(base_size = 14)
  457. ###Figure for Segment Moderator###
  458. library(knitr)
  459. data <- data.frame(
  460. Segment = c("L1-L2", "L5 Med", "Lumbar", "L3-L6"),
  461. Effect_Size = c(-3.91, -2.83, -2.07, -1.91),
  462. CI = c("[-4.68, -3.13]", "[-4.05, -1.60]", "[-2.95, -1.20]", "[-2.70, -1.03]"),
  463. SE = c(0.39, 0.62, 0.44, 0.50),
  464. Comparison = c("–", "0.083", "<.0001", "<.0001")
  465. )
  466. kable(data, align = "c", col.names = c("Segment", "Effect Size", "95% CI", "SE", "Pairwise Comparison"))
  467. ###3PSM not used due to groupings having smaller study sizes###
  468. ##Test 3PSM with step adjustments##
  469. # Ensure p-values are calculated
  470. escalc_data$sei <- sqrt(escalc_data$vi)
  471. escalc_data$pval <- 2 * (1 - pnorm(abs(escalc_data$yi / escalc_data$sei)))
  472. steps = c(0.05, 1)
  473. segment_summaries <- sma_comp %>%
  474. group_by(Segment.Taken) %>%
  475. group_map(~ {
  476. meta_obj <- metagen(
  477. TE = .x$yi,
  478. seTE = .x$se,
  479. sm = "SMD",
  480. method.tau = "REML",
  481. method.random.ci = "HK",
  482. studlab = .x$First.Author
  483. )
  484. data.frame(
  485. Segment = unique(.x$Segment.Taken),
  486. g = meta_obj$TE.random,
  487. lower = meta_obj$lower.random,
  488. upper = meta_obj$upper.random,
  489. I2 = meta_obj$I2,
  490. Q = round(meta_obj$Q, 2),
  491. pval = format.pval(meta_obj$pval.Q, digits = 3, eps = .001),
  492. CI = paste0("[", round(meta_obj$lower.random, 2), ", ", round(meta_obj$upper.random, 2), "]")
  493. )
  494. }, .keep = TRUE) %>%
  495. bind_rows()
  496. # Order levels
  497. segment_summaries$Segment <- factor(segment_summaries$Segment, levels = c("L1-L2", "L3-L6", "L5 Med", "Lumbar"))
  498. # Create label for under-y-axis text
  499. segment_summaries$LabelText <- paste0("I² = ", round(segment_summaries$I2, 1), "%\nCI = ", segment_summaries$CI, "\nQ = ", segment_summaries$Q, ", p = ", segment_summaries$pval)
  500. # Plot
  501. library(ggplot2)
  502. grid::grid.newpage()
  503. ggplot(segment_summaries, aes(x = Segment, y = g)) +
  504. geom_point(size = 4, color = "#1f78b4") +
  505. geom_errorbar(aes(ymin = lower, ymax = upper), width = 0.15, color = "#1f78b4") +
  506. geom_hline(yintercept = 0, linetype = "dashed", color = "gray40") +
  507. coord_flip(clip = "off") +
  508. labs(
  509. title = "Summary Effect Sizes by Spinal Segment",
  510. x = NULL,
  511. y = "Hedges' g (95% CI)"
  512. ) +
  513. # Add text below segment label
  514. geom_text(aes(x = Segment, y = min(lower) - 0.5, label = LabelText),
  515. hjust = 0, vjust = 1, size = 4.2) +
  516. theme_minimal(base_size = 14) +
  517. theme(
  518. plot.margin = margin(10, 30, 40, 10),
  519. axis.text.y = element_text(margin = margin(r = 20))
  520. ) +
  521. ylim(min(segment_summaries$lower) - 1.2, max(segment_summaries$upper) + 0.5)
  522. # Get unique segment groups
  523. segments <- unique(escalc_data$Segment.Taken)
  524. # Define a function to run 3PSM on a single subgroup
  525. run_3psm <- function(data, segment_name) {
  526. model <- tryCatch({
  527. weightfunct(
  528. effect = data$yi,
  529. v = data$vi,
  530. steps = c(0.01, 0.05, 1),
  531. table = TRUE
  532. )
  533. }, error = function(e) return(NULL))
  534. if (!is.null(model)) {
  535. data.frame(
  536. Segment = segment_name,
  537. Unadj_Est = round(model$unadj_est[1], 3),
  538. Unadj_CI = paste0("[", round(model$ci.lb_unadj[1], 3), ", ", round(model$ci.ub_unadj[1], 3), "]"),
  539. Unadj_p = signif(model$p_unadj[1], 3),
  540. Adj_Est = round(model$adj_est[1], 3),
  541. Adj_CI = paste0("[", round(model$ci.lb_adj[1], 3), ", ", round(model$ci.ub_adj[1], 3), "]"),
  542. Adj_p = signif(model$p_adj[1], 3)
  543. )
  544. } else {
  545. data.frame(
  546. Segment = segment_name,
  547. Unadj_Est = NA, Unadj_CI = NA, Unadj_p = NA,
  548. Adj_Est = NA, Adj_CI = NA, Adj_p = NA
  549. )
  550. }
  551. }
  552. # Loop over segments and run 3PSM per group
  553. results_list <- lapply(segments, function(seg) {
  554. group_data <- subset(escalc_data, Segment.Taken == seg)
  555. run_3psm(group_data, seg)
  556. })
  557. # Combine all results into a data frame
  558. results_df <- do.call(rbind, results_list)
  559. # View results
  560. print(results_df)

D7_Final.R at commit 79120b4, no license · at the source

Overview

Authors: Leonie Sowoidnich1, Aaron L Norman1, Florian Gerstner1, Josiane K Siemund1, Jannik M Buettner1, John G Pagiazitis2,3, Vanessa Dreilich1, Konstantin Pilz1, Dajun Tian4, Charlotte J Sumner5,6,7, Angela Paradis4, George Z Mentis2,3, Christian M Simon1
  1. Carl-Ludwig-Institute for Physiology, Leipzig University, 04103 Leipzig, Germany
  2. Center for Motor Neuron Biology and Disease, Columbia University, New York, NY 10032 USA
  3. Depts. of Pathology and Cell Biology and Neurology, Columbia University, New York, NY 10032 USA
  4. Biogen, Cambridge, MA 02142 USA
  5. Department of Neurology, Johns Hopkins University School of Medicine, Baltimore, MD 21205 USA
  6. Department of Neuroscience, Johns Hopkins University School of Medicine, Baltimore, MD 21205 USA
  7. Department of Genetic Medicine, Johns Hopkins University School of Medicine, Baltimore, MD 21218 USA
Institutions: Leipzig University (Germany); Columbia University (United States); Biogen (United States) (United States); Johns Hopkins University (United States); Johns Hopkins Medicine (United States)
Journal: Acta neuropathologica communications, volume 14, issue 1, article 182
Dates: received 23 April 2026; accepted 14 August 2026; published online 1 September 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1186/s40478-026-02415-7 · PMID 42681667 · PMCID PMC13536862 · OpenAlex W7154965075
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: human (organism), mouse (organism), other condition (population), methods / tools (subfield)
Methods: Spectral & time-frequency, Statistics
Keywords: Motor neuron quantification, Neurodegeneration, Motor neuron diseases, Spinal muscular atrophy, Amyotrophic lateral sclerosis, Spinal cord, SMN∆7, SOD1-G93A, 4-copy SMN2 Type III-like SMA
MeSH: Motor Neurons*, Neurodegenerative Diseases*, Spinal Cord*, Animals, Disease Models, Animal, Humans, Mice, Muscular Atrophy, Spinal (* major topic)
Topic: Neurogenetic and Muscular Disorders Research (Genetics, Medicine), according to OpenAlex
Funding: Universität Leipzig
Citations: not cited yet (Europe PMC); 83 references in the paper

Abstract

Motor neuron (MN) loss is a hallmark of neurodegenerative disorders, yet its assessment remains variable, confounding mechanistic and therapeutic interpretation. To address this, we conducted a systematic review and meta-analysis of spinal muscular atrophy (SMA) mouse studies, revealing 60% variability in reported MN loss, for which spinal cord sampling emerged as a major contributor. Using a whole-segment approach with tissue clearing, MN tracing, and multimodal imaging, we confirmed segment-dependent differences in MN counts. Common MN markers (SMI-32, Nissl) lacked specificity, whereas choline acetyltransferase (ChAT) provided robust labeling in murine and human spinal cords. Deep learning–based whole-mount segmentation enabled unbiased MN quantification and validated manual counts. Integrating analysis with computational modeling established segment sampling as a key driver of variability and revealed degeneration patterns: widespread MN loss in amyotrophic lateral sclerosis (ALS), selective MN loss in severe SMA, and preservation in mild SMA models. These findings establish a framework for reproducible MN quantification.

Supplementary Information: The online version contains supplementary material available at https://doi.org/10.1186/s40478-026-02415-7.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above.

a-l-norman/SMN-delta-7-meta-analysis-R-code

License: none: the authors keep all their rights
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: 79120b41bbcedcc82d5dfb239b7425463a4f8bbd, 10 July 2026
Languages: R (1)
Size: 3 files, 1 script
Software Heritage: not archived
Found in: the text, “Subgroup analysis and multilevel analysis”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: brms (1 file), car (1 file), data.table (1 file), ggplot2 (1 file), metafor (1 file), patchwork (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
2 files

GerstnerF/Counting-Simulation

License: none: the authors keep all their rights
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: bd5b07a6bcc34bedda102d6283df2aa8594e9bce, 16 April 2026
Languages: R (1)
Size: 2 files, 1 script
Software Heritage: not archived
Found in: the text, “Randomization approach for sampling from spinal ”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
2 files

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 2 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data availability

The authors confirm that the data supporting the findings of this study are available within the article and its Supplementary material. Some data are not publicly available owing to patient-related restrictions, because they contain information that could compromise the privacy of research participants. Additionally, certain derived data from mouse experiments are available from the corresponding authors upon reasonable request.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 13 authors, 9 keywords, 8 MeSH terms, 1 funder, 83 references.

Cite

This paper

Sowoidnich, L., Norman, A. L., Gerstner, F., Siemund, J. K., Buettner, J. M., Pagiazitis, J. G., Dreilich, V., Pilz, K., Tian, D., Sumner, C. J., Paradis, A., Mentis, G. Z., & Simon, C. M. (2026). A standardized framework resolves ambiguity in motor neuron loss across neurodegenerative diseases. Acta neuropathologica communications, 14(1), 182. https://doi.org/10.1186/s40478-026-02415-7

BibTeX

@article{sowoidnich2026standardized,
author = {Sowoidnich, Leonie and Norman, Aaron L and Gerstner, Florian and Siemund, Josiane K and Buettner, Jannik M and Pagiazitis, John G and Dreilich, Vanessa and Pilz, Konstantin and Tian, Dajun and Sumner, Charlotte J and Paradis, Angela and Mentis, George Z and Simon, Christian M},
title = {{A standardized framework resolves ambiguity in motor neuron loss across neurodegenerative diseases}},
journal = {Acta neuropathologica communications},
year = {2026},
month = sep,
volume = {14},
number = {1},
pages = {182},
publisher = {BMC},
issn = {2051-5960},
doi = {10.1186/s40478-026-02415-7},
url = {https://doi.org/10.1186/s40478-026-02415-7},
pmid = {42681667},
pmcid = {PMC13536862}
}

RIS

TY - JOUR
AU - Sowoidnich, Leonie
AU - Norman, Aaron L
AU - Gerstner, Florian
AU - Siemund, Josiane K
AU - Buettner, Jannik M
AU - Pagiazitis, John G
AU - Dreilich, Vanessa
AU - Pilz, Konstantin
AU - Tian, Dajun
AU - Sumner, Charlotte J
AU - Paradis, Angela
AU - Mentis, George Z
AU - Simon, Christian M
TI - A standardized framework resolves ambiguity in motor neuron loss across neurodegenerative diseases
T2 - Acta neuropathologica communications
J2 - Acta Neuropathol Commun
PY - 2026
DA - 2026/09/01
VL - 14
IS - 1
SP - 182
SN - 2051-5960
PB - BMC
DO - 10.1186/s40478-026-02415-7
UR - https://doi.org/10.1186/s40478-026-02415-7
LA - en
ER -

CSL-JSON

{
"id": "10.1186/s40478-026-02415-7",
"type": "article-journal",
"title": "A standardized framework resolves ambiguity in motor neuron loss across neurodegenerative diseases",
"container-title": "Acta neuropathologica communications",
"author": [
{
"family": "Sowoidnich",
"given": "Leonie"
},
{
"family": "Norman",
"given": "Aaron L"
},
{
"family": "Gerstner",
"given": "Florian"
},
{
"family": "Siemund",
"given": "Josiane K"
},
{
"family": "Buettner",
"given": "Jannik M"
},
{
"family": "Pagiazitis",
"given": "John G"
},
{
"family": "Dreilich",
"given": "Vanessa"
},
{
"family": "Pilz",
"given": "Konstantin"
},
{
"family": "Tian",
"given": "Dajun"
},
{
"family": "Sumner",
"given": "Charlotte J"
},
{
"family": "Paradis",
"given": "Angela"
},
{
"family": "Mentis",
"given": "George Z"
},
{
"family": "Simon",
"given": "Christian M"
}
],
"container-title-short": "Acta Neuropathol Commun",
"volume": "14",
"issue": "1",
"page": "182",
"DOI": "10.1186/s40478-026-02415-7",
"PMID": "42681667",
"PMCID": "PMC13536862",
"ISSN": "2051-5960",
"publisher": "BMC",
"URL": "https://doi.org/10.1186/s40478-026-02415-7",
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
1
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1016/j.cell.2026.05.047 [code]
An emergent disease-associated motor neuron state precedes cell death in ALS.
Journal: Cell
In common: ggplot2, tidyverse, other condition, mouse, 5 references
[2] doi:10.1016/j.celrep.2026.117505 [code]
Impaired spatial coding and neuronal hyperactivity in the medial entorhinal cortex of aged APP knock-in mice.
Journal: Cell reports
In common: metafor, brms, car, 3 other tools, mouse
[3] doi:10.1038/s41467-026-73865-9 [code]
Histamine shapes the neurocomputational dynamics of human learning.
Journal: Nature communications
In common: metafor, brms, car, 3 other tools
[4] doi:10.1038/s41467-026-73545-8
Long-term comparative analysis of AAV9-mediated gene replacement therapies for spinal muscular atrophy in mice.
Journal: Nature communications
In common: other condition, mouse, 5 references
[5] doi:10.1038/s12276-026-01689-0
Haloperidol induces neuroprotection and enhances neuromuscular function in both murine and human models of spinal muscular atrophy.
Journal: Experimental & molecular medicine
In common: other condition, mouse, 5 references
[6] doi:10.1162/opmi.a.372 [code]
Broadening the Agent Preference Hypothesis Through Experiencers: Eye-Tracking and EEG Evidence of Proto-Agents and Proto-Patients.
Journal: Open mind : discoveries in cognitive science
In common: brms, car, data.table, 3 other tools
[7] doi:10.1093/braincomms/fcag146 [code]
Convergent structural brain alterations in chronic pain: a multi-metric individual participant data meta-analysis.
Journal: Brain communications
In common: metafor, car, data.table, 2 other tools
[8] doi:10.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: brms, data.table, patchwork, 2 other tools, mouse
[9] doi:10.1523/eneuro.0076-26.2026 [code]
Exogenously Driven Neural Reactivation of Spatially Matching Visual Working-Memory Contents.
Journal: eNeuro
In common: brms, car, data.table, 2 other tools
[10] doi:10.1016/j.isci.2026.116747 [code]
Age and loneliness relate to reduced trust learning and alterations in amygdala function.
Journal: iScience
In common: brms, car, patchwork, 2 other tools

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.