OSCR

Substantial evidence against sex differences in bed nucleus of the stria terminalis volume in the human brain.

Code ↔ Paper

9 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 9 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
  1. [1] § Methods › Bayesian model specification › Prior choice ↔ scripts/02_create_prior_table.R, lines 1 to 30 · score 0.79 · derived Cohen, linear models, covariate adjusted, male female, bootstrap, residual · Report a mismatch
  2. [2] § Results › Bayesian model results suggest substantial evidence in favour of no sex difference in total BNST volume ↔ scripts/03_fit_bilateral_model.R, lines 166 to 233 · score 0.72 · posterior predictive check, Savage Dickey, BNST volume sex, BF, fitted, residualisation · Report a mismatch
  3. [3] § Methods › Bayesian model specification › Specifying the model ↔ scripts/05_unilateral_sensitivity_and_descriptives.R, lines 40 to 61 · score 0.69 · MZ twins, twin pairing, MZ pair, genetically, siblings, monozygotic · Report a mismatch
  4. [4] § Methods › The Young Adults Human Connectome Project ↔ scripts/05_unilateral_sensitivity_and_descriptives.R, lines 40 to 61 · score 0.66 · twin siblings, twin pairs, Demographic, unrelated, genetic, monozygotic · Report a mismatch
  5. [5] § Methods › Bayesian model specification › Prior choice ↔ scripts/02_create_prior_table.R, lines 245 to 292 · score 0.63 · HCP Young Adult, female participants, split, Guma, sex · Report a mismatch
  6. [6] § Methods › Size calculations ↔ scripts/00_calculate_tbv_from_fast_pves.R, lines 69 to 81 · score 0.61 · FAST tissue, partial volume, voxels, summing, TBV, mm3 · Report a mismatch
  7. [7] § Methods › Bayesian model specification › Specifying the model ↔ scripts/_common.R, lines 163 to 246 · score 0.58 · MZ twins, MZ pair, intercepts, monozygotic, family, model · Report a mismatch
  8. [8] § Methods › Bayesian model specification › Specifying the model ↔ scripts/03_fit_bilateral_model.R, lines 235 to 274 · score 0.56 · Bayes factor, Savage Dickey, density, posterior, model, sex · Report a mismatch
  9. [9] § Methods › Size calculations ↔ scripts/01_extract_bnst_volumes.R, the whole file · a weak match · score 0.51 · right BNST volumes, hemisphere, mask, voxels, summing, mm3 · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R · 440 lines · 19 KB · MIT · 2 matches

  1. # Reconstruct literature effect sizes, pool them, and examine prior sensitivity.
  2. args <- commandArgs(FALSE)
  3. file_arg <- args[grepl("^--file=", args)]
  4. this_file <- if (length(file_arg) > 0) sub("^--file=", "", file_arg[1]) else "scripts/02_create_prior_table.R"
  5. this_file <- gsub("~+~", " ", this_file, fixed = TRUE)
  6. source(file.path(dirname(normalizePath(this_file)), "_common.R"))
  7. root <- find_repo_root(script_dir())
  8. require_packages(c("dplyr", "metafor"))
  9. prior_dir <- file.path(root, "data", "prior_sources")
  10. results_dir <- file.path(root, "results")
  11. figures_dir <- file.path(root, "figures")
  12. ensure_dir(results_dir)
  13. ensure_dir(figures_dir)
  14. n_boot <- read_integer_arg("n_boot", 5000, minimum = 2)
  15. guma_participant_file <- read_arg("guma_participant_file")
  16. guma_adjusted_file <- read_arg("guma_adjusted_effect", file.path(prior_dir, "Guma_2024_adjusted_effect.csv"))
  17. published_summary_file <- read_arg("published_summary_file", file.path(prior_dir, "published_summary_inputs.csv"))
  18. set.seed(123)
  19. # -------------------------------------------------------------------------
  20. # Helper functions
  21. # -------------------------------------------------------------------------
  22. # The prior is built from standardized male-female BNST differences. Where
  23. # participant-level data are available, we estimate covariate-adjusted effects
  24. # using a linear model and standardize the adjusted contrast by the model's
  25. # residual SD. Where only paper summaries are available, we derive Cohen's d
  26. # from the reported means, SDs/SEMs, and sample sizes.
  27. # For papers reporting group summaries only, pool within-group SDs before
  28. # dividing the male-female mean difference by the pooled value.
  29. calc_smd_from_summary <- function(mean_m, mean_f, sd_m, sd_f, n_m, n_f) {
  30. sd_pooled <- sqrt(((n_m - 1) * sd_m^2 + (n_f - 1) * sd_f^2) / (n_m + n_f - 2))
  31. d <- (mean_m - mean_f) / sd_pooled
  32. se_d <- sqrt((n_m + n_f) / (n_m * n_f) + d^2 / (2 * (n_m + n_f - 2)))
  33. data.frame(
  34. n_male = n_m,
  35. n_female = n_f,
  36. effect_size = d,
  37. effect_se = se_d
  38. )
  39. }
  40. # Reconstruct the SD of two combined groups, including the distance between
  41. # their means as well as variation within each group.
  42. combine_subgroups <- function(n1, mean1, sd1, n2, mean2, sd2) {
  43. pooled_mean <- (n1 * mean1 + n2 * mean2) / (n1 + n2)
  44. pooled_var <- (
  45. ((n1 - 1) * sd1^2) +
  46. ((n2 - 1) * sd2^2) +
  47. n1 * (mean1 - pooled_mean)^2 +
  48. n2 * (mean2 - pooled_mean)^2
  49. ) / (n1 + n2 - 1)
  50. data.frame(n = n1 + n2, mean = pooled_mean, sd = sqrt(pooled_var))
  51. }
  52. adjusted_d_from_lm <- function(data, outcome, group, covariates,
  53. male_level, female_level, seed, study_label) {
  54. vars <- c(outcome, group, covariates)
  55. require_columns(data, vars, study_label)
  56. df <- data[stats::complete.cases(data[, vars]), vars, drop = FALSE]
  57. if (!all(c(male_level, female_level) %in% df[[group]]) ||
  58. any(!df[[group]] %in% c(male_level, female_level))) {
  59. stop(study_label, " must contain both specified sex groups and no other labels.", call. = FALSE)
  60. }
  61. for (column in c(outcome, covariates)) {
  62. df[[column]] <- numeric_values(df[[column]], paste(study_label, column))
  63. }
  64. df[[group]] <- stats::relevel(factor(df[[group]]), ref = female_level)
  65. fmla <- stats::as.formula(paste(outcome, "~", paste(c(group, covariates), collapse = " + ")))
  66. fit <- stats::lm(fmla, data = df)
  67. if (fit$rank != length(stats::coef(fit)) || !is.finite(stats::sigma(fit)) || stats::sigma(fit) <= 0) {
  68. stop(study_label, " does not support an identifiable model with positive residual SD.", call. = FALSE)
  69. }
  70. # Predict male and female values at the sample mean of each covariate.
  71. new_f <- data.frame(row.names = 1)
  72. new_m <- data.frame(row.names = 1)
  73. new_f[[group]] <- factor(female_level, levels = levels(df[[group]]))
  74. new_m[[group]] <- factor(male_level, levels = levels(df[[group]]))
  75. for (v in covariates) {
  76. new_f[[v]] <- mean(df[[v]], na.rm = TRUE)
  77. new_m[[v]] <- mean(df[[v]], na.rm = TRUE)
  78. }
  79. adjusted_mean_male <- as.numeric(stats::predict(fit, new_m))
  80. adjusted_mean_female <- as.numeric(stats::predict(fit, new_f))
  81. diff_adj <- adjusted_mean_male - adjusted_mean_female
  82. d_adj <- diff_adj / stats::sigma(fit)
  83. # Nonparametric bootstrap SE for the adjusted standardized contrast.
  84. set.seed(seed)
  85. boot_vals <- rep(NA_real_, n_boot)
  86. for (b in seq_len(n_boot)) {
  87. idx <- sample(seq_len(nrow(df)), size = nrow(df), replace = TRUE)
  88. df_b <- df[idx, , drop = FALSE]
  89. df_b[[group]] <- factor(df_b[[group]], levels = levels(df[[group]]))
  90. if (length(unique(df_b[[group]])) < 2) next
  91. fit_b <- try(stats::lm(fmla, data = df_b), silent = TRUE)
  92. if (inherits(fit_b, "try-error")) next
  93. boot_vals[b] <- as.numeric(stats::predict(fit_b, new_m) - stats::predict(fit_b, new_f)) / stats::sigma(fit_b)
  94. }
  95. boot_vals <- boot_vals[is.finite(boot_vals)]
  96. if (length(boot_vals) < 2 || stats::sd(boot_vals) <= 0) {
  97. stop(study_label, " has insufficient valid bootstrap estimates for an SE.", call. = FALSE)
  98. }
  99. data.frame(
  100. study = study_label,
  101. n_total = nrow(df),
  102. n_male = sum(df[[group]] == male_level),
  103. n_female = sum(df[[group]] == female_level),
  104. formula = deparse(fmla),
  105. adjusted_mean_male = adjusted_mean_male,
  106. adjusted_mean_female = adjusted_mean_female,
  107. adjusted_difference = diff_adj,
  108. residual_sd = stats::sigma(fit),
  109. effect_size = d_adj,
  110. effect_se = stats::sd(boot_vals),
  111. n_boot_valid = length(boot_vals),
  112. ci_lower = stats::quantile(boot_vals, 0.025, na.rm = TRUE),
  113. ci_upper = stats::quantile(boot_vals, 0.975, na.rm = TRUE),
  114. stringsAsFactors = FALSE
  115. )
  116. }
  117. add_result <- function(study, source_type, sample_restriction, effect_method,
  118. covariates, n_male, n_female, effect_size, effect_se, notes) {
  119. data.frame(
  120. study = study,
  121. source_type = source_type,
  122. sample_restriction = sample_restriction,
  123. effect_method = effect_method,
  124. covariates = covariates,
  125. n_male = n_male,
  126. n_female = n_female,
  127. effect_size = effect_size,
  128. effect_se = effect_se,
  129. notes = notes,
  130. stringsAsFactors = FALSE
  131. )
  132. }
  133. require_file <- function(path, description) {
  134. if (!file.exists(path)) {
  135. stop(
  136. "Missing ", description, ": ", path, "\n",
  137. "See data/prior_sources/README.md for required prior-source inputs.",
  138. call. = FALSE
  139. )
  140. }
  141. }
  142. # Keeping transcribed summary values in a separate CSV exposes every number
  143. # used for the studies without participant-level re-analysis data.
  144. require_file(published_summary_file, "published summary-statistic inputs")
  145. published <- read.csv(published_summary_file, stringsAsFactors = FALSE)
  146. if (!identical(names(published), c("variable", "value")) || anyDuplicated(published$variable)) {
  147. stop("Published summary inputs must have unique variable,value rows.", call. = FALSE)
  148. }
  149. stat <- function(name) {
  150. value <- published$value[match(name, published$variable)]
  151. if (length(value) != 1 || !is.finite(suppressWarnings(as.numeric(value)))) {
  152. stop("Missing or nonnumeric published summary input: ", name, call. = FALSE)
  153. }
  154. as.numeric(value)
  155. }
  156. # -------------------------------------------------------------------------
  157. # Participant-level re-analyses
  158. # -------------------------------------------------------------------------
  159. allen_path <- file.path(prior_dir, "Allen_Gorski.csv")
  160. require_file(allen_path, "Allen & Gorski participant-level table")
  161. allen <- read.csv(allen_path, check.names = TRUE)
  162. allen <- allen[allen$Age >= 18, , drop = FALSE]
  163. allen_res <- adjusted_d_from_lm(
  164. data = allen,
  165. outcome = "BNST.Volume",
  166. group = "Sex",
  167. covariates = c("Brain.Weight", "Age"),
  168. male_level = "m",
  169. female_level = "f",
  170. seed = 101,
  171. study_label = "Allen & Gorski (1990)"
  172. )
  173. chung_path <- file.path(prior_dir, "Chung_etal.csv")
  174. require_file(chung_path, "Chung participant-level table")
  175. chung <- read.csv(chung_path, check.names = TRUE)
  176. chung$Age <- as.numeric(gsub(" years", "", chung$Age))
  177. chung <- chung[chung$Age >= 18, , drop = FALSE]
  178. chung_res <- adjusted_d_from_lm(
  179. data = chung,
  180. outcome = "BNST.Volume",
  181. group = "Sex",
  182. covariates = c("Brain.Weight", "Age"),
  183. male_level = "m",
  184. female_level = "f",
  185. seed = 102,
  186. study_label = "Chung et al. (2002)"
  187. )
  188. # Guma et al. provide df_HCP_volumes_clean.RDS in their human-anatomy inputs:
  189. # https://github.com/elisaguma/Normative-Sex-Differences/tree/main
  190. # When the external participant-level file is supplied, recompute the adjusted
  191. # effect; otherwise use the included study-level aggregate CSV.
  192. if (!is.null(guma_participant_file) && !file.exists(guma_participant_file)) {
  193. stop("Guma participant-level input not found: ", guma_participant_file, call. = FALSE)
  194. }
  195. if (!is.null(guma_participant_file)) {
  196. guma <- readRDS(guma_participant_file)
  197. require_columns(guma, c("euler", "QC_include", "Sex", "L_BNST", "R_BNST",
  198. "AGE_cent", "BrainSegVolNotVent.y"), "Guma participant-level input")
  199. guma <- subset(guma, euler > -200 & QC_include == 1)
  200. guma$Sex <- factor(guma$Sex, levels = c("F", "M"))
  201. guma$BNST_bilateral <- guma$L_BNST + guma$R_BNST
  202. guma_res <- adjusted_d_from_lm(
  203. data = guma,
  204. outcome = "BNST_bilateral",
  205. group = "Sex",
  206. covariates = c("AGE_cent", "BrainSegVolNotVent.y", "euler"),
  207. male_level = "M",
  208. female_level = "F",
  209. seed = 103,
  210. study_label = "Guma et al. (2024)"
  211. )
  212. } else {
  213. require_file(guma_adjusted_file, "Guma adjusted-effect table")
  214. guma_res <- read.csv(guma_adjusted_file, check.names = TRUE)
  215. }
  216. require_columns(guma_res, c("n_male", "n_female", "effect_size", "effect_se"), "Guma adjusted effect")
  217. if (nrow(guma_res) != 1L) stop("Guma adjusted-effect input must contain exactly one row.", call. = FALSE)
  218. for (column in c("n_male", "n_female", "effect_size", "effect_se")) {
  219. guma_res[[column]] <- numeric_values(guma_res[[column]], paste("Guma", column), positive = column != "effect_size")
  220. }
  221. if (guma_res$n_male < 2 || guma_res$n_female < 2 ||
  222. any(c(guma_res$n_male, guma_res$n_female) %% 1 != 0)) {
  223. stop("Guma sex counts must be integers of at least two per group.", call. = FALSE)
  224. }
  225. # -------------------------------------------------------------------------
  226. # Published summary-statistic derivations
  227. # -------------------------------------------------------------------------
  228. # Zhou et al. report mean +/- SEM. We combine cisgender heterosexual and
  229. # homosexual male groups, exclude hormone-treated transgender participants, and
  230. # compare the combined male group with female participants.
  231. zhou_male <- combine_subgroups(
  232. n1 = stat("zhou_m1_n"), mean1 = stat("zhou_m1_mean"),
  233. sd1 = stat("zhou_m1_sem") * sqrt(stat("zhou_m1_n")),
  234. n2 = stat("zhou_m2_n"), mean2 = stat("zhou_m2_mean"),
  235. sd2 = stat("zhou_m2_sem") * sqrt(stat("zhou_m2_n"))
  236. )
  237. zhou <- calc_smd_from_summary(
  238. mean_m = zhou_male$mean,
  239. mean_f = stat("zhou_f_mean"),
  240. sd_m = zhou_male$sd,
  241. sd_f = stat("zhou_f_sem") * sqrt(stat("zhou_f_n")),
  242. n_m = zhou_male$n,
  243. n_f = stat("zhou_f_n")
  244. )
  245. slabe <- calc_smd_from_summary(
  246. mean_m = stat("slabe_m_mean"),
  247. mean_f = stat("slabe_f_mean"),
  248. sd_m = stat("slabe_m_sd"),
  249. sd_f = stat("slabe_f_sd"),
  250. n_m = stat("slabe_m_n"),
  251. n_f = stat("slabe_f_n")
  252. )
  253. # Neudorfer et al. did not report sex-specific sample sizes. We estimate the
  254. # split using the broader HCP Young Adult sex proportions described by Guma
  255. # et al., then apply those proportions to Neudorfer's reported total N.
  256. neud_total_n <- stat("neud_total_n")
  257. neud_n_f <- round(
  258. (stat("neud_reference_f_n") /
  259. (stat("neud_reference_f_n") + stat("neud_reference_m_n"))) * neud_total_n
  260. )
  261. neud_n_m <- neud_total_n - neud_n_f
  262. neud <- calc_smd_from_summary(
  263. mean_m = stat("neud_m_mean"),
  264. mean_f = stat("neud_f_mean"),
  265. sd_m = stat("neud_m_sd"),
  266. sd_f = stat("neud_f_sd"),
  267. n_m = neud_n_m,
  268. n_f = neud_n_f
  269. )
  270. # -------------------------------------------------------------------------
  271. # Combine effect-size table and fit the random-effects prior meta-analysis.
  272. # -------------------------------------------------------------------------
  273. prior_table <- rbind(
  274. add_result(
  275. study = "Allen & Gorski (1990)", source_type = "participant-level re-analysis",
  276. sample_restriction = "Adults only (>=18 years)",
  277. effect_method = "Adjusted standardized mean difference from lm",
  278. covariates = "Brain.Weight, Age", n_male = allen_res$n_male, n_female = allen_res$n_female,
  279. effect_size = allen_res$effect_size, effect_se = allen_res$effect_se,
  280. notes = "Effect derived from regression-adjusted male-female contrast divided by residual SD."
  281. ),
  282. add_result(
  283. study = "Chung et al. (2002)", source_type = "participant-level re-analysis",
  284. sample_restriction = "Adults only (>=18 years)",
  285. effect_method = "Adjusted standardized mean difference from lm",
  286. covariates = "Brain.Weight, Age", n_male = chung_res$n_male, n_female = chung_res$n_female,
  287. effect_size = chung_res$effect_size, effect_se = chung_res$effect_se,
  288. notes = "Effect derived from regression-adjusted male-female contrast divided by residual SD."
  289. ),
  290. add_result(
  291. study = "Guma et al. (2024)", source_type = "participant-level re-analysis",
  292. sample_restriction = "Available HCP rows passing euler > -200 and QC_include == 1",
  293. effect_method = "Adjusted standardized mean difference from lm",
  294. covariates = "AGE_cent, BrainSegVolNotVent.y, euler",
  295. n_male = guma_res$n_male[1], n_female = guma_res$n_female[1],
  296. effect_size = guma_res$effect_size[1], effect_se = guma_res$effect_se[1],
  297. notes = "Effect derived from regression-adjusted male-female contrast divided by residual SD."
  298. ),
  299. add_result(
  300. study = "Zhou et al. (1995)", source_type = "published summary statistics",
  301. sample_restriction = "Adult cisgender participants; transgender hormone-treated participants excluded",
  302. effect_method = "Cohen's d from reported means, SEMs, and reconstructed subgroup SDs",
  303. covariates = "None available", n_male = zhou$n_male, n_female = zhou$n_female,
  304. effect_size = zhou$effect_size, effect_se = zhou$effect_se,
  305. notes = "Male group combines heterosexual and homosexual cisgender men; SEMs converted to SDs before pooling."
  306. ),
  307. add_result(
  308. study = "Slabe et al. (2023)", source_type = "published summary statistics",
  309. sample_restriction = "As reported in paper",
  310. effect_method = "Cohen's d from reported means, SDs, and n",
  311. covariates = "No global size adjustment available",
  312. n_male = slabe$n_male, n_female = slabe$n_female,
  313. effect_size = slabe$effect_size, effect_se = slabe$effect_se,
  314. notes = "No TBV/brain-weight-adjusted effect available."
  315. ),
  316. add_result(
  317. study = "Neudorfer et al. (2020)", source_type = "published TBV-normalised summary statistics",
  318. sample_restriction = "As reported in paper",
  319. effect_method = "Cohen's d from TBV-normalised means, SDs, and estimated sex-specific n",
  320. covariates = "TBV-normalised values reported by paper",
  321. n_male = neud$n_male, n_female = neud$n_female,
  322. effect_size = neud$effect_size, effect_se = neud$effect_se,
  323. notes = "Sex split estimated from Guma et al. HCP sex proportions because Neudorfer did not report sex-specific sample counts."
  324. )
  325. )
  326. write.csv(prior_table, file.path(results_dir, "BNST_prior_effect_sizes_all_studies.csv"), row.names = FALSE)
  327. write.csv(allen_res, file.path(results_dir, "Allen_Gorski_1990_adjusted_effect.csv"), row.names = FALSE)
  328. write.csv(chung_res, file.path(results_dir, "Chung_2002_adjusted_effect.csv"), row.names = FALSE)
  329. write.csv(guma_res, file.path(results_dir, "Guma_2024_adjusted_effect.csv"), row.names = FALSE)
  330. # Each study contributes one standardized effect and its SE. REML estimates
  331. # between-study variation rather than assuming all studies share one effect.
  332. meta_input <- prior_table[, c("study", "effect_size", "effect_se")]
  333. names(meta_input) <- c("study", "yi", "sei")
  334. if (any(!is.finite(meta_input$yi)) || any(!is.finite(meta_input$sei)) || any(meta_input$sei <= 0)) {
  335. stop("Every study must have a finite effect and positive SE; no studies are silently omitted.", call. = FALSE)
  336. }
  337. write.csv(meta_input, file.path(results_dir, "BNST_prior_meta_input.csv"), row.names = FALSE)
  338. primary <- metafor::rma(yi = yi, sei = sei, data = meta_input, method = "REML")
  339. summary_out <- data.frame(
  340. analysis = "primary",
  341. pooled_effect = as.numeric(primary$b),
  342. pooled_se = primary$se,
  343. ci_lower = primary$ci.lb,
  344. ci_upper = primary$ci.ub,
  345. tau2 = primary$tau2,
  346. I2 = primary$I2,
  347. Q = primary$QE,
  348. Q_p = primary$QEp
  349. )
  350. meta_no_neud <- meta_input[!grepl("Neudorfer", meta_input$study, ignore.case = TRUE), ]
  351. meta_no_zhou <- meta_input[!grepl("Zhou", meta_input$study, ignore.case = TRUE), ]
  352. meta_adjusted_only <- meta_input[meta_input$study %in% c("Allen & Gorski (1990)", "Chung et al. (2002)", "Guma et al. (2024)"), ]
  353. sensitivity <- list(
  354. exclude_neudorfer = metafor::rma(yi = yi, sei = sei, data = meta_no_neud, method = "REML"),
  355. exclude_zhou = metafor::rma(yi = yi, sei = sei, data = meta_no_zhou, method = "REML"),
  356. adjusted_only = metafor::rma(yi = yi, sei = sei, data = meta_adjusted_only, method = "REML")
  357. )
  358. sensitivity_table <- do.call(rbind, lapply(names(sensitivity), function(label) {
  359. fit <- sensitivity[[label]]
  360. data.frame(
  361. analysis = label,
  362. pooled_effect = as.numeric(fit$b),
  363. pooled_se = fit$se,
  364. ci_lower = fit$ci.lb,
  365. ci_upper = fit$ci.ub,
  366. tau2 = fit$tau2,
  367. I2 = fit$I2,
  368. Q = fit$QE,
  369. Q_p = fit$QEp
  370. )
  371. }))
  372. write.csv(rbind(summary_out, sensitivity_table), file.path(results_dir, "BNST_prior_meta_summary.csv"), row.names = FALSE)
  373. # -------------------------------------------------------------------------
  374. # Forest plots and influence diagnostics for the primary and sensitivity analyses.
  375. # -------------------------------------------------------------------------
  376. grDevices::pdf(file.path(figures_dir, "BNST_meta_analysis_forest_plot.pdf"), width = 6, height = 5)
  377. metafor::forest(primary, slab = meta_input$study, xlab = "Standardized mean difference", mlab = "Random-effects model")
  378. grDevices::dev.off()
  379. grDevices::pdf(file.path(figures_dir, "BNST_meta_analysis_forest_plots_sensitivity.pdf"), width = 6, height = 5)
  380. metafor::forest(sensitivity$exclude_neudorfer, slab = meta_no_neud$study, xlab = "Standardized mean difference", mlab = "Exclude Neudorfer")
  381. metafor::forest(sensitivity$exclude_zhou, slab = meta_no_zhou$study, xlab = "Standardized mean difference", mlab = "Exclude Zhou")
  382. metafor::forest(sensitivity$adjusted_only, slab = meta_adjusted_only$study, xlab = "Standardized mean difference", mlab = "Adjusted-only studies")
  383. grDevices::dev.off()
  384. # influence() is an S3 generic; the rma.uni method is registered by metafor
  385. # but is not exported as metafor::influence().
  386. inf <- stats::influence(primary)
  387. grDevices::pdf(file.path(figures_dir, "BNST_meta_analysis_influence_plot.pdf"), width = 7, height = 5)
  388. plot(inf)
  389. grDevices::dev.off()
  390. capture.output(
  391. {
  392. cat("Primary random-effects meta-analysis\n")
  393. print(summary(primary))
  394. cat("\nSensitivity analyses\n")
  395. print(rbind(summary_out, sensitivity_table))
  396. cat("\nInfluence diagnostics\n")
  397. print(inf)
  398. },
  399. file = file.path(results_dir, "BNST_meta_analysis_summary.txt")
  400. )
  401. message("Wrote prior effect table, meta-analysis summaries, and prior figures.")
  402. message("Primary pooled d = ", round(as.numeric(primary$b), 4), "; SE = ", round(primary$se, 4))

