OSCR

Remembered Event Features Shape Default Mode Network Engagement during Emotional Memory Recall.

Code ↔ Paper

1 match 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 1 match
  1. [1] § Materials and Methods › Statistical analysis ↔ reframe-detail-main-paper.Rmd, lines 1203 to 1244 · score 0.54 · linear mixed, intercept, lme4, coefficients, predicted, behavioral · 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 Markdown · 1,357 lines · 49 KB · no license · 1 match

  1. ---
  2. title: "R Notebook"
  3. output: html_notebook
  4. ---
  5. This script contains univariate analyses at the network level + amygdala and hippocampus, and behavioral analyses, for the reframe-detail project.
  6. # Setup
  7. ```{r}
  8. # Libraries
  9. library(tidyverse)
  10. library(lme4)
  11. library(lmerTest)
  12. library(ez)
  13. library(ggsegSchaefer)
  14. library(ggseg3d)
  15. library(ggseg)
  16. library(sjPlot)
  17. library(kableExtra)
  18. library(corrplot)
  19. library(ggpubr)
  20. library(here)
  21. library(glue)
  22. library(officer)
  23. library(rvg)
  24. library(emmeans)
  25. # Calculations
  26. zscore <- function(x) (x-mean(x))/sd(x)
  27. se <- function(x) sqrt(var(x)/length(x)) #function to calculate SE
  28. ci <- function(x) (sqrt(var(x)/length(x))) * 1.96 #function to calculate 95% CI
  29. #Plotting theme
  30. fontsize <- 14
  31. linesize <- .5
  32. barcolors <- c("#f76c67","#67aaf7","#0bca81","#f6a84f","#9c67f7","#67f7f0","#7F7F7F")
  33. my_theme <- function() {
  34. theme(plot.title = element_text(hjust = 0.5, size=fontsize, margin=margin(0,0,20,0)),
  35. axis.line.x = element_line(color = "black", size = 1),
  36. axis.line.y = element_line(color = "black", size = 1),
  37. axis.text.x = element_text(size = .8*fontsize, hjust=1, vjust=1, angle = 45),
  38. axis.text.y = element_text(size = .8*fontsize),
  39. axis.title.y = element_text(size = 1*fontsize),
  40. axis.title.x = element_blank(),
  41. panel.background = element_blank(),
  42. legend.position="none",
  43. strip.text.x = element_text(size=fontsize),
  44. text = element_text(family="Helvetica")) # +
  45. # theme(plot.margin = margin(1, 1, 1, 1, "cm"))
  46. }
  47. ```
  48. ## Load data
  49. ### behavioral data
  50. ```{r}
  51. behav <- read.csv('/Volumes/memolab/Data/Behavioral_Online/reframe-details/detail_script_files/behav_data_allonsets.csv')
  52. behav <- behav %>%
  53. filter(period=="recall") # keep only one row per trial
  54. nina_behav <- read.csv('/Volumes/memolab/Data/Behavioral_Online/reframe-details/detail_script_files/onsets_all.csv')
  55. nina_behav <- nina_behav %>%
  56. filter(period=="recall")
  57. behav$eventDet = nina_behav$eventDetails.y # adding nina's add'l coding
  58. behav$visualDet = nina_behav$visualDetails.y
  59. # add in missing data from nina's coding
  60. missing = read.csv('/Volumes/memolab/Data/Behavioral_Online/reframe-details/detail_script_files/missing_coded.csv')
  61. behav <- behav %>%
  62. left_join(missing, by = c("subID", "videoName"))
  63. behav$eventDets = ifelse(is.na(behav$eventDet.x), behav$eventDet.y, behav$eventDet.x)
  64. behav$visualDets = ifelse(is.na(behav$visualDet.x), behav$visualDet.y, behav$visualDet.x)
  65. # remove unnecessary columns
  66. behav = behav %>% select(-eventDet.x, -visualDet.x, -eventDet.y, -visualDet.y)
  67. table(behav$subID,behav$run)
  68. nsub.behav <- length(unique(behav$subID))
  69. # Some video info is contained only for the first round. Make sure it's repeated for other rounds.
  70. behav.roundone <- behav %>%
  71. filter(regRound==1) %>%
  72. select("subID","videoName","recallValence","recallArousal","recallVividness",
  73. "encValence","encArousal","valenceChange","arousalChange","successful",
  74. "remembered","correctDetails", "eventDets", "visualDets")
  75. behav.left <- behav[,1:18]
  76. behav.all <- full_join(behav.left,behav.roundone,by=c("subID","videoName"),
  77. suffix=c("",".ignore"))
  78. # no event/visual detail column should have "NA" - replace with zero.
  79. behav.all$eventDets = ifelse(is.na(behav.all$eventDets), 0, behav.all$eventDets)
  80. behav.all$visualDets = ifelse(is.na(behav.all$visualDets), 0, behav.all$visualDets)
  81. ```
  82. ### activity data
  83. ```{r}
  84. subjects <- list.files(path='/Volumes/memolab/Data/Behavioral_Online/reframe-details/detail_script_files/redo/',full.names=TRUE, recursive = TRUE, pattern = 'block15s_timepoint-averages_schaefer')
  85. actdata = do.call(rbind, lapply(subjects, function(x) {read.csv(x, header = TRUE)}))
  86. tmp <- filter(actdata,ROI=="LH_HIPP")
  87. table(tmp$subID,tmp$run)
  88. nsub.act <- length(unique(actdata$subID))
  89. ```
  90. ### combine behavioral + activity
  91. ```{r}
  92. # first fix subID numbers to follow same format
  93. behav.all <- behav.all %>%
  94. mutate(subID.orig = subID,
  95. subID = paste0("sub-",subID.orig))
  96. alldata <- left_join(actdata,behav.all,by=c("subID","videoName","trial"),suffix=c(".act",".beh"))
  97. ```
  98. summarize trial numbers per condition:
  99. ```{r}
  100. tmp <- filter(alldata,ROI=="LH_HIPP" & subID=="sub-s002")
  101. table(tmp$conditionName,tmp$valenceCategory)
  102. ```
  103. ### cleaning
  104. #### Define factors
  105. ```{r}
  106. alldata$ROI <- as.factor(alldata$ROI)
  107. alldata$conditionName <- as.factor(alldata$conditionName)
  108. alldata$valenceCategory <- as.factor(alldata$valenceCategory)
  109. alldata$subID <- as.factor(alldata$subID)
  110. alldata$regRound.categ <- as.factor(alldata$regRound) # keep both integer & categorical versions
  111. alldata$videoName <- as.factor(alldata$videoName)
  112. alldata$periodLabel <- as.factor(alldata$periodLabel)
  113. ```
  114. #### Remove outliers
  115. Defined as values abs(z)>4, calculated within subject and ROI - as in Cooper & Ritchey 2020 parcel analysis
  116. Note that these time-points come from the residuals of a nuisance regressor-only model, which included run regressors that account for mean differences between runs.
  117. ```{r}
  118. ### add z score of activity estimates within region and subject and time-period
  119. alldata <- alldata %>%
  120. group_by(subID, ROI, periodLabel) %>%
  121. mutate(Z = zscore(regulationActivity)) %>%
  122. ungroup()
  123. # remove betas that are > 4SD
  124. tmp <- alldata %>%
  125. mutate(isOutlier = ifelse(abs(Z)>4,TRUE,FALSE))
  126. # Following Cooper & Ritchey, remove trials where mean for ANY ROI is an outlier
  127. outliers <- tmp %>%
  128. select(isOutlier,subID,trial) %>%
  129. filter(isOutlier) %>%
  130. unique()
  131. alldata <- left_join(alldata,outliers,by=c("subID","trial"))
  132. alldata$isOutlier[is.na(alldata$isOutlier)] <- FALSE
  133. # Summarize number of outliers
  134. table(alldata$subID,alldata$isOutlier)
  135. table(alldata$isOutlier)
  136. alldata$regulationActivity[alldata$isOutlier] <- NA #mark value as NA if outlier
  137. ```
  138. #### Trial filters
  139. Removing reappraisal trials that were initially collected for a separate study;
  140. filtering trials to remembered-only
  141. ```{r}
  142. alldata <- alldata %>%
  143. mutate(isComplete.emo = ifelse(is.na(valenceChange) | is.na(arousalChange),
  144. FALSE,TRUE))
  145. # Removing negative reappraisal (non-memory) trials
  146. alldata <- alldata %>%
  147. filter(conditionName == "remember")
  148. all_nr = alldata # capturing all trials, not just remembered
  149. alldata <- alldata %>% filter(remembered == 1) # only looking at remembered-only data!
  150. ```
  151. #### Mean centering predictors
  152. Within-participant
  153. ```{r}
  154. alldata <- alldata %>%
  155. group_by(subID,ROI,periodLabel) %>%
  156. mutate(regSuccess = scale(regSuccess,scale=FALSE),
  157. valenceChange = scale(valenceChange,scale=FALSE),
  158. arousalChange = scale(arousalChange,scale=FALSE),
  159. recallVividness = scale(recallVividness,scale=FALSE),
  160. eventDets = scale(eventDets, scale =FALSE),
  161. visualDets = scale(visualDets, scale=FALSE),
  162. correctDetails = scale(correctDetails, scale=FALSE)) %>% # mean-center within subject
  163. ungroup()
  164. # double check that this worked as expected
  165. tmp <- alldata %>% filter(valenceCategory=="neg" & ROI=="LH_HIPP") %>% group_by(subID) %>% summarize(meansucc = mean(regSuccess,na.rm=TRUE))
  166. ```
  167. #### Getting ROI info
  168. ```{r}
  169. alldata %>%
  170. ungroup() %>%
  171. filter(subID=="sub-s005" & trialID==8) %>%
  172. mutate(ROIsplit = ROI) %>%
  173. separate(ROIsplit, into = c("hemisphere", "network", "netregion"), sep = "_", extra = "merge") %>%
  174. select(ROI,hemisphere,network,netregion) -> roi_info
  175. alldata <- left_join(alldata,roi_info,by=c("ROI"))
  176. tempdf = alldata %>%
  177. filter(subID=="sub-s005" & ROI=="DefaultC")
  178. ```
  179. save alldata for use in other analyses - specify a path accordingly
  180. ```{r}
  181. saveRDS(alldata, "alldata_reframe-detail.rds")
  182. saveRDS(mem.data, "mem.data_reframe-detail.rds")
  183. ```
  184. # Analysis: DMN subnetwork activity
  185. ## setup
  186. ```{r}
  187. rois <- levels(alldata$ROI)
  188. outDir <- '/Volumes/memolab/Data/Behavioral_Online/reframe-details/detail_script_files/reframe-detail_timepoint_results/'
  189. alphafdr <- .05
  190. ```
  191. get network-level data:
  192. ```{r}
  193. include_networks = c("DefaultA","DefaultB","DefaultC", "HIPP", "AMYG")
  194. # Summarize data
  195. alldata %>%
  196. # filter to include only some rows
  197. filter(network %in% include_networks) %>%
  198. # average over ROIs within a network
  199. group_by(subID,trial, cueWord.act, network, eventDets, visualDets, correctDetails, valenceCategory) %>%
  200. summarize(regulationActivity = mean(regulationActivity,na.rm=TRUE)) %>%
  201. ungroup() -> network.data
  202. ```
  203. create function for running model:
  204. ```{r}
  205. model.stats <- data.frame()
  206. # define function
  207. detail_emo_neuref <- function(curROI,model.stats) {
  208. # model
  209. roiData <- network.data %>% filter(network %in% curROI)
  210. roiData$valenceCategory <- factor(roiData$valenceCategory, levels=c("neu", "neg", "pos"))
  211. full.model <- lmer(regulationActivity ~ visualDets + eventDets +
  212. visualDets*valenceCategory +eventDets*valenceCategory + (1|subID), data = roiData)
  213. print(tab_model(full.model,title="detail x emotion, neutral reference"))
  214. stats <- data.frame(summary(full.model)$coefficients[2:nrow(summary(full.model)$coefficients),])
  215. stats <- mutate(stats,ROI=curROI)
  216. model.stats <- rbind(model.stats,stats)
  217. p <- plot_model(full.model, show.values = TRUE, show.p = FALSE,
  218. value.offset = .3, vline.color = "gray30",
  219. colors=c("lightskyblue","steelblue"), type = "std") + ylim(c(-.3,.3)) +
  220. ggtitle(curROI) +
  221. my_theme()
  222. print(p)
  223. return(model.stats)
  224. }
  225. ```
  226. ## run models
  227. ```{r}
  228. model.stats <- detail_emo_neuref("DefaultA",model.stats)
  229. model.stats <- detail_emo_neuref("DefaultB",model.stats)
  230. model.stats <- detail_emo_neuref("DefaultC",model.stats)
  231. model.stats <- detail_emo_neuref("HIPP",model.stats)
  232. model.stats <- detail_emo_neuref("AMYG",model.stats)
  233. ```
  234. ## Figure 2c (network activity by valence)
  235. ```{r}
  236. include_rois <- c("DefaultA","DefaultB","DefaultC")
  237. # Summarize data
  238. alldata %>%
  239. filter(network %in% include_rois) %>%
  240. mutate(network = factor(network,levels=include_rois)) %>%
  241. group_by(subID,ROI,network,periodLabel,valenceCategory) %>% # average across trials
  242. summarize(meanActivity = mean(regulationActivity,na.rm=TRUE)) %>%
  243. group_by(subID,network,periodLabel,valenceCategory) %>% # average across ROIs
  244. summarize(meanNet = mean(meanActivity)) -> subdata
  245. subdata %>%
  246. filter(valenceCategory=="neu") %>%
  247. mutate(meanNeutral = meanNet) %>%
  248. select(subID,network,periodLabel,meanNeutral) -> subdata.neu
  249. subdata %>%
  250. left_join(subdata.neu,by=c("subID","network","periodLabel")) %>%
  251. mutate(valenceDiff = meanNet - meanNeutral) -> subdata
  252. subdata %>%
  253. group_by(network,periodLabel,valenceCategory) %>% # then average across subjects
  254. summarize(meanAct = mean(meanNet),
  255. seAct = se(meanNet)) -> meandata
  256. network_names <- list(
  257. 'DMN-A'="Core midline",
  258. 'DMN-B'="Dorsomedial",
  259. 'DMN-C'="Medial temporal"
  260. )
  261. network_labeller <- function(variable,value){
  262. return(network_names[value])
  263. }
  264. subdata %>%
  265. ggplot(aes(y=meanNet,x=valenceCategory,color=valenceCategory,fill=valenceCategory)) +
  266. facet_grid(.~network, labeller = network_labeller) +
  267. # add individual data points
  268. geom_jitter(width = 0.15, size = 0.5, alpha = 0.75) +
  269. # add a boxplot
  270. geom_boxplot(width = .5, #0.25,
  271. fill = "white",
  272. alpha = 0.75,
  273. #fatten = 0, # removes the median line
  274. outlier.alpha = 0) +
  275. # add a point that represents the mean
  276. #stat_summary(fun = mean,
  277. # geom = "point",
  278. # size = 2) +
  279. ggtitle("Network activity by valence") +
  280. ylab("Network activity") + # for the y axis label
  281. xlab("Valence") +
  282. # Set fill colors for the bars and specify legend labels
  283. scale_fill_manual(values = c("neg" = "#e3401a", # Red for negative
  284. "neu" = "#1f78b4", # Blue for neutral
  285. "pos" = "#33a02c"), # Green for positive
  286. labels = c("neg" = "negative", "neu" = "neutral", "pos" = "positive"),
  287. name = "Valence") +
  288. scale_color_manual(values = c("neg" = "#e3401a", # Red for negative
  289. "neu" = "#1f78b4", # Blue for neutral
  290. "pos" = "#33a02c"), # Green for positive
  291. labels = c("neg" = "negative", "neu" = "neutral", "pos" = "positive"),
  292. name = "Valence") +
  293. my_theme() + theme(
  294. axis.title.y = element_text(size = 10),
  295. axis.title.x = element_text(size = 10),
  296. axis.text.y = element_text(size = 8),
  297. axis.text.x = element_text(size = 8),
  298. # strip.text.x = element_text(size = 8),
  299. axis.line.x = element_line(color = "black", size = .5),
  300. axis.line.y = element_line(color = "black", size = .5),
  301. axis.ticks = element_line(color = "black", size = .5),
  302. axis.ticks.length = unit(0.1, "cm"),
  303. plot.title = element_blank(),
  304. panel.background = element_blank(),
  305. strip.text.x = element_blank()
  306. ) -> p2
  307. p2
  308. # ggsave(filename = 'insert-path/network_valence.png',
  309. # plot = p2,
  310. # device = "png",
  311. # dpi = 300,
  312. # width = 4.2,
  313. # height = 2.7 ,
  314. # units = "in")
  315. ```
  316. ## results
  317. ### narrative details
  318. ```{r}
  319. # event.model
  320. event.model = model.stats %>% filter((row.names(model.stats) == "eventDets")|(row.names(model.stats) == "eventDets1")|(row.names(model.stats) == "eventDets2")|(row.names(model.stats) == "eventDets3")|(row.names(model.stats) == "eventDets4"))
  321. p.values <- event.model[,5]
  322. Pr.fdr <- p.adjust(p.values, method = "fdr")
  323. event.model <- cbind(event.model,Pr.fdr)
  324. event.model <- mutate(event.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  325. kbl(event.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  326. scroll_box(width="1200px",height="800px")
  327. ```
  328. ### perceptual details
  329. ```{r}
  330. # visual.model
  331. visual.model = model.stats %>% filter((row.names(model.stats) == "visualDets")|(row.names(model.stats) == "visualDets1")|(row.names(model.stats) == "visualDets2")|(row.names(model.stats) == "visualDets3")|(row.names(model.stats) == "visualDets4"))
  332. p.values <- visual.model[,5]
  333. Pr.fdr <- p.adjust(p.values, method = "fdr")
  334. visual.model <- cbind(visual.model,Pr.fdr)
  335. visual.model <- mutate(visual.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  336. kbl(visual.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  337. scroll_box(width="1200px",height="800px")
  338. ```
  339. ### positive valence
  340. ```{r}
  341. # pos.model
  342. pos.model = model.stats %>% filter((row.names(model.stats) == "valenceCategorypos")|(row.names(model.stats) == "valenceCategorypos1")|(row.names(model.stats) == "valenceCategorypos2")|(row.names(model.stats) == "valenceCategorypos3")|(row.names(model.stats) == "valenceCategorypos4"))
  343. p.values <- pos.model[,5]
  344. Pr.fdr <- p.adjust(p.values, method = "fdr")
  345. pos.model <- cbind(pos.model,Pr.fdr)
  346. pos.model <- mutate(pos.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  347. kbl(pos.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  348. scroll_box(width="1200px",height="800px")
  349. ```
  350. ### negative valence
  351. ```{r}
  352. # neg.model
  353. neg.model = model.stats %>% filter((row.names(model.stats) == "valenceCategoryneg")|(row.names(model.stats) == "valenceCategoryneg1")|(row.names(model.stats) == "valenceCategoryneg2")|(row.names(model.stats) == "valenceCategoryneg3")|(row.names(model.stats) == "valenceCategoryneg4"))
  354. p.values <- neg.model[,5]
  355. Pr.fdr <- p.adjust(p.values, method = "fdr")
  356. neg.model <- cbind(neg.model,Pr.fdr)
  357. neg.model <- mutate(neg.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  358. kbl(neg.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  359. scroll_box(width="1200px",height="800px")
  360. ```
  361. ### perceptual x positive
  362. ```{r}
  363. visual.pos.model = model.stats %>% filter((row.names(model.stats) == "visualDets:valenceCategorypos")|(row.names(model.stats) == "visualDets:valenceCategorypos1")|(row.names(model.stats) == "visualDets:valenceCategorypos2")|(row.names(model.stats) == "visualDets:valenceCategorypos3")|(row.names(model.stats) == "visualDets:valenceCategorypos4"))
  364. p.values <- visual.pos.model[,5]
  365. Pr.fdr <- p.adjust(p.values, method = "fdr")
  366. visual.pos.model <- cbind(visual.pos.model,Pr.fdr)
  367. visual.pos.model <- mutate(visual.pos.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  368. kbl(visual.pos.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  369. scroll_box(width="1200px",height="800px")
  370. ```
  371. ### perceptual x negative
  372. ```{r}
  373. # visual.neg.model
  374. visual.neg.model = model.stats %>% filter((row.names(model.stats) == "visualDets:valenceCategoryneg")|(row.names(model.stats) == "visualDets:valenceCategoryneg1")|(row.names(model.stats) == "visualDets:valenceCategoryneg2")|(row.names(model.stats) == "visualDets:valenceCategoryneg3")|(row.names(model.stats) == "visualDets:valenceCategoryneg4"))
  375. p.values <- visual.neg.model[,5]
  376. Pr.fdr <- p.adjust(p.values, method = "fdr")
  377. visual.neg.model <- cbind(visual.neg.model,Pr.fdr)
  378. visual.neg.model <- mutate(visual.neg.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  379. kbl(visual.neg.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  380. scroll_box(width="1200px",height="800px")
  381. ```
  382. ### narrative.x positive
  383. ```{r}
  384. event.pos.model = model.stats %>% filter((row.names(model.stats) == "eventDets:valenceCategorypos")|(row.names(model.stats) == "eventDets:valenceCategorypos1")|(row.names(model.stats) == "eventDets:valenceCategorypos2")|(row.names(model.stats) == "eventDets:valenceCategorypos3")|(row.names(model.stats) == "eventDets:valenceCategorypos4"))
  385. p.values <- event.pos.model[,5]
  386. Pr.fdr <- p.adjust(p.values, method = "fdr")
  387. event.pos.model <- cbind(event.pos.model,Pr.fdr)
  388. event.pos.model <- mutate(event.pos.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  389. kbl(event.pos.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  390. scroll_box(width="1200px",height="800px")
  391. ```
  392. ### narrative x negative
  393. ```{r}
  394. # event.neg.model
  395. event.neg.model = model.stats %>% filter((row.names(model.stats) == "eventDets:valenceCategoryneg")|(row.names(model.stats) == "eventDets:valenceCategoryneg1")|(row.names(model.stats) == "eventDets:valenceCategoryneg2")|(row.names(model.stats) == "eventDets:valenceCategoryneg3")|(row.names(model.stats) == "eventDets:valenceCategoryneg4"))
  396. p.values <- event.neg.model[,5]
  397. Pr.fdr <- p.adjust(p.values, method = "fdr")
  398. event.neg.model <- cbind(event.neg.model,Pr.fdr)
  399. event.neg.model <- mutate(event.neg.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  400. kbl(event.neg.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  401. scroll_box(width="1200px",height="800px")
  402. ```
  403. # Figure 2d (perceptual x medial temporal)
  404. ```{r}
  405. include_rois <- c("DefaultC")
  406. roiData <- network.data %>% filter(network %in% include_rois)
  407. roiData$valenceCategory <- factor(roiData$valenceCategory,
  408. levels = c("neu", "neg", "pos"))
  409. # model for DMN-C
  410. full.model.c <- lmer(regulationActivity ~ visualDets + eventDets +
  411. visualDets*valenceCategory + eventDets*valenceCategory +
  412. (1|subID), data = roiData)
  413. # plotting function
  414. plot_visualDets_noScatter <- function(cur_model, roiData, ylab) {
  415. visualDets_seq <- seq(-8, 12, length.out = 100)
  416. pred_data <- data.frame(
  417. visualDets = visualDets_seq,
  418. eventDets = mean(roiData$eventDets),
  419. valenceCategory = "neu"
  420. )
  421. pred_values <- predict(cur_model, newdata = pred_data, re.form = NA, se.fit = TRUE)
  422. pred_data <- pred_data %>%
  423. mutate(
  424. pred = pred_values$fit,
  425. se = pred_values$se.fit,
  426. lower = pred - 1.96 * se,
  427. upper = pred + 1.96 * se
  428. )
  429. p1 <- ggplot() +
  430. geom_point(data = roiData, aes(x = visualDets, y = regulationActivity), alpha = 0) +
  431. geom_line(data = pred_data, aes(x = visualDets, y = pred), color = "violet", size = 1) +
  432. geom_ribbon(data = pred_data, aes(x = visualDets, ymin = lower, ymax = upper),
  433. fill = "violet", alpha = 0.2) +
  434. labs(x = "Perceptual details recalled (mean-centered)", y = ylab) +
  435. theme_minimal(14) +
  436. theme(
  437. panel.grid.major.x = element_blank(),
  438. panel.grid.minor.x = element_blank(),
  439. panel.grid.major.y = element_blank(),
  440. panel.grid.minor.y = element_blank(),
  441. panel.background = element_blank(),
  442. axis.line.x = element_line(color = "black", size = .5),
  443. axis.line.y = element_line(color = "black", size = .5),
  444. axis.title.y = element_text(size = 10),
  445. axis.title.x = element_text(size = 10),
  446. axis.text.y = element_text(size = 8),
  447. axis.text.x = element_text(size = 8),
  448. plot.title = element_blank(),
  449. axis.ticks = element_line(color = "black", size = .5),
  450. axis.ticks.length = unit(0.1, "cm")
  451. ) +
  452. scale_x_continuous(limits = c(-8, 12), expand = c(0, 0)) +
  453. scale_y_continuous(limits = c(-.2, .4))
  454. ggMarginal(p1, type = "histogram", fill = "gray30", size = 10, margins = "x")
  455. }
  456. dw <- plot_visualDets_noScatter(full.model.c, roiData, "MT subnetwork activity")
  457. dw
  458. # UNCOMMENT + INSERT PATH TO EXPORT
  459. # ggsave(filename = 'insert-path',
  460. # plot = dw,
  461. # device = "png",
  462. # dpi = 300,
  463. # width = 3.5,
  464. # height = 2.25,
  465. # units = "in")
  466. ```
  467. # Figure 3b (perceptual x amygdala)
  468. ```{r}
  469. plot_visualDets_noHist <- function(cur_model,roiData,ylab) {
  470. visualDets_seq <- seq(-8, 12, length.out = 100)
  471. pred_data <- data.frame(
  472. visualDets = visualDets_seq,
  473. eventDets = mean(roiData$eventDets), # Holding eventDets constant at its mean
  474. valenceCategory = "neu" # You can specify any level of valenceCategory here
  475. )
  476. # Get predictions and standard errors using the model
  477. pred_values <- predict(cur_model, newdata = pred_data, re.form = NA, se.fit = TRUE)
  478. # Combine predictions and standard errors into a data frame
  479. pred_data <- pred_data %>%
  480. mutate(
  481. pred = pred_values$fit,
  482. se = pred_values$se.fit,
  483. lower = pred - 1.96 * se, # Lower bound of 95% CI
  484. upper = pred + 1.96 * se # Upper bound of 95% CI
  485. )
  486. # Plot using ggplot2
  487. p1 <- ggplot() +
  488. # Individual data points
  489. geom_point(data=roiData, aes(x=visualDets,y=regulationActivity), alpha=0) +
  490. # Individual lines
  491. # geom_line(data=roiData, aes(x=visualDets,y=regulationActivity,group=subID),
  492. # stat="smooth",method = "lm", color="slateblue",size=1, alpha = 0.5) +
  493. # Line and ribbon for visualDets
  494. geom_line(data = pred_data, aes(x = visualDets, y = pred), color = "violet", size = 1) +
  495. geom_ribbon(data = pred_data, aes(x = visualDets, ymin = lower, ymax = upper), fill = "violet", alpha = 0.2) +
  496. labs(x = "Perceptual details recalled (mean-centered)", y = ylab) +
  497. theme_minimal(14) +
  498. theme(
  499. panel.grid.major.x = element_blank(),
  500. panel.grid.minor.x = element_blank(),
  501. panel.grid.major.y = element_blank(),
  502. panel.grid.minor.y = element_blank(),
  503. panel.background = element_blank(),
  504. axis.line.x = element_line(color = "black", size = .5),
  505. axis.line.y = element_line(color = "black", size = .5),
  506. axis.title.y = element_text(size = 10),
  507. axis.title.x = element_text(size = 10),
  508. axis.text.y = element_text(size = 8),
  509. axis.text.x = element_text(size = 8),
  510. plot.title = element_blank(),
  511. axis.ticks = element_line(color = "black", size = .5),
  512. axis.ticks.length = unit(0.1, "cm")
  513. ) +
  514. scale_x_continuous(limits = c(-8, 12), expand = c(0, 0)) +
  515. scale_y_continuous(limits = c(-.2, .4))
  516. p1
  517. return(p1)
  518. }
  519. include_rois <- c("AMYG")
  520. roiData <- network.data %>% filter(network %in% include_rois)
  521. roiData$valenceCategory <- factor(roiData$valenceCategory, levels=c("neu", "neg", "pos"))
  522. full.model <- lmer(regulationActivity ~ visualDets + eventDets +
  523. visualDets*valenceCategory + eventDets*valenceCategory +
  524. (1|subID), data = roiData)
  525. full.model.amy <- full.model
  526. amyg <- plot_visualDets_noHist(full.model, roiData, "Amygdala activity")
  527. amyg
  528. # UNCOMMENT + INSERT PATH TO EXPORT
  529. # ggsave(filename = 'insert-path',
  530. # plot = amyg,
  531. # device = "png",
  532. # dpi = 300,
  533. # width = 3.5,
  534. # height = 2.25,
  535. # units = "in")
  536. ```
  537. # Figure 2a + 3a (model plotting)
  538. set up models for plotting
  539. ```{r}
  540. include_rois <- c("HIPP")
  541. roiData <- network.data %>% filter(network %in% include_rois)
  542. roiData$valenceCategory <- factor(roiData$valenceCategory, levels=c("neu", "neg", "pos"))
  543. full.model <- lmer(regulationActivity ~ visualDets + eventDets +
  544. visualDets*valenceCategory + eventDets*valenceCategory +
  545. (1|subID), data = roiData)
  546. full.model.hipp <- full.model
  547. include_rois <- c("DefaultB")
  548. roiData <- network.data %>% filter(network %in% include_rois)
  549. roiData$valenceCategory <- factor(roiData$valenceCategory, levels=c("neu", "neg", "pos"))
  550. full.model.b <- lmer(regulationActivity ~ visualDets + eventDets +
  551. visualDets*valenceCategory + eventDets*valenceCategory +
  552. (1|subID), data = roiData)
  553. include_rois <- c("DefaultA")
  554. roiData <- network.data %>% filter(network %in% include_rois)
  555. roiData$valenceCategory <- factor(roiData$valenceCategory, levels=c("neu", "neg", "pos"))
  556. full.model.a <- lmer(regulationActivity ~ visualDets + eventDets +
  557. visualDets*valenceCategory + eventDets*valenceCategory +
  558. (1|subID), data = roiData)
  559. # full.model.c for Default C already made above
  560. # full.model.amy for Amygdala already made above
  561. ```
  562. plot:
  563. ```{r}
  564. p1 <- plot_models(full.model.a, full.model.b, full.model.c,
  565. # value.offset = .3, order.terms=c(1,4,2,3,5,6,7,8),
  566. vline.color = "gray30", colors=c("slateblue4","lightsteelblue","slateblue1"),
  567. #c("hotpink","lightpink","lightsalmon"),
  568. std.est = "std",
  569. m.labels = c("Core", "DM", "MTL"),
  570. show.values = FALSE, show.p = FALSE, p.shape = TRUE, p.threshold=.029,
  571. spacing=.7,
  572. axis.labels = rev(c('Perceptual Details', 'Narrative Details', 'Neg Valence','Pos Valence',
  573. 'Perceptual x Neg','Perceptual x Pos',
  574. 'Narrative x Neg','Narrative x Pos'))) +
  575. guides(shape=FALSE) +
  576. ylim(c(-.3,.3)) +
  577. theme_minimal(12) + theme(legend.title = element_blank())
  578. print(p1)
  579. p2 <- plot_models(full.model.amy, full.model.hipp,
  580. # value.offset = .3, order.terms=c(1,4,2,3,5,6,7,8),
  581. vline.color = "gray30", colors=c("hotpink","orange"),
  582. std.est = TRUE,
  583. m.labels = c("Amyg","Hipp"),
  584. show.values = FALSE, show.p = FALSE, p.shape = TRUE, p.threshold=.01,
  585. spacing=.7,
  586. axis.labels = rev(c('Perceptual Details', 'Narrative Details', 'Neg Valence','Pos Valence',
  587. 'Perceptual x Neg','Perceptual x Pos',
  588. 'Narrative x Neg','Narrative x Pos'))) +
  589. guides(shape=FALSE) +
  590. ylim(c(-.3,.3)) +
  591. theme_minimal(14) + theme(legend.title = element_blank())
  592. print(p2)
  593. ggarrange(p1,p2,ncol=2,legend="top")
  594. # UNCOMMENT + ADD PATH below for export
  595. # ggsave(filename = 'insert-path',
  596. # plot = p1,
  597. # device = "png",
  598. # dpi = 300,
  599. # width = 4,
  600. # height = 4,
  601. # units = "in")
  602. #
  603. #
  604. #
  605. # ggsave(filename = 'insert-path',
  606. # plot = p2,
  607. # device = "png",
  608. # dpi = 300,
  609. # width = 4,
  610. # height = 4,
  611. # units = "in")
  612. ```
  613. # Analysis: change reference category
  614. ```{r}
  615. model.stats <- data.frame()
  616. detail_emo_neuref <- function(curROI,model.stats) {
  617. # model
  618. roiData <- network.data %>% filter(network %in% curROI)
  619. roiData$valenceCategory <- factor(roiData$valenceCategory, levels=c("pos", "neu", "neg"))
  620. full.model <- lmer(regulationActivity ~ visualDets*valenceCategory+eventDets*valenceCategory+ (1|subID), data = roiData)
  621. print(tab_model(full.model,title="uni detail x emotion, ALT reference"))
  622. #,
  623. # file=paste0("outfiles/network_",curROI,"_rem-only.html")))
  624. # p1 <- plot_model(full.model, type = "pred",
  625. # terms = c("regSuccess [-2.5:2.5]","conditionName")) +
  626. # theme_minimal(10) + guides(color="none")
  627. stats <- data.frame(summary(full.model)$coefficients[2:nrow(summary(full.model)$coefficients),])
  628. stats <- mutate(stats,ROI=curROI)
  629. model.stats <- rbind(model.stats,stats)
  630. return(model.stats)
  631. }
  632. model.stats <- detail_emo_neuref("DefaultA",model.stats)
  633. model.stats <- detail_emo_neuref("DefaultB",model.stats)
  634. model.stats <- detail_emo_neuref("DefaultC",model.stats)
  635. model.stats <- detail_emo_neuref("HIPP",model.stats)
  636. model.stats <- detail_emo_neuref("AMYG",model.stats)
  637. # event.model
  638. event.model = model.stats %>% filter((row.names(model.stats) == "eventDets")|(row.names(model.stats) == "eventDets1")|(row.names(model.stats) == "eventDets2")|(row.names(model.stats) == "eventDets3")|(row.names(model.stats) == "eventDets4"))
  639. p.values <- event.model[,5]
  640. Pr.fdr <- p.adjust(p.values, method = "fdr")
  641. event.model <- cbind(event.model,Pr.fdr)
  642. event.model <- mutate(event.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  643. kbl(event.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  644. scroll_box(width="1200px",height="800px")
  645. # visual.model
  646. visual.model = model.stats %>% filter((row.names(model.stats) == "visualDets")|(row.names(model.stats) == "visualDets1")|(row.names(model.stats) == "visualDets2")|(row.names(model.stats) == "visualDets3")|(row.names(model.stats) == "visualDets4"))
  647. p.values <- visual.model[,5]
  648. Pr.fdr <- p.adjust(p.values, method = "fdr")
  649. visual.model <- cbind(visual.model,Pr.fdr)
  650. visual.model <- mutate(visual.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  651. kbl(visual.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  652. scroll_box(width="1200px",height="800px")
  653. # neg.model
  654. neg.model = model.stats %>% filter((row.names(model.stats) == "valenceCategoryneg")|(row.names(model.stats) == "valenceCategoryneg1")|(row.names(model.stats) == "valenceCategoryneg2")|(row.names(model.stats) == "valenceCategoryneg3")|(row.names(model.stats) == "valenceCategoryneg4"))
  655. p.values <- neg.model[,5]
  656. Pr.fdr <- p.adjust(p.values, method = "fdr")
  657. neg.model <- cbind(neg.model,Pr.fdr)
  658. neg.model <- mutate(neg.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  659. kbl(neg.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  660. scroll_box(width="1200px",height="800px")
  661. # neu.model
  662. neu.model = model.stats %>% filter((row.names(model.stats) == "valenceCategoryneu")|(row.names(model.stats) == "valenceCategoryneu1")|(row.names(model.stats) == "valenceCategoryneu2")|(row.names(model.stats) == "valenceCategoryneu3")|(row.names(model.stats) == "valenceCategoryneu4"))
  663. p.values <- neu.model[,5]
  664. Pr.fdr <- p.adjust(p.values, method = "fdr")
  665. neu.model <- cbind(neu.model,Pr.fdr)
  666. neu.model <- mutate(neu.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  667. kbl(neu.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  668. scroll_box(width="1200px",height="800px")
  669. # visual.neg.model
  670. visual.neg.model = model.stats %>% filter((row.names(model.stats) == "visualDets:valenceCategoryneg")|(row.names(model.stats) == "visualDets:valenceCategoryneg1")|(row.names(model.stats) == "visualDets:valenceCategoryneg2")|(row.names(model.stats) == "visualDets:valenceCategoryneg3")|(row.names(model.stats) == "visualDets:valenceCategoryneg4"))
  671. p.values <- visual.neg.model[,5]
  672. Pr.fdr <- p.adjust(p.values, method = "fdr")
  673. visual.neg.model <- cbind(visual.neg.model,Pr.fdr)
  674. visual.neg.model <- mutate(visual.neg.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  675. kbl(visual.neg.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  676. scroll_box(width="1200px",height="800px")
  677. # visual.neu.model
  678. visual.neu.model = model.stats %>% filter((row.names(model.stats) == "visualDets:valenceCategoryneu")|(row.names(model.stats) == "visualDets:valenceCategoryneu1")|(row.names(model.stats) == "visualDets:valenceCategoryneu2")|(row.names(model.stats) == "visualDets:valenceCategoryneu3")|(row.names(model.stats) == "visualDets:valenceCategoryneu4"))
  679. p.values <- visual.neu.model[,5]
  680. Pr.fdr <- p.adjust(p.values, method = "fdr")
  681. visual.neu.model <- cbind(visual.neu.model,Pr.fdr)
  682. visual.neu.model <- mutate(visual.neu.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  683. kbl(visual.neu.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  684. scroll_box(width="1200px",height="800px")
  685. # event.neg.model
  686. event.neg.model = model.stats %>% filter((row.names(model.stats) == "valenceCategoryneg:eventDets")|(row.names(model.stats) == "valenceCategoryneg:eventDets1")|(row.names(model.stats) == "valenceCategoryneg:eventDets2")|(row.names(model.stats) == "valenceCategoryneg:eventDets3")|(row.names(model.stats) == "valenceCategoryneg:eventDets4"))
  687. p.values <- event.neg.model[,5]
  688. Pr.fdr <- p.adjust(p.values, method = "fdr")
  689. event.neg.model <- cbind(event.neg.model,Pr.fdr)
  690. event.neg.model <- mutate(event.neg.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  691. kbl(event.neg.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  692. scroll_box(width="1200px",height="800px")
  693. # event.neu.model
  694. event.neu.model = model.stats %>% filter((row.names(model.stats) == "valenceCategoryneu:eventDets")|(row.names(model.stats) == "valenceCategoryneu:eventDets1")|(row.names(model.stats) == "valenceCategoryneu:eventDets2")|(row.names(model.stats) == "valenceCategoryneu:eventDets3")|(row.names(model.stats) == "valenceCategoryneu:eventDets4"))
  695. p.values <- event.neu.model[,5]
  696. Pr.fdr <- p.adjust(p.values, method = "fdr")
  697. event.neu.model <- cbind(event.neu.model,Pr.fdr)
  698. event..model <- mutate(event.neu.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  699. kbl(event.neu.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  700. scroll_box(width="1200px",height="800px")
  701. ```
  702. # Analysis: behavioral
  703. ## setup
  704. ```{r}
  705. allsubs <- unique(actdata$subID)
  706. behav.all %>%
  707. filter(subID %in% allsubs) %>%
  708. filter(conditionName=="remember") %>%
  709. filter(remembered==1) -> mem.data
  710. ```
  711. ## analysis
  712. ```{r}
  713. means_all = mem.data %>%
  714. group_by(valenceCategory) %>%
  715. summarise(
  716. mean_event = mean(eventDets),
  717. mean_visual = mean(visualDets),
  718. mean_total = mean(correctDetails)
  719. )
  720. means_all
  721. sd_all = mem.data %>% # for reporting SDs in paper
  722. group_by(valenceCategory) %>%
  723. summarise(
  724. sd_event = sd(eventDets),
  725. sd_visual = sd(visualDets),
  726. sd_total = sd(correctDetails)
  727. )
  728. sd_all
  729. # setting up for behavioral plot:
  730. means_individ = mem.data %>%
  731. group_by(valenceCategory, subID) %>%
  732. summarise(
  733. mean_event = mean(eventDets),
  734. mean_visual = mean(visualDets),
  735. mean_total = mean(correctDetails)
  736. )
  737. # pivot means_individ to long format
  738. means_individ_long <- means_individ %>%
  739. pivot_longer(cols = c(mean_event, mean_visual),
  740. names_to = "condition",
  741. values_to = "mean") %>%
  742. mutate(detail = ifelse(condition == "mean_event", "event", "visual"))
  743. # computing se from subject-level means
  744. se_individ_long <- means_individ_long %>%
  745. group_by(valenceCategory, detail) %>%
  746. summarise(se = sd(mean) / sqrt(n()), .groups = "drop")
  747. means_all_long = means_all %>%
  748. pivot_longer(cols = mean_event:mean_total,
  749. names_to = "detail",
  750. values_to = "mean") %>%
  751. mutate(detail = gsub("mean_", "", detail))
  752. behav_plot_data = merge(means_all_long, se_individ_long, by = c("valenceCategory", "detail"))
  753. behav_plot_nocorrectdets = behav_plot_data %>% filter(detail != "total")
  754. ```
  755. correct details
  756. ```{r}
  757. mem_Correct <-ezANOVA(data = mem.data,
  758. dv = .(correctDetails),
  759. wid = .(subID),
  760. within = .(valenceCategory),
  761. type = 3,
  762. detailed = TRUE)
  763. mem_Correct
  764. aov_model <- aov(correctDetails ~ valenceCategory + Error(subID/valenceCategory), data = mem.data)
  765. emmeans_result <- emmeans(aov_model, ~ valenceCategory)
  766. pairs(emmeans_result, adjust = "tukey")
  767. ```
  768. narrative details
  769. ```{r}
  770. mem_Event <-ezANOVA(data = mem.data,
  771. dv = .(eventDets),
  772. wid = .(subID),
  773. within = .(valenceCategory),
  774. type = 3,
  775. detailed = TRUE)
  776. mem_Event
  777. # posthoc
  778. aov_model <- aov(eventDets ~ valenceCategory + Error(subID/valenceCategory), data = mem.data)
  779. emmeans_result <- emmeans(aov_model, ~ valenceCategory)
  780. pairs(emmeans_result, adjust = "tukey")
  781. ```
  782. perceptual details
  783. ```{r}
  784. mem_vis <-ezANOVA(data = mem.data,
  785. dv = .(visualDets),
  786. wid = .(subID),
  787. within = .(valenceCategory),
  788. type = 3,
  789. detailed = TRUE)
  790. mem_vis
  791. # posthoc
  792. aov_model <- aov(visualDets ~ valenceCategory + Error(subID/valenceCategory), data = mem.data)
  793. emmeans_result <- emmeans(aov_model, ~ valenceCategory)
  794. pairs(emmeans_result, adjust = "tukey")
  795. ```
  796. follow-up t-tests:
  797. ```{r}
  798. # Narrative details
  799. valence_summary_event <- mem.data %>%
  800. group_by(subID, valenceCategory) %>%
  801. summarise(mean_event = mean(eventDets), .groups = "drop") %>%
  802. tidyr::pivot_wider(names_from = valenceCategory, values_from = mean_event)
  803. # Positive vs Negative
  804. t.test(valence_summary_event$pos, valence_summary_event$neg, paired = TRUE)
  805. # Positive vs Neutral
  806. t.test(valence_summary_event$pos, valence_summary_event$neu, paired = TRUE)
  807. # Negative vs Neutral
  808. t.test(valence_summary_event$neg, valence_summary_event$neu, paired = TRUE)
  809. ```
  810. ```{r}
  811. # Perceptual details
  812. valence_summary_vis <- mem.data %>%
  813. group_by(subID, valenceCategory) %>%
  814. summarise(mean_vis = mean(visualDets), .groups = "drop") %>%
  815. tidyr::pivot_wider(names_from = valenceCategory, values_from = mean_vis)
  816. # Positive vs Negative
  817. t.test(valence_summary_vis$pos, valence_summary_vis$neg, paired = TRUE)
  818. # Positive vs Neutral
  819. t.test(valence_summary_vis$pos, valence_summary_vis$neu, paired = TRUE)
  820. # Negative vs Neutral
  821. t.test(valence_summary_vis$neg, valence_summary_vis$neu, paired = TRUE)
  822. ```
  823. ```{r}
  824. # Overall correct details
  825. valence_summary_cor <- mem.data %>%
  826. group_by(subID, valenceCategory) %>%
  827. summarise(mean_correct = mean(correctDetails), .groups = "drop") %>%
  828. tidyr::pivot_wider(names_from = valenceCategory, values_from = mean_correct)
  829. valence_summary_cor
  830. # Positive vs Negative
  831. t.test(valence_summary_cor$pos, valence_summary_cor$neg, paired = TRUE)
  832. # Positive vs Neutral
  833. t.test(valence_summary_cor$pos, valence_summary_cor$neu, paired = TRUE)
  834. # Negative vs Neutral
  835. t.test(valence_summary_cor$neg, valence_summary_cor$neu, paired = TRUE)
  836. ```
  837. ## Figure 1d (detail counts by valence)
  838. ```{r}
  839. # behavcolors <- c("#f76c67","#67aaf7","#0bca81","#f6a84f","#9c67f7","#67f7f0","#7F7F7F")
  840. ll = ggplot(data = behav_plot_nocorrectdets, aes(x = detail, y = mean, fill = valenceCategory)) +
  841. geom_bar(stat = "identity", position = position_dodge(), alpha = 0.60, color = "black") +
  842. # Set fill colors for the bars and specify legend labels
  843. scale_fill_manual(values = c("neg" = "#e3401a", # Red for negative
  844. "neu" = "#1f78b4", # Blue for neutral
  845. "pos" = "#33a02c"), # Green for positive
  846. labels = c("neg" = "negative", "neu" = "neutral", "pos" = "positive"),
  847. name = "Valence") +
  848. labs(x = "Detail type", y = "Mean details recalled") +
  849. scale_y_continuous(limits = c(0, 8), expand = c(0, 0)) +
  850. scale_x_discrete(labels = c("narrative", "perceptual")) +
  851. theme(
  852. panel.border = element_blank(),
  853. panel.grid.major = element_blank(),
  854. panel.grid.minor = element_blank(),
  855. panel.background = element_blank(),
  856. axis.title.x = element_text(size = 10),
  857. axis.title.y = element_text(size = 10),
  858. axis.text = element_text(size = 8),
  859. legend.title = element_text(size = 8),
  860. legend.text = element_text(size = 7),
  861. legend.key.size = unit(0.4, "cm"),
  862. axis.line = element_line(colour = "black")
  863. ) +
  864. geom_errorbar(data = behav_plot_nocorrectdets, stat = "identity", width = 0,
  865. position = position_dodge(width = 0.9),
  866. aes(x = detail, group = valenceCategory, ymax = mean + se, ymin = mean - se)) +
  867. # Overlay individual data points
  868. geom_point(data = means_individ_long, aes(x = detail, y = mean, color = valenceCategory),
  869. position = position_jitterdodge(jitter.width = 0.1, dodge.width = 0.9),
  870. alpha = 0.6, size = 1.5, show.legend = TRUE) +
  871. # Set color mapping for the individual points and specify legend labels
  872. scale_color_manual(values = c("neg" = "#e3401a", # Red for negative
  873. "neu" = "#1f78b4", # Blue for neutral
  874. "pos" = "#33a02c"), # Green for positive
  875. labels = c("neg" = "negative", "neu" = "neutral", "pos" = "positive"),
  876. name="Valence") # Ensure colors match the bars
  877. ll
  878. # UNCOMMENT and INSERT PATH to export
  879. # ggsave(filename = 'insert-path',
  880. # plot = ll,
  881. # device = "png",
  882. # dpi = 300,
  883. # width = 3.1,
  884. # height = 2.5,
  885. # units = "in")
  886. ```
  887. # Analysis: anterior/posterior hipp
  888. ## setup
  889. ```{r}
  890. # import activity data
  891. subjects <- list.files(path='/Volumes/memolab/Data/Behavioral_Online/reframe-details/detail_script_files/hipp-recall-block15s/',full.names=TRUE, recursive = TRUE, pattern = 'block15s_timepoint-averages')
  892. actdata2 = do.call(rbind, lapply(subjects, function(x) {read.csv(x, header = TRUE)}))
  893. # join behavioral and activity data
  894. alldata2 <- left_join(actdata2,behav.all,by=c("subID","videoName","trial"),suffix=c(".act",".beh"))
  895. # define factors
  896. alldata2$ROI <- as.factor(alldata2$ROI)
  897. alldata2$conditionName <- as.factor(alldata2$conditionName)
  898. alldata2$valenceCategory <- as.factor(alldata2$valenceCategory)
  899. alldata2$subID <- as.factor(alldata2$subID)
  900. alldata2$regRound.categ <- as.factor(alldata2$regRound) # keep both integer & categorical versions
  901. alldata2$videoName <- as.factor(alldata2$videoName)
  902. alldata2$periodLabel <- as.factor(alldata2$periodLabel)
  903. ```
  904. ```{r}
  905. ### add z score of activity estimates within region and subject and time-period
  906. alldata2 <- alldata2 %>%
  907. group_by(subID, ROI, periodLabel) %>%
  908. mutate(Z = zscore(regulationActivity)) %>%
  909. ungroup()
  910. # remove betas that are > 4SD
  911. tmp <- alldata2 %>%
  912. mutate(isOutlier = ifelse(abs(Z)>4,TRUE,FALSE))
  913. # Following Cooper & Ritchey, remove trials where mean for ANY ROI is an outlier
  914. outliers <- tmp %>%
  915. select(isOutlier,subID,trial) %>%
  916. filter(isOutlier) %>%
  917. unique()
  918. alldata2 <- left_join(alldata2,outliers,by=c("subID","trial"))
  919. alldata2$isOutlier[is.na(alldata2$isOutlier)] <- FALSE
  920. # Summarize number of outliers
  921. table(alldata2$subID,alldata2$isOutlier)
  922. table(alldata2$isOutlier)
  923. alldata2$regulationActivity[alldata2$isOutlier] <- NA #mark value as NA if outlier
  924. ```
  925. ```{r}
  926. # TRIAL FILTERS
  927. alldata2 <- alldata2 %>%
  928. mutate(isComplete.emo = ifelse(is.na(valenceChange) | is.na(arousalChange),
  929. FALSE,TRUE))
  930. # Removing negative reappraisal trials
  931. alldata2 <- alldata2 %>%
  932. filter(conditionName == "remember")
  933. alldata2 <- alldata2 %>%
  934. filter(remembered == "1") # remembered-only
  935. ```
  936. ```{r}
  937. alldata2 <- alldata2 %>%
  938. group_by(subID,ROI,periodLabel) %>%
  939. mutate(regSuccess = scale(regSuccess,scale=FALSE),
  940. valenceChange = scale(valenceChange,scale=FALSE),
  941. arousalChange = scale(arousalChange,scale=FALSE),
  942. recallVividness = scale(recallVividness,scale=FALSE),
  943. eventDets = scale(eventDets, scale =FALSE),
  944. visualDets = scale(visualDets, scale=FALSE),
  945. correctDetails = scale(correctDetails, scale=FALSE)) %>% # mean-center within subject
  946. ungroup()
  947. # double check that this worked as expected
  948. tmp <- alldata2 %>% filter(valenceCategory=="neg" & ROI=="AntHipp_L") %>% group_by(subID) %>% summarize(meansucc = mean(regSuccess,na.rm=TRUE))
  949. ```
  950. ## analysis
  951. ```{r}
  952. alldata2$ROI = as.factor(alldata2$ROI)
  953. rois <- levels(alldata2$ROI)
  954. outDir <- '/Volumes/memolab/Data/Behavioral_Online/reframe-details/detail_script_files/reframe-detail_timepoint_results/'
  955. alphafdr <- .05
  956. curFile = paste0(outDir,'lme_hippocampal_rem.csv')
  957. ### set up data frame for mixed effect model results:
  958. mixed.data <- data.frame(array(0,c(length(rois)*8,8)))
  959. colnames(mixed.data) <- c('ROI','Period','Predictor','Beta','SE','T','Df','Pvalue')
  960. row = 0
  961. model.data <- alldata2
  962. periodLabel <- as.character(model.data$periodLabel[1])
  963. # ******** run linear mixed effects model within each ROI and store results **********
  964. for (r in 1:length(rois)) {
  965. thisROI <- as.character(rois[r])
  966. roiData <- filter(model.data, ROI == thisROI)
  967. roiData$regSuccess <- scale(roiData$regSuccess, scale = FALSE)
  968. # run lmer and get fixed effect stats
  969. roiData$valenceCategory <- factor(roiData$valenceCategory, levels=c("neu", "pos", "neg"))
  970. full.model <- suppressMessages(lmer(regulationActivity ~ valenceCategory*eventDets + valenceCategory*visualDets+
  971. (1|subID), data = roiData))
  972. stats <- summary(full.model)$coefficients
  973. nIV <- nrow(stats) - 1 # number of fixed effects, discounting intercept
  974. ### add fixed effects and p values to data frame
  975. mixed.data$ROI[(row+1):(row+nIV)] <- thisROI
  976. mixed.data$Phase[(row+1):(row+nIV)] <- periodLabel
  977. mixed.data$Predictor[(row+1):(row+nIV)] <- row.names(stats)[2:(nIV+1)]
  978. mixed.data[(row+1):(row+nIV),c("Beta","SE","T","Df","Pvalue")] <- stats[2:(nIV+1),
  979. c("Estimate","Std. Error","t value","df","Pr(>|t|)")]
  980. row = row + nIV
  981. }
  982. ```
  983. ```{r}
  984. # event.model
  985. event.model = mixed.data %>% filter(mixed.data$Predictor == "eventDets")
  986. p.values <- event.model[,8]
  987. Pr.fdr <- p.adjust(p.values, method = "fdr")
  988. event.model <- cbind(event.model,Pr.fdr)
  989. event.model <- mutate(event.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  990. kbl(event.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  991. scroll_box(width="1200px",height="800px")
  992. # visual.model
  993. visual.model = mixed.data %>% filter(mixed.data$Predictor == "visualDets")
  994. p.values <- visual.model[,8]
  995. Pr.fdr <- p.adjust(p.values, method = "fdr")
  996. visual.model <- cbind(visual.model,Pr.fdr)
  997. visual.model <- mutate(visual.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  998. kbl(visual.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  999. scroll_box(width="1200px",height="800px")
  1000. # pos.model
  1001. pos.model = mixed.data %>% filter(mixed.data$Predictor == "valenceCategorypos")
  1002. p.values <- pos.model[,8]
  1003. Pr.fdr <- p.adjust(p.values, method = "fdr")
  1004. pos.model <- cbind(pos.model,Pr.fdr)
  1005. pos.model <- mutate(pos.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  1006. kbl(pos.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  1007. scroll_box(width="1200px",height="800px")
  1008. # neg.model
  1009. neg.model = mixed.data %>% filter(mixed.data$Predictor == "valenceCategoryneg")
  1010. p.values <- neg.model[,8]
  1011. Pr.fdr <- p.adjust(p.values, method = "fdr")
  1012. neg.model <- cbind(neg.model,Pr.fdr)
  1013. neg.model <- mutate(neg.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  1014. kbl(neg.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  1015. scroll_box(width="1200px",height="800px")
  1016. # visual.pos.model
  1017. visual.pos.model = mixed.data %>% filter(mixed.data$Predictor == "valenceCategorypos:visualDets")
  1018. p.values <- visual.pos.model[,8]
  1019. Pr.fdr <- p.adjust(p.values, method = "fdr")
  1020. visual.pos.model <- cbind(visual.pos.model,Pr.fdr)
  1021. visual.pos.model <- mutate(visual.pos.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  1022. kbl(visual.pos.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  1023. scroll_box(width="1200px",height="800px")
  1024. # visual.neg.model
  1025. visual.neg.model =mixed.data %>% filter(mixed.data$Predictor == "valenceCategoryneg:visualDets")
  1026. p.values <- visual.neg.model[,8]
  1027. Pr.fdr <- p.adjust(p.values, method = "fdr")
  1028. visual.neg.model <- cbind(visual.neg.model,Pr.fdr)
  1029. visual.neg.model <- mutate(visual.neg.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  1030. kbl(visual.neg.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  1031. scroll_box(width="1200px",height="800px")
  1032. # event.pos.model
  1033. event.pos.model =mixed.data %>% filter(mixed.data$Predictor == "valenceCategorypos:eventDets")
  1034. p.values <- event.pos.model[,8]
  1035. Pr.fdr <- p.adjust(p.values, method = "fdr")
  1036. event.pos.model <- cbind(event.pos.model,Pr.fdr)
  1037. event.pos.model <- mutate(event.pos.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  1038. kbl(event.pos.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  1039. scroll_box(width="1200px",height="800px")
  1040. # event.neg.model
  1041. event.neg.model = mixed.data %>% filter(mixed.data$Predictor == "valenceCategoryneg:eventDets")
  1042. p.values <- event.neg.model[,8]
  1043. Pr.fdr <- p.adjust(p.values, method = "fdr")
  1044. event.neg.model <- cbind(event.neg.model,Pr.fdr)
  1045. event.neg.model <- mutate(event.neg.model,sig = ifelse(Pr.fdr<.05,TRUE,FALSE))
  1046. kbl(event.neg.model,digits=3) %>% kable_styling(bootstrap_options = c("striped", "hover")) %>%
  1047. scroll_box(width="1200px",height="800px")
  1048. ```
  1049. ## Figure 3c (perceptual x aHipp)
  1050. ```{r}
  1051. alldata2 %>% filter(ROI != "PostHipp_L") %>%
  1052. filter(ROI != "PostHipp_R") %>%
  1053. filter(ROI != "AntHipp_R") %>%
  1054. group_by(trial, subID) %>%
  1055. summarise(eventDets, visualDets, valenceCategory, regulationActivity = mean(regulationActivity)) -> anterioract_data
  1056. anterioract_data$valenceCategory <- factor(anterioract_data$valenceCategory, levels=c("neu", "pos", "neg"))
  1057. full.model.hpca <- suppressMessages(lmer(regulationActivity ~ eventDets*valenceCategory + visualDets*valenceCategory + (1|subID), data = anterioract_data))
  1058. anth = plot_visualDets_noHist(full.model.hpca, anterioract_data, "Left aHipp activity")
  1059. anth
  1060. # UNCOMMENT AND INSERT PATH to export
  1061. # ggsave(filename = 'insert-path',
  1062. # plot = anth,
  1063. # device = "png",
  1064. # dpi = 300,
  1065. # width = 3.5,
  1066. # height = 2.25,
  1067. # units = "in")
  1068. ```

