OSCR

Ultrasound neuromodulation reveals distinct roles of the dorsal anterior cingulate cortex and anterior insula in learning.

Code ↔ Paper

15 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 15 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
  1. [1] § Methods › Computational modeling and model comparison ↔ analyses/cbm/mgngtus_cbm06c_model_recovery_eval.m, lines 343–383 · score 0.78 · inverse confusion matrix, forward confusion matrix, model recovery, diagonal probabilities, permutation, simulated
  2. [2] § Methods › Computational modeling and model comparison ↔ analyses/cbm/mgngtus_cbm02_fit.m, lines 159–259 · score 0.73 · hierarchical Bayesian inference, protected exceedance probability, model frequency, CBM, fitted
  3. [3] § Methods › Computational modeling and model comparison ↔ analyses/cbm/mgngtus_cbm03a_eval_fit.m, lines 260–340 · score 0.70 · Bayesian model selection, protected exceedance probability, model frequency, CBM, weighted, fitted
  4. [4] § Results › Pavlovian biases in responding and learning in the sham session ↔ analyses/regression/01_mgngtus_regression.R, lines 285–326 · score 0.68 · stronger outcome, logistic regression, response repetitions, valenced outcomes, mixed, interaction
  5. [5] § Methods › Computational modeling and model comparison ↔ analyses/regression/functions/00_mgngtus_functions_regression.R, lines 3712–3753 · score 0.68 · bootstrapped confidence intervals, replacement, Cohen, Hedges, iteration, vector
  6. [6] § Results › Computational modeling of the sham data ↔ analyses/figures/mgngtus_figureS6.m, lines 354–436 · score 0.67 · Bayesian model selection, protected exceedance probability, model frequency, S6, sham
  7. [7] § Methods › Computational modeling and model comparison ↔ analyses/cbm/helpers/mgngtus_cbm_wrapper_sim.m, lines 1–39 · score 0.66 · hierarchical Bayesian, step ahead predictions, action probabilities, simulate, Go, model
  8. [8] § Results › Computational modeling of the sham data ↔ analyses/figures/mgngtus_figure2.m, lines 480–563 · score 0.64 · Bayesian model selection, protected exceedance probability, model frequency, Figure 2, sham
  9. [9] § Results › Sonication effects on Go/NoGo choices ↔ analyses/regression/01_mgngtus_regression.R, lines 285–326 · score 0.64 · logistic regression model, block half, response repetitions, cue valence, mixed, interaction
  10. [10] § Results › Pavlovian biases in responding and learning in the sham session ↔ analyses/cbm/mgngtus_cbm02_fit.m, lines 159–259 · score 0.61 · hierarchical Bayesian inference, protected exceedance probability, model frequency, fitting, sham
  11. [11] § Methods › Computational modeling and model comparison ↔ analyses/cbm/mgngtus_cbm06a_parameter_recovery.m, lines 469–528 · score 0.58 · ground truth, fitting parameter, permuting, permutation, correlated, simulated
  12. [12] § Methods › Computational modeling and model comparison ↔ analyses/cbm/models/mgngtus_cbm_mod09.m, the whole file · a weak match · score 0.56 · neutral outcomes, prediction errors, feedback sensitivity, NoGo, zero, punishment
  13. [13] § Results › Pavlovian biases in responding and learning in the sham session ↔ analyses/cbm/helpers/mgngtus_cbm_wrapper_sim.m, lines 1–39 · score 0.54 · hierarchical Bayesian inference, step ahead predictions, log, error, Probability, feedback
  14. [14] § Results › Sonication effects on response repetitions/switches ↔ analyses/regression/01_mgngtus_regression.R, lines 328–367 · score 0.53 · logistic regression model, response repetitions, learning bias, dACC, aIns, NoGo
  15. [15] § Methods › Regression analyses ↔ analyses/regression/01_mgngtus_regression.R, lines 92–131 · score 0.52 · logistic regression models, fit mixed

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 · 508 lines · 23 KB · MIT · 4 matches

  1. #!/usr/bin/env Rscript
  2. # ============================================================================ #
  3. ## 01_mgngtus_regression.R
  4. ## MGNG-TUS study: Fit mixed-effects logistic/linear regression models to behaviour (responses, repetitions, RTs).
  5. ## Copyright (C) Johannes Algermissen, University of Oxford, Oxford, UK, 2024-2025.
  6. rm(list = ls())
  7. # ============================================================================ #
  8. #### Set directories, load packages and custom functions: ####
  9. ## Set codeDir:
  10. currDir <- dirname(rstudioapi::getSourceEditorContext()$path)
  11. helperDir <- file.path(currDir, "helpers")
  12. source(file.path(helperDir, "set_dirs.R")) # Load packages and options settings
  13. ## Load directories:
  14. rootDir <- dirname(dirname(currDir))
  15. dirs <- set_dirs(rootDir)
  16. ## Load packages:
  17. source(file.path(dirs$helperDir, "package_manager.R")) # Load packages and options settings
  18. # ------------------------------------------------- #
  19. ## Load custom functions:
  20. source(file.path(dirs$funcDir, "00_mgngtus_functions_regression.R")) # Load functions
  21. # ============================================================================ #
  22. #### 01a) Read in behavioral data: ####
  23. ## Sham:
  24. data1 <- read_behavior(file.path(dirs$rawDataDir, "1_sham"))
  25. table(data1$subjectID, data1$stim_ID)
  26. data1 <- wrapper_preprocessing(data1)
  27. data1$sonication_n <- 1
  28. ## dACC:
  29. data2 <- read_behavior(file.path(dirs$rawDataDir, "2_dacc"))
  30. table(data2$subjectID, data2$stim_ID)
  31. table(data2$stim_ID)
  32. data2 <- wrapper_preprocessing(data2)
  33. data2$sonication_n <- 2
  34. table(data2$cueRep_n)
  35. table(data2$subject_n, data2$cueRep_n)
  36. ## aIns:
  37. data3 <- read_behavior(file.path(dirs$rawDataDir, "3_ai"))
  38. table(data3$subjectID, data3$stim_ID)
  39. data3 <- wrapper_preprocessing(data3)
  40. data3$sonication_n <- 3
  41. ## Concatenate:
  42. data <- rbind(data1, data2, data3)
  43. data$sonication_f <- factor(data$sonication_n, levels = c(1, 2, 3), labels = c("sham", "dACC", "aIns"))
  44. data$sonication_short_f <- data$sonication_f
  45. ## Inspect:
  46. length(unique(data$subID))
  47. table(data$subID, data$sonication_f)
  48. table(data$subID, data$cue_n)
  49. table(data$subID, data$cueRep_n)
  50. # ============================================================================ #
  51. #### 01b) Exclude subjects with incomplete sessions or outlier behaviour: ####
  52. length(unique(data$subID))
  53. table(data$subID, data$sonication_f)
  54. incompleteSubs <- c("JIJS1080", "KYJF0110", "MRMO0104", "NACA0882")
  55. outlierSubs <- c("EEMR0429")
  56. excludeSubs <- sort(unique(c(incompleteSubs, outlierSubs)))
  57. data <- subset(data, !(subID %in% excludeSubs))
  58. table(data$subID, data$sonication_f)
  59. length(unique(data$subID))
  60. # ============================================================================ #
  61. #### 01c) Exclude excessive cue repetitions: ####
  62. data <- subset(data, cueRep_n %in% 1:20)
  63. # ============================================================================ #
  64. #### 01d) Inspect cell sizes: ####
  65. ### Subjects:
  66. length(unique(data$subject_n))
  67. table(data$subject_n)
  68. # --> unequal numbers because not all sessions finished
  69. ### Sonication sessions:
  70. table(data$sonication_f)
  71. table(data$subID, data$sonication_f)
  72. # --> several subjects with empty sessions
  73. ### Cue counts:
  74. table(data$cue_n)
  75. table(data$subID, data$cue_n)
  76. # --> most cues 60 times (3 session x 20 cue repetitions)
  77. # --> but some cues less/more often...?!?
  78. ## Cue repetitions:
  79. table(data$cueRep_n)
  80. table(data$subID, data$cueRep_n)
  81. # --> most cue position 48 times (3 session x 16 cues)
  82. # --> but some cue repetitions less often, sometimes cue repetitions 21-23...?!?
  83. ## Outcomes:
  84. sum(is.na(data$outcome_n)) # 300 x NA
  85. table(data[is.na(data$outcome_n), "subID"])
  86. # JAKA0154 SINB0180 SKKY0189 SSHW0093
  87. # 60 60 120 60
  88. table(data[is.na(data$outcome_n), "subID"], data[is.na(data$outcome_n), "sonication_f"])
  89. # JAKA0154 0 60 0
  90. # SINB0180 0 0 60
  91. # SKKY0189 0 60 60
  92. # SSHW0093 0 60 0
  93. ## --> checked in raw data: verum NaN; always at the end of session
  94. data[is.na(data$outcome_n), c("subID", "sonication_f", "trialnr_n", "cue_n", "cueRep_n", "reqAction_n", "valence_n", "response_n", "ACC_n", "RT_n", "validity_n", "outcome_n")]
  95. ## Check validity:
  96. round(tapply(data$validity_n, data$subID, mean, na.rm = T), 4) # 0.8125
  97. # ============================================================================ #
  98. #### 01e) Select data, standardize variables, add age, gender, session number: ####
  99. modData <- select_standardize(data)
  100. modData <- add_demographics(modData) # add age and gender
  101. modData <- add_session_order(modData) # add session order
  102. # ============================================================================ #
  103. # ============================================================================ #
  104. # ============================================================================ #
  105. # ============================================================================ #
  106. #### 02a) Fit mixed-effects logistic regression models on RESPONSES: ####
  107. # ---------------------------------------------------------------------------- #
  108. ### Select formula:
  109. ## 2-way interactions:
  110. formula <- "response_n ~ reqAction_f * valence_f + (reqAction_f * valence_f|subject_f)"
  111. ## 3-way interaction:
  112. formula <- "response_n ~ reqAction_f * valence_f * sonication_f + (reqAction_f * valence_f * sonication_f|subject_f)"
  113. ## 4-way interaction:
  114. formula <- "response_n ~ reqAction_f * valence_f * sonication_f * firstHalfBlock_f + (reqAction_f * valence_f * sonication_f * firstHalfBlock_f|subject_f)"
  115. ## Interactions with age and gender:
  116. formula <- "response_n ~ reqAction_f * valence_f * age_z + reqAction_f * valence_f * gender_f + (reqAction_f * valence_f|subject_f)"
  117. formula <- "response_n ~ reqAction_f * valence_f * sonication_f * age_z + reqAction_f * valence_f * sonication_f * gender_f + (reqAction_f * valence_f * sonication_f|subject_f)"
  118. ## Interactions with session ID:
  119. formula <- "response_n ~ reqAction_f * valence_f * session_f + (reqAction_f * valence_f * session_f|subject_f)"
  120. ## Interactions with session order:
  121. formula <- "response_n ~ reqAction_f * valence_f * sonOrder_f + (reqAction_f * valence_f|subject_f)"
  122. formula <- "response_n ~ reqAction_f * valence_f * sonication_f * sonOrder_f + (reqAction_f * valence_f * sonication_f|subject_f)"
  123. ## Effect of cue set:
  124. formula <- "response_n ~ cue_set_f + (cue_set_f|subject_f)"
  125. formula <- "response_n ~ session_f * block_f + (session_f * block_f|subject_f)"
  126. # ---------------------------------------------------------------------------- #
  127. ### Fit or read existing model back in:
  128. mod <- fit_lmem(formula)
  129. quickCI(mod, nRound = 3)
  130. # mod <- fit_lmem(formula, useLRT = T) # for LRTs; very slow
  131. ## Plots:
  132. plot(effect("reqAction_f:valence_f", mod))
  133. plot(effect("reqAction_f:valence_f", mod, x.var = "valence_f"))
  134. plot(effect("reqAction_f:valence_f", mod), multiline = T, lwd = 4, colors = c("#007174", "#c93d21"))
  135. plot(effect("valence_f:sonication_f", mod), multiline = T, lwd = 4, colors = c("#007174", "#c93d21"))
  136. plot(effect("reqAction_f:valence_f:sonication_f", mod))
  137. plot(effect("reqAction_f:valence_f:sonication_f", mod), multiline = T)
  138. plot(effect("reqAction_f:valence_f:sonication_f", mod), multiline = T, lwd = 4, colors = c("#B2182B", "#2166AC"))
  139. plot(effect("reqAction_f:valence_f:sonication_f:firstHalfBlock_f", mod), multiline = T, lwd = 4, colors = c("#B2182B", "#2166AC"))
  140. plot(effect("reqAction_f:age_z", mod), multiline = T, lwd = 4, colors = c("#B2182B", "#2166AC"))
  141. plot(effect("reqAction_f:gender_f", mod), multiline = T, lwd = 4, colors = c("#B2182B", "#2166AC"))
  142. plot(effect("session_f", mod), multiline = T, lwd = 4)
  143. plot(effect("reqAction_f:session_f", mod), multiline = T, lwd = 4)
  144. plot(effect("sonOrder_f", mod), multiline = T, lwd = 4)
  145. plot(effect("reqAction_f:sonOrder_f", mod), multiline = T, lwd = 4)
  146. plot(effect("sonication_f:sonOrder_f", mod), multiline = T, lwd = 4)
  147. plot(effect("reqAction_f:sonication_f:sonOrder_f", mod), multiline = T, lwd = 4)
  148. plot(effect("cue_set_f", mod), multiline = T, lwd = 4)
  149. plot(effect("session_f:block_f", mod), multiline = T, lwd = 4)
  150. plot(effect("session_f:block_f", mod, x.var = "session_f"), multiline = T, lwd = 4)
  151. # ============================================================================ #
  152. #### 02b) Fit logistic regression models to responses manually & separately per cue condition: ####
  153. # ---------------------------------------------------------------------------- #
  154. ### Select cue conditions:
  155. selData <- droplevels(modData) ## all data
  156. selData <- droplevels(subset(modData, reqAction_f == "Go"))
  157. selData <- droplevels(subset(modData, reqAction_f == "NoGo"))
  158. selData <- droplevels(subset(modData, reqAction_f == "Go" & valence_f == "Win"))
  159. selData <- droplevels(subset(modData, reqAction_f == "Go" & valence_f == "Avoid"))
  160. selData <- droplevels(subset(modData, reqAction_f == "NoGo" & valence_f == "Win"))
  161. selData <- droplevels(subset(modData, reqAction_f == "NoGo" & valence_f == "Avoid"))
  162. ## Inspect:
  163. table(selData$reqAction_f)
  164. table(selData$valence_f)
  165. table(selData$reqAction_f, selData$valence_f)
  166. # ---------------------------------------------------------------------------- #
  167. ### Select block half:
  168. selData <- droplevels(subset(selData, firstHalfBlock_f == "first"))
  169. selData <- droplevels(subset(selData, firstHalfBlock_f == "second"))
  170. ## Inspect:
  171. table(selData$firstHalfBlock_f)
  172. # ---------------------------------------------------------------------------- #
  173. ### Select sonication conditions:
  174. selData <- droplevels(subset(selData, sonication_f == "sham"))
  175. selData <- droplevels(subset(selData, sonication_f %in% c("sham", "dACC")))
  176. selData <- droplevels(subset(selData, sonication_f %in% c("sham", "aIns")))
  177. ## Inspect:
  178. table(selData$sonication_f)
  179. # ---------------------------------------------------------------------------- #
  180. ### Select formula:
  181. ## Sonication main effect:
  182. formula <- "response_n ~ sonication_f + (sonication_f|subject_f)"
  183. ## 2-way interactions:
  184. formula <- "response_n ~ reqAction_f * valence_f + (reqAction_f * valence_f|subject_f)"
  185. formula <- "response_n ~ valence_f * sonication_f + (valence_f * sonication_f|subject_f)"
  186. formula <- "response_n ~ sonication_f * firstHalfBlock_f + (sonication_f * firstHalfBlock_f|subject_f)"
  187. ## 3-way interactions:
  188. formula <- "response_n ~ valence_f * sonication_f * firstHalfBlock_f + (valence_f * sonication_f * firstHalfBlock_f|subject_f)"
  189. # ---------------------------------------------------------------------------- #
  190. ### Fit manually:
  191. mod <- glmer(formula = formula, data = selData, family = binomial(),
  192. control = glmerControl(optCtrl = list(maxfun = 1e+9), calc.derivs = F, optimizer = c("bobyqa")))
  193. summary(mod, correlation = F); beep()
  194. quickCI(mod)
  195. Anova(mod, type = "3")
  196. # ---------------------------------------------------------------------------- #
  197. ### Plot:
  198. plot(effect("reqAction_f:valence_f", mod), multiline = T, lwd = 4, colors = c("#007174", "#c93d21"))
  199. plot(effect("sonication_f", mod), multiline = T, lwd = 4)
  200. plot(effect("valence_f:sonication_f", mod, x.var = "sonication_f"), multiline = T, lwd = 4, colors = c("#007174", "#c93d21"))
  201. plot(effect("sonication_f:firstHalfBlock_f", mod, x.var = "firstHalfBlock_f"), multiline = T, lwd = 4, colors = c("grey90", "#D3436EFF", "#FEBA80FF"))
  202. plot(effect("sonication_f:firstHalfBlock_f", mod, x.var = "firstHalfBlock_f"), multiline = T, lwd = 4, colors = c("grey90", "#D3436EFF"))
  203. plot(effect("sonication_f:firstHalfBlock_f", mod, x.var = "firstHalfBlock_f"), multiline = T, lwd = 4, colors = c("grey90", "#FEBA80FF"))
  204. plot(effect("valence_f:sonication_f:firstHalfBlock_f", mod, x.var = "valence_f"), multiline = T, lwd = 4)
  205. plot(effect("valence_f:sonication_f:firstHalfBlock_f", mod, x.var = "firstHalfBlock_f"), multiline = T, lwd = 4, colors = c("#007174", "#c93d21"))
  206. # ---------------------------------------------------------------------------- #
  207. ### Post-hoc z-tests with emmeans:
  208. emmeans(mod, specs = pairwise ~ valence_f | reqAction_f,
  209. interaction = "pairwise", regrid = "response", adjust = "none")
  210. emmeans(mod, specs = pairwise ~ reqAction_f | valence_f,
  211. interaction = "pairwise", regrid = "response", adjust = "none")
  212. emmeans(mod, specs = pairwise ~ sonication_f | reqAction_f,
  213. interaction = "pairwise", regrid = "response", adjust = "none")
  214. emmeans(mod, specs = pairwise ~ sonication_f | valence_f,
  215. interaction = "pairwise", regrid = "response", adjust = "none")
  216. emmeans(mod, specs = pairwise ~ sonication_f | firstHalfBlock_f,
  217. interaction = "pairwise", regrid = "response", adjust = "none")
  218. ## Sonication effect given required action x valence x block half combination:
  219. emmeans(mod, specs = pairwise ~ sonication_f | valence_f:reqAction_f:firstHalfBlock_f,
  220. regrid = "response", interaction = "pairwise", adjust = "none")
  221. emmeans(mod, specs = pairwise ~ sonication_f | valence_f:reqAction_f:firstHalfBlock_f,
  222. interaction = "pairwise", adjust = "none")
  223. ## Difference in Valence effect between sonications given reqAction level:
  224. emmeans(mod, specs = pairwise ~ valence_f:sonication_f | reqAction_f,
  225. regrid = "response", interaction = "pairwise", adjust = "none")
  226. emmeans(mod, specs = pairwise ~ reqAction_f:sonication_f | valence_f,
  227. regrid = "response", interaction = "pairwise", adjust = "none")
  228. # ============================================================================ #
  229. # ============================================================================ #
  230. # ============================================================================ #
  231. # ============================================================================ #
  232. #### 03a) Fit mixed-effects logistic regression models to RESPONSE REPETITIONS: ####
  233. # ---------------------------------------------------------------------------- #
  234. ### Select formula:
  235. ## Learning bias: stronger outcome effect for Go than NoGo (trials are valenced outcomes only):
  236. formula <- "repeat_n ~ outcome_last_rel_f * response_last_f + (outcome_last_rel_f * response_last_f|subject_f)"
  237. ## Persistence bias: main effect of cue valence:
  238. formula <- "repeat_n ~ valence_f + (valence_f|subject_f)"
  239. ## Interactions with age and gender:
  240. formula <- "repeat_n ~ outcome_last_rel_f * response_last_f * age_z + outcome_last_rel_f * response_last_f * gender_f + (outcome_last_rel_f * response_last_f|subject_f)"
  241. formula <- "repeat_n ~ outcome_last_rel_f * response_last_f * sonication_f * age_z + outcome_last_rel_f * response_last_f * sonication_f * gender_f + (outcome_last_rel_f * response_last_f * sonication_f|subject_f)"
  242. formula <- "repeat_n ~ valence_f * age_z + valence_f * gender_f + (valence_f|subject_f)"
  243. formula <- "repeat_n ~ valence_f * sonication_f * age_z + valence_f * sonication_f * gender_f + (valence_f * sonication_f|subject_f)"
  244. ## Interactions with session ID:
  245. formula <- "repeat_n ~ outcome_last_rel_f * response_last_f * session_f + (outcome_last_rel_f * response_last_f * session_f|subject_f)"
  246. formula <- "repeat_n ~ valence_f * session_f + (valence_f * session_f|subject_f)"
  247. ## Interactions with session order:
  248. formula <- "repeat_n ~ sonOrder_f + (1|subject_f)"
  249. formula <- "repeat_n ~ outcome_last_rel_f * response_last_f * sonOrder_f + (outcome_last_rel_f * response_last_f|subject_f)"
  250. formula <- "repeat_n ~ valence_f * sonOrder_f + (valence_f|subject_f)"
  251. formula <- "repeat_n ~ valence_f * sonication_f * sonOrder_f + (valence_f * sonication_f|subject_f)"
  252. ## Effect of cue set:
  253. formula <- "repeat_n ~ cue_set_f + (cue_set_f|subject_f)"
  254. formula <- "repeat_n ~ session_f * block_f + (session_f * block_f|subject_f)"
  255. # ---------------------------------------------------------------------------- #
  256. ### Fit model automatically or read past fit back in:
  257. mod <- fit_lmem(formula)
  258. # ============================================================================ #
  259. #### 03b) Fit logistic regression model to response repetitions manually & separately per condition: ####
  260. # ---------------------------------------------------------------------------- #
  261. ### Select task conditions:
  262. selData <- droplevels(modData) # all data
  263. ## For learning bias:
  264. selData <- droplevels(subset(modData, salience_last_f == "salient"))
  265. ## For learning bias modulation by sonication:
  266. selData <- droplevels(subset(modData, (outcome_last_all_f == "rewarded" & response_last_f == "Go") | (outcome_last_all_f == "punished" & response_last_f == "NoGo")))
  267. ## Inspect:
  268. table(selData$outcome_last_all_f)
  269. table(selData$response_last_f)
  270. table(selData$outcome_last_all_f, selData$response_last_f)
  271. # ---------------------------------------------------------------------------- #
  272. ### Select sonication conditions:
  273. selData <- droplevels(subset(selData, sonication_f == "sham"))
  274. selData <- droplevels(subset(selData, sonication_f %in% c("sham", "dACC")))
  275. selData <- droplevels(subset(selData, sonication_f %in% c("sham", "aIns")))
  276. ## Inspect:
  277. table(selData$sonication_f)
  278. # ---------------------------------------------------------------------------- #
  279. ### Select formula:
  280. ## Learning bias: only after salient outcomes:
  281. formula <- "repeat_n ~ outcome_last_rel_f * response_last_f + (outcome_last_rel_f * response_last_f|subject_f)"
  282. ## Learning bias modulated by TUS aIns: only rewarded Gos & punished NoGos:
  283. formula <- "repeat_n ~ sonication_f * outcome_last_rel_f + (sonication_f * outcome_last_rel_f|subject_f)"
  284. ## Persistence bias: all outcomes/conditions:
  285. formula <- "repeat_n ~ sonication_f * valence_f + (sonication_f * valence_f|subject_f)"
  286. # ---------------------------------------------------------------------------- #
  287. ### Fit manually:
  288. mod <- glmer(formula = formula, data = selData, family = binomial(),
  289. control = glmerControl(optCtrl = list(maxfun = 1e+9), calc.derivs = F, optimizer = c("bobyqa")))
  290. summary(mod); beep()
  291. Anova(mod, type = "3")
  292. quickCI(mod)
  293. # ---------------------------------------------------------------------------- #
  294. ### Plot:
  295. plot(effect("outcome_last_rel_f", mod), multiline = T, lwd = 4)
  296. plot(effect("response_last_f", mod), multiline = T, lwd = 4)
  297. plot(effect("outcome_last_rel_f:response_last_f", mod, x.var = "response_last_f"), multiline = T, lwd = 4, colors = c("#007174", "#c93d21"))
  298. plot(effect("sonication_f", mod), multiline = T, lwd = 4)
  299. plot(effect("valence_f", mod), multiline = T, lwd = 4)
  300. plot(effect("sonication_f:valence_f", mod), multiline = T, lwd = 4)
  301. plot(effect("age_z", mod), multiline = T, lwd = 4)
  302. plot(effect("gender_f", mod), multiline = T, lwd = 4)
  303. plot(effect("outcome_last_rel_f:age_z", mod), multiline = T, lwd = 4, colors = c("#B2182B", "#2166AC"))
  304. plot(effect("response_last_f:age_z", mod), multiline = T, lwd = 4, colors = c("#B2182B", "#2166AC"))
  305. plot(effect("session_f", mod), multiline = T, lwd = 4)
  306. plot(effect("outcome_last_rel_f:session_f", mod), multiline = T, lwd = 4)
  307. plot(effect("response_last_f:session_f", mod), multiline = T, lwd = 4)
  308. plot(effect("sonOrder_f", mod), multiline = T, lwd = 4)
  309. plot(effect("sonication_f:sonOrder_f", mod), multiline = T, lwd = 4)
  310. plot(effect("outcome_last_rel_f:response_last_f:sonOrder_f", mod), multiline = T, lwd = 4)
  311. plot(effect("valence_f:sonOrder_f", mod), multiline = T, lwd = 4)
  312. plot(effect("valence_f:sonication_f:sonOrder_f", mod), multiline = T, lwd = 4)
  313. plot(effect("cue_set_f", mod), multiline = T, lwd = 4)
  314. plot(effect("session_f:block_f", mod), multiline = T, lwd = 4)
  315. plot(effect("session_f:block_f", mod, x.var = "session_f"), multiline = T, lwd = 4)
  316. # ---------------------------------------------------------------------------- #
  317. ### Post-hoc z-tests with emmeans:
  318. emmeans(mod, specs = pairwise ~ sonication_f,
  319. interaction = "pairwise", regrid = "response", adjust = "none")
  320. emmeans(mod, specs = pairwise ~ sonication_f | outcome_last_rel_f,
  321. interaction = "pairwise", regrid = "response", adjust = "none")
  322. emmeans(mod, specs = pairwise ~ sonication_f | valence_f,
  323. interaction = "pairwise", regrid = "response", adjust = "none")
  324. # ============================================================================ #
  325. # ============================================================================ #
  326. # ============================================================================ #
  327. # ============================================================================ #
  328. #### 04a) Fit mixed-effects linear regression models to RTs: ####
  329. ## Select sonication conditions:
  330. selData <- modData # all data
  331. selData <- droplevels(subset(modData, sonication_f == "sham"))
  332. selData <- droplevels(subset(modData, sonication_f %in% c("sham", "dACC")))
  333. selData <- droplevels(subset(modData, sonication_f %in% c("sham", "aIns")))
  334. ## Inspect:
  335. table(selData$sonication_f)
  336. length(unique(selData$subID))
  337. table(selData$subID)
  338. ## Inspect outliers:
  339. sum(selData$RT_n < 0.2, na.rm = T)
  340. tapply(selData$RTcleaned_n, selData$response_f, mean, na.rm = T)
  341. tapply(selData$RTcleaned_n, selData$reqAction_f, mean, na.rm = T)
  342. tapply(selData$RTcleaned_n, selData$valence_f, mean, na.rm = T)
  343. densityplot(selData$RTcleaned_z)
  344. # ---------------------------------------------------------------------------- #
  345. ### Select formula:
  346. ## 2-way interactions:
  347. formula <- "RTcleaned_z ~ reqAction_f * valence_f + (reqAction_f * valence_f|subject_f)"
  348. ## 3-way interaction:
  349. formula <- "RTcleaned_z ~ reqAction_f * valence_f * sonication_f + (reqAction_f * valence_f * sonication_f|subject_f)"
  350. # ---------------------------------------------------------------------------- #
  351. ### Fit linear regression or read in past fit:
  352. mod <- fit_lmem(formula)
  353. quickCI(mod, nRound = 3)
  354. mod <- fit_lmem(formula, useLRT = T)
  355. # ---------------------------------------------------------------------------- #
  356. ### Fit manually:
  357. mod <- lmer(formula = formula, data = selData,
  358. control = lmerControl(optCtrl = list(maxfun = 1e+9), calc.derivs = F, optimizer = c("bobyqa")))
  359. summary(mod, correlation = F); beep()
  360. quickCI(mod)
  361. Anova(mod, type = "3")
  362. # ---------------------------------------------------------------------------- #
  363. ### Plot:
  364. plot(effect("reqAction_f", mod), multiline = T, lwd = 4)
  365. plot(effect("valence_f", mod), multiline = T, lwd = 4)
  366. plot(effect("sonication_f", mod), multiline = T, lwd = 4)
  367. plot(effect("reqAction_f:valence_f", mod), multiline = T, lwd = 4, colors = c("#007174", "#c93d21"))
  368. plot(effect("reqAction_f:sonication_f", mod), multiline = T, lwd = 4, colors = c("#B2182B", "#2166AC"))
  369. plot(effect("valence_f:sonication_f", mod), multiline = T, lwd = 4, colors = c("#007174", "#c93d21"))
  370. plot(effect("reqAction_f:valence_f:sonication_f", mod), multiline = T, lwd = 4, colors = c("#B2182B", "#2166AC"))
  371. # ---------------------------------------------------------------------------- #
  372. ### Post-hoc z-tests with emmeans:
  373. emmeans(mod, specs = pairwise ~ valence_f | reqAction_f,
  374. interaction = "pairwise", djust = "none")
  375. emmeans(mod, specs = pairwise ~ reqAction_f | valence_f,
  376. interaction = "pairwise", djust = "none")
  377. emmeans(mod, specs = pairwise ~ sonication_f | reqAction_f,
  378. interaction = "pairwise", djust = "none")
  379. emmeans(mod, specs = pairwise ~ sonication_f | valence_f,
  380. interaction = "pairwise", djust = "none")
  381. emmeans(mod, specs = pairwise ~ valence_f:sonication_f | reqAction_f,
  382. interaction = "pairwise", adjust = "none")
  383. emmeans(mod, specs = pairwise ~ reqAction_f:sonication_f | valence_f,
  384. interaction = "pairwise", adjust = "none")
  385. # END OF FILE.