02_create_prior_table.R at commit 4891e02, under MIT · at the source

Overview

  1. Department of Psychology, Royal Holloway, University of London, Egham, Surrey, United Kingdom
  2. School of Psychology, Cardiff University, Cardiff, United Kingdom
Institutions: Royal Holloway University of London (United Kingdom); Cardiff University (United Kingdom)
Journal: Imaging neuroscience (Cambridge, Mass.), volume 4, article IMAG.a.1420
Dates: received 7 February 2025; accepted 15 September 2026; published online 27 October 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1162/imag.a.1420 · PMID 42953882 · PMCID PMC13716282 · OpenAlex W7220386683
Open access: diamond, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: structural MRI / diffusion (modality), human (organism)
Methods: Connectivity, Statistics, fMRI & imaging
Keywords: bed nucleus of the stria terminalis, BNST, sex differences, sexual dimorphism, magnetic resonance imaging, Bayesian modelling
MeSH: Septal Nuclei*, Sex Characteristics*, Adolescent, Adult, Bayes Theorem, Female, Humans, Magnetic Resonance Imaging, Male, Organ Size, Young Adult (* major topic)
Topic: Sex and Gender in Healthcare (Public Health, Environmental and Occupational Health, Medicine), according to OpenAlex
Citations: not cited yet (Europe PMC); 85 references in the paper

