OSCR

Neural and behavioural correlates of theory of mind reasoning in five-year-old children born preterm.

Code ↔ Paper

12 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 12 matches
  1. [1] § Methods › fMRI data analyses ↔ scripts/05.motion_exclusions/mark_motion_exclusions.py, lines 142–217 · score 0.83 · composite motion, framewise displacement, standardised DVARS, artifact timepoints, rapidart, FD
  2. [2] § Methods › fMRI data analyses › Whole-brain random effects analyses ↔ scripts/07.second_level/secondlevel_pipeline.py, lines 344–391 · score 0.73 · threshold free cluster, FSL, enhancement, RANDOMISE, nonparametric, TFCE
  3. [3] § Methods › Measures › Other cognitive measures and covariates ↔ Data and Code/Abeletal_PTB-ToM_dosedependency.R, lines 142–190 · score 0.69 · executive functions, percentile rank, gestational age, siblings, covariates, language
  4. [4] § Methods › fMRI data analyses ↔ scripts/06.first_level/firstlevel_pipeline.py, lines 858–997 · score 0.67 · MNI152NLin2009cAsym, fMRIPrep, T1w, kernel, pipeline, smoothed
  5. [5] § Methods › fMRI data analyses ↔ scripts/06.first_level/timecourse_pipeline.py, lines 297–338 · score 0.66 · framewise displacement, aCompCor, DVARS, confound, pipeline, MNI
  6. [6] § Methods › Measures › Other cognitive measures and covariates ↔ Data and Code/Abeletal_PTB-ToM_mainAnalyses.R, lines 561–647 · score 0.65 · Receptive language, forced choice, percentile rank, boxplot, booklet, violin
  7. [7] § Methods › fMRI data analyses › First-level modelling ↔ scripts/07.second_level/reverse_correlation.py, lines 1–21 · score 0.63 · Reverse correlation, timecourses extracted, HRF, timepoints, movie, event
  8. [8] § Methods › Measures › Other cognitive measures and covariates ↔ Data and Code/Abeletal_PTB-ToM_mainAnalyses.R, lines 561–647 · score 0.59 · receptive language, percentile rank, gestational age, score, GA
  9. [9] § Methods › fMRI data analyses › Regions of interest (ROI) analyses ↔ scripts/07.second_level/reverse_correlation.py, lines 104–174 · score 0.59 · reverse correlation, events identified, peak, longer, timepoints, magnitude
  10. [10] § Methods › fMRI data analyses ↔ Data and Code/Abeletal_PTB-ToM_dosedependency.R, lines 320–371 · score 0.55 · framewise displacement, Cohen, DVARS, SD, artifact, FD
  11. [11] § Results › Movie-viewing fMRI results › Regions of interest analyses ↔ Data and Code/Abeletal_PTB-ToM_mainAnalyses.R, lines 792–831 · score 0.54 · functional maturity, gestational age, response magnitude, network, GA, preterm
  12. [12] § Methods › fMRI data analyses › Regions of interest (ROI) analyses ↔ scripts/06.first_level/calc_psc.py, lines 122–160 · score 0.51 · artifact timepoint, high pass filtered, TR, volumes, Motion

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 · 1,484 lines · 79 KB · no license · 3 matches

  1. #requires Abeletal_Data, TEBC_TC, and TEBC_timeshift_IRC to have been run
  2. #setwd
  3. library(tidyverse)
  4. library("ggplot2")
  5. library("ggExtra")
  6. library(tiff)
  7. library(lmerTest)
  8. library(lme4)
  9. library(patchwork)
  10. library(purrr)
  11. Abeletal_Data <- read.csv("./Data/Abeletal_PTB-ToM_Data.csv")
  12. sink(paste0("./PTB_results_", Sys.Date(), ".txt"))
  13. print("#Descriptives")
  14. print("##get averages, min, max GA for Pt and T groups
  15. Behavioural kids")
  16. Behavioural_kids <- Abeletal_Data %>% filter(!is.na(T_ToM_Score) & T_ToM_Score != "")
  17. Behavioural_kids %>%
  18. group_by(Preterm) %>%
  19. summarise_at(vars(GA_birth), list(min, max, mean, sd), na.rm=T)
  20. Behavioural_kids %>%
  21. group_by(Preterm) %>%
  22. summarise(min_age = min(T_age, na.rm = TRUE),
  23. max_age = max(T_age, na.rm = TRUE),
  24. mean_age = mean(T_age, na.rm = TRUE),
  25. SD_age = sd(T_age, na.rm = TRUE)
  26. )
  27. Behavioural_kids %>%
  28. group_by(Preterm) %>%
  29. summarize(count = n())
  30. Behavioural_kids %>% count(Sex, Preterm)
  31. print("all kids")
  32. Abeletal_Data %>%
  33. group_by(Preterm) %>%
  34. summarise_at(vars(GA_birth), list(min, max, mean, sd), na.rm=T)
  35. Abeletal_Data %>%
  36. group_by(Preterm) %>%
  37. summarise(min_age = min(T_age, na.rm = TRUE),
  38. max_age = max(T_age, na.rm = TRUE),
  39. mean_age = mean(T_age, na.rm = TRUE),
  40. SD_age = sd(T_age, na.rm = TRUE)
  41. )
  42. Abeletal_Data %>%
  43. group_by(Preterm) %>%
  44. summarize(count = n())
  45. Abeletal_Data %>% count(Sex, Preterm)
  46. #---------------------------------------
  47. print("##Calculate descriptive statistics (M (Se)) of proportion of test items answered correctly, per group [children born preterm and at term]). ")
  48. variables <- c("C_ToM_Score", "AF_ToM_Score", "E_ToM_Score", "T_ToM_Score", "DD_ToM_Score", "RL_PercentileRank")
  49. data_summary <- map_dfr(variables, function(var) {
  50. Abeletal_Data %>%
  51. group_by(Preterm) %>%
  52. summarise(
  53. Variable = var,
  54. Mean = mean(.data[[var]], na.rm = TRUE),
  55. SE = sd(.data[[var]], na.rm = TRUE) / sqrt(n())
  56. )
  57. })
  58. print(data_summary)
  59. print("##Does performance on ToM task differ as a function of GA, controlling for test age? ")
  60. summary(lm(T_ToM_Score ~ scale(GA_birth) + scale(T_age), data = Abeletal_Data))
  61. summary(lm(AF_ToM_Score ~ scale(GA_birth) + scale(T_age), data = Abeletal_Data))
  62. summary(lm(E_ToM_Score ~ scale(GA_birth) + scale(T_age), data = Abeletal_Data))
  63. #summary(lm(C_ToM_Score ~ scale(GA_birth) + scale(T_age), data = Abeletal_Data))
  64. #summary(lm(DD_ToM_Score ~ scale(GA_birth) + scale(T_age), data = Abeletal_Data))
  65. cor.test(Abeletal_Data$DD_ToM_Score, Abeletal_Data$GA_birth, use = "complete.obs")
  66. correlation_DD_ToM <- cor(Abeletal_Data$DD_ToM_Score, Abeletal_Data$GA_birth, use = "complete.obs")
  67. r_squared <- correlation_DD_ToM^2
  68. cohen_d <- 2 * correlation_DD_ToM / sqrt(1 - correlation_DD_ToM^2)
  69. fisher_z <- 0.5 * log((1 + correlation_DD_ToM) / (1 - correlation_DD_ToM))
  70. list(correlation_DD_ToM = correlation_DD_ToM, r_squared = r_squared, cohen_d = cohen_d, fisher_z = fisher_z)
  71. cor.test(Abeletal_Data$DD_ToM_Score, Abeletal_Data$T_ToM_Score, use = "complete.obs")
  72. #summary(lm(FB_ToM_Score ~ scale(GA_birth) + scale(T_age), data = Abeletal_Data))
  73. #Including interaction term
  74. ##Does performance on ToM task differ as a function of GA, controlling for test age? "
  75. #summary(lm(T_ToM_Score ~ scale(GA_birth) * scale(T_age), data = Abeletal_Data))
  76. #summary(lm(AF_ToM_Score ~ scale(GA_birth) * scale(T_age), data = Abeletal_Data))
  77. #summary(lm(E_ToM_Score ~ scale(GA_birth) * scale(T_age), data = Abeletal_Data))
  78. #summary(lm(C_ToM_Score ~ scale(GA_birth) * scale(T_age), data = Abeletal_Data))
  79. #summary(lm(DD_ToM_Score ~ scale(GA_birth) * scale(T_age), data = Abeletal_Data))
  80. summary(lm(FB_ToM_Score ~ scale(GA_birth) + scale(T_age), data = Abeletal_Data))
  81. print("#Additional - nSibs")
  82. summary(lm(T_ToM_Score ~ scale(num_sibs) + scale(GA_birth) + scale(T_age), data = Abeletal_Data))
  83. summary(lm(T_ToM_Score ~ scale(num_sibs) + scale(T_age), data = Abeletal_Data))
  84. print("#If GA predicts ToM performance: Does performance on ToM task differ as a function of GA, controlling for other covariates impacted by/related to GA? ")
  85. print("#First, we will test whether language, executive functions, attention, and number of siblings correlate with gestational age:")
  86. summary(lm(Abeletal_Data$RL_PercentileRank ~ scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age)))
  87. summary(lm(Abeletal_Data$Inattention ~ scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age)))
  88. summary(lm(Abeletal_Data$ECITT_accd ~ scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age)))
  89. summary(lm(Abeletal_Data$num_sibs ~ scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age)))
  90. Sub_Abeletal_Data <- subset(Abeletal_Data, select = c(Sub, num_sibs, GA_birth, Preterm, T_age, T_ToM_Score, RL_PercentileRank))
  91. Sub_Abeletal_Data <- Sub_Abeletal_Data[!(Sub_Abeletal_Data$num_sibs %in% "4"),]
  92. summary(lm(Sub_Abeletal_Data$num_sibs ~ scale(Sub_Abeletal_Data$GA_birth) + scale(Sub_Abeletal_Data$T_age)))
  93. summary(lm(Sub_Abeletal_Data$T_ToM_Score ~ scale(Sub_Abeletal_Data$num_sibs) + scale(Sub_Abeletal_Data$GA_birth) + scale(Sub_Abeletal_Data$T_age) + scale(Sub_Abeletal_Data$RL_PercentileRank)))
  94. summary(lm(Sub_Abeletal_Data$T_ToM_Score ~ scale(Sub_Abeletal_Data$num_sibs) + scale(Sub_Abeletal_Data$GA_birth) + scale(Sub_Abeletal_Data$T_age)))
  95. summary(lm(Sub_Abeletal_Data$T_ToM_Score ~ scale(Sub_Abeletal_Data$num_sibs) + scale(Sub_Abeletal_Data$T_age)))
  96. print("#Abeletal_Data")
  97. Abeletal_Data %>%
  98. group_by(Preterm) %>%
  99. summarise(mean_sibs = mean(num_sibs, na.rm = TRUE),
  100. SD_sibs = sd(num_sibs, na.rm = TRUE)
  101. )
  102. print("#Sub_Abeletal_Data")
  103. Sub_Abeletal_Data %>%
  104. group_by(Preterm) %>%
  105. summarise(mean_sibs = mean(num_sibs, na.rm = TRUE),
  106. SD_sibs = sd(num_sibs, na.rm = TRUE)
  107. )
  108. print("#Next, we will repeat the analysis testing for an impact of gestational age on ToM, controlling for the other covariates that correlate with GA: ")
  109. summary(lm(Abeletal_Data$T_ToM_Score ~ scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age) + scale(Abeletal_Data$RL_PercentileRank) +scale(Abeletal_Data$ECITT_accd) + scale(Abeletal_Data$Inattention))) #+ scale(Abeletal_Data$num_sibs)))
  110. summary(lm(Abeletal_Data$T_ToM_Score ~ scale(Abeletal_Data$num_sibs) + scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age) + scale(Abeletal_Data$RL_PercentileRank)))
  111. summary(lm(Abeletal_Data$T_ToM_Score ~ scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age) + scale(Abeletal_Data$RL_PercentileRank)))
  112. summary(lm(Abeletal_Data$AF_ToM_Score ~ scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age) + scale(Abeletal_Data$RL_PercentileRank))) # + scale(Abeletal_Data$num_sibs)))
  113. summary(lm(Abeletal_Data$E_ToM_Score ~ scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age) + scale(Abeletal_Data$RL_PercentileRank))) # + scale(Abeletal_Data$num_sibs)))
  114. #summary(lm(Abeletal_Data$DD_ToM_Score ~ scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age) + scale(Abeletal_Data$RL_PercentileRank))) # + scale(Abeletal_Data$num_sibs)))
  115. summary(lm(Abeletal_Data$FB_ToM_Score ~ scale(Abeletal_Data$GA_birth) + scale(Abeletal_Data$T_age) + scale(Abeletal_Data$RL_PercentileRank))) # + scale(Abeletal_Data$num_sibs)))
  116. Item_type_long_data <- Abeletal_Data %>%
  117. pivot_longer(
  118. cols = AF_ToM_Score:E_ToM_Score, # Columns to pivot
  119. names_to = "Item_type", # New column for the variable names
  120. values_to = "Performance" # New column for the values
  121. )
  122. class(Item_type_long_data$Performance)
  123. #Difficulty_long_data$Performance <- as.numeric(as.character(Difficulty_long_data$Performance))
  124. #view(Difficulty_long_data)
  125. Item_type_long_data <- Item_type_long_data %>% filter(!is.na(FB_ToM_Score) & FB_ToM_Score != "")
  126. Item_type_long_data <- Item_type_long_data %>%
  127. mutate(Item_type = case_when(Item_type == "AF_ToM_Score" ~ "Forced choice",
  128. Item_type == "E_ToM_Score" ~ "Free response"))
  129. Item_type_long_data$Item_type <- factor(
  130. Item_type_long_data$Item_type,
  131. levels = c("Forced choice", "Free response")
  132. )
  133. TEBC_ToM_Item_type <- lmerTest::lmer(Performance ~ scale(GA_birth) * Item_type + scale(T_age) + scale(RL_PercentileRank) + (1 | Sub), data = Item_type_long_data) #+ scale(num_sibs)
  134. summary(TEBC_ToM_Item_type)
  135. print("##ADDITIONAL")
  136. print("#splitting beh data in easier and harder items")
  137. # for each child score per sub-cat and column (GA/TA/Difficulty/Score)
  138. # Pivot from wide to long format
  139. Difficulty_long_data <- Abeletal_Data %>%
  140. pivot_longer(
  141. cols = Easy_ToM_Score:Hard_ToM_Score, # Columns to pivot
  142. names_to = "Difficulty", # New column for the variable names
  143. values_to = "Performance" # New column for the values
  144. )
  145. class(Difficulty_long_data$Performance)
  146. #Difficulty_long_data$Performance <- as.numeric(as.character(Difficulty_long_data$Performance))
  147. #view(Difficulty_long_data)
  148. Difficulty_long_data <- Difficulty_long_data %>% filter(!is.na(T_ToM_Score) & T_ToM_Score != "")
  149. TEBC_ToM_Difficulty <- lmerTest::lmer(Performance ~ scale(GA_birth) + Difficulty + scale(T_age) + scale(RL_PercentileRank) + (1 | Sub), data = Difficulty_long_data) #+ scale(num_sibs)
  150. summary(TEBC_ToM_Difficulty)
  151. Difficulty_long_data <- Difficulty_long_data %>%
  152. mutate(Difficulty = case_when(Difficulty == "Easy_ToM_Score" ~ "Easy",
  153. Difficulty == "FB_ToM_Score" ~ "FB",
  154. Difficulty == "Hard_ToM_Score" ~ "Hard"))
  155. Difficulty_long_data$Difficulty <- factor(
  156. Difficulty_long_data$Difficulty,
  157. levels = c("Easy", "FB", "Hard")
  158. )
  159. print("##Neuro data")
  160. print("#ToM only children with useable fMRI data")
  161. fMRI_kids <- Abeletal_Data %>% filter(task == "pixar")
  162. fMRI_kids %>%
  163. group_by(Preterm) %>%
  164. summarise_at(vars(GA_birth), list(name = mean), na.rm=T)
  165. fMRI_kids %>%
  166. group_by(Preterm) %>%
  167. summarise_at(vars(GA_birth), list(min, max), na.rm=T)
  168. fMRI_kids %>%
  169. group_by(Preterm) %>%
  170. summarise(min_age = min(T_age, na.rm = TRUE),
  171. max_age = max(T_age, na.rm = TRUE),
  172. mean_age = mean(T_age, na.rm = TRUE))
  173. fMRI_kids %>%
  174. group_by(Preterm) %>%
  175. summarize(count = n())
  176. fMRI_kids %>% count(Sex, Preterm)
  177. fMRI_kids %>%
  178. summarise(
  179. mean_value = mean(T_age, na.rm = TRUE),
  180. sd_value = sd(T_age, na.rm = TRUE)
  181. )
  182. summary(lm(fMRI_kids$ECITT_accd ~ scale(fMRI_kids$GA_birth) + scale(fMRI_kids$T_age)))
  183. summary(lm(fMRI_kids$RL_PercentileRank ~ scale(fMRI_kids$GA_birth) + scale(fMRI_kids$T_age)))
  184. summary(lm(fMRI_kids$Inattention ~ scale(fMRI_kids$GA_birth) + scale(fMRI_kids$T_age)))
  185. summary(lm(T_ToM_Score ~ scale(GA_birth) + scale(T_age), data = fMRI_kids))
  186. summary(lm(T_ToM_Score ~ scale(GA_birth) + scale(T_age) + scale(RL_PercentileRank), data = fMRI_kids)) #+ scale(num_sibs)
  187. Item_type_long_data <- fMRI_kids %>%
  188. pivot_longer(
  189. cols = AF_ToM_Score:E_ToM_Score, # Columns to pivot
  190. names_to = "Item_type", # New column for the variable names
  191. values_to = "Performance" # New column for the values
  192. )
  193. class(Item_type_long_data$Performance)
  194. #Difficulty_long_data$Performance <- as.numeric(as.character(Difficulty_long_data$Performance))
  195. #view(Difficulty_long_data)
  196. Item_type_long_data <- Item_type_long_data %>% filter(!is.na(FB_ToM_Score) & FB_ToM_Score != "")
  197. Item_type_long_data <- Item_type_long_data %>%
  198. mutate(Item_type = case_when(Item_type == "AF_ToM_Score" ~ "Forced choice",
  199. Item_type == "E_ToM_Score" ~ "Free response"))
  200. Item_type_long_data$Item_type <- factor(
  201. Item_type_long_data$Item_type,
  202. levels = c("Forced choice", "Free response")
  203. )
  204. TEBC_ToM_Item_type <- lmerTest::lmer(Performance ~ scale(GA_birth) * Item_type + scale(T_age) + scale(RL_PercentileRank) + (1 | Sub), data = Item_type_long_data) #+ scale(num_sibs)
  205. summary(TEBC_ToM_Item_type)
  206. TEBC_ToM_Item_type <- lmerTest::lmer(Performance ~ scale(GA_birth) + Item_type + scale(T_age) + scale(RL_PercentileRank) + (1 | Sub), data = Item_type_long_data) #+ scale(num_sibs)
  207. summary(TEBC_ToM_Item_type)
  208. #Pixar Comp
  209. std.error <- function(x) sd(x)/sqrt(length(x)) #define standard error of mean function
  210. Abeletal_Data %>%
  211. group_by(Preterm) %>%
  212. summarize(
  213. Pix_ToM_Mean = round(mean(Pix_ToM, na.rm = TRUE), 2),
  214. Pix_ToM_SD = round(sd(Pix_ToM, na.rm = TRUE), 2),
  215. Pix_Control_Mean = round(mean(Pix_Control, na.rm = TRUE), 2),
  216. Pix_Control_SD = round(sd(Pix_Control, na.rm = TRUE), 2),
  217. Pix_ToM_SE = ((sd(Pix_ToM, na.rm = T))/ sqrt(n())),
  218. Pix_Control_SE = ((sd(Pix_Control, na.rm = T))/ sqrt(n()))
  219. )
  220. summary(lm(Pix_Control ~ scale(GA_birth) + scale(T_age), Abeletal_Data))
  221. summary(lm(Pix_ToM ~ scale(GA_birth) + scale(T_age), Abeletal_Data))
  222. summary(lm(Pix_Control ~ scale(GA_birth) + scale(T_age) + scale(RL_PercentileRank), Abeletal_Data))
  223. summary(lm(Pix_ToM ~ scale(GA_birth) + scale(T_age) + scale(RL_PercentileRank), Abeletal_Data))
  224. summary(lm(T_ToM_Score ~ scale(Pix_ToM) + scale(GA_birth) + scale(T_age) + scale(RL_PercentileRank), Abeletal_Data))
  225. summary(lm(T_ToM_Score ~ scale(Pix_ToM) + scale(GA_birth) + scale(T_age), Abeletal_Data))
  226. summary(lm(T_ToM_Score ~ scale(Pix_ToM) + scale(RL_PercentileRank) + scale(T_age), Abeletal_Data))
  227. summary(lm(T_ToM_Score ~ scale(Pix_ToM) + scale(T_age), Abeletal_Data))
  228. #Motion
  229. Abeletal_Data$X.Artifacts_ART <- as.numeric(Abeletal_Data$X.Artifacts_ART)
  230. Abeletal_Data %>%
  231. group_by(Preterm) %>%
  232. summarize(
  233. Mean_MeanFD = mean(MeanFD, na.rm = TRUE),
  234. MeanDVARS = mean(MeanDVARS, na.rm = TRUE),
  235. MeanART = mean(X.Artifacts_ART, na.rm = TRUE))
  236. Abeletal_Data %>%
  237. group_by(Preterm) %>%
  238. summarize(
  239. SD_MeanFD = (sqrt(var(MeanFD, na.rm = TRUE))),
  240. SD_DVARS = (sqrt(var(MeanDVARS, na.rm = TRUE))),
  241. SD_ART = (sqrt(var(X.Artifacts_ART, na.rm = TRUE))))
  242. #We will test for correlations between motion and GA, controlling for age, with (1) number of motion outliers and (2) average framewise displacemen
  243. cor.test(Abeletal_Data$MeanFD, Abeletal_Data$GA_birth, use = "complete.obs")
  244. correlation_MeanFD <- cor(Abeletal_Data$MeanFD, Abeletal_Data$GA_birth, use = "complete.obs")
  245. r_squared <- correlation_MeanFD^2
  246. cohen_d <- 2 * correlation_MeanFD / sqrt(1 - correlation_MeanFD^2)
  247. fisher_z <- 0.5 * log((1 + correlation_MeanFD) / (1 - correlation_MeanFD))
  248. list(correlation_MeanFD = correlation_MeanFD, r_squared = r_squared, cohen_d = cohen_d, fisher_z = fisher_z)
  249. cor.test(Abeletal_Data$X.Artifacts_ART, Abeletal_Data$GA_birth, use = "complete.obs")
  250. correlation_X.Artifacts_ART <- cor(Abeletal_Data$X.Artifacts_ART, Abeletal_Data$GA_birth, use = "complete.obs")
  251. r_squared <- correlation_X.Artifacts_ART^2
  252. cohen_d <- 2 * correlation_X.Artifacts_ART / sqrt(1 - correlation_X.Artifacts_ART^2)
  253. fisher_z <- 0.5 * log((1 + correlation_X.Artifacts_ART) / (1 - correlation_X.Artifacts_ART))
  254. list(correlation_X.Artifacts_ART = correlation_X.Artifacts_ART, r_squared = r_squared, cohen_d = cohen_d, fisher_z = fisher_z)
  255. #FuncMat
  256. #FuncMat_data <- read.csv("./EBC/Data/TEBC_other/FuncMat_Data.csv")
  257. #ToM_Funcmat <- c("RTPJ_FuncMat", "LTPJ_FuncMat", "DMPFC_FuncMat", "VMPFC_FuncMat", "PC_FuncMat", "MMPFC_FuncMat")
  258. #FuncMat_data <- FuncMat_data %>%
  259. # mutate(ToM_FuncMat = rowMeans(select(., all_of(ToM_Funcmat))))
  260. #Abeletal_Data <- merge(Abeletal_Data, FuncMat_data, by = "Sub", all.x = T)
  261. Abeletal_Data %>%
  262. group_by(Preterm) %>%
  263. summarize(
  264. ToM_FuncMat_Mean = round(mean(ToM_FuncMat, na.rm = TRUE), 2),
  265. ToM_FuncMat_SD = round(sd(ToM_FuncMat, na.rm = TRUE), 2),
  266. ToM_FuncMat_SE = ((sd(ToM_FuncMat, na.rm = T))/ sqrt(n())),
  267. )
  268. Abeletal_Data %>%
  269. group_by(Preterm) %>%
  270. summarize(
  271. RTPJ_FuncMat_Mean = round(mean(RTPJ_FuncMat, na.rm = TRUE), 2),
  272. RTPJ_FuncMat_SD = round(sd(RTPJ_FuncMat, na.rm = TRUE), 2),
  273. RTPJ_FuncMat_SE = ((sd(RTPJ_FuncMat, na.rm = T))/ sqrt(n())),
  274. )
  275. summary(lm(RTPJ_FuncMat ~ scale(GA_birth) + scale(T_age) + scale(MeanFD) , data = Abeletal_Data)) #scale(GA_birth) * scale(T_age)
  276. summary(lm(RTPJ_FuncMat ~ scale(num_sibs) + scale(GA_birth) + scale(T_age) + scale(MeanFD) , data = Abeletal_Data))
  277. FuncMat_long_data <- Abeletal_Data %>% select(Sub, GA_birth, T_age, num_sibs, MeanFD, DMPFC_FuncMat, VMPFC_FuncMat, PC_FuncMat, MMPFC_FuncMat, LTPJ_FuncMat, RTPJ_FuncMat)
  278. FuncMat_long_data <- FuncMat_long_data %>%
  279. pivot_longer(
  280. cols = DMPFC_FuncMat:RTPJ_FuncMat, # Columns to pivot
  281. names_to = "ROI", # New column for the variable names
  282. values_to = "FuncMat_ROI" # New column for the values
  283. ) %>%
  284. filter(!is.na(MeanFD))
  285. class(FuncMat_long_data$ROI)
  286. FuncMat_long_data$ROI <- as.factor(FuncMat_long_data$ROI)
  287. FuncMat_long_data$ROI <- relevel(FuncMat_long_data$ROI, ref="RTPJ_FuncMat")
  288. summary(lmerTest::lmer(FuncMat_ROI ~ scale(GA_birth) + scale(T_age) + ROI + scale(MeanFD) + (1|Sub), data = FuncMat_long_data))
  289. #summary(lmerTest::lmer(FuncMat_ROI ~ scale(GA_birth) + scale(T_age) + ROI + scale(num_sibs) + scale(MeanFD) + (1|Sub), data = FuncMat_long_data))
  290. # IRC
  291. #TEBC_IRC_Data <- read.csv("./EBC/Data/TEBC_other/TEBC_IRC_Data.csv")
  292. #Abeletal_Data <- merge(Abeletal_Data, TEBC_IRC_Data, by = "Sub", all.x = T)
  293. #write.csv(Abeletal_Data, file="./EBC/Data/Abeletal_Data.csv", row.names=FALSE)
  294. #tmp <- Abeletal_Data %>% select(Sub, Preterm)
  295. #TEBC_IRC_Data <- merge(TEBC_IRC_Data, tmp, by = "Sub", all.x =T)
  296. fMRI_kids %>%
  297. group_by(Preterm) %>%
  298. summarize(
  299. ToM_IRC_Mean = round(mean(ToM_IRC_AverageCorrelation, na.rm = TRUE), 2),
  300. ToM_IRC_SD = round(sd(ToM_IRC_AverageCorrelation, na.rm = TRUE), 2),
  301. ToM_IRC_SE = (ToM_IRC_SD/ sqrt(n())),
  302. )
  303. fMRI_kids %>%
  304. group_by(Preterm) %>%
  305. summarize(
  306. Across_IRC_Mean = round(mean(Across_IRC_AverageCorrelation, na.rm = TRUE), 2),
  307. Across_IRC_SD = round(sd(Across_IRC_AverageCorrelation, na.rm = TRUE), 2),
  308. Across_IRC_SE = (Across_IRC_SD/ sqrt(n())),
  309. )
  310. split_IRC_Data <- split(fMRI_kids, fMRI_kids$Preterm)
  311. t.test(split_IRC_Data$Yes$ToM_IRC_AverageCorrelation, split_IRC_Data$Yes$Across_IRC_AverageCorrelation, alternative = "greater", paired = T)
  312. t.test(split_IRC_Data$No$ToM_IRC_AverageCorrelation, split_IRC_Data$No$Across_IRC_AverageCorrelation, alternative = "greater", paired = T)
  313. summary(lm(ToM_IRC_AverageCorrelation ~ scale(GA_birth) + scale(T_age) + scale(MeanFD), data = Abeletal_Data))
  314. summary(lm(Across_IRC_AverageCorrelation ~ scale(GA_birth) + scale(T_age) + scale(MeanFD), data = Abeletal_Data))
  315. summary(lm(Pain_IRC_AverageCorrelation ~ scale(GA_birth) + scale(T_age) + scale(MeanFD), data = Abeletal_Data))
  316. summary(lm(ToM_IRC_AverageCorrelation ~ scale(GA_birth) + scale(T_age) + scale(num_sibs) + scale(MeanFD), data = Abeletal_Data))
  317. summary(lm(Across_IRC_AverageCorrelation ~ scale(GA_birth) + scale(T_age) + scale(num_sibs) + scale(MeanFD), data = Abeletal_Data))
  318. summary(lm(Pain_IRC_AverageCorrelation ~ scale(GA_birth) + scale(T_age) + scale(num_sibs) + scale(MeanFD), data = Abeletal_Data))
  319. Abeletal_Data$ToMIRC_acrossIRC <- (Abeletal_Data$ToM_IRC_AverageCorrelation - Abeletal_Data$Across_IRC_AverageCorrelation)
  320. summary(lm(ToMIRC_acrossIRC ~ scale(GA_birth) + scale(T_age) + scale(MeanFD), data = Abeletal_Data))
  321. #RM
  322. #TEBC_RM_Data <- read.csv("./EBC/Data/TEBC_RM_Data.csv")
  323. #Abeletal_Data <- merge(Abeletal_Data, TEBC_RM_Data, by = "Sub", all.x = T)
  324. #write.csv(Abeletal_Data, file="./EBC/Data/Abeletal_Data.csv", row.names=FALSE)
  325. #RTPJ
  326. summary(lm(RTPJ_RMT01 ~ scale(GA_birth) + scale(T_age) + scale(MeanFD), data = Abeletal_Data))
  327. summary(lm(RTPJ_RMT02 ~ scale(GA_birth) + scale(T_age) + scale(MeanFD), data = Abeletal_Data))
  328. summary(lm(RTPJ_RMT04 ~ scale(GA_birth) + scale(T_age) + scale(MeanFD), data = Abeletal_Data))
  329. summary(lm(RTPJ_RMT01 ~ scale(GA_birth) * scale(T_age) + scale(num_sibs) + scale(MeanFD), data = Abeletal_Data))
  330. summary(lm(RTPJ_RMT02 ~ scale(GA_birth) + scale(T_age) + scale(num_sibs) + scale(MeanFD), data = Abeletal_Data))
  331. summary(lm(RTPJ_RMT04 ~ scale(GA_birth) + scale(T_age) + scale(num_sibs) + scale(MeanFD), data = Abeletal_Data))
  332. #Network-level analyses:
  333. TEBC_RM_Data_long <- read.csv("./Data/Abeletal_PTB-ToM_RM_long.csv")
  334. tmp <- Abeletal_Data %>% select(Sub, GA_birth, T_age, T_ToM_Score, MeanFD)
  335. TEBC_RM_Data_long <- merge(TEBC_RM_Data_long, tmp, by = "Sub", all.x = T)
  336. ToM <- c("DMPFC", "VMPFC", "PC", "MMPFC", "LTPJ", "RTPJ")
  337. Pain <- c("LInsula", "RInsula", "AMCC", "RS2", "LS2", "RMFG", "LMFG")
  338. TEBC_RM_Data_long <- TEBC_RM_Data_long %>%
  339. mutate(Group = case_when(
  340. ROI %in% ToM ~ "ToM",
  341. ROI %in% Pain ~ "Pain",
  342. TRUE ~ "Other" # Optional, for values not in A or B
  343. ))
  344. class(TEBC_RM_Data_long$ROI)
  345. TEBC_RM_Data_long$ROI <- as.factor(TEBC_RM_Data_long$ROI)
  346. TEBC_RM_Data_long$ROI <- relevel(TEBC_RM_Data_long$ROI, ref="RTPJ")
  347. split_TEBC_RM_Data_long <- split(TEBC_RM_Data_long, TEBC_RM_Data_long$Group)
  348. #view(split_TEBC_RM_Data_long$ToM)
  349. TEBC_RM_Data_long_ToM_RMT01 <- split_TEBC_RM_Data_long$ToM %>% filter(TimeGroup == "RMT01")
  350. TEBC_RM_Data_long_ToM_RMT02 <- split_TEBC_RM_Data_long$ToM %>% filter(TimeGroup == "RMT02")
  351. TEBC_RM_Data_long_ToM_RMT04 <- split_TEBC_RM_Data_long$ToM %>% filter(TimeGroup == "RMT04")
  352. TEBC_RM_Data_long_Pain_RMT01 <- split_TEBC_RM_Data_long$Pain %>% filter(TimeGroup == "RMT01")
  353. TEBC_RM_Data_long_Pain_RMT02 <- split_TEBC_RM_Data_long$Pain %>% filter(TimeGroup == "RMT02")
  354. TEBC_RM_Data_long_Pain_RMT04 <- split_TEBC_RM_Data_long$Pain %>% filter(TimeGroup == "RMT04")
  355. summary(lmerTest::lmer(Average_RM ~ scale(GA_birth) + scale(T_age) + ROI + scale(MeanFD) + (1|Sub), data = TEBC_RM_Data_long_ToM_RMT01))
  356. summary(lmerTest::lmer(Average_RM ~ scale(GA_birth) + scale(T_age) + ROI + scale(GA_birth) * ROI + scale(MeanFD) + (1|Sub), data = TEBC_RM_Data_long_ToM_RMT02))
  357. summary(lmerTest::lmer(Average_RM ~ scale(GA_birth) + scale(T_age) + ROI + scale(MeanFD) + (1|Sub), data = TEBC_RM_Data_long_ToM_RMT04))
  358. summary(lmerTest::lmer(Average_RM ~ scale(GA_birth) + scale(T_age) + ROI + scale(GA_birth) * ROI + scale(MeanFD) + (1|Sub), data = TEBC_RM_Data_long_Pain_RMT01))
  359. summary(lmerTest::lmer(Average_RM ~ scale(GA_birth) + scale(T_age) + ROI + scale(GA_birth) * ROI + scale(MeanFD) + (1|Sub), data = TEBC_RM_Data_long_Pain_RMT02))
  360. summary(lmerTest::lmer(Average_RM ~ scale(GA_birth) + scale(T_age) + ROI + scale(MeanFD) + (1|Sub), data = TEBC_RM_Data_long_Pain_RMT04))
  361. #additionl
  362. summary(lm(RTPJ_RMT04 ~ scale(T_ToM_Score) + scale(GA_birth) + scale(T_age) + scale(MeanFD), data = Abeletal_Data))
  363. summary(lm(RTPJ_RMT02 ~ scale(T_ToM_Score) + scale(GA_birth) + scale(T_age) + scale(MeanFD), data = Abeletal_Data))
  364. summary(lm(RTPJ_RMT04 ~ scale(num_sibs) + scale(T_ToM_Score) + scale(MeanFD), data = Abeletal_Data))
  365. summary(lm(RTPJ_RMT02 ~ scale(num_sibs) + scale(T_ToM_Score) + scale(MeanFD), data = Abeletal_Data))
  366. summary(lmer(scale(Average_RM) ~ scale(T_ToM_Score) + scale(GA_birth) + scale(T_age) + ROI + scale(MeanFD) + (1|Sub),, data = TEBC_RM_Data_long_ToM_RMT04))
  367. #Additional ISC's
  368. #AverageCorrelations <- read.csv("./EBC/Data/TEBC_AverageCorrelations.csv")
  369. #tmp <- AverageCorrelations %>% select(Sub:AverageCorrelation_averageToM_PTxMIT34)
  370. #Abeletal_Data <- merge(Abeletal_Data, tmp, by = "Sub", all.x = T)
  371. #Abeletal_Data <- Abeletal_Data %>% rename ("Preterm" = Preterm.x)
  372. #write.csv(Abeletal_Data, file="./EBC/Data/Abeletal_Data.csv", row.names=FALSE)
  373. Abeletal_Data %>%
  374. group_by(Preterm) %>%
  375. summarize(
  376. Mean_RTPJ_withinPTorT = round(mean(AverageCorrelation_RTPJ_withinPTorT, na.rm = TRUE), 2),
  377. Mean_averageToM_withinPTorT = round(mean(AverageCorrelation_averageToM_withinPTorT, na.rm = TRUE), 2),
  378. Mean_RTPJ_PTxT = round(mean(AverageCorrelation_RTPJ_PTxT, na.rm = TRUE), 2),
  379. Mean_averageToM_PTxT = round(mean(AverageCorrelation_averageToM_PTxT, na.rm = TRUE), 2))
  380. Abeletal_Data %>%
  381. group_by(Preterm) %>%
  382. summarize(
  383. Mean_RTPJ_TEBCxMIT5 = round(mean(AverageCorrelation_RTPJ_TEBCxMIT5, na.rm = TRUE), 2),
  384. Mean_averageToM_TEBCxMIT5 = round(mean(AverageCorrelation_averageToM_TEBCxMIT5, na.rm = TRUE), 2),
  385. Mean_RTPJ_PTxMIT34 = round(mean(AverageCorrelation_RTPJ_PTxMIT34, na.rm = TRUE), 2),
  386. Mean_averageToM_PTxMIT34 = round(mean(AverageCorrelation_averageToM_PTxMIT34, na.rm = TRUE), 2))
  387. Abeletal_Data %>%
  388. group_by(Preterm) %>%
  389. summarize(
  390. SE_RTPJ_withinPTorT = ((sd(AverageCorrelation_RTPJ_withinPTorT, na.rm = TRUE))/ sqrt(n())),
  391. SE_averageToM_withinPTorT = ((sd(AverageCorrelation_averageToM_withinPTorT, na.rm = TRUE))/ sqrt(n())),
  392. SE_RTPJ_PTxT = ((sd(AverageCorrelation_RTPJ_PTxT, na.rm = TRUE))/ sqrt(n())),
  393. SE_averageToM_PTxT = ((sd(AverageCorrelation_averageToM_PTxT, na.rm = TRUE))/ sqrt(n())))
  394. Abeletal_Data %>%
  395. group_by(Preterm) %>%
  396. summarize(
  397. SE_RTPJ_TEBCxMIT5 = ((sd(AverageCorrelation_RTPJ_TEBCxMIT5, na.rm = TRUE))/ sqrt(n())),
  398. SE_averageToM_TEBCxMIT5 = ((sd(AverageCorrelation_averageToM_TEBCxMIT5, na.rm = TRUE))/ sqrt(n())),
  399. SE_RTPJ_PTxMIT34 = ((sd(AverageCorrelation_RTPJ_PTxMIT34, na.rm = TRUE))/ sqrt(n())),
  400. SE_averageToM_PTxMIT34 = ((sd(AverageCorrelation_averageToM_PTxMIT34, na.rm = TRUE))/ sqrt(n())),
  401. )
  402. split_AverageCorrelations <- split(fMRI_kids, fMRI_kids$Preterm)
  403. #within PT , within T
  404. t.test(split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_withinPTorT, split_AverageCorrelations$No$AverageCorrelation_RTPJ_withinPTorT, alternative = "greater", paired = F)
  405. t.test(split_AverageCorrelations$Yes$AverageCorrelation_averageToM_withinPTorT, split_AverageCorrelations$No$AverageCorrelation_averageToM_withinPTorT, alternative = "greater", paired = F)
  406. #within T , within PT
  407. t.test(split_AverageCorrelations$No$AverageCorrelation_RTPJ_withinPTorT, split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_withinPTorT, alternative = "greater", paired = F)
  408. t.test(split_AverageCorrelations$No$AverageCorrelation_averageToM_withinPTorT, split_AverageCorrelations$Yes$AverageCorrelation_averageToM_withinPTorT, alternative = "greater", paired = F)
  409. #within-PT,across-PT-T
  410. t.test(split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_withinPTorT, split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_PTxT, alternative = "greater", paired = T)
  411. t.test(split_AverageCorrelations$Yes$AverageCorrelation_averageToM_withinPTorT, split_AverageCorrelations$Yes$AverageCorrelation_averageToM_PTxT, alternative = "greater", paired = T)
  412. #within-PT,across-PT-T - post-hoc two tailed
  413. t.test(split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_withinPTorT, split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_PTxT, alternative = "two.sided", paired = T)
  414. t.test(split_AverageCorrelations$Yes$AverageCorrelation_averageToM_withinPTorT, split_AverageCorrelations$Yes$AverageCorrelation_averageToM_PTxT, alternative = "two.sided", paired = T)
  415. #within-T,across-PT-T
  416. t.test(split_AverageCorrelations$No$AverageCorrelation_RTPJ_withinPTorT, split_AverageCorrelations$No$AverageCorrelation_RTPJ_PTxT, alternative = "greater", paired = T)
  417. t.test(split_AverageCorrelations$No$AverageCorrelation_averageToM_withinPTorT, split_AverageCorrelations$No$AverageCorrelation_averageToM_PTxT, alternative = "greater", paired = T)
  418. #TEBC-PT – TEBC-T, TEBC-PT – MIT5-T
  419. t.test(split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_PTxT, split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_TEBCxMIT5, alternative = "two.sided", paired = T)
  420. t.test(split_AverageCorrelations$Yes$AverageCorrelation_averageToM_PTxT, split_AverageCorrelations$Yes$AverageCorrelation_averageToM_TEBCxMIT5, alternative = "two.sided", paired = T)
  421. #TEBC-PT – MIT34-T , TEBC-PT – MIT5-T
  422. t.test(split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_PTxMIT34, split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_TEBCxMIT5, alternative = "two.sided", paired = T)
  423. t.test(split_AverageCorrelations$Yes$AverageCorrelation_averageToM_PTxMIT34, split_AverageCorrelations$Yes$AverageCorrelation_averageToM_TEBCxMIT5, alternative = "two.sided", paired = T)
  424. sink()
  425. #Timeshift analyses (not prereg)
  426. # create txt with results
  427. sink(paste0("./PTB_timeshift_IRC_results_", Sys.Date(), ".txt"))
  428. # calculate means
  429. fMRI_kids %>%
  430. group_by(Preterm) %>%
  431. summarise(mean_RTPJ_shift = mean(AverageCorrelation_RTPJ_PTxT_shift, na.rm = TRUE),
  432. mean_averageToM_shift = mean(AverageCorrelation_averageToM_PTxT_shift, na.rm = TRUE),
  433. mean_RTPJ_NOshift = mean(AverageCorrelation_RTPJ_PTxT_NOshift, na.rm = TRUE),
  434. mean_averageToM_NOshift = mean(AverageCorrelation_averageToM_PTxT_NOshift, na.rm = TRUE),
  435. SE_RTPJ_shift = ((sd(AverageCorrelation_RTPJ_PTxT_shift, na.rm = T))/ sqrt(n())),
  436. SE_averageToM_shift = ((sd(AverageCorrelation_averageToM_PTxT_shift, na.rm = T))/ sqrt(n())),
  437. SE_RTPJ_NOshift = ((sd(AverageCorrelation_RTPJ_PTxT_NOshift, na.rm = T))/ sqrt(n())),
  438. SE_RTPJ_averageToM_NOshift = ((sd(AverageCorrelation_averageToM_PTxT_NOshift, na.rm = T))/ sqrt(n())),
  439. )
  440. # run stats
  441. split_AverageCorrelations <- split(fMRI_kids, fMRI_kids$Preterm)
  442. #across T_321, PT_2 vs across T_321, PT_321
  443. t.test(split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_PTxT_NOshift, split_AverageCorrelations$Yes$AverageCorrelation_RTPJ_PTxT_shift, alternative = "two.sided", paired = T)
  444. t.test(split_AverageCorrelations$Yes$AverageCorrelation_averageToM_PTxT_NOshift, split_AverageCorrelations$Yes$AverageCorrelation_averageToM_PTxT_shift, alternative = "two.sided", paired = T)
  445. sink()
  446. #--------------------
  447. ##paper plots
  448. library(patchwork)
  449. desired_order_2 <- c("Yes", "No")
  450. Plot_Abeletal_Data <- Abeletal_Data %>%
  451. mutate(
  452. Preterm = factor(Preterm, levels = desired_order_2))
  453. # Figure 1 option 2 - JCPP
  454. P1a <- ggplot(Plot_Abeletal_Data, aes(x=GA_birth, y=T_ToM_Score)) +
  455. geom_point(size=4, alpha=0.7,aes(colour=Preterm)) +
  456. scale_colour_manual(values = c("Yes"="deeppink3", "No"="goldenrod2"), labels = c("Term", "Preterm")) +
  457. labs(x="Gestational Age", y="Proportion Correct", title= "a. ToM Booklet") +
  458. ylim(0,1) +
  459. guides(colour = guide_legend(override.aes = list(colour = "white")))+
  460. scale_x_continuous(breaks = seq(24, 42, 3), minor_breaks=NULL) +
  461. theme(legend.title = element_blank(),
  462. plot.title = element_text(size=30,face="bold",hjust=.5),
  463. panel.background = element_rect(fill="white"),
  464. axis.line=element_line(color="black"),
  465. axis.text=element_text(size=27),
  466. axis.title=element_text(size=27,face="bold"),
  467. legend.key=element_rect(fill="white"),
  468. legend.text= element_blank(),
  469. legend.position = "none") + #legend.text=element_text(size=20, lineheight=.8),legend.key.height=unit(2,"cm"))+
  470. geom_smooth(method=lm, se=TRUE,colour="black")
  471. P1d <- ggMarginal(P1a,type="violin", margins = c("y"), groupColour = TRUE, groupFill = TRUE)
  472. print(P1d)
  473. Item_type_long_data <- Plot_Abeletal_Data %>%
  474. pivot_longer(
  475. cols = AF_ToM_Score:T_ToM_Score, # Columns to pivot
  476. names_to = "Item_type", # New column for the variable names
  477. values_to = "Performance" # New column for the values
  478. )
  479. class(Item_type_long_data$Performance)
  480. Item_type_long_data <- Item_type_long_data %>% filter(!is.na(FB_ToM_Score) & FB_ToM_Score != "")
  481. Item_type_long_data <- Item_type_long_data %>%
  482. mutate(Item_type = case_when(Item_type == "T_ToM_Score" ~ "All Items",
  483. Item_type == "AF_ToM_Score" ~ "Forced choice",
  484. Item_type == "E_ToM_Score" ~ "Free response"))
  485. Item_type_long_data$Item_type <- factor(
  486. Item_type_long_data$Item_type,
  487. levels = c("All Items", "Forced choice", "Free response")
  488. )
  489. P1b <- ggplot(Item_type_long_data, aes(x = Item_type, y = Performance, fill = Preterm)) +
  490. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm)) +
  491. scale_fill_manual(values = c("Yes" = "deeppink3", "No" = "goldenrod2"), labels = c("Preterm", "Term")) + #' Alpha makes the violin plots semi-transparent
  492. geom_point(size=3, shape = 27, alpha=0.7,aes(colour = Preterm), position = position_jitterdodge(dodge.width = 0.85, jitter.width = 0.25)) +
  493. scale_colour_manual(values = c("Yes" = "deeppink3", "No" = "goldenrod2"), labels = c("Preterm", "Term")) +
  494. geom_boxplot(width = 0.2, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  495. stat_summary(fun = mean, geom = "point", shape = 18, size = 4, alpha = 0.7,
  496. position = position_dodge(width = 0.9)) +
  497. labs(x = "Response Type", y = "Proportion Correct", title = "b. ToM Booklet by Response Type") +
  498. ylim(0, 1) +
  499. theme(legend.title = element_blank(),
  500. plot.title = element_text(size=30,face="bold",hjust=.5),
  501. axis.text.x = element_text(face = "bold", size = 23),
  502. panel.background = element_rect(fill = "white"),
  503. axis.line=element_line(color="black"),
  504. axis.text=element_text(size=27),
  505. axis.title=element_text(size=27,face="bold"),
  506. legend.key = element_rect(fill = "white"),
  507. legend.text = element_text(size = 23),
  508. legend.key.height = unit(1.5, "cm"),
  509. legend.position = "top"
  510. )
  511. print(P1b)
  512. P1c <- ggplot(Plot_Abeletal_Data, aes(x=GA_birth, y=RL_PercentileRank)) +
  513. geom_point(size=4, alpha=0.7,aes(color=Preterm)) +
  514. scale_colour_manual(values = c("Yes"="deeppink3", "No"="goldenrod2")) +
  515. guides(colour = guide_legend(override.aes = list(colour = "white")))+
  516. labs(x="Gestational Age", y="Percentile Rank", title= "c. Receptive Language") + #ylim(100) +
  517. scale_x_continuous(breaks = seq(24, 42, 3), minor_breaks=NULL) +
  518. theme(legend.title = element_blank(),
  519. plot.title = element_text(size=30,face="bold",hjust=.5),
  520. panel.background = element_rect(fill="white"),
  521. axis.line=element_line(color="black"),
  522. axis.text=element_text(size=27),
  523. axis.title=element_text(size=27,face="bold"),
  524. legend.key=element_rect(fill="white"),
  525. legend.text=element_blank(),
  526. legend.position = "top") +
  527. geom_smooth(method=lm, se=TRUE,colour="black")
  528. P1f <- ggMarginal(P1c,type="violin", margins = c("y"), groupColour = TRUE, groupFill = TRUE)
  529. print(P1f)
  530. png("./JCPP_Figure1_141125.png", width = 2000, height = 732)
  531. patchwork::wrap_elements(P1d) + patchwork::wrap_elements(P1b) + patchwork::wrap_elements(P1f) + plot_layout(guides = 'collect')
  532. dev.off()
  533. #supplement 1
  534. S1a <- ggplot(Plot_Abeletal_Data, aes(x=GA_birth, y=Pix_ToM)) +
  535. geom_point(size=4, alpha=0.7,aes(colour=Preterm)) +
  536. scale_colour_manual(values = c("Yes"="deeppink3", "No"="goldenrod2"), labels = c("Preterm", "Term")) +
  537. guides(colour = guide_legend(override.aes = list(colour = "white")))+
  538. labs(x="Gestational Age", y="Proportion Correct", title= "Partly Cloudy ToM performance") +ylim(0,1) +
  539. scale_x_continuous(breaks = seq(24, 42, 3), minor_breaks=NULL) +
  540. theme(legend.title = element_blank(),
  541. plot.title = element_text(size=20,face="bold",hjust=.5),
  542. panel.background = element_rect(fill="white"),
  543. axis.line=element_line(color="black"),
  544. axis.text=element_text(size=16),
  545. axis.title=element_text(size=16,face="bold"),
  546. legend.key=element_rect(fill="white"),
  547. legend.text= element_blank(),
  548. legend.position = "left") + #legend.text=element_text(size=20, lineheight=.8),legend.key.height=unit(2,"cm"))+
  549. geom_smooth(method=lm, se=TRUE,colour="black")
  550. S1c <- ggMarginal(S1a,type="violin", margins = c("y"), groupColour = TRUE, groupFill = TRUE)
  551. print(S1c)
  552. S1d <- ggplot(Plot_Abeletal_Data, aes(x=T_ToM_Score, y=Pix_ToM)) +
  553. geom_point(size=4, alpha=0.7,aes(colour=Preterm)) +
  554. scale_colour_manual(values = c("Yes"="deeppink3", "No"="goldenrod2"), labels = c("Preterm", "Term")) +
  555. labs(x="Booklet task Proportion Correct", y="Partly Cloudy task Proportion Correct", title= "ToM") +
  556. ylim(0.2,1) +
  557. xlim(0.2,1) +
  558. #scale_x_continuous(breaks = seq(0.25, 0.50, 0.75), minor_breaks=NULL) +
  559. theme(legend.title = element_blank(),
  560. plot.title = element_text(size=20,face="bold",hjust=.5),
  561. panel.background = element_rect(fill="white"),
  562. axis.line=element_line(color="black"),
  563. axis.text=element_text(size=16),
  564. axis.title=element_text(size=16,face="bold"),
  565. legend.key=element_rect(fill="white"),
  566. legend.text= element_text(size=16, lineheight=.8),
  567. legend.position = "right") + #legend.text=element_text(size=20, lineheight=.8),legend.key.height=unit(2,"cm"))+
  568. geom_smooth(method=lm, se=TRUE,colour="black")
  569. #S1d <- ggMarginal(S1b,type="violin", margins = c("y"), groupColour = TRUE, groupFill = TRUE)
  570. print(S1d)
  571. png("./SupplementalFigure1_290825.png", width = 1300, height = 500)
  572. patchwork::wrap_elements(S1c) + patchwork::wrap_elements(S1d)
  573. dev.off()
  574. #Figure 2 whole brain
  575. #Figure 3s TC plots - see TC.R
  576. TEBC_TC_Data <- read.csv("./Data/Abeletal_PTB-ToM_timecourses_zscored.csv")
  577. library(R.matlab)
  578. Adult_TC_ToM_Data <- read.csv("./Data/Abeletal_PTB-ToM_adultTCs.csv") %>%
  579. rename("group.RTPJ" = "averageAdultRTPJ", "group.LTPJ" = "averageAdultLTPJ", "group.DMPFC" = "averageAdultDMPFC", "group.MMPFC" = "averageAdultMMPFC", "group.VMPFC" = "averageAdultVMPFC", "group.PC" = "averageAdultPC", "group.avToM" = "averageAdultToM", "group.avPain" = "averageAdultaveragePain")
  580. GA_group_data <- Abeletal_Data %>% select(Sub, Preterm, task, GA_birth, T_age, Sex)
  581. GA_group_data <- GA_group_data %>% filter(!is.na(task))
  582. GA_group_data$Sub <- as.character(GA_group_data$Sub)
  583. #Create Participant lists
  584. filtered_rows_PT <- GA_group_data %>%
  585. filter(grepl("Yes", Preterm)) # Use grepl() to check for the string
  586. print(filtered_rows_PT)
  587. filtered_rows_T <- GA_group_data %>%
  588. filter(grepl("No", Preterm)) # Use grepl() to check for the string
  589. print(filtered_rows_T)
  590. Preterm <- c("1010","1012","1016","1020","1026","1032","1034","1038","1039","1040",
  591. "1042","1047","1048","1050","1052","1057","1058","1061","1075","1083",
  592. "1085","1088","1090","1099","1103","1104","1109","1110","1111","1112")
  593. Term <- c("1002","1006","1007","1008","1009","1011","1013","1014","1015","1018",
  594. "1019","1021","1023","1024","1029","1031","1037","1043","1045","1051",
  595. "1053","1054","1055","1063","1064","1066","1068","1069","1070","1072",
  596. "1074","1077","1078","1079","1080","1084","1093","1095","1096","1097",
  597. "1100","1101","1102","1106","1107","1107")
  598. # Create network lists
  599. ToM <- c("DMPFC", "VMPFC", "PC", "MMPFC", "LTPJ", "RTPJ")
  600. Pain <- c("LInsula", "RInsula", "AMCC", "RS2", "LS2", "RMFG", "LMFG")
  601. Adult.ToM <- c("group.RTPJ", "group.LTPJ", "group.PC", "group.DMPFC", "group.MMPFC", "group.VMPFC")
  602. Adult_ToM_Data <- Adult_TC_ToM_Data %>% select (all_of(Adult.ToM))
  603. #Remove all unused runs
  604. TEBC_TC_Data <- TEBC_TC_Data %>%
  605. group_by(Sub, run) %>%
  606. filter(any(!is.na(RTPJ))) %>%
  607. ungroup()
  608. #average ToM and Pain Networks
  609. TEBC_TC_Data <- TEBC_TC_Data %>%
  610. mutate(averageToM = rowMeans(select(., all_of(ToM)))) %>% #ToM
  611. mutate(averagePain = rowMeans(select(., all_of(Pain)))) #Pain
  612. #look at avergae TC
  613. library(reshape2)
  614. AvToM_TC_Data <- TEBC_TC_Data %>% select(Sub, averageToM, time)
  615. AvToM_TC_Data_plusAdults <- AvToM_TC_Data %>% pivot_wider(names_from = Sub, values_from = averageToM, names_prefix = "")
  616. tmp <- Adult_TC_ToM_Data %>% select(group.avToM)
  617. AvToM_TC_Data_plusAdults <- cbind(AvToM_TC_Data_plusAdults, tmp)
  618. AvToM_TC_Data_plusAdults <- AvToM_TC_Data_plusAdults %>% rename(AvAdult = "group.avToM")
  619. AvToM_TC_Data_plusAdults <- AvToM_TC_Data_plusAdults %>%
  620. mutate(across(everything(), as.numeric))
  621. warnings()
  622. AvToM_TC_Group_Data <- AvToM_TC_Data_plusAdults %>%
  623. mutate(
  624. avgPreterm = rowMeans(across(all_of(Preterm)), na.rm = TRUE),
  625. avgTerm = rowMeans(across(all_of(Term)), na.rm = TRUE)
  626. )
  627. Data_AvToM_TC_Group <- AvToM_TC_Group_Data %>% select(time, AvAdult, avgPreterm, avgTerm)
  628. # Step 1: Melt the data into long format
  629. TC_df_long <- melt(Data_AvToM_TC_Group, id.vars = "time", variable.name = "Subject", value.name = "Magnitude")
  630. #view(TC_df_long)
  631. # Step 2: Create the timecourse plot
  632. P4a <- ggplot(TC_df_long, aes(x = time, y = Magnitude, color = Subject, group = Subject)) +
  633. geom_line(linewidth = 2.5, alpha = 0.8) + # Add lines to connect the points
  634. #geom_point(size = 1.5) + # Optional: Add points to show the actual values
  635. labs(title = "a. ToM Network Timecourse", x = "Time (TR)", y = "Response Magnitude") +
  636. theme_minimal() + # A clean theme for the plot
  637. scale_color_manual(values = c("mediumorchid3", "deeppink3", "goldenrod1"), labels = c("Adult", "Preterm", "Term")) + # Custom colors for each subject (adjust as needed)
  638. #geom_hline(yintercept = 0, linetype = "dashed", color = "darkgrey") + # Add horizontal line at y = 0
  639. #geom_line(xintercept =192.5, color = "chartreuse", linewidth = 1) +
  640. annotate("segment", y=-0.6, yend = 0.7, x= 192.5, xend = 192.5, color = "#ff00aa", linewidth = 2.5, alpha = 0.55) +
  641. annotate("segment", y=-0.6, yend = 0.7, x= 262.5, xend = 262.5, color = "#ff00aa", linewidth = 2.5, alpha = 0.55) +
  642. annotate("segment", y=-0.6, yend = 0.7, x= 300.5, xend = 300.5, color = "#ff00aa", linewidth = 2.5, alpha = 0.55) +
  643. annotate("text", label="T02", x=192.5, y=-0.8, size=7) +
  644. annotate("text", label="T01", x=262.5, y=-0.8, size=7) +
  645. annotate("text", label="T04", x=300.5, y=-0.8, size=7) +
  646. #geom_vline(xintercept =192.5, color = "#ff00aa", linewidth = 2, alpha = 0.7) + # linetype = "dashed",
  647. #geom_vline(xintercept =262.5, color = "#ff00aa", linewidth = 2, alpha = 0.7) + #aaff00, linetype = "dashed",
  648. #geom_vline(xintercept =300.5, color = "#ff00aa", linewidth = 2, alpha = 0.7) + # linetype = "dashed",
  649. scale_x_continuous(breaks = seq(0, 323, by = 5), expand = c(0, 0)) + # Set x-axis breaks every 2 seconds
  650. theme(legend.title = element_blank(),
  651. plot.title = element_text(size=25,face="bold"),
  652. axis.line = element_line(linewidth = 0.5, colour = "black"),
  653. axis.title=element_text(size=23,face="bold"),
  654. axis.text.x = element_text(size = 18, angle = -45),
  655. axis.text.y = element_text(size = 18),
  656. legend.text=element_text(size=22, lineheight=.8),
  657. panel.grid.major = element_blank(),
  658. panel.grid.minor = element_blank(),
  659. legend.position = "top") # Make the axes lines more pronounced
  660. print(P4a)
  661. #Figure 3b
  662. #ToM FuncMAt,
  663. P5a. <- ggplot(Plot_Abeletal_Data, aes(x=GA_birth, y=ToM_FuncMat)) +
  664. geom_smooth(method=lm, se=TRUE,colour="black") +
  665. geom_point(size=3, alpha=0.7,aes(color=Preterm)) +
  666. scale_colour_manual(values = c("Yes"="deeppink3", "No"="goldenrod2"), labels = c("Preterm", "Term")) +
  667. labs(x="Gestational Age", y="Functional Maturity", title= "b. ToM Network FM") +
  668. scale_y_continuous(breaks = seq(-0.75, 1.25, 0.25)) +
  669. scale_x_continuous(breaks = seq(24, 42, 3), minor_breaks=NULL) +
  670. theme(legend.title = element_blank(),
  671. plot.title = element_text(size=25,face="bold",hjust=.5),
  672. panel.background = element_rect(fill="white"),
  673. axis.line=element_line(color="black"),
  674. axis.text=element_text(size=18),
  675. axis.title=element_text(size=23,face="bold"),
  676. legend.key=element_rect(fill="white"),
  677. legend.text=element_text(size = 21),
  678. legend.position = "top")
  679. P5a <- ggMarginal(P5a., type = "violin", margins = c("y"), groupColour = TRUE, groupFill = TRUE)
  680. print(P5a)
  681. #ToM T01
  682. P5b. <- ggplot(Plot_Abeletal_Data, aes(x=GA_birth, y=averageToM_RMT01)) +
  683. geom_smooth(method=lm, se=TRUE,colour="black") +
  684. geom_point(size=3, alpha=0.7,aes(color=Preterm)) +
  685. guides(colour = guide_legend(override.aes = list(colour = "white")))+
  686. scale_colour_manual(values = c("Yes"="deeppink3", "No"="goldenrod2"), labels = c("Preterm", "Term")) +
  687. labs(x="Gestational Age", y="Response Magnitude", title= "c. T01") +
  688. scale_y_continuous(breaks = seq(-1, 1.25, 0.5)) +
  689. scale_x_continuous(breaks = seq(24, 42, 3), minor_breaks=NULL) +
  690. theme(legend.title = element_blank(),
  691. plot.title = element_text(size=25,face="bold",hjust=.5),
  692. panel.background = element_rect(fill="white"),
  693. axis.line=element_line(color="black"),
  694. axis.text=element_text(size=18),
  695. axis.title=element_text(size=23,face="bold"),
  696. legend.key=element_rect(fill="white"),
  697. legend.text=element_blank(),
  698. legend.position = "top")
  699. P5b <- ggMarginal(P5b.,type="violin", margins = c("y"), groupColour = TRUE, groupFill = TRUE)
  700. #ToM T02
  701. P5c. <- ggplot(Plot_Abeletal_Data, aes(x=GA_birth, y=averageToM_RMT02)) +
  702. geom_smooth(method=lm, se=TRUE,colour="black") +
  703. geom_point(size=3, alpha=0.7,aes(color=Preterm)) +
  704. guides(colour = guide_legend(override.aes = list(colour = "white")))+
  705. scale_colour_manual(values = c("Yes"="deeppink3", "No"="goldenrod2"), labels = c("Preterm", "Term")) +
  706. labs(x="Gestational Age", y="Response Magnitude", title= "d. T02") +
  707. scale_y_continuous(breaks = seq(-1, 1.25, 0.5)) +
  708. scale_x_continuous(breaks = seq(24, 42, 3), minor_breaks=NULL) +
  709. theme(legend.title = element_blank(),
  710. plot.title = element_text(size=25,face="bold",hjust=.5),
  711. panel.background = element_rect(fill="white"),
  712. axis.line=element_line(color="black"),
  713. axis.text=element_text(size=18),
  714. axis.title=element_text(size=23,face="bold"),
  715. legend.key=element_rect(fill="white"),
  716. legend.text=element_blank(),
  717. legend.position = "top") #legend.text=element_text(size=20, lineheight=.8),legend.key.height=unit(2,"cm"))+
  718. P5c <- ggMarginal(P5c.,type="violin", margins = c("y"), groupColour = TRUE, groupFill = TRUE)
  719. #ToM T04
  720. P5d. <- ggplot(Plot_Abeletal_Data, aes(x=GA_birth, y=averageToM_RMT04)) +
  721. geom_smooth(method=lm, se=TRUE,colour="black") +
  722. geom_point(size=3, alpha=0.7,aes(color=Preterm)) +
  723. guides(colour = guide_legend(override.aes = list(colour = "white")))+
  724. scale_colour_manual(values = c("Yes"="deeppink3", "No"="goldenrod2"), labels = c("Preterm", "Term")) +
  725. labs(x="Gestational Age", y="Response Magnitude", title= "e. T04") +
  726. scale_y_continuous(breaks = seq(-1, 1.25, 0.5)) +
  727. scale_x_continuous(breaks = seq(24, 42, 3), minor_breaks=NULL) +
  728. theme(legend.title = element_blank(),
  729. plot.title = element_text(size=25,face="bold",hjust=.5),
  730. panel.background = element_rect(fill="white"),
  731. axis.line=element_line(color="black"),
  732. axis.text=element_text(size=18),
  733. axis.title=element_text(size=23,face="bold"),
  734. legend.key=element_rect(fill="white"),
  735. legend.text=element_blank(),
  736. legend.position = "top") #legend.text=element_text(size=20, lineheight=.8),legend.key.height=unit(2,"cm"))+
  737. P5d <- ggMarginal(P5d.,type="violin", margins = c("y"), groupColour = TRUE, groupFill = TRUE)
  738. # JCPP Figure 3
  739. png("./JCPP_Figure3_141125.png", width = 1500, height = 900)
  740. P5i <- patchwork::wrap_elements(P5a) + patchwork::wrap_elements(P5b) +
  741. patchwork::wrap_elements(P5c) + patchwork::wrap_elements(P5d) +
  742. plot_layout(ncol = 4) + plot_layout(guides = 'collect')
  743. JCPP3 <-
  744. patchwork::wrap_elements(P4a) + patchwork::wrap_elements(P5i) +
  745. plot_layout(ncol = 1)
  746. print(JCPP3)
  747. dev.off()
  748. #Figure 4 - IRC
  749. IRC_averageCorrelations <- read.csv("./Data/Abeletal_PTB-ToM_IRCaverageCorrelations.csv")
  750. desired_order <- c("RTPJ", "LTPJ", "PC", "DMPFC", "MMPFC", "VMPFC", "RS2", "LS2", "RInsula", "LInsula", "RMFG", "LMFG", "AMCC")
  751. IRC_averageCorrelations <- IRC_averageCorrelations %>%
  752. mutate(
  753. Var1 = factor(Var1, levels = desired_order),
  754. Var2 = factor(Var2, levels = rev(desired_order)),
  755. Preterm = factor(Preterm, levels = desired_order_2)
  756. )
  757. split_IRC_averageCorrelations <- split(IRC_averageCorrelations, IRC_averageCorrelations$Preterm)
  758. P6a <- ggplot(split_IRC_averageCorrelations$No, aes(x = Var1, y = Var2, fill = AverageCorrelation)) +
  759. geom_tile() +
  760. scale_fill_gradient2(low = "purple", mid = "white", high = "orange",
  761. limit = c(-0.4, 1.2),
  762. name = "Correlation") +
  763. theme_minimal() +
  764. theme(axis.title = element_blank(),
  765. axis.text.x = element_text(size = 14, angle = 45, hjust = 1, face = "bold"),
  766. axis.text.y = element_text(size = 14, face = "bold"),
  767. plot.title = element_text(size = 18, face = "bold", hjust=.5),
  768. legend.title = element_text(size = 14)
  769. ) +
  770. labs(title = "Term", x = "", y = "") +
  771. annotate("segment", x=.5, xend=6.5, y=13.5, yend=13.5, linewidth = 2, color = "#ff00aa") +
  772. annotate("segment", x=.5, xend=6.5, y=7.5, yend=7.5, linewidth = 2, color = "#ff00aa") +
  773. annotate("segment", x=.5, xend= .5, y= 7.5, yend= 13.5, linewidth = 2, color = "#ff00aa") +
  774. annotate("segment", x=6.5, xend=6.5, y=7.5, yend=13.5, linewidth = 2, color = "#ff00aa")
  775. print(P6a)
  776. P6b <- ggplot(split_IRC_averageCorrelations$Yes, aes(x = Var1, y = Var2, fill = AverageCorrelation)) +
  777. geom_tile() +
  778. scale_fill_gradient2(low = "purple", mid = "white", high = "orange",
  779. limit = c(-0.4, 1.2),
  780. name = "Correlation") +
  781. theme_minimal() +
  782. theme(axis.title = element_blank(),
  783. axis.text.x = element_text(size = 14, angle = 45, hjust = 1, face = "bold"),
  784. axis.text.y = element_text(size = 14, face = "bold"),
  785. plot.title = element_text(size = 18, face = "bold", hjust=.5),
  786. legend.title = element_text(size = 14)
  787. ) +
  788. labs(title = "Preterm", x = "", y = "") +
  789. annotate("segment", x=.5, xend=6.5, y=13.5, yend=13.5, linewidth = 2, color = "#ff00aa") +
  790. annotate("segment", x=.5, xend=6.5, y=7.5, yend=7.5, linewidth = 2, color = "#ff00aa") +
  791. annotate("segment", x=.5, xend= .5, y= 7.5, yend= 13.5, linewidth = 2, color = "#ff00aa") +
  792. annotate("segment", x=6.5, xend=6.5, y=7.5, yend=13.5, linewidth = 2, color = "#ff00aa")
  793. print(P6b)
  794. P6c <- P6b + P6a +
  795. plot_layout(axes = "collect") + plot_layout(guides = 'collect')
  796. print(P6c) #1200 x 620
  797. #IRC box plot
  798. TEBC_IRC_Data_long <- Plot_Abeletal_Data %>%
  799. pivot_longer(
  800. cols = c(ToM_IRC_AverageCorrelation, Pain_IRC_AverageCorrelation, Across_IRC_AverageCorrelation),
  801. names_to = "Variable",
  802. values_to = "Value")
  803. TEBC_IRC_Data_long <- TEBC_IRC_Data_long %>%
  804. mutate(Variable = case_when(Variable == "ToM_IRC_AverageCorrelation" ~ "Within ToM",
  805. Variable == "Pain_IRC_AverageCorrelation" ~ "Within Pain",
  806. Variable == "Across_IRC_AverageCorrelation" ~ "Across ToM-Pain"))
  807. TEBC_IRC_Data_long$Variable <- factor(
  808. TEBC_IRC_Data_long$Variable,
  809. levels = c("Within ToM", "Within Pain", "Across ToM-Pain")
  810. )
  811. P6d <- ggplot(TEBC_IRC_Data_long, aes(x = Variable, y = Value, fill = Preterm)) +
  812. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitterdodge(dodge.width = 0.85, jitter.width = 0.25)) +
  813. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm)) + # Alpha makes the violin plots semi-transparent
  814. geom_boxplot(width = 0.2, position = position_dodge(width = 0.9), alpha = 0.8, color = "lightgrey", linewidth = 0.1) +
  815. stat_summary(fun = mean, geom = "point", shape = 18, size = 4, alpha = 0.7, position = position_dodge(width = 0.9)) +
  816. scale_colour_manual(values = c("Yes" = "deeppink3", "No" = "goldenrod2"), labels = c("Preterm", "Term")) +
  817. labs(title = " ", x = "Variable", y = "z-scored correlation") +
  818. #scale_y_continuous(breaks = seq(-.25, 1, 0.25)) +
  819. #geom_hline(yintercept = 0, linetype = "dashed", color = "darkgrey") + # Add horizontal line at y =
  820. theme_minimal() +
  821. scale_fill_manual(values = c("Yes" = "deeppink3", "No" = "goldenrod1"), labels = c("Preterm", "Term")) + # Customize colors
  822. theme(plot.title = element_blank(),
  823. panel.grid.minor = element_blank(),
  824. panel.background = element_blank(),
  825. axis.line = element_blank(),
  826. axis.text = element_text(size = 16, color = "black"),
  827. axis.title.y = element_text(size = 16, face = "bold", line= 0),
  828. axis.title.x = element_blank(),
  829. legend.key = element_rect(fill = "white"),
  830. legend.text = element_text(size = 16),
  831. legend.title = element_blank(),
  832. panel.grid.major.x = element_blank(),
  833. panel.grid.major.y = element_line(linetype = "dashed", color = "darkgrey"),
  834. legend.position = "right") # Tilt x-axis labels for better readability
  835. print(P6d)
  836. png("./Figure6b_310825.png", width = 850, height = 743)
  837. P6 <- P6c / P6d
  838. print(P6)
  839. dev.off()
  840. #Figure 5
  841. ISC_long_data_RTPJ_a <- Plot_Abeletal_Data %>%
  842. pivot_longer(
  843. cols = c(AverageCorrelation_RTPJ_withinPTorT, AverageCorrelation_RTPJ_PTxT), # Columns to pivot
  844. names_to = "Comparison", # New column for the variable names
  845. values_to = "Correlation" # New column for the values
  846. )
  847. class(ISC_long_data_RTPJ_a$Correlation)
  848. #Difficulty_long_data$Performance <- as.numeric(as.character(Difficulty_long_data$Performance))
  849. #view(Difficulty_long_data)
  850. ISC_long_data_RTPJ_a <- ISC_long_data_RTPJ_a %>% filter(!is.na(task))
  851. ISC_long_data_RTPJ_a <- ISC_long_data_RTPJ_a %>%
  852. mutate(Comparison = case_when(Comparison == "AverageCorrelation_RTPJ_withinPTorT" ~ "Within Group",
  853. Comparison == "AverageCorrelation_RTPJ_PTxT" ~ "Preterm-Term",
  854. ))
  855. ISC_long_data_RTPJ_a$Comparison <- factor(
  856. ISC_long_data_RTPJ_a$Comparison,
  857. levels = c("Within Group", "Preterm-Term", "TEBC-MIT3&4", "TEBC-MIT5")
  858. )
  859. split_ISC_long_data_RTPJ_a <- split(ISC_long_data_RTPJ_a, ISC_long_data_RTPJ_a$Preterm)
  860. #ISC_long_data_RTPJ_a <- ISC_long_data_RTPJ_a %>%
  861. # mutate(Group_Comparison = interaction(Preterm, Comparison, sep = "_"))
  862. #ISC_long_data_RTPJ_a$Group_Comparison <- factor(
  863. # ISC_long_data_RTPJ_a$Group_Comparison,
  864. #levels = c("Yes_Within Group", "Yes_Across Preterm-Term", "No_Within Group", "No_Across Preterm-Term")
  865. #)
  866. P7a <- ggplot(split_ISC_long_data_RTPJ_a$Yes, aes(x = Comparison, y = Correlation, fill = Preterm)) +
  867. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitter(0.1)) +
  868. geom_line(aes(group = Sub, colour = "darkgrey"), linewidth = 0.7) +
  869. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm), scale = "count") + #' Alpha makes the violin plots semi-transparent
  870. scale_colour_manual(values = c("Yes" = "deeppink3"), labels = c("Preterm")) +
  871. #guides(colour = guide_legend(override.aes = list(colour = "white"))) +
  872. geom_boxplot(width = 0.1, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  873. stat_summary(fun = mean, geom = "point", shape = 18, size = 3, alpha = 0.7,
  874. position = position_dodge(width = 0.9)) +
  875. labs(x = " ", y = "z-scored correlation", title = "RTPJ") +
  876. ylim(-0.5, 1) +
  877. theme(
  878. plot.title = element_text(size = 18, face = "bold"),
  879. axis.text.x = element_text(face = "bold", size = 14),
  880. panel.background = element_rect(fill = "white"),
  881. axis.line = element_line(color = "black"),
  882. axis.text = element_text(size = 14),
  883. axis.title = element_text(size = 14, face = "bold"),
  884. legend.title = element_blank(),
  885. legend.key = element_rect(fill = "white"),
  886. legend.text = element_text(size = 14),
  887. #legend.key.height = unit(1.5, "cm"),
  888. legend.position = "top"
  889. ) +
  890. scale_fill_manual(values = c("Yes" = "deeppink3"), labels = c("Preterm")) #, guide = F
  891. print(P7a)
  892. P7aa <- ggplot(split_ISC_long_data_RTPJ_a$No, aes(x = Comparison, y = Correlation, fill = Preterm)) +
  893. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitter(0.1)) +
  894. geom_line(aes(group = Sub, colour = "darkgrey"), linewidth = 0.7) +
  895. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm), scale = "count") + #' Alpha makes the violin plots semi-transparent
  896. #guides(colour = guide_legend(override.aes = list(colour = "white"))) +
  897. scale_colour_manual(values = c("No" = "goldenrod2"), labels = c("Term")) +
  898. geom_boxplot(width = 0.1, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  899. stat_summary(fun = mean, geom = "point", shape = 18, size = 3, alpha = 0.7,
  900. position = position_dodge(width = 0.9)) +
  901. labs(x = " ", y = "z-scored correlation", title = "") +
  902. ylim(-0.5, 1) +
  903. theme(
  904. plot.title = element_text(size = 18, face = "bold"),
  905. axis.text.x = element_text(face = "bold", size = 14),
  906. panel.background = element_rect(fill = "white"),
  907. axis.line = element_line(color = "black"),
  908. axis.text = element_text(size = 14),
  909. axis.title = element_text(size = 14, face = "bold"),
  910. legend.title = element_blank(),
  911. legend.key = element_rect(fill = "white"),
  912. legend.text = element_text(size = 14),
  913. #legend.key.height = unit(1.5, "cm"),
  914. legend.position = "top"
  915. ) +
  916. scale_fill_manual(values = c("No" = "goldenrod2"), labels = c("Term")) #,guide = F
  917. print(P7aa)
  918. split_ISC_long_data_RTPJ_aaa <- split(ISC_long_data_RTPJ_a, ISC_long_data_RTPJ_a$Comparison)
  919. P7aaa <- ggplot(split_ISC_long_data_RTPJ_aaa$"Within Group", aes(x = Comparison, y = Correlation, fill = Preterm)) +
  920. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitterdodge(dodge.width = 0.85, jitter.width = 0.15)) +
  921. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm), scale = "count") + #' Alpha makes the violin plots semi-transparent
  922. scale_colour_manual(values = c("Yes" = "deeppink3", "No" = "goldenrod2"), labels = c("Preterm", "Term")) +
  923. #guides(colour = guide_legend(override.aes = list(colour = "white"))) +
  924. geom_boxplot(width = 0.1, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  925. stat_summary(fun = mean, geom = "point", shape = 18, size = 3, alpha = 0.7,
  926. position = position_dodge(width = 0.9)) +
  927. labs(x = " ", y = "z-scored correlation", title = "") +
  928. ylim(-0.5, 1) +
  929. theme(
  930. plot.title = element_text(size = 18, face = "bold"),
  931. axis.text.x = element_text(face = "bold", size = 14),
  932. panel.background = element_rect(fill = "white"),
  933. axis.line = element_line(color = "black"),
  934. axis.text = element_text(size = 14),
  935. axis.title = element_text(size = 14, face = "bold"),
  936. legend.title = element_blank(),
  937. legend.key = element_rect(fill = "white"),
  938. legend.text = element_text(size = 14),
  939. #legend.key.height = unit(1.5, "cm"),
  940. legend.position = "top"
  941. ) +
  942. scale_fill_manual(values = c("Yes" = "deeppink3", "No" = "goldenrod2"), labels = c("Preterm", "Term")) #, guide = F
  943. print(P7aaa)
  944. ISC_long_data_RTPJ_b <- Abeletal_Data %>%
  945. pivot_longer(
  946. cols = c(AverageCorrelation_RTPJ_TEBCxMIT5, AverageCorrelation_RTPJ_PTxMIT34), # Columns to pivot
  947. names_to = "Comparison", # New column for the variable names
  948. values_to = "Correlation" # New column for the values
  949. )
  950. class(ISC_long_data_RTPJ_b$Correlation)
  951. #Difficulty_long_data$Performance <- as.numeric(as.character(Difficulty_long_data$Performance))
  952. #view(Difficulty_long_data)
  953. ISC_long_data_RTPJ_b <- ISC_long_data_RTPJ_b %>% filter(!is.na(task))
  954. ISC_long_data_RTPJ_b <- ISC_long_data_RTPJ_b %>%
  955. mutate(Comparison = case_when(Comparison == "AverageCorrelation_RTPJ_TEBCxMIT5" ~ "TEBC-MIT5",
  956. Comparison == "AverageCorrelation_RTPJ_PTxMIT34" ~ "TEBC-MIT3&4"))
  957. ISC_long_data_RTPJ_b$Comparison <- factor(
  958. ISC_long_data_RTPJ_b$Comparison,
  959. levels = c("Within Group", "Preterm-Term", "TEBC-MIT3&4", "TEBC-MIT5")
  960. )
  961. split_ISC_long_data_RTPJ_b <- split(ISC_long_data_RTPJ_b, ISC_long_data_RTPJ_b$Preterm)
  962. P7b <- ggplot(split_ISC_long_data_RTPJ_b$Yes, aes(x = Comparison, y = Correlation, fill = Preterm)) +
  963. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitter(0.1)) +
  964. geom_line(aes(group = Sub, colour = "darkgrey"), linewidth = 0.7) +
  965. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm), scale = "count") + #' Alpha makes the violin plots semi-transparent
  966. scale_colour_manual(values = c("Yes" = "deeppink3"), labels = c("Preterm")) +
  967. geom_boxplot(width = 0.1, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  968. stat_summary(fun = mean, geom = "point", shape = 18, size = 3, alpha = 0.7,
  969. position = position_dodge(width = 0.9)) +
  970. labs(x = " ", y = "z-scored correlation", title = "") +
  971. ylim(-0.5, 1) +
  972. theme(
  973. plot.title = element_text(size = 18, face = "bold"),
  974. axis.text.x = element_text(face = "bold", size = 14),
  975. panel.background = element_rect(fill = "white"),
  976. axis.line = element_line(color = "black"),
  977. axis.text = element_text(size = 14),
  978. axis.title = element_text(size = 14, face = "bold"),
  979. legend.title = element_blank(),
  980. legend.key = element_rect(fill = "white"),
  981. legend.text = element_text(size = 14),
  982. #legend.key.height = unit(1.5, "cm"),,
  983. legend.position = "top"
  984. ) +
  985. scale_fill_manual(values = c("Yes" = "deeppink3"), labels = c("Preterm"))
  986. print(P7b)
  987. P7 <- (patchwork::wrap_elements(P7aaa) + patchwork::wrap_elements(P7a) + patchwork::wrap_elements(P7aa) + patchwork::wrap_elements(P7b)) + plot_layout(ncol = 4) + plot_layout(guides = "collect") + plot_layout(axis_titles = "collect") + plot_layout(axes = "collect")
  988. print(P7)
  989. #Network
  990. ISC_long_data_averageToM_a <- Plot_Abeletal_Data %>%
  991. pivot_longer(
  992. cols = c(AverageCorrelation_averageToM_withinPTorT, AverageCorrelation_averageToM_PTxT), # Columns to pivot
  993. names_to = "Comparison", # New column for the variable names
  994. values_to = "Correlation" # New column for the values
  995. )
  996. class(ISC_long_data_averageToM_a$Correlation)
  997. #Difficulty_long_data$Performance <- as.numeric(as.character(Difficulty_long_data$Performance))
  998. #view(Difficulty_long_data)
  999. ISC_long_data_averageToM_a <- ISC_long_data_averageToM_a %>% filter(!is.na(task))
  1000. ISC_long_data_averageToM_a <- ISC_long_data_averageToM_a %>%
  1001. mutate(Comparison = case_when(Comparison == "AverageCorrelation_averageToM_withinPTorT" ~ "Within Group",
  1002. Comparison == "AverageCorrelation_averageToM_PTxT" ~ "Preterm-Term",
  1003. ))
  1004. ISC_long_data_averageToM_a$Comparison <- factor(
  1005. ISC_long_data_averageToM_a$Comparison,
  1006. levels = c("Within Group", "Preterm-Term", "TEBC-MIT3&4", "TEBC-MIT5")
  1007. )
  1008. split_ISC_long_data_averageToM_a <- split(ISC_long_data_averageToM_a, ISC_long_data_averageToM_a$Preterm)
  1009. #ISC_long_data_averageToM_a <- ISC_long_data_averageToM_a %>%
  1010. # mutate(Group_Comparison = interaction(Preterm, Comparison, sep = "_"))
  1011. #ISC_long_data_averageToM_a$Group_Comparison <- factor(
  1012. # ISC_long_data_averageToM_a$Group_Comparison,
  1013. #levels = c("Yes_Within Group", "Yes_Across Preterm-Term", "No_Within Group", "No_Across Preterm-Term")
  1014. #)
  1015. P7Na <- ggplot(split_ISC_long_data_averageToM_a$Yes, aes(x = Comparison, y = Correlation, fill = Preterm)) +
  1016. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitter(0.1)) +
  1017. geom_line(aes(group = Sub, colour = "darkgrey"), linewidth = 0.7) +
  1018. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm), scale = "count") + #' Alpha makes the violin plots semi-transparent
  1019. scale_colour_manual(values = c("Yes" = "deeppink3"), labels = c("Preterm")) +
  1020. #guides(colour = guide_legend(override.aes = list(colour = "white"))) +
  1021. geom_boxplot(width = 0.1, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  1022. stat_summary(fun = mean, geom = "point", shape = 18, size = 3, alpha = 0.7,
  1023. position = position_dodge(width = 0.9)) +
  1024. labs(x = " ", y = "z-scored correlation", title = "ToM Network") +
  1025. scale_y_continuous(limits = c(-0.5, 1)) +
  1026. theme(
  1027. plot.title = element_text(size = 18, face = "bold"),
  1028. axis.text.x = element_text(face = "bold", size = 14),
  1029. panel.background = element_rect(fill = "white"),
  1030. axis.line = element_line(color = "black"),
  1031. axis.text = element_text(size = 14),
  1032. axis.title.y = element_text(size = 14, face = "bold"),
  1033. axis.title.x = element_blank(),
  1034. legend.title = element_blank(),
  1035. legend.key = element_rect(fill = "white"),
  1036. legend.text = element_text(size = 14),
  1037. #legend.key.height = unit(1.5, "cm"),
  1038. legend.position = "top"
  1039. ) +
  1040. scale_fill_manual(values = c("Yes" = "deeppink3"), labels = c("Preterm")) #, guide = F
  1041. print(P7Na)
  1042. P7Naa <- ggplot(split_ISC_long_data_averageToM_a$No, aes(x = Comparison, y = Correlation, fill = Preterm)) +
  1043. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitter(0.1)) +
  1044. geom_line(aes(group = Sub, colour = "darkgrey"), linewidth = 0.7) +
  1045. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm), scale = "count") + #' Alpha makes the violin plots semi-transparent
  1046. #guides(colour = guide_legend(override.aes = list(colour = "white"))) +
  1047. scale_colour_manual(values = c("No" = "goldenrod2"), labels = c("Term")) +
  1048. geom_boxplot(width = 0.1, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  1049. stat_summary(fun = mean, geom = "point", shape = 18, size = 3, alpha = 0.7,
  1050. position = position_dodge(width = 0.9)) +
  1051. labs(x = " ", y = "z-scored correlation", title = "") +
  1052. scale_y_continuous(limits = c(-0.5, 1)) +
  1053. theme(
  1054. plot.title = element_text(size = 18, face = "bold"),
  1055. axis.text.x = element_text(face = "bold", size = 14),
  1056. panel.background = element_rect(fill = "white"),
  1057. axis.line = element_line(color = "black"),
  1058. axis.text = element_text(size = 14),
  1059. axis.title.y = element_text(size = 14, face = "bold"),
  1060. axis.title.x = element_blank(),
  1061. legend.title = element_blank(),
  1062. legend.key = element_rect(fill = "white"),
  1063. legend.text = element_text(size = 14),
  1064. #legend.key.height = unit(1.5, "cm"),
  1065. legend.position = "top"
  1066. ) +
  1067. scale_fill_manual(values = c("No" = "goldenrod2"), labels = c("Term")) #,guide = F
  1068. print(P7Naa)
  1069. split_ISC_long_data_averageToM_aaa <- split(ISC_long_data_averageToM_a, ISC_long_data_averageToM_a$Comparison)
  1070. P7Naaa <- ggplot(split_ISC_long_data_averageToM_aaa$"Within Group", aes(x = Comparison, y = Correlation, fill = Preterm)) +
  1071. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitterdodge(dodge.width = 0.85, jitter.width = 0.15)) +
  1072. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm), scale = "count") + #' Alpha makes the violin plots semi-transparent
  1073. scale_colour_manual(values = c("Yes" = "deeppink3", "No" = "goldenrod2"), labels = c("Preterm", "Term")) +
  1074. #guides(colour = guide_legend(override.aes = list(colour = "white"))) +
  1075. geom_boxplot(width = 0.1, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  1076. stat_summary(fun = mean, geom = "point", shape = 18, size = 3, alpha = 0.7,
  1077. position = position_dodge(width = 0.9)) +
  1078. labs(x = " ", y = "z-scored correlation", title = "") +
  1079. scale_y_continuous(limits = c(-0.5, 1)) +
  1080. theme(
  1081. plot.title = element_text(size = 18, face = "bold"),
  1082. axis.text.x = element_text(face = "bold", size = 14),
  1083. panel.background = element_rect(fill = "white"),
  1084. axis.line = element_line(color = "black"),
  1085. axis.text = element_text(size = 14),
  1086. axis.title.y = element_text(size = 14, face = "bold"),
  1087. axis.title.x = element_blank(),
  1088. legend.title = element_blank(),
  1089. legend.key = element_rect(fill = "white"),
  1090. legend.text = element_text(size = 14),
  1091. #legend.key.height = unit(1.5, "cm"),
  1092. legend.position = "top"
  1093. ) +
  1094. scale_fill_manual(values = c("Yes" = "deeppink3", "No" = "goldenrod2"), labels = c("Preterm", "Term")) #, guide = F
  1095. print(P7Naaa)
  1096. ISC_long_data_averageToM_b <- Abeletal_Data %>%
  1097. pivot_longer(
  1098. cols = c(AverageCorrelation_averageToM_TEBCxMIT5, AverageCorrelation_averageToM_PTxMIT34), # Columns to pivot
  1099. names_to = "Comparison", # New column for the variable names
  1100. values_to = "Correlation" # New column for the values
  1101. )
  1102. class(ISC_long_data_averageToM_b$Correlation)
  1103. #Difficulty_long_data$Performance <- as.numeric(as.character(Difficulty_long_data$Performance))
  1104. #view(Difficulty_long_data)
  1105. ISC_long_data_averageToM_b <- ISC_long_data_averageToM_b %>% filter(!is.na(task))
  1106. ISC_long_data_averageToM_b <- ISC_long_data_averageToM_b %>%
  1107. mutate(Comparison = case_when(Comparison == "AverageCorrelation_averageToM_TEBCxMIT5" ~ "TEBC-MIT5",
  1108. Comparison == "AverageCorrelation_averageToM_PTxMIT34" ~ "TEBC-MIT3&4"))
  1109. ISC_long_data_averageToM_b$Comparison <- factor(
  1110. ISC_long_data_averageToM_b$Comparison,
  1111. levels = c("Within Group", "Preterm-Term", "TEBC-MIT3&4", "TEBC-MIT5")
  1112. )
  1113. split_ISC_long_data_averageToM_b <- split(ISC_long_data_averageToM_b, ISC_long_data_averageToM_b$Preterm)
  1114. P7Nb <- ggplot(split_ISC_long_data_averageToM_b$Yes, aes(x = Comparison, y = Correlation, fill = Preterm)) +
  1115. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitter(0.1)) +
  1116. geom_line(aes(group = Sub, colour = "darkgrey"), linewidth = 0.7) +
  1117. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm), scale = "count") + #' Alpha makes the violin plots semi-transparent
  1118. scale_colour_manual(values = c("Yes" = "deeppink3"), labels = c("Preterm")) +
  1119. geom_boxplot(width = 0.1, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  1120. stat_summary(fun = mean, geom = "point", shape = 18, size = 3, alpha = 0.7,
  1121. position = position_dodge(width = 0.9)) +
  1122. labs(x = " ", y = "z-scored correlation", title = "") +
  1123. scale_y_continuous(limits = c(-0.5, 1)) +
  1124. theme(
  1125. plot.title = element_text(size = 18, face = "bold"),
  1126. axis.text.x = element_text(face = "bold", size = 14),
  1127. panel.background = element_rect(fill = "white"),
  1128. axis.line = element_line(color = "black"),
  1129. axis.text = element_text(size = 14),
  1130. axis.title.y = element_text(size = 14, face = "bold"),
  1131. axis.title.x = element_blank(),
  1132. legend.title = element_blank(),
  1133. legend.key = element_rect(fill = "white"),
  1134. legend.text = element_text(size = 14),
  1135. #legend.key.height = unit(1.5, "cm"),,
  1136. legend.position = "top"
  1137. ) +
  1138. scale_fill_manual(values = c("Yes" = "deeppink3"), labels = c("Preterm"))
  1139. print(P7Nb)
  1140. P71 <- (patchwork::wrap_elements(P7aaa) + patchwork::wrap_elements(P7a) + patchwork::wrap_elements(P7aa) + patchwork::wrap_elements(P7b)) + theme(axis.title.x = element_blank()) + plot_layout(ncol = 4) + plot_layout(guides = "collect") + plot_layout(axis_titles = "collect") + plot_layout(axes = "collect_y")
  1141. print(P71)
  1142. P72 <- (patchwork::wrap_elements(P7Naaa) + patchwork::wrap_elements(P7Na) + patchwork::wrap_elements(P7Naa) + patchwork::wrap_elements(P7Nb)) + plot_layout(ncol = 4) + plot_layout(guides = "collect") + plot_layout(axis_titles = "collect") + plot_layout(axes = "collect")
  1143. print(P72)
  1144. P7 <- (P72 / P71) + plot_layout(guides = "collect") + plot_layout(axis_titles = "collect") + plot_layout(axes = "collect")
  1145. png("./Figure7_290725.png", width = 1500, height = 743)
  1146. print(P7)
  1147. dev.off()
  1148. #P7c <- P7a + P7b + plot_layout(axes = "collect") + plot_layout(guides = "collect") + plot_layout(widths = c(2, 1))
  1149. #P7f <- P7d + P7e + plot_layout(axes = "collect") + plot_layout(guides = "collect") + plot_layout(widths = c(2, 1))
  1150. #P7 <- P7c / P7f #+ plot_layout(axes = "collect") + plot_layout(guides = "collect") + plot_layout(widths = c(2.5, 1))
  1151. # S3 motion plots
  1152. S3a. <- ggplot(Plot_Abeletal_Data, aes(x=GA_birth, y=MeanFD)) +
  1153. geom_point(size=4, alpha=0.7,aes(colour=Preterm)) +
  1154. scale_colour_manual(values = c("Yes"="deeppink3", "No"="goldenrod2"), labels = c("Preterm", "Term")) +
  1155. labs(x="Gestational Age", y="Mean FD", title= "Full sample") +
  1156. scale_x_continuous(breaks = seq(24, 42, 3), minor_breaks=NULL) +
  1157. ylim(0,1.2) +
  1158. theme(legend.title = element_blank(),
  1159. plot.title = element_text(size=20),
  1160. panel.background = element_rect(fill="white"),
  1161. axis.line=element_line(color="black"),
  1162. axis.text=element_text(size=18),
  1163. axis.title=element_text(size=18,face="bold"),
  1164. legend.key=element_rect(fill="white"),
  1165. legend.text= element_text(size=18),
  1166. legend.position = "none") + #legend.text=element_text(size=20, lineheight=.8),legend.key.height=unit(2,"cm"))+
  1167. geom_smooth(method=lm, se=TRUE,colour="black")
  1168. S3a<- ggMarginal(S3a.,type="violin", margins = c("y"), groupColour = TRUE, groupFill = TRUE)
  1169. print(S3a)
  1170. S3b. <- ggplot(Plot_Abeletal_Data, aes(x=GA_birth, y=X.Artifacts_ART)) +
  1171. geom_point(size=4, alpha=0.7,aes(colour=Preterm)) +
  1172. scale_colour_manual(values = c("Yes"="deeppink3", "No"="goldenrod2"), labels = c("Preterm", "Term")) +
  1173. labs(x="Gestational Age", y="Artifact Timepoints", title= "") +
  1174. scale_x_continuous(breaks = seq(24, 42, 3), minor_breaks=NULL) +
  1175. ylim(0,100) +
  1176. theme(legend.title = element_blank(),
  1177. plot.title = element_text(size=20),
  1178. panel.background = element_rect(fill="white"),
  1179. axis.line=element_line(color="black"),
  1180. axis.text=element_text(size=18),
  1181. axis.title=element_text(size=18,face="bold"),
  1182. legend.key=element_rect(fill="white"),
  1183. legend.text= element_text(size=18),
  1184. legend.position = "left") + #legend.text=element_text(size=20, lineheight=.8),legend.key.height=unit(2,"cm"))+
  1185. geom_smooth(method=lm, se=TRUE,colour="black")
  1186. S3b <- ggMarginal(S3b.,type="violin", margins = c("y"), groupColour = TRUE, groupFill = TRUE)
  1187. print(S3b)
  1188. S3.1 <- patchwork::wrap_elements(S3a) + patchwork::wrap_elements(S3b) + plot_layout(guides = "collect") +
  1189. plot_layout(widths = c(1, 1.3))
  1190. png("./Supplementals_Figure3.1_290725.png", width = 1200, height = 450)
  1191. print(S3.1)
  1192. dev.off()
  1193. #S3 motion in matched groups- see "TEBC_SubGroup_analyses.R"
  1194. S3 <- S3.1 / S3.2 + plot_layout(guides = "collect")
  1195. png("./Supplementals_Figure3_290725.png", width = 1200, height = 900)
  1196. print(S3)
  1197. dev.off()
  1198. #S2 site effects
  1199. ISC_long_data_RTPJ_d <- Plot_Abeletal_Data %>%
  1200. pivot_longer(
  1201. cols = c(AverageCorrelation_RTPJ_PTxT, AverageCorrelation_RTPJ_TEBCxMIT5), # Columns to pivot
  1202. names_to = "Comparison", # New column for the variable names
  1203. values_to = "Correlation" # New column for the values
  1204. )
  1205. class(ISC_long_data_RTPJ_d$Correlation)
  1206. #Difficulty_long_data$Performance <- as.numeric(as.character(Difficulty_long_data$Performance))
  1207. #view(Difficulty_long_data)
  1208. ISC_long_data_RTPJ_d <- ISC_long_data_RTPJ_d %>% filter(!is.na(task))
  1209. ISC_long_data_RTPJ_d <- ISC_long_data_RTPJ_d %>%
  1210. mutate(Comparison = case_when(Comparison == "AverageCorrelation_RTPJ_PTxT" ~ "PT TEBC - T TEBC",
  1211. Comparison == "AverageCorrelation_RTPJ_TEBCxMIT5" ~ "PT TEBC - T MIT5"))
  1212. ISC_long_data_RTPJ_d$Comparison <- factor(
  1213. ISC_long_data_RTPJ_d$Comparison,
  1214. levels = c("PT TEBC - T TEBC", "PT TEBC - T MIT5")
  1215. )
  1216. split_ISC_long_data_RTPJ_d <- split(ISC_long_data_RTPJ_d, ISC_long_data_RTPJ_d$Preterm)
  1217. S2a <- ggplot(split_ISC_long_data_RTPJ_d$Yes, aes(x = Comparison, y = Correlation, fill = Preterm)) +
  1218. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitter(0.1)) +
  1219. geom_line(aes(group = Sub, colour = "darkgrey"), linewidth = 0.7) +
  1220. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm), scale = "count") + #' Alpha makes the violin plots semi-transparent
  1221. scale_colour_manual(values = c("Yes" = "deeppink3"), labels = c("Preterm")) +
  1222. geom_boxplot(width = 0.1, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  1223. stat_summary(fun = mean, geom = "point", shape = 18, size = 3, alpha = 0.7,
  1224. position = position_dodge(width = 0.9)) +
  1225. labs(x = " ", y = "z-scored correlation", title = "RTPJ") +
  1226. ylim(-0.5, 1) +
  1227. theme(
  1228. plot.title = element_text(size = 22, face = "bold"),
  1229. axis.text.x = element_text(face = "bold", size = 18),
  1230. panel.background = element_rect(fill = "white"),
  1231. axis.line = element_line(color = "black"),
  1232. axis.text = element_text(size = 18),
  1233. axis.title.y = element_text(size = 20, face = "bold"),
  1234. axis.title.x = element_blank(),
  1235. legend.title = element_blank(),
  1236. legend.key = element_rect(fill = "white"),
  1237. legend.text = element_text(size = 18),
  1238. #legend.key.height = unit(1.5, "cm"),,
  1239. legend.position = "top"
  1240. ) +
  1241. scale_fill_manual(values = c("Yes" = "deeppink3"), labels = c("Preterm"))
  1242. print(S2a)
  1243. #Figure S3
  1244. # Pivot from wide to long format
  1245. Difficulty_long_data <- Plot_Abeletal_Data %>%
  1246. pivot_longer(
  1247. cols = Easy_ToM_Score:Hard_ToM_Score, # Columns to pivot
  1248. names_to = "Difficulty", # New column for the variable names
  1249. values_to = "Performance" # New column for the values
  1250. )
  1251. class(Difficulty_long_data$Performance)
  1252. #Difficulty_long_data$Performance <- as.numeric(as.character(Difficulty_long_data$Performance))
  1253. #view(Difficulty_long_data)
  1254. Difficulty_long_data <- Difficulty_long_data %>% filter(!is.na(T_ToM_Score) & T_ToM_Score != "")
  1255. TEBC_ToM_Difficulty <- lmerTest::lmer(Performance ~ scale(GA_birth) + Difficulty + scale(T_age) + scale(RL_PercentileRank) + (1 | Sub), data = Difficulty_long_data) #+ scale(num_sibs)
  1256. summary(TEBC_ToM_Difficulty)
  1257. Difficulty_long_data <- Difficulty_long_data %>%
  1258. mutate(Difficulty = case_when(Difficulty == "Easy_ToM_Score" ~ "Easy",
  1259. Difficulty == "FB_ToM_Score" ~ "FB",
  1260. Difficulty == "Hard_ToM_Score" ~ "Hard"))
  1261. Difficulty_long_data$Difficulty <- factor(
  1262. Difficulty_long_data$Difficulty,
  1263. levels = c("Easy", "FB", "Hard")
  1264. )
  1265. png("./FigureS3_260825.png", width = 800, height = 500)
  1266. PS3 <- ggplot(Difficulty_long_data, aes(x = Difficulty, y = Performance, fill = Preterm)) +
  1267. geom_violin(trim = FALSE, alpha = 0.6, aes(colour = Preterm)) +
  1268. scale_fill_manual(values = c("Yes" = "deeppink3", "No" = "goldenrod2"), labels = c("Preterm", "Term")) + #' Alpha makes the violin plots semi-transparent
  1269. geom_point(size=3, shape = 21, alpha=0.7,aes(colour = Preterm), position = position_jitterdodge(dodge.width = 0.85, jitter.width = 0.25)) +
  1270. scale_colour_manual(values = c("Yes" = "deeppink3", "No" = "goldenrod2"), labels = c("Preterm", "Term")) +
  1271. geom_boxplot(width = 0.2, position = position_dodge(width = 0.9), alpha = 0.7, color = "lightgrey", linewidth = 0.1) +
  1272. stat_summary(fun = mean, geom = "point", shape = 18, size = 4, alpha = 0.7,
  1273. position = position_dodge(width = 0.9)) +
  1274. labs(x = "Difficulty", y = "Proportion Correct", title = "ToM booklet by Item Difficulty") +
  1275. ylim(0, 1) +
  1276. theme(
  1277. legend.title = element_blank(),
  1278. plot.title = element_text(size=20,face="bold",hjust=.5),
  1279. axis.text.x = element_text(face = "bold", size = 16),
  1280. panel.background = element_rect(fill = "white"),
  1281. axis.line = element_line(color = "black"),
  1282. axis.text = element_text(size = 16),
  1283. axis.title = element_text(size = 16, face = "bold"),
  1284. legend.key = element_rect(fill = "white"),
  1285. legend.text = element_text(size = 16),
  1286. legend.key.height = unit(1.5, "cm"),
  1287. #legend.position = "top"
  1288. )
  1289. print(PS3)
  1290. dev.off()

Abeletal_PTB-ToM_mainAnalyses.R, no license · at the source

Overview

Authors: Selina Abel1,2, Melissa Thye1,3, Katie Mckinnon1, Rebekah Smikle1, Jean Skelton3, Lorena Jiménez-Sánchez3, Ray Amir1, Gayle Barclay4, Charlotte Jardine4, Donna Mcintyre4, Iona Hamilton4, Yu Wei Chua5, Aditi Hosangadi6, Alan Quigley7, G David Batty8, Michael J Thrippleton2,4, Heather C Whalley2, James P Boardman1,2, Hilary Richardson3
  1. Centre for Reproductive Health, Institute for Regeneration and Repair, University of Edinburgh, Edinburgh, United Kingdom
  2. Institute for Neuroscience and Cardiovascular Research, University of Edinburgh, Edinburgh, United Kingdom
  3. School of Philosophy, Psychology, and Language Sciences, University of Edinburgh, Edinburgh, United Kingdom
  4. Edinburgh Imaging Facility, Royal Infirmary of Edinburgh, Edinburgh, United Kingdom
  5. Department of Public Health, Policy and Systems, Institute of Population Health, University of Liverpool, Liverpool, United Kingdom
  6. Department of Psychology, University of Wisconsin-Madison, Madison, WI, United States
  7. Department of Radiology, Royal Hospital for Children and Young People, Edinburgh, United Kingdom
  8. Department of Epidemiology and Public Health, University College London, London, United Kingdom
Institutions: MRC Centre for Reproductive Health (United Kingdom); University of Edinburgh (United Kingdom); Edinburgh Royal Infirmary (United Kingdom); University of Liverpool (United Kingdom); University of Wisconsin–Madison (United States); University College London (United Kingdom)
Journal: Imaging neuroscience (Cambridge, Mass.), volume 4, article IMAG.a.1347
Dates: received 3 February 2026; accepted 26 July 2026; published online 26 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1162/imag.a.1347 · PMID 42662222 · PMCID PMC13519987 · OpenAlex W7201880297
Open access: diamond, a free copy (OpenAlex)
Status: code verified
Categories: fMRI (modality), human (organism), other condition (population)
Methods: Connectivity, Statistics, Preprocessing, fMRI & imaging
Keywords: theory of mind, functional MRI (fMRI), social cognition, cognitive development, preterm birth
MeSH: Brain*, Infant, Premature*, Premature Birth*, Theory of Mind*, Brain Mapping, Child Development, Child, Preschool, Female, Gestational Age, Humans, Magnetic Resonance Imaging, Male (* major topic)
Topic: Child and Animal Learning Development (Developmental and Educational Psychology, Psychology), according to OpenAlex
Funding: Wellcome Trust (108890/Z/15/Z, 218493/Z/19/Z)
Citations: not cited yet (Europe PMC); 97 references in the paper

Abstract

Behavioural studies suggest atypical or delayed development of “theory of mind” (ToM; our ability to reason about others’ mental states) following preterm birth. Using pre-registered analyses of behavioural and movie-viewing functional magnetic resonance imaging (fMRI) metrics of ToM, we tested for a domain-specific impact of preterm birth (24–32 weeks’ gestational age) on theory of mind development at age 5 years. Preterm-born children (n = 52) scored lower than term-born comparators (n = 58) on a linguistic behavioural ToM task, but this difference was primarily driven by differences in receptive language. Neurally, preterm-born children (n = 30) had qualitatively similar responses in brain regions that support ToM reasoning to a short movie to term-born comparators (n = 46), as characterised by four neural metrics; responses to one scene differed as a function of gestational age. Using intersubject correlation analyses, we found that preterm-born children’s ToM network responses were more heterogenous than term-born children’s responses; however, individual preterm-born children’s responses most resembled those observed in same-age term-born children, relative to younger children or other preterm-born children. Taken together, preterm birth does not appear to preclude broadly similar functional development in ToM brain regions by age 5 years.

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

hrichardsonlab/fmri-analysis

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 15a4d88696a4daa910c428d636a1d5ad90c581d5, 10 September 2026
Languages: Python (24), Shell (18), R (1)
Size: 310 files, 43 scripts
Software Heritage: not archived
Found in: “Data and Code Availability”
Holds: README, 1 notebook
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (24 files), pandas (24 files), Nipype (14 files), Nilearn (11 files), NiBabel (9 files), SciPy (8 files), FSL (6 files), PyBIDS (5 files), fMRIPrep (4 files), Dcm2Bids (2 files), FreeSurfer (2 files), ANTs (1 file), Matplotlib (1 file), MRIQC (1 file), scikit-learn (1 file), tedana (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
44 files

OSF xtyu8

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: R (5)
Size: 7 files, 5 scripts
Software Heritage: not checked
Found in: “Data and Code Availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: lmerTest (5 files), tidyverse (4 files), ggplot2 (3 files), lme4 (3 files), patchwork (2 files), brms (1 file), easystats (1 file), reshape2 (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
5 files
At the source: osf.io/xtyu8/overview

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;
  • 48 scripts, each with its path and the digest of its content;
  • 12 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

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

Data

Datasets cited

Data and Code Availability

Requests for anonymised data for reproducing the statistical analyses of this study and raw, de-identified (f)MRI data can be made by completing a Data Access Request form at https://reproductive-health.ed.ac.uk/theirworld-edinburgh-birth-cohort-tebc/for-researchers/data-access-and-collaboration. The fMRI analysis pipeline (https://github.com/hrichardsonlab/fmri-analysis) and statistical analysis code (https://osf.io/xtyu8/overview) are publicly available.

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

Versions

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

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 19 authors, 5 keywords, 12 MeSH terms, 1 funder, 95 references.

Cite

This paper

Abel, S., Thye, M., Mckinnon, K., Smikle, R., Skelton, J., Jiménez-Sánchez, L., Amir, R., Barclay, G., Jardine, C., Mcintyre, D., Hamilton, I., Chua, Y. W., Hosangadi, A., Quigley, A., Batty, G. D., Thrippleton, M. J., Whalley, H. C., Boardman, J. P., & Richardson, H. (2026). Neural and behavioural correlates of theory of mind reasoning in five-year-old children born preterm. Imaging neuroscience (Cambridge, Mass.), 4, IMAG.a.1347. https://doi.org/10.1162/imag.a.1347

BibTeX

@article{abel2026neural,
author = {Abel, Selina and Thye, Melissa and Mckinnon, Katie and Smikle, Rebekah and Skelton, Jean and Jiménez-Sánchez, Lorena and Amir, Ray and Barclay, Gayle and Jardine, Charlotte and Mcintyre, Donna and Hamilton, Iona and Chua, Yu Wei and Hosangadi, Aditi and Quigley, Alan and Batty, G David and Thrippleton, Michael J and Whalley, Heather C and Boardman, James P and Richardson, Hilary},
title = {{Neural and behavioural correlates of theory of mind reasoning in five-year-old children born preterm}},
journal = {Imaging neuroscience (Cambridge, Mass.)},
year = {2026},
month = aug,
volume = {4},
pages = {IMAG.a.1347},
publisher = {MIT Press},
issn = {2837-6056},
doi = {10.1162/imag.a.1347},
url = {https://doi.org/10.1162/imag.a.1347},
pmid = {42662222},
pmcid = {PMC13519987}
}

RIS

TY - JOUR
AU - Abel, Selina
AU - Thye, Melissa
AU - Mckinnon, Katie
AU - Smikle, Rebekah
AU - Skelton, Jean
AU - Jiménez-Sánchez, Lorena
AU - Amir, Ray
AU - Barclay, Gayle
AU - Jardine, Charlotte
AU - Mcintyre, Donna
AU - Hamilton, Iona
AU - Chua, Yu Wei
AU - Hosangadi, Aditi
AU - Quigley, Alan
AU - Batty, G David
AU - Thrippleton, Michael J
AU - Whalley, Heather C
AU - Boardman, James P
AU - Richardson, Hilary
TI - Neural and behavioural correlates of theory of mind reasoning in five-year-old children born preterm
T2 - Imaging neuroscience (Cambridge, Mass.)
J2 - Imaging Neurosci (Camb)
PY - 2026
DA - 2026/08/26
VL - 4
SP - IMAG.a.1347
SN - 2837-6056
PB - MIT Press
DO - 10.1162/imag.a.1347
UR - https://doi.org/10.1162/imag.a.1347
LA - en
ER -

CSL-JSON

{
"id": "10.1162/imag.a.1347",
"type": "article-journal",
"title": "Neural and behavioural correlates of theory of mind reasoning in five-year-old children born preterm",
"container-title": "Imaging neuroscience (Cambridge, Mass.)",
"author": [
{
"family": "Abel",
"given": "Selina"
},
{
"family": "Thye",
"given": "Melissa"
},
{
"family": "Mckinnon",
"given": "Katie"
},
{
"family": "Smikle",
"given": "Rebekah"
},
{
"family": "Skelton",
"given": "Jean"
},
{
"family": "Jiménez-Sánchez",
"given": "Lorena"
},
{
"family": "Amir",
"given": "Ray"
},
{
"family": "Barclay",
"given": "Gayle"
},
{
"family": "Jardine",
"given": "Charlotte"
},
{
"family": "Mcintyre",
"given": "Donna"
},
{
"family": "Hamilton",
"given": "Iona"
},
{
"family": "Chua",
"given": "Yu Wei"
},
{
"family": "Hosangadi",
"given": "Aditi"
},
{
"family": "Quigley",
"given": "Alan"
},
{
"family": "Batty",
"given": "G David"
},
{
"family": "Thrippleton",
"given": "Michael J"
},
{
"family": "Whalley",
"given": "Heather C"
},
{
"family": "Boardman",
"given": "James P"
},
{
"family": "Richardson",
"given": "Hilary"
}
],
"container-title-short": "Imaging Neurosci (Camb)",
"volume": "4",
"page": "IMAG.a.1347",
"DOI": "10.1162/imag.a.1347",
"PMID": "42662222",
"PMCID": "PMC13519987",
"ISSN": "2837-6056",
"publisher": "MIT Press",
"URL": "https://doi.org/10.1162/imag.a.1347",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
26
]
]
}
}

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

Similar papers

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

[1] doi:10.1016/j.dcn.2026.101765 [code]
Fusiform face area development correlates with development in higher-order social brain regions.
Journal: Developmental cognitive neuroscience
In common: MRIQC, Dcm2Bids, fMRIPrep, 18 other tools, OpenNeuro ds000228, fMRI, 5 references, author Lorena Jiménez-Sánchez
[2] doi:10.1162/imag.a.1252 [code]
Does the brain's E:I balance really shape long-range temporal correlations? Lessons learned from 3T MRI.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: MRIQC, Dcm2Bids, fMRIPrep, 12 other tools, fMRI, 1 reference
[3] doi:10.1162/imag.a.1198 [code]
MEPrep: A robust pipeline for multi-echo fMRI denoising and preprocessing.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: fMRIPrep, tedana, PyBIDS, 9 other tools, fMRI, 3 references
[4] doi:10.1038/s41467-026-72916-5 [code]
Precision fMRI reveals that the language network exhibits adult-like left-hemispheric lateralization by 4 years of age.
Journal: Nature communications
In common: brms, lmerTest, lme4, 2 other tools, fMRI, 6 references, author Hilary Richardson
[5] doi:10.1038/s41467-026-71151-2 [code]
Common and distinct neural correlates of social interaction processing and theory of mind in narratives.
Journal: Nature communications
In common: fMRIPrep, Nipype, ANTs, 9 other tools, 4 references
[6] doi:10.1162/netn.a.547 [code]
An evaluation of the efficacy of single-echo and multi-echo fMRI denoising strategies.
Journal: Network neuroscience (Cambridge, Mass.)
In common: fMRIPrep, tedana, Nipype, 10 other tools, fMRI, 2 references
[7] doi:10.1162/imag.a.1245 [code]
Towards precision EEG connectomics: Evaluating the benefits of dense sampling.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: Nipype, ANTs, FreeSurfer, 13 other tools
[8] doi:10.1038/s41597-026-06869-1 [code]
Individual Brain Charting: fifth release of high-resolution fMRI data for cognitive mapping.
Journal: Scientific data
In common: PyBIDS, Nipype, ANTs, 9 other tools, fMRI, 2 references
[9] doi:10.1016/j.neuron.2026.04.011 [code]
Precision fMRI reveals densely interdigitated network patches with conserved motifs in the lateral prefrontal cortex.
Journal: Neuron
In common: tedana, ANTs, FreeSurfer, 7 other tools, fMRI, 4 references
[10] doi:10.1002/hbm.70512 [code]
Precision Imaging for Intraindividual Investigation of the Reward Response.
Journal: Human brain mapping
In common: fMRIPrep, easystats, ANTs, 10 other tools, fMRI, 1 reference

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.