01_mgngtus_regression.R at commit eaa1a08, under MIT · at the source

Overview

Authors: Nomiki Koutsoumpari1,2, Johannes Algermissen3,4, Siti Nurbaya Yaakub1,2, Hanneke EM den Ouden4, Nadege Bault1,2, Elsa Fouragnan1,2
  1. School of Psychology, University of Plymouth, Plymouth, United Kingdom
  2. Brain Research Imaging Center (BRIC), University of Plymouth, Plymouth, United Kingdom
  3. Department of Experimental Psychology, University of Oxford, Oxford, United Kingdom
  4. Radboud University, Donders Institute for Brain, Cognition and Behaviour, Nijmegen, The Netherlands
Institutions: University of Plymouth (United Kingdom); Radboud University Nijmegen (Netherlands); University of Oxford (United Kingdom); Donders Institute for Brain, Cognition and Behaviour (Netherlands)
Journal: PLoS biology, volume 24, issue 5, article e3003767
Dates: received 5 August 2025; accepted 7 April 2026; published online 5 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1371/journal.pbio.3003767 · PMID 42085365 · PMCID PMC13143107 · OpenAlex W7160234531
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: other (modality), human (organism), cognitive (subfield)
Methods: Statistics, Machine learning, Preprocessing, Connectivity, fMRI & imaging
MeSH: Gyrus Cinguli*, Insular Cortex*, Learning*, Adult, Cues, Female, Humans, Male, Reward, Young Adult (* major topic)
Journal subjects: Biology and Life Sciences, Neuroscience, Cognitive Science, Cognitive Psychology, Learning, Psychology, Social Sciences, Learning and Memory, Research and Analysis Methods, Specimen Preparation and Treatment, Mechanical Treatment of Specimens, Sonication, Physical Sciences, Physics, Acoustics, Medicine and Health Sciences, Diagnostic Medicine, Diagnostic Radiology, Magnetic Resonance Imaging, Imaging Techniques, Radiology and Imaging, Mathematics, Discrete Mathematics, Combinatorics, Permutation, Decision Making, Cognition, Behavior, Simulation and Modeling
Topic: Transcranial Magnetic Stimulation Studies (Neurology, Neuroscience), according to OpenAlex
Citations: cited by 1 paper (Europe PMC); 90 references in the paper