Abstract

“The bed nucleus of the stria terminalis (BNST) is a sexually dimorphic basal forebrain region” is a claim prevalent across rodent and human neuroscience research, arising from the observation that it is substantially larger in male versus female brains. Despite the pervasiveness of this claim, which may have implications for understanding sex differences in anxiety and substance use disorders, inspection of the literature reveals a complex and nuanced picture. Research on volumetric human BNST sex differences comes from a handful of mostly small-scale post-mortem studies and two MRI studies, between them reporting no, moderate, or very large differences. This indicates the need for a more detailed systematic investigation. Addressing this, we developed a novel 3T T1-weighted (T1w) manual segmentation protocol for the BNST, which was applied to sub-millimetre resolution T1w structural MRI data in 170 young human adults. Using a Bayesian modelling approach, taking into account existing data and accounting for total brain volume, age, and sibship, we find substantial evidence favouring no sex difference in total BNST volume. We recommend that researchers exercise caution when reporting evidence of BNST sexual dimorphism, particularly when translating findings from rodent models in which the BNST may play a different, olfaction-focused, role.

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

Repositories

Its files are read in the Code ↔ Paper reader above, with 9 matches between paragraphs and lines of code.

mattelisi/mlisi

License: none: the authors keep all their rights
State: the link answers, verified on 30 October 2026
Evidence: files inventoried
Commit: 54700ea9b7afb2cc4a342c2beb26f4500c919d9c, 11 October 2019
Languages: R (46)
Size: 98 files, 46 scripts
Software Heritage: archived
Found in: the text, “Specifying the model”
Holds: README, environment (DESCRIPTION), documentation
Not found: license file, CITATION.cff, tests, continuous integration
Availability: 1 check, the latest on 30 October 2026: the link answers
  • 30 October 2026: the link answers