reframe-detail-main-paper.Rmd at commit 0531848, no license · at the source

Overview

Authors: Nina Curko1, Rosalie Samide1, Valentina Krenz1, Elizabeth A Kensinger1, Maureen Ritchey1,2
  1. Department of Psychology and Neuroscience, Boston College, Chestnut Hill, Massachusetts 02467
  2. Department of Psychology, University of California, Los Angeles, California 90095
Institutions: Boston College (United States); University of California, Los Angeles (United States)
Journal: eNeuro, volume 13, issue 11, pages ENEURO.0146-26.2026
Dates: received 4 May 2026; accepted 14 September 2026; published online 6 November 2026; in print November 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1523/eneuro.0146-26.2026 · PMID 42888042 · PMCID PMC13750827 · OpenAlex W7222583887
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: fMRI (modality), human (organism), cognitive (subfield)
Methods: Statistics, Preprocessing, Connectivity, fMRI & imaging, Machine learning
Keywords: default mode network, emotional memory, episodic memory, fMRI
MeSH: Brain*, Default Mode Network*, Emotions*, Memory, Episodic*, Mental Recall*, Adult, Brain Mapping, Female, Humans, Magnetic Resonance Imaging, Male, Young Adult (* major topic)
Topic: Memory Processes and Influences (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Citations: not cited yet (Europe PMC); 68 references in the paper

Abstract

Episodic memory involves reconstruction of past events through integration of multiple types of information, including perceptual details, narrative content, and emotional tone. The default mode network (DMN) is a set of regions thought to support episodic retrieval, yet it remains unclear how distinct subnetworks contribute to recall of these different memory features. Here, we examined how DMN subnetworks support and represent memory for naturalistic emotional events. Male and female human participants encoded short news videos that varied in emotional valence and recalled them in response to neutral cues during functional MRI scanning. Videos were again recalled 1 d later and memories were scored for perceptual and narrative details. Activity in the dorsomedial subnetwork was related to the emotional valence of the memory, while activity in the medial temporal subnetwork was associated with the number of perceptual details recalled. Multivariate pattern analyses further revealed that the medial temporal subnetwork exhibited greater pattern stability across recalls when recalling more perceptual details, while stability in the dorsomedial and core subnetworks was tied to emotional remembering. Our findings suggest that the dorsomedial subnetwork provides an affective frame for a memory, while the medial temporal subnetwork contributes perceptual specificity. These results demonstrate that the contents of memory retrieval shape network engagement during emotional recall, providing insight into how the brain reconstructs complex real-world experiences.

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

Repository

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

memobc/reframe-detail-paper

License: none: the authors keep all their rights
State: the link answers, verified on 12 November 2026
Evidence: files inventoried
Commit: 0531848de1a73e2b7113376d1bf0be3e83243b74, 30 October 2026
Languages: R (6)
Size: 7 files, 6 scripts
Software Heritage: not archived
Found in: the text, “Statistical analysis”
Holds: README, 6 notebooks
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: tidyverse (6 files), lme4 (5 files), ggpubr (4 files), ggseg (4 files), lmerTest (4 files), ggplot2 (3 files), emmeans (2 files), patchwork (2 files), cowplot (1 file)
Availability: 1 check, the latest on 12 November 2026: the link answers
  • 12 November 2026: the link answers
7 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:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 6 scripts, each with its path and the digest of its content;
  • 1 match 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

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, 12 November 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 4 keywords, 12 MeSH terms, 2 funders, 66 references.

Cite

This paper

Curko, N., Samide, R., Krenz, V., Kensinger, E. A., & Ritchey, M. (2026). Remembered Event Features Shape Default Mode Network Engagement during Emotional Memory Recall. eNeuro, 13(11), ENEURO.0146-26.2026. https://doi.org/10.1523/eneuro.0146-26.2026

BibTeX

@article{curko2026remembered,
author = {Curko, Nina and Samide, Rosalie and Krenz, Valentina and Kensinger, Elizabeth A and Ritchey, Maureen},
title = {{Remembered Event Features Shape Default Mode Network Engagement during Emotional Memory Recall}},
journal = {eNeuro},
year = {2026},
month = nov,
volume = {13},
number = {11},
pages = {ENEURO.0146--26.2026},
publisher = {Society for Neuroscience},
issn = {2373-2822},
doi = {10.1523/eneuro.0146-26.2026},
url = {https://doi.org/10.1523/eneuro.0146-26.2026},
pmid = {42888042},
pmcid = {PMC13750827}
}

RIS

TY - JOUR
AU - Curko, Nina
AU - Samide, Rosalie
AU - Krenz, Valentina
AU - Kensinger, Elizabeth A
AU - Ritchey, Maureen
TI - Remembered Event Features Shape Default Mode Network Engagement during Emotional Memory Recall
T2 - eNeuro
J2 - eNeuro
PY - 2026
DA - 2026/11/10
VL - 13
IS - 11
SP - ENEURO.0146
EP - 26.2026
SN - 2373-2822
PB - Society for Neuroscience
DO - 10.1523/eneuro.0146-26.2026
UR - https://doi.org/10.1523/eneuro.0146-26.2026
LA - en
ER -

CSL-JSON

{
"id": "10.1523/eneuro.0146-26.2026",
"type": "article-journal",
"title": "Remembered Event Features Shape Default Mode Network Engagement during Emotional Memory Recall",
"container-title": "eNeuro",
"author": [
{
"family": "Curko",
"given": "Nina"
},
{
"family": "Samide",
"given": "Rosalie"
},
{
"family": "Krenz",
"given": "Valentina"
},
{
"family": "Kensinger",
"given": "Elizabeth A"
},
{
"family": "Ritchey",
"given": "Maureen"
}
],
"container-title-short": "eNeuro",
"volume": "13",
"issue": "11",
"page": "ENEURO.0146-26.2026",
"DOI": "10.1523/eneuro.0146-26.2026",
"PMID": "42888042",
"PMCID": "PMC13750827",
"ISSN": "2373-2822",
"publisher": "Society for Neuroscience",
"URL": "https://doi.org/10.1523/eneuro.0146-26.2026",
"language": "en",
"issued": {
"date-parts": [
[
2026,
11,
10
]
]
}
}

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.1523/jneurosci.2406-23.2025 [code]
Memory Boost for Recurring Emotional Events Is Driven by Initial Amygdala Response Promoting Stable Neocortical Patterns across Repetitions.
Journal: The Journal of neuroscience : the official journal of the Society for Neuroscience
In common: emmeans, lmerTest, lme4, 4 other tools, neurovault.org/collections/3731, cognitive, 8 references
[2] doi:10.1038/s41467-023-41648-1 [code]
Time-dependent memory transformation in hippocampus and neocortex is semantic in nature.
Journal: Nature communications
In common: emmeans, lmerTest, lme4, 3 other tools, cognitive, 10 references
[3] doi:10.1162/imag_a_00169 [code]
Intrinsic functional connectivity among memory networks does not predict individual differences in narrative recall.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: patchwork, ggplot2, tidyverse, fMRI, cognitive, 9 references, author Maureen Ritchey
[4] doi:10.1038/s41467-025-63633-6 [code]
The intrinsic time tracker: temporal context is embedded in entorhinal and hippocampal functional connectivity patterns.
Journal: Nature communications
In common: emmeans, lmerTest, lme4, 2 other tools, fMRI, 10 references
[5] doi:10.1038/s44271-026-00481-0 [code]
Natural language processing captures memory content associated with shared neural patterns at encoding and retrieval.
Journal: Communications psychology
In common: ggseg, emmeans, lmerTest, 3 other tools, cognitive, 7 references
[6] doi:10.1038/s41467-023-36805-5 [code]
Flexible reuse of cortico-hippocampal representations during encoding and recall of naturalistic events.
Journal: Nature communications
In common: cognitive, 11 references
[7] doi:10.1038/s41467-022-33517-0 [code]
Schemas provide a scaffold for neocortical integration of new memories over time.
Journal: Nature communications
In common: emmeans, lmerTest, lme4, 2 other tools, 7 references
[8] doi:10.1002/hbm.70475 [code]
The Development of Hippocampal-Cortical Functional Connectivity in Infants and Toddlers.
Journal: Human brain mapping
In common: emmeans, cowplot, ggplot2, 1 other tool, fMRI, 8 references
[9] doi:10.1162/imag.a.1321 [code]
Phase similarity between similar objects indicates representational merging across retrieval training but not sleep.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: emmeans, lmerTest, lme4, 2 other tools, cognitive, 6 references
[10] doi:10.1162/imag.a.1313 [code]
Functional specialization of angular gyrus and precuneus subregions for perspective-guided autobiographical memory retrieval.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: emmeans, lmerTest, lme4, 4 other tools, cognitive, 4 references

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.1523/eneuro.0146-26.2026.svg)](https://openscicode.org/badge/doi/10.1523/eneuro.0146-26.2026)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1523/eneuro.0146-26.2026.svg
   :target: https://openscicode.org/badge/doi/10.1523/eneuro.0146-26.2026
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1523/eneuro.0146-26.2026"><img src="https://openscicode.org/badge/doi/10.1523/eneuro.0146-26.2026.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.