Abstract

Pavlovian biases reflect how evolutionarily hard-wired tendencies—automatic approach toward reward cues and withdrawal from threat cues—can interfere with flexible, goal-directed action. Such biases arise through three mechanisms: (a) anticipated rewards energize action while anticipated punishments suppress it (response bias), (b) agents learn differently from actions than from inactions (learning bias), and (c) reward/punishment cues themselves drive repetitive behavior, independent of outcomes (perseveration bias). The neural origin of these biases is unclear. Past evidence suggests dorsal anterior cingulate cortex (dACC) and anterior insula (aIns) as part of a “reset network” that rapidly responds to salient information and might contribute to these biases. We used transcranial ultrasonic stimulation (TUS) in 29 healthy participants to interfere with neural activity in these regions and test their causal role in a within-subject, counter-balanced design across three sessions (sham, TUS-dACC, TUS-aIns). Computational modeling revealed a functional differentiation of both regions in Pavlovian biases: while TUS to either region did not affect the response bias, TUS to the aIns decreased people’s learning bias, while TUS to dACC increased participants’ perseveration bias. Although the dACC and aIns are part of the same network and often co-activate during decision-making tasks, TUS interference reveals their distinct roles: the dACC mediates cue-dependent persistence while the aIns is critical for inferring whether outcomes are self-caused.

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 15 matches between paragraphs and lines of code.