47 files

El-Suri/Substantial-evidence-against-sex-differences-in-bed-nucleus-of-the-stria-terminalis-volume

License: MIT
State: the link answers, verified on 30 October 2026
Evidence: files inventoried
Commit: 4891e021c87d09179c087f6105bd3daa81d4f7c5, 1 October 2026
Languages: R (10), Python (2)
Size: 29 files, 12 scripts
Software Heritage: not archived
Found in: “Data and Code Availability”
Holds: README, license file, tests, documentation
Not found: CITATION.cff, environment file, continuous integration
Tools: brms (3 files), RNifti (3 files), easystats (1 file), ggplot2 (1 file), metafor (1 file), patchwork (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 30 October 2026: the link answers
  • 30 October 2026: the link answers
14 files

The paper's code and data availability statement is in the Data section.

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;
  • 58 scripts, each with its path and the digest of its content;
  • 9 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • 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 and Code Availability

Human data were provided [in part] by the Human Connectome Project, WU-Minn Consortium (Principal Investigators: David Van Essen and Kamil Ugurbil; 1U54MH091657) funded by the 16 NIH Institutes and Centers that support the NIH Blueprint for Neuroscience Research; and by the McDonnell Center for Systems Neuroscience at Washington University. The 3T T1w BNST manual segmentation protocol is available on the Open Science Framework website at https://doi.org/10.17605/OSF.IO/QKUPE.

All code used to run the analyses and the BNST segmentation protocol is at https://github.com/El-Suri/Substantial-evidence-against-sex-differences-in-bed-nucleus-of-the-stria-terminalis-volume. As the analyses require restricted-access data from the Human Connectome Project Young Adult dataset, to comply with HCP terms data is not included in this repository.

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, 30 October 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 6 authors, 6 keywords, 11 MeSH terms, 1 funder, 82 references.

Cite

This paper

Berry, S. C., Suri, H. K., Lisi, M., Ravenhill, J. P., Aggleton, J. P., & Hodgetts, C. J. (2026). Substantial evidence against sex differences in bed nucleus of the stria terminalis volume in the human brain. Imaging neuroscience (Cambridge, Mass.), 4, IMAG.a.1420. https://doi.org/10.1162/imag.a.1420

BibTeX

@article{berry2026substantial,
author = {Berry, Sam C and Suri, Harsimran K and Lisi, Matteo and Ravenhill, James P and Aggleton, John P and Hodgetts, Carl J},
title = {{Substantial evidence against sex differences in bed nucleus of the stria terminalis volume in the human brain}},
journal = {Imaging neuroscience (Cambridge, Mass.)},
year = {2026},
month = oct,
volume = {4},
pages = {IMAG.a.1420},
publisher = {MIT Press},
issn = {2837-6056},
doi = {10.1162/imag.a.1420},
url = {https://doi.org/10.1162/imag.a.1420},
pmid = {42953882},
pmcid = {PMC13716282}
}

RIS

TY - JOUR
AU - Berry, Sam C
AU - Suri, Harsimran K
AU - Lisi, Matteo
AU - Ravenhill, James P
AU - Aggleton, John P
AU - Hodgetts, Carl J
TI - Substantial evidence against sex differences in bed nucleus of the stria terminalis volume in the human brain
T2 - Imaging neuroscience (Cambridge, Mass.)
J2 - Imaging Neurosci (Camb)
PY - 2026
DA - 2026/10/27
VL - 4
SP - IMAG.a.1420
SN - 2837-6056
PB - MIT Press
DO - 10.1162/imag.a.1420
UR - https://doi.org/10.1162/imag.a.1420
LA - en
ER -

CSL-JSON

{
"id": "10.1162/imag.a.1420",
"type": "article-journal",
"title": "Substantial evidence against sex differences in bed nucleus of the stria terminalis volume in the human brain",
"container-title": "Imaging neuroscience (Cambridge, Mass.)",
"author": [
{
"family": "Berry",
"given": "Sam C"
},
{
"family": "Suri",
"given": "Harsimran K"
},
{
"family": "Lisi",
"given": "Matteo"
},
{
"family": "Ravenhill",
"given": "James P"
},
{
"family": "Aggleton",
"given": "John P"
},
{
"family": "Hodgetts",
"given": "Carl J"
}
],
"container-title-short": "Imaging Neurosci (Camb)",
"volume": "4",
"page": "IMAG.a.1420",
"DOI": "10.1162/imag.a.1420",
"PMID": "42953882",
"PMCID": "PMC13716282",
"ISSN": "2837-6056",
"publisher": "MIT Press",
"URL": "https://doi.org/10.1162/imag.a.1420",
"language": "en",
"issued": {
"date-parts": [
[
2026,
10,
27
]
]
}
}

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.7554/elife.92200 [code]
Comparative neuroimaging of sex differences in human and mouse brain anatomy.
Journal: eLife
In common: ggplot2, tidyverse, humanconnectome.org/study/hcp-young-adult, structural MRI / diffusion, 9 references
[2] doi:10.1162/imag.a.1260
Organization, fine structure, and stereotaxic maps of the human Bed nucleus of the Stria terminalis.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: 10 references
[3] doi:10.1038/s41467-026-73262-2 [code]
Robust but independent sex differences in human brain function, structure, and behavior.
Journal: Nature communications
In common: easystats, patchwork, ggplot2, 1 other tool, humanconnectome.org/study/hcp-young-adult, structural MRI / diffusion, 6 references
[4] doi:10.1186/s13293-025-00728-1 [code]
A cross-species analysis of neuroanatomical covariance sex differences in humans and mice.
Journal: Biology of sex differences
In common: patchwork, ggplot2, tidyverse, humanconnectome.org/study/hcp-young-adult, structural MRI / diffusion, 6 references
[5] doi:10.1162/imag.a.1235 [code]
Intracranial volume: To adjust or not to adjust? It is not a matter of if, but how.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: patchwork, ggplot2, tidyverse, structural MRI / diffusion, 6 references
[6] doi:10.1038/s41467-024-51942-1 [code]
Sex differences in functional cortical organization reflect differences in network topology rather than cortical morphometry.
Journal: Nature communications
In common: tidyverse, structural MRI / diffusion, 8 references
[7] doi:10.1038/s41467-026-71414-y [code]
Bed nucleus of the stria terminalis connectivity during food cue and taste processing under stress.
Journal: Nature communications
In common: 7 references
[8] doi:10.1007/s10571-025-01536-2 [code]
Single-Cell Analysis of Sex and Gender Differences in the Human Brain During Development and Disease.
Journal: Cellular and molecular neurobiology
In common: patchwork, ggplot2, tidyverse, 5 references
[9] doi:10.1073/pnas.2403212121 [code]
Sex and mental health are related to subcortical brain microstructure.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: humanconnectome.org/study/hcp-young-adult, structural MRI / diffusion, 6 references
[10] doi:10.1016/j.nicl.2025.103881 [code]
Brain age gap reduction following exercise mirrors clinical improvements in schizophrenia spectrum disorders.
Journal: NeuroImage. Clinical
In common: RNifti, brms, easystats, 3 other tools, structural MRI / diffusion

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.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1162/imag.a.1420.svg)](https://openscicode.org/badge/doi/10.1162/imag.a.1420)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1162/imag.a.1420.svg
   :target: https://openscicode.org/badge/doi/10.1162/imag.a.1420
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1162/imag.a.1420"><img src="https://openscicode.org/badge/doi/10.1162/imag.a.1420.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

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