johalgermissen/mgng_tus_dacc_ains

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: eaa1a081215b5a33882d49d6a6ddbc97f073e892, 2 April 2026
Languages: MATLAB (70), R (11)
Size: 86 files, 81 scripts
Software Heritage: not archived
Found in: “Data Availability”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Statistics and Machine Learning Toolbox (18 files), ggplot2 (3 files), tidyverse (3 files), afex (2 files), car (2 files), lme4 (2 files), psych (2 files), boundedline (1 file), data.table (1 file), emmeans (1 file), mgcv (1 file), patchwork (1 file), reshape2 (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
83 files

Zenodo 19386479

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data Availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Statistics and Machine Learning Toolbox (18 files), ggplot2 (3 files), tidyverse (3 files), afex (2 files), car (2 files), lme4 (2 files), psych (2 files), boundedline (1 file), data.table (1 file), emmeans (1 file), mgcv (1 file), patchwork (1 file), reshape2 (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
  • 28 September 2026: the link answers (HTTP 200)
83 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;
  • 162 scripts, each with its path and the digest of its content;
  • 15 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 Availability

The data files are available as .csv and .mat files on the OSF repository https://doi.org/10.17605/OSF.IO/PUX6S. Code availability statement: Analyses code to reproduce the results from regression and reinforcement learning models are in a GitHub repository under https://github.com/johalgermissen/mgng_tus_dacc_ains as well as on Zenodo under https://doi.org/10.5281/zenodo.19386479.

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, 28 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 10 MeSH terms, 5 funders, 89 references.

Cite

This paper

Koutsoumpari, N., Algermissen, J., Yaakub, S. N., den Ouden, H. E., Bault, N., & Fouragnan, E. (2026). Ultrasound neuromodulation reveals distinct roles of the dorsal anterior cingulate cortex and anterior insula in learning. PLoS biology, 24(5), e3003767. https://doi.org/10.1371/journal.pbio.3003767

BibTeX

@article{koutsoumpari2026ultrasound,
author = {Koutsoumpari, Nomiki and Algermissen, Johannes and Yaakub, Siti Nurbaya and den Ouden, Hanneke EM and Bault, Nadege and Fouragnan, Elsa},
title = {{Ultrasound neuromodulation reveals distinct roles of the dorsal anterior cingulate cortex and anterior insula in learning}},
journal = {PLoS biology},
year = {2026},
month = may,
volume = {24},
number = {5},
pages = {e3003767},
publisher = {PLOS},
issn = {1544-9173},
doi = {10.1371/journal.pbio.3003767},
url = {https://doi.org/10.1371/journal.pbio.3003767},
pmid = {42085365},
pmcid = {PMC13143107}
}

RIS

TY - JOUR
AU - Koutsoumpari, Nomiki
AU - Algermissen, Johannes
AU - Yaakub, Siti Nurbaya
AU - den Ouden, Hanneke EM
AU - Bault, Nadege
AU - Fouragnan, Elsa
TI - Ultrasound neuromodulation reveals distinct roles of the dorsal anterior cingulate cortex and anterior insula in learning
T2 - PLoS biology
J2 - PLoS Biol
PY - 2026
DA - 2026/05/05
VL - 24
IS - 5
SP - e3003767
SN - 1544-9173
PB - PLOS
DO - 10.1371/journal.pbio.3003767
UR - https://doi.org/10.1371/journal.pbio.3003767
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pbio.3003767",
"type": "article-journal",
"title": "Ultrasound neuromodulation reveals distinct roles of the dorsal anterior cingulate cortex and anterior insula in learning",
"container-title": "PLoS biology",
"author": [
{
"family": "Koutsoumpari",
"given": "Nomiki"
},
{
"family": "Algermissen",
"given": "Johannes"
},
{
"family": "Yaakub",
"given": "Siti Nurbaya"
},
{
"family": "den Ouden",
"given": "Hanneke EM"
},
{
"family": "Bault",
"given": "Nadege"
},
{
"family": "Fouragnan",
"given": "Elsa"
}
],
"container-title-short": "PLoS Biol",
"volume": "24",
"issue": "5",
"page": "e3003767",
"DOI": "10.1371/journal.pbio.3003767",
"PMID": "42085365",
"PMCID": "PMC13143107",
"ISSN": "1544-9173",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pbio.3003767",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
5
]
]
}
}

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.1371/journal.pbio.3003979 [code]
Impaired midfrontal‑motor theta phase synchronization characterizes maladaptive motivational behavior in people with obsessive‑compulsive disorder.
Journal: PLoS biology
In common: afex, boundedline, psych, 7 other tools, 7 references
[2] doi:10.1038/s41467-026-72934-3 [code]
Multi-focal ultrasound neuromodulation to the dorsal anterior cingulate cortex disrupts behavioural and neural pain processing.
Journal: Nature communications
In common: car, emmeans, lme4, 3 other tools, other, 4 references, 2 authors
[3] doi:10.1126/sciadv.aec9291 [code]
Computational mechanisms of perception in autism revealed using games inspired by rodent operant tasks.
Journal: Science advances
In common: afex, psych, car, 7 other tools, cognitive
[4] doi:10.1371/journal.pone.0353990 [code]
Positive mood enhances accessibility of unrelated concepts in the first language but not in the foreign language.
Journal: PloS one
In common: afex, psych, car, 6 other tools, cognitive, 1 reference
[5] doi:10.1038/s41467-026-74565-0 [code]
The functional neurobiology of dispositions towards negative emotions.
Journal: Nature communications
In common: afex, boundedline, psych, 5 other tools, cognitive, 1 reference
[6] doi:10.1093/bioinformatics/btag592 [code]
Network-based stratification of allele-specific expression reveals patient subgroups in Huntington's disease.
Journal: Bioinformatics (Oxford, England)
In common: mgcv, car, emmeans, 6 other tools
[7] doi:10.1016/j.neuroimage.2026.122115 [code]
Midfrontal theta power relates to response speeding following frustrative nonreward.
Journal: NeuroImage
In common: psych, car, emmeans, 6 other tools, cognitive
[8] doi:10.1073/pnas.2606871123 [code]
Oxytocin modulates the neurocomputational mechanisms engaged in learning rank relationships in social networks.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: psych, car, emmeans, 6 other tools
[9] doi:10.1016/j.nicl.2026.104012 [code]
Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder.
Journal: NeuroImage. Clinical
In common: afex, psych, car, 5 other tools, other
[10] doi:10.1192/bjp.2026.10664 [code]
Early effects of a novel 5-HT&lt;sub&gt;4&lt;/sub&gt;R agonist (PF-04995274) and the SSRI citalopram on emotional cognition in unmedicated depression: RESTAND study.
Journal: The British journal of psychiatry : the journal of mental science
In common: afex, car, emmeans, 5 other tools, cognitive

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.