OSCR

Random auditory stimulation during sleep disturbs traveling slow waves and declarative memory.

Code ↔ Paper

20 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 20 matches
  1. [1] § STAR★Methods › Method details › Task material › Hearing test and auditory stimulation ↔ analysis/ana27_hearingthreshold_calculation.m, lines 1–26 · score 0.89 · supra aural, biological norm, insert earphones, hearing threshold, ISO, physical
  2. [2] § STAR★Methods › Quantification and statistical analysis › Linear mixed-effect modeling and mediation analysis ↔ analysis/ana25_correlations_behaviour_PCA_LMM_mediation.R, lines 1064–1111 · score 0.86 · linear mixed, full model, lme4, PCA, ANOVA, mediation
  3. [3] § STAR★Methods › Quantification and statistical analysis › Spindle peak-frequency ↔ analysis/ana18_spindle_frequency.m, lines 83–114 · score 0.77 · power spectral density, log transformed, pwelch, PSD, 45 Hz, spindle
  4. [4] § STAR★Methods › Quantification and statistical analysis › Spindle and slow wave detection ↔ analysis/detectSpindles.m, lines 1–29 · score 0.68 · N1 sleep, amplitude criterion, envelope, sleep stages, events, spindle
  5. [5] § STAR★Methods › Quantification and statistical analysis › Spindle and slow wave detection ↔ analysis/ana11_spindle_SO_detection.m, lines 18–35 · score 0.67 · bandpass filtered, 11–17 Hz, Detection, concatenated, spindle, 11 Hz
  6. [6] § Results › Stimulation decreased physiological markers of slow waves but not sleep spindles ↔ analysis/ana09_frequency_statistics.m, lines 36–94 · score 0.65 · 12–16 Hz, 0.5–30 Hz, 0.5–4 Hz, delta, spindles, Cluster
  7. [7] § Results › Stimulation triggered a broad cortical response with a lasting low-frequency reduction ↔ analysis/ana22_ERP_stats.m, lines 626–689 · score 0.61 · ERPs, onset, REM, 30 Hz, Cluster, channels
  8. [8] § STAR★Methods › Method details › Task material › Hearing test and auditory stimulation ↔ analysis/ana27_hearingthreshold_calculation.m, lines 1–26 · score 0.60 · insert earphones, Hearing threshold, volume, stimulation
  9. [9] § Results › Traveling slow wave dynamics drive the sleep effect on memory › N2 duration ↔ analysis/ana25_correlations_behaviour_PCA_LMM_mediation.R, lines 1064–1111 · score 0.59 · linear mixed, N2 sleep, VIF, mediation, fit, predictor
  10. [10] § Results › Stimulation reduced slow-wave sleep, but left sleep duration and general alertness mostly intact ↔ analysis/ana10_sleep_architecture.m, lines 26–125 · score 0.58 · sleep latency, falling asleep, awake, N1, REM, N2
  11. [11] § Results › Traveling slow wave dynamics drive the sleep effect on memory ↔ analysis/ana25_correlations_behaviour_PCA_LMM_mediation.R, lines 897–936 · score 0.58 · principal component, linear mixed, mediation, correlated, models, distance
  12. [12] § Results › Stimulation decreased physiological markers of slow waves but not sleep spindles ↔ analysis/ana18_spindle_frequency.m, lines 188–237 · score 0.56 · fast spindles, slow spindles, spindle frequency, amplitude, density, peak
  13. [13] § STAR★Methods › Method details › Task material › Learning-and-memory-task (Lern-und-Gedächtnistest, LGT-3) ↔ analysis/ana24_behavioural_mean.m, lines 270–273 · score 0.56 · verbal score, figural score, DMS, LGT
  14. [14] § Results › Traveling slow wave dynamics drive the sleep effect on memory › SWS duration ↔ analysis/ana16_TSW_analysis_stats_SWS.R, lines 49–133 · score 0.55 · maximal distance, TSW features, peak duration, electrodes, SE, SWS
  15. [15] § STAR★Methods › Quantification and statistical analysis › Spindle and slow wave detection ↔ analysis/coupling_analysis/prep1.m, lines 43–102 · score 0.53 · Spindle events, cycle, SOs, inflection, troughs, coupling
  16. [16] § STAR★Methods › Method details › Task material › Electrophysiology recordings and preprocessing ↔ analysis/signal_processing.m, lines 67–129 · score 0.53 · notch, detrending, demeaning, preprocessing, filtering, derivations
  17. [17] § STAR★Methods › Method details › Task material › Finger tapping ↔ analysis/ana23_behavioural_readin.m, lines 138–265 · score 0.52 · finger tapping, accuracy, block, sequence
  18. [18] § STAR★Methods › Quantification and statistical analysis › Wave parameters and statistical analysis ↔ analysis/ana17_TSW_electrodes.m, lines 78–95 · score 0.51 · permuted, diagonal, shuffling, heatmap, matrices, vector
  19. [19] § Results › Stimulation decreased physiological markers of slow waves but not sleep spindles ↔ analysis/coupling_analysis/statistics_v4.m, lines 1–36 · score 0.51 · coupled spindle, auditory stimulation altered, Slow wave, phase, channels, sham
  20. [20] § Results › Stimulation altered the nature and trajectory of traveling slow waves ↔ analysis/ana15_travelSOs.m, lines 242–256 · score 0.51 · maximal distance covered, peak duration, speed, travel, trajectory, TSW

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,327 lines · 69 KB · no license · 3 matches

  1. rm(list = ls())
  2. # correlate behavioural outputs with sleep architecture, SO features, and TSW
  3. MAINPATH <- ("D:/Nora/SPIN/data/")
  4. PATH_IN_behavioural <- "D:/Nora/SPIN/results/behavioural/"
  5. PATH_IN_behavioural <- "D:/Nora/SPIN/results_clean/behavioural/"
  6. PATH_IN_architecture <- "D:/Nora/SPIN/results_clean/sleep_architecture"
  7. PATH_IN_SO <- "D:/Nora/SPIN/results_clean/so_features/"
  8. PATH_IN_TSW <- "D:/Nora/SPIN/results_clean/traveling_waves/"
  9. PATH_IN_coupling <- "D:/Nora/SPIN/results_clean/coupling/"
  10. PATH_OUT <- ("D:/Nora/SPIN/results_clean/correlation/")
  11. # Set cd
  12. setwd(MAINPATH)
  13. # initiate libraries
  14. library(tidyr)
  15. library(dplyr)
  16. library(rstatix)
  17. library(plotrix)
  18. library(ggpubr)
  19. library(viridis)
  20. library(svglite)
  21. #install.packages('rmcorr')
  22. library(rmcorr)
  23. library(ggplot2)
  24. library(car)
  25. ### define colors according to 'coolwarm' Matlab
  26. color_sham <- rgb(0.1276, 0.3162, 0.8584) # old: "#0085BCFF"
  27. color_stim <- rgb(0.7524, 0.0084, 0.0218) # old: '#FF9E61FF'
  28. axes_color <- rgb(0.1500, 0.1500, 0.1500) # to match matlab plots
  29. axisLineWidth <- 0.5 # to match matlab plots
  30. #### Behavioural: Data read in & transformation ####
  31. # Set cd
  32. setwd(MAINPATH)
  33. # read in data behavioural
  34. subject_notes <- read.csv("subject_notes.csv")
  35. subject_notes_20 <- subject_notes[c(1:10, 12:13, 15:19, 22:23, 25),]
  36. colnames(subject_notes_20) <- as.factor(c('ID', 'cond_time', 'sex', 'age'))
  37. # Set cd
  38. setwd(PATH_IN_behavioural)
  39. # LGT
  40. LGT_categories_stim_20 <- read.csv("LGT_data_categories_stim_20.csv")
  41. LGT_categories_stim_20 <- cbind(subject_notes_20,LGT_categories_stim_20)
  42. LGT_tests_stim_20 <- read.csv("LGT_data_tests_stim_20.csv")
  43. LGT_tests_stim_20 <- cbind(subject_notes_20,LGT_tests_stim_20)
  44. colnames(LGT_tests_stim_20)[6] <- 'stim_Turk'
  45. colnames(LGT_tests_stim_20)[12] <- 'sham_Turk'
  46. LGT_categories_stim_20 <- LGT_categories_stim_20 %>%
  47. gather(conditions, measure, stim_LGS:sham_VG) %>%
  48. separate(conditions, c('stim', 'category')) %>%
  49. arrange(ID, stim)
  50. LGT_tests_stim_20 <- LGT_tests_stim_20 %>%
  51. gather(conditions, measure, stim_Stadt:sham_Zeich) %>%
  52. separate(conditions, c('stim', 'test')) %>%
  53. arrange(ID, stim)
  54. #### end ####
  55. #### Sleep architecture: data read in & transformation ####
  56. # Set cd
  57. setwd(PATH_IN_architecture)
  58. # sorted by stimulation
  59. sleep_stim_20 <- read.csv("sleep_architecture_stim_20.csv")
  60. sleep_stim_20 <- cbind(subject_notes_20,sleep_stim_20)
  61. abs_sleep_stim_20 <- sleep_stim_20[,c(1:14, 23:32)]
  62. colnames(abs_sleep_stim_20) <- c('ID', 'cond_time', 'sex', 'age','stim_duration', 'stim_sleep', 'stim_awake', 'stim_pure','stim_N1', 'stim_N2', 'stim_N3', 'stim_N4', 'stim_SWS', 'stim_REM','sham_duration', 'sham_sleep', 'sham_awake', 'sham_pure','sham_N1', 'sham_N2', 'sham_N3', 'sham_N4', 'sham_SWS', 'sham_REM')
  63. rel_sleep_stim_20 <- sleep_stim_20[,c(1:4, 15:22, 33:40)]
  64. colnames(rel_sleep_stim_20) <- c('ID', 'cond_time', 'sex', 'age','stim_sleep','stim_N1', 'stim_N2', 'stim_N3', 'stim_N4', 'stim_SWS', 'stim_REM','stim_sleeponset','sham_sleep','sham_N1', 'sham_N2', 'sham_N3', 'sham_N4', 'sham_SWS', 'sham_REM','sham_sleeponset')
  65. # transform to long format
  66. abs_sleep_stim_20 <- abs_sleep_stim_20 %>%
  67. gather(conditions, duration, stim_duration:sham_REM) %>%
  68. separate(conditions, c('stim', 'type')) %>%
  69. arrange(ID, stim)
  70. rel_sleep_stim_20 <- rel_sleep_stim_20 %>%
  71. gather(conditions, proportion, stim_sleep:sham_sleeponset) %>%
  72. separate(conditions, c('stim', 'type')) %>%
  73. arrange(ID, stim)
  74. #### end ####
  75. #### SO count: Data read in & transformation ####
  76. # Set cd
  77. setwd(PATH_IN_SO)
  78. sleep_so_20 <- read.csv("spin_sleep_so.csv")
  79. sleep_so_20$id <- as.factor(sleep_so_20$id)
  80. # transform to long format
  81. sleep_so_20 <- sleep_so_20 %>%
  82. gather(conditions, output, stim_counttotal:sham_ampNREM) %>%
  83. separate(conditions, c('stim','type')) %>%
  84. arrange(id, stim)
  85. #### end ####
  86. #### TSW: Data read in & transformation ####
  87. # Set cd
  88. setwd(PATH_IN_TSW)
  89. # read in data
  90. TSW_DS_20 <- read.csv("spin_TSW_DS.csv")
  91. TSW_DS_20$id <- as.factor(TSW_DS_20$id)
  92. TSW_relative_DS_20 <- read.csv("spin_TSW_relative_DS.csv")
  93. TSW_relative_DS_20$id <- as.factor(TSW_relative_DS_20$id)
  94. # transform to long format
  95. TSW_DS_20 <- TSW_DS_20 %>%
  96. gather(conditions, output, clustercount_sham:speedmax_stim) %>%
  97. separate(conditions, c('type','stim')) %>%
  98. arrange(id, stim)
  99. TSW_relative_DS_20 <- TSW_relative_DS_20 %>%
  100. gather(conditions, output, countbyduration_sham:countbysocount_stim) %>%
  101. separate(conditions, c('type','stim')) %>%
  102. arrange(id, stim)
  103. #### end ####
  104. #### SO spindle coupling: Data read in & transformation ####
  105. # Set cd
  106. setwd(PATH_IN_coupling)
  107. coupling_20 <- read.csv("proportion_SOs_summary.csv")
  108. coupling_20$id <- as.factor(coupling_20$id)
  109. # transform to long format
  110. coupling_20 <- coupling_20 %>%
  111. gather(conditions, output, frontal_stim:parietal_sham) %>%
  112. separate(conditions, c('type','stim')) %>%
  113. arrange(id, stim)
  114. #### end ####
  115. #### Normality and data setup ####
  116. # Set cd
  117. setwd(PATH_OUT)
  118. # check normal distribution
  119. normality_travel_peakduration <- list()
  120. normality_travel_duration <- list()
  121. normality_travel_distance <- list()
  122. normality_travel_distancemax <- list()
  123. normality_travel_speed <- list()
  124. normality_travel_speedmax <- list()
  125. normality_travel_clustersize <- list()
  126. normality_LGT_fig <- list()
  127. normality_Zeich <- list()
  128. normality_so_count <- list()
  129. normality_cluster_count <- list()
  130. normality_cluster_count_DS <- list()
  131. normality_cluster_count_rel <- list()
  132. normality_sleep_N2 <- list()
  133. normality_sleep_SWS <- list()
  134. normality_coupling_frontal <- list()
  135. normality_coupling_parietal <- list()
  136. for (types in 1:4){
  137. criteria <- LGT_categories_stim_20$stim[types]
  138. print(criteria)
  139. normality <- shapiro.test(TSW_DS_20[which(TSW_DS_20$stim == criteria & TSW_DS_20$type == 'clustercount'),4])
  140. normality_cluster_count_DS[criteria] <- normality$p.value
  141. normality <- shapiro.test(TSW_DS_20[which(TSW_DS_20$stim == criteria & TSW_DS_20$type == 'peakduration'),4])
  142. normality_travel_peakduration[criteria] <- normality$p.value
  143. normality <- shapiro.test(TSW_DS_20[which(TSW_DS_20$stim == criteria & TSW_DS_20$type == 'distancemax'),4])
  144. normality_travel_distancemax[criteria] <- normality$p.value
  145. normality <- shapiro.test(TSW_DS_20[which(TSW_DS_20$stim == criteria & TSW_DS_20$type == 'speedmax'),4])
  146. normality_travel_speedmax[criteria] <- normality$p.value
  147. normality <- shapiro.test(TSW_DS_20[which(TSW_DS_20$stim == criteria & TSW_DS_20$type == 'clustersize'),4])
  148. normality_travel_clustersize[criteria] <- normality$p.value
  149. normality <- shapiro.test(TSW_relative_DS_20[which(TSW_relative_DS_20$stim == criteria & TSW_relative_DS_20$type == 'countbyduration'),4])
  150. normality_cluster_count_rel[criteria] <- normality$p.value
  151. normality <- shapiro.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == criteria & LGT_tests_stim_20$test == 'Zeich'),7])
  152. normality_Zeich[criteria] <- normality$p.value
  153. normality <- shapiro.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == criteria & LGT_categories_stim_20$category == 'FG'),7])
  154. normality_LGT_fig[criteria] <- normality$p.value
  155. normality <- shapiro.test(sleep_so_20[which(sleep_so_20$stim == criteria & sleep_so_20$type == 'counttotal'),4])
  156. normality_so_count[criteria] <- normality$p.value
  157. normality <- shapiro.test(rel_sleep_stim_20[which(rel_sleep_stim_20$stim == criteria & rel_sleep_stim_20$type == 'N2'),7])
  158. normality_sleep_N2[criteria] <- normality$p.value
  159. normality <- shapiro.test(rel_sleep_stim_20[which(rel_sleep_stim_20$stim == criteria & rel_sleep_stim_20$type == 'SWS'),7])
  160. normality_sleep_SWS[criteria] <- normality$p.value
  161. normality <- shapiro.test(coupling_20[which(coupling_20$stim == criteria & coupling_20$type == 'frontal'),4])
  162. normality_coupling_frontal[criteria] <- normality$p.value
  163. normality <- shapiro.test(coupling_20[which(coupling_20$stim == criteria & coupling_20$type == 'parietal'),4])
  164. normality_coupling_parietal[criteria] <- normality$p.value}
  165. # correlations
  166. df.regression_stim = data.frame(id = as.character(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"&LGT_categories_stim_20$stim == "stim"]),
  167. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7],
  168. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7],
  169. N2 = rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'stim' & rel_sleep_stim_20$type == 'N2'),7],
  170. SWS = rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'stim' & rel_sleep_stim_20$type == 'SWS'),7],
  171. socount = sleep_so_20[which(sleep_so_20$stim == 'stim' & sleep_so_20$type == 'counttotal'),4],
  172. clustercountDS = TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'clustercount'),4],
  173. clustercountrel = TSW_relative_DS_20[which(TSW_relative_DS_20$stim == 'stim' & TSW_relative_DS_20$type == 'countbyduration'),4],
  174. clustersize = TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'clustersize'),4],
  175. travelpeakdur = TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'peakduration'),4],
  176. traveldistancemax = TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'distancemax'),4],
  177. travelspeedmax = TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'speedmax'),4],
  178. coupling_frontal = coupling_20[which(coupling_20$stim == 'stim' & coupling_20$type == 'frontal'),4],
  179. coupling_parietal = coupling_20[which(coupling_20$stim == 'stim' & coupling_20$type == 'parietal'),4]
  180. )
  181. df.regression_sham = data.frame(id = as.character(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"&LGT_categories_stim_20$stim == "stim"]),
  182. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7],
  183. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7],
  184. N2 = rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'sham' & rel_sleep_stim_20$type == 'N2'),7],
  185. SWS = rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'sham' & rel_sleep_stim_20$type == 'SWS'),7],
  186. socount = sleep_so_20[which(sleep_so_20$stim == 'sham' & sleep_so_20$type == 'counttotal'),4],
  187. clustercountDS = TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'clustercount'),4],
  188. clustercountrel = TSW_relative_DS_20[which(TSW_relative_DS_20$stim == 'sham' & TSW_relative_DS_20$type == 'countbyduration'),4],
  189. clustersize = TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'clustersize'),4],
  190. travelpeakdur = TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'peakduration'),4],
  191. traveldistancemax = TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'distancemax'),4],
  192. travelspeedmax = TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'speedmax'),4],
  193. coupling_frontal = coupling_20[which(coupling_20$stim == 'sham' & coupling_20$type == 'frontal'),4],
  194. coupling_parietal = coupling_20[which(coupling_20$stim == 'sham' & coupling_20$type == 'parietal'),4]
  195. )
  196. #### end ####
  197. #### Correlations figural memory ####
  198. # behaviour FG & N2 duration
  199. # repeated correlations: FG & N2
  200. df.regression_FG_N2 = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  201. N2 = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'N2'),7],
  202. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
  203. )
  204. corr_overall_FG_N2 <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'N2', dataset = df.regression_FG_N2)
  205. # individual correlations
  206. results_FG_N2_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'stim' & rel_sleep_stim_20$type == 'N2'),7], alternative = 'two.sided',method = 'pearson')
  207. results_FG_N2_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'sham' & rel_sleep_stim_20$type == 'N2'),7], alternative = 'two.sided',method = 'pearson')
  208. # overall plot: FG & N2
  209. df <- rbind.data.frame(
  210. data.frame(x = df.regression_stim$FG, y = df.regression_stim$N2, id = "stim"),
  211. data.frame(x = df.regression_sham$FG, y = df.regression_sham$N2, id = "sham")
  212. )
  213. plot_FG_N2 <- ggplot(df, aes(x, y, color = id, fill = id)) +
  214. geom_point(size = 3, alpha = 0.7) +
  215. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  216. stat_cor(method = "pearson",size = 7, family = 'arial') +
  217. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  218. theme_pubr() +
  219. labs(x = "FS", y = "% in N2") +
  220. theme(text = element_text(size = 20, family = "arial"))#,
  221. print(plot_FG_N2)
  222. ggsave('FG_N2.svg', plot = plot_FG_N2, width = 4, height = 6, dpi = 300)
  223. ggsave('FG_N2_wider.svg', plot = plot_FG_N2, width = 5.5, height = 6, dpi = 300)
  224. # behaviour FG & SWS duration
  225. # repeated correlations: FG & SWS
  226. df.regression_FG_SWS = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  227. SWS = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'SWS'),7],
  228. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
  229. )
  230. corr_overall_FG_SWS <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'SWS', dataset = df.regression_FG_SWS)
  231. # individual correlations
  232. results_FG_SWS_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'stim' & rel_sleep_stim_20$type == 'SWS'),7], alternative = 'two.sided',method = 'spearman')
  233. results_FG_SWS_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'sham' & rel_sleep_stim_20$type == 'SWS'),7], alternative = 'two.sided',method = 'pearson')
  234. # overall plot: FG & SWS
  235. df <- rbind.data.frame(
  236. data.frame(x = df.regression_stim$FG, y = df.regression_stim$SWS, id = "stim"),
  237. data.frame(x = df.regression_sham$FG, y = df.regression_sham$SWS, id = "sham")
  238. )
  239. plot_FG_SWS <- ggplot(df, aes(x, y, color = id, fill = id)) +
  240. geom_point(size = 3, alpha = 0.7) +
  241. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  242. stat_cor(method = "spearman",size = 7, family = 'arial') +
  243. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  244. theme_pubr() +
  245. labs(x = "FS", y = "% in SWS") +
  246. theme(text = element_text(size = 20, family = "arial"))
  247. print(plot_FG_SWS)
  248. ggsave('FG_SWS.svg', plot = plot_FG_SWS, width = 4, height = 6, dpi = 300)
  249. ggsave('FG_SWS_wider.svg', plot = plot_FG_SWS, width = 5.5, height = 6, dpi = 300)
  250. # behaviour FG & SO count total
  251. # repeated correlations: FG & SO count
  252. df.regression_FG_socount = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  253. socount = sleep_so_20[which(sleep_so_20$type == 'counttotal'),4],
  254. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
  255. )
  256. corr_overall_FG_socount <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'socount', dataset = df.regression_FG_socount)
  257. # individual correlations
  258. results_FG_socount_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], sleep_so_20[which(sleep_so_20$stim == 'stim' & sleep_so_20$type == 'counttotal'),4], alternative = 'two.sided',method = 'pearson')
  259. results_FG_socount_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], sleep_so_20[which(sleep_so_20$stim == 'sham' & sleep_so_20$type == 'counttotal'),4], alternative = 'two.sided',method = 'pearson')
  260. # overall plot: FG & socount
  261. df <- rbind.data.frame(
  262. data.frame(x = df.regression_stim$FG, y = df.regression_stim$socount, id = "stim"),
  263. data.frame(x = df.regression_sham$FG, y = df.regression_sham$socount, id = "sham")
  264. )
  265. plot_FG_socount <- ggplot(df, aes(x, y, color = id, fill = id)) +
  266. geom_point(size = 3, alpha = 0.7) +
  267. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  268. stat_cor(method = "pearson",size = 7, family = 'arial') +
  269. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  270. theme_pubr() +
  271. labs(x = "FS", y = "SO count") +
  272. theme(text = element_text(size = 20, family = "arial"))
  273. print(plot_FG_socount)
  274. ggsave('FG_socount.svg', plot = plot_FG_socount, width = 4, height = 6, dpi = 300)
  275. ggsave('FG_socount_wider.svg', plot = plot_FG_socount, width = 5.5, height = 6, dpi = 300)
  276. # behaviour FG & travelling peak duration
  277. # repeated correlations: FG & travel peak duration
  278. df.regression_FG_travelpeakdur = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  279. travelpeakdur = TSW_DS_20[which(TSW_DS_20$type == 'peakduration'),4],
  280. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
  281. )
  282. corr_overall_FG_travelpeakdur <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'travelpeakdur', dataset = df.regression_FG_travelpeakdur)
  283. # individual correlations
  284. results_FG_travelpeakduration_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'peakduration'),4], alternative = 'two.sided',method = 'pearson')
  285. results_FG_travelpeakduration_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'peakduration'),4], alternative = 'two.sided',method = 'pearson')
  286. # overall plot: FG & travelling peakduration
  287. df <- rbind.data.frame(
  288. data.frame(x = df.regression_stim$FG, y = df.regression_stim$travelpeakdur, id = "stim"),
  289. data.frame(x = df.regression_sham$FG, y = df.regression_sham$travelpeakdur, id = "sham")
  290. )
  291. plot_FG_travelpeakduration <- ggplot(df, aes(x, y, color = id, fill = id)) +
  292. geom_point(size = 3, alpha = 0.7) +
  293. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  294. stat_cor(method = "pearson",size = 7, family = 'arial') +
  295. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  296. theme_pubr() +
  297. labs(x = "FS", y = "peak to peak duration") +
  298. theme(text = element_text(size = 20, family = "arial"))
  299. print(plot_FG_travelpeakduration)
  300. ggsave('FG_travelpeakduration.svg', plot = plot_FG_travelpeakduration, width = 4, height = 6, dpi = 300)
  301. # behaviour FG & travelling distancemax
  302. # repeated correlations: FG & travel distancemax
  303. df.regression_FG_traveldistancemax = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  304. traveldistancemax = TSW_DS_20[which(TSW_DS_20$type == 'distancemax'),4],
  305. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
  306. )
  307. corr_overall_FG_traveldistancemax <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'traveldistancemax', dataset = df.regression_FG_traveldistancemax)
  308. # individual correlations
  309. results_FG_traveldistancemax_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'distancemax'),4], alternative = 'two.sided',method = 'pearson')
  310. results_FG_traveldistancemax_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'distancemax'),4], alternative = 'two.sided',method = 'pearson')
  311. # overall plot: FG & travelling distancemax
  312. df <- rbind.data.frame(
  313. data.frame(x = df.regression_stim$FG, y = df.regression_stim$traveldistancemax, id = "stim"),
  314. data.frame(x = df.regression_sham$FG, y = df.regression_sham$traveldistancemax, id = "sham")
  315. )
  316. plot_FG_traveldistancemax <- ggplot(df, aes(x, y, color = id, fill = id)) +
  317. geom_point(size = 3, alpha = 0.7) +
  318. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  319. stat_cor(method = "pearson",size = 7, family = 'arial') +
  320. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  321. theme_pubr() +
  322. labs(x = "FS", y = "SO travel distancemax") +
  323. theme(text = element_text(size = 20, family = "arial"))
  324. print(plot_FG_traveldistancemax)
  325. ggsave('FG_traveldistancemax.svg', plot = plot_FG_traveldistancemax, width = 4, height = 6, dpi = 300)
  326. # behaviour FG & travelling speedmax
  327. # repeated correlations: FG & travel speedmax
  328. df.regression_FG_travelspeedmax = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  329. travelspeedmax = TSW_DS_20[which(TSW_DS_20$type == 'speedmax'),4],
  330. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
  331. )
  332. corr_overall_FG_travelspeedmax <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'travelspeedmax', dataset = df.regression_FG_travelspeedmax)
  333. # individual correlations
  334. results_FG_travelspeedmax_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'speedmax'),4], alternative = 'two.sided',method = 'spearman')
  335. results_FG_travelspeedmax_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'speedmax'),4], alternative = 'two.sided',method = 'spearman')
  336. # overall plot: FG & travelling speedmax
  337. df <- rbind.data.frame(
  338. data.frame(x = df.regression_stim$FG, y = df.regression_stim$travelspeedmax, id = "stim"),
  339. data.frame(x = df.regression_sham$FG, y = df.regression_sham$travelspeedmax, id = "sham")
  340. )
  341. plot_FG_travelspeedmax <- ggplot(df, aes(x, y, color = id, fill = id)) +
  342. geom_point(size = 3, alpha = 0.7) +
  343. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  344. stat_cor(method = "spearman",size = 7, family = 'arial') +
  345. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  346. theme_pubr() +
  347. labs(x = "FS", y = "SO travel speedmax") +
  348. theme(text = element_text(size = 20, family = "arial"))
  349. ggsave('FG_travelspeedmax.svg', plot = plot_FG_travelspeedmax, width = 4, height = 6, dpi = 300)
  350. # behaviour FG & travelling clustersize
  351. # repeated correlations: FG & clustersize
  352. df.regression_FG_clustersize = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  353. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7],
  354. clustersize = TSW_DS_20[which(TSW_DS_20$type == 'clustersize'),4]
  355. )
  356. corr_overall_FG_clustersize <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'clustersize', dataset = df.regression_FG_clustersize)
  357. # individual correlations
  358. results_FG_clustersize_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'clustersize'),4], alternative = 'two.sided',method = 'pearson')
  359. results_FG_clustersize_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'clustersize'),4], alternative = 'two.sided',method = 'pearson')
  360. # overall plot: FG & clustersize
  361. df <- rbind.data.frame(
  362. data.frame(x = df.regression_stim$FG, y = df.regression_stim$clustersize, id = "stim"),
  363. data.frame(x = df.regression_sham$FG, y = df.regression_sham$clustersize, id = "sham")
  364. )
  365. plot_FG_clustersize <- ggplot(df, aes(x, y, color = id, fill = id)) +
  366. geom_point(size = 3, alpha = 0.7) +
  367. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  368. stat_cor(method = "pearson",size = 7, family = 'arial') +
  369. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  370. theme_pubr() +
  371. labs(x = "FS", y = "SO cluster size") +
  372. theme(text = element_text(size = 20, family = "arial"))
  373. print(plot_FG_clustersize)
  374. ggsave('FG_clustersize.svg', plot = plot_FG_clustersize, width = 4, height = 6, dpi = 300)
  375. # behaviour FG & SO cluster count DS
  376. # repeated correlations: FG & cluster count DS
  377. df.regression_FG_clustercountDS = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  378. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7],
  379. clustercountDS = TSW_DS_20[which(TSW_DS_20$type == 'clustercount'),4]
  380. )
  381. corr_overall_FG_clustercountDS <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'clustercountDS', dataset = df.regression_FG_clustercountDS)
  382. # individual correlation
  383. results_FG_clustercountDS_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'clustercount'),4], alternative = 'two.sided',method = 'pearson')
  384. results_FG_clustercountDS_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'clustercount'),4], alternative = 'two.sided',method = 'pearson')
  385. # overall plot: FG & clustercountDS
  386. df <- rbind.data.frame(
  387. data.frame(x = df.regression_stim$FG, y = df.regression_stim$clustercountDS, id = "stim"),
  388. data.frame(x = df.regression_sham$FG, y = df.regression_sham$clustercountDS, id = "sham")
  389. )
  390. plot_FG_clustercountDS <- ggplot(df, aes(x, y, color = id, fill = id)) +
  391. geom_point(size = 3, alpha = 0.7) +
  392. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  393. stat_cor(method = "pearson",size = 7, family = 'arial') +
  394. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  395. theme_pubr() +
  396. labs(x = "FS", y = "SO cluster count") +
  397. theme(text = element_text(size = 20, family = "arial"))
  398. print(plot_FG_clustercountDS)
  399. ggsave('FG_clustercountDS.svg', plot = plot_FG_clustercountDS, width = 4, height = 6, dpi = 300)
  400. # behaviour FG & SO cluster count relative
  401. # repeated correlations: FG & clustercount rel
  402. df.regression_FG_clustercountrel = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  403. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7],
  404. clustercountrel = TSW_relative_DS_20[which(TSW_relative_DS_20$type == 'countbyduration'),4]
  405. )
  406. corr_overall_FG_clustercountrel <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'clustercountrel', dataset = df.regression_FG_clustercountrel)
  407. # individual correlations
  408. results_FG_clustercountrel_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], TSW_relative_DS_20[which(TSW_relative_DS_20$stim == 'stim' & TSW_relative_DS_20$type == 'countbyduration'),4], alternative = 'two.sided',method = 'pearson')
  409. results_FG_clustercountrel_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], TSW_relative_DS_20[which(TSW_relative_DS_20$stim == 'sham' & TSW_relative_DS_20$type == 'countbyduration'),4], alternative = 'two.sided',method = 'spearman')
  410. # overall plot: FG & clustercount relative
  411. df <- rbind.data.frame(
  412. data.frame(x = df.regression_stim$FG, y = df.regression_stim$clustercountrel, id = "stim"),
  413. data.frame(x = df.regression_sham$FG, y = df.regression_sham$clustercountrel, id = "sham")
  414. )
  415. plot_FG_clustercountrel <- ggplot(df, aes(x, y, color = id, fill = id)) +
  416. geom_point(size = 3, alpha = 0.7) +
  417. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  418. stat_cor(method = "spearman",size = 7, family = 'arial') +
  419. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  420. theme_pubr() +
  421. labs(x = "FS", y = "SO cluster count (rel)") +
  422. theme(text = element_text(size = 20, family = "arial"))
  423. print(plot_FG_clustercountrel)
  424. ggsave('FG_clustercountrel.svg', plot = plot_FG_clustercountrel, width = 4, height = 6, dpi = 300)
  425. # behaviour FG & coupling frontal
  426. # repeated correlations: FG & coupling
  427. df.regression_FG_couplingfrontal = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  428. coupling = coupling_20[which(coupling_20$type == 'frontal'),4],
  429. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
  430. )
  431. corr_overall_FG_couplingfrontal <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'coupling', dataset = df.regression_FG_couplingfrontal)
  432. # individual correlations
  433. results_FG_couplingfrontal_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], coupling_20[which(coupling_20$stim == 'stim' & coupling_20$type == 'frontal'),4], alternative = 'two.sided',method = 'spearman')
  434. results_FG_couplingfrontal_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], coupling_20[which(coupling_20$stim == 'sham' & coupling_20$type == 'frontal'),4], alternative = 'two.sided',method = 'spearman')
  435. # overall plot: FG & coupling frontal
  436. df <- rbind.data.frame(
  437. data.frame(x = df.regression_stim$FG, y = df.regression_stim$coupling_frontal, id = "stim"),
  438. data.frame(x = df.regression_sham$FG, y = df.regression_sham$coupling_frontal, id = "sham")
  439. )
  440. plot_FG_couplingfrontal <- ggplot(df, aes(x, y, color = id, fill = id)) +
  441. geom_point(size = 3, alpha = 0.7) +
  442. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  443. stat_cor(method = "spearman",size = 7, family = 'arial') +
  444. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  445. theme_pubr() +
  446. labs(x = "FS", y = "% in coupling") +
  447. theme(text = element_text(size = 20, family = "arial"))#,
  448. print(plot_FG_couplingfrontal)
  449. ggsave('FG_couplingfrontal.svg', plot = plot_FG_couplingfrontal, width = 4, height = 6, dpi = 300)
  450. ggsave('FG_couplingfrontal_wider.svg', plot = plot_FG_couplingfrontal, width = 5.5, height = 6, dpi = 300)
  451. # behaviour FG & coupling parietal
  452. # repeated correlations: FG & coupling
  453. df.regression_FG_couplingparietal = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
  454. coupling = coupling_20[which(coupling_20$type == 'parietal'),4],
  455. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
  456. )
  457. corr_overall_FG_couplingparietal <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'coupling', dataset = df.regression_FG_couplingparietal)
  458. # individual correlations
  459. results_FG_couplingparietal_stim <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7], coupling_20[which(coupling_20$stim == 'stim' & coupling_20$type == 'parietal'),4], alternative = 'two.sided',method = 'spearman')
  460. results_FG_couplingparietal_sham <- cor.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7], coupling_20[which(coupling_20$stim == 'sham' & coupling_20$type == 'parietal'),4], alternative = 'two.sided',method = 'spearman')
  461. # overall plot: FG & coupling parietal
  462. df <- rbind.data.frame(
  463. data.frame(x = df.regression_stim$FG, y = df.regression_stim$coupling_parietal, id = "stim"),
  464. data.frame(x = df.regression_sham$FG, y = df.regression_sham$coupling_parietal, id = "sham")
  465. )
  466. plot_FG_couplingparietal <- ggplot(df, aes(x, y, color = id, fill = id)) +
  467. geom_point(size = 3, alpha = 0.7) +
  468. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  469. stat_cor(method = "spearman",size = 7, family = 'arial') +
  470. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  471. theme_pubr() +
  472. labs(x = "FS", y = "% in coupling") +
  473. theme(text = element_text(size = 20, family = "arial"))#,
  474. print(plot_FG_couplingparietal)
  475. ggsave('FG_couplingparietal.svg', plot = plot_FG_couplingparietal, width = 4, height = 6, dpi = 300)
  476. ggsave('FG_couplingparietal_wider.svg', plot = plot_FG_couplingparietal, width = 5.5, height = 6, dpi = 300)
  477. #### end ####
  478. #### correlations with Zeichen subtest ####
  479. # behaviour Zeich & N2 duration
  480. # repeated correlations: Zeich & N2
  481. df.regression_Zeich_N2 = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
  482. N2 = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'N2'),7],
  483. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
  484. )
  485. corr_overall_Zeich_N2 <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'N2', dataset = df.regression_Zeich_N2)
  486. # individual correlations
  487. results_Zeich_N2_stim <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7], rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'stim' & rel_sleep_stim_20$type == 'N2'),7], alternative = 'two.sided',method = 'pearson')
  488. results_Zeich_N2_sham <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7], rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'sham' & rel_sleep_stim_20$type == 'N2'),7], alternative = 'two.sided',method = 'pearson')
  489. # overall plot: Zeich & N2
  490. df <- rbind.data.frame(
  491. data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$N2, id = "stim"),
  492. data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$N2, id = "sham")
  493. )
  494. plot_Zeich_N2 <- ggplot(df, aes(x, y, color = id, fill = id)) +
  495. geom_point(size = 3, alpha = 0.7) +
  496. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  497. stat_cor(method = "pearson",size = 7, family = 'arial') +
  498. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  499. theme_pubr() +
  500. labs(x = "FS", y = "% in N2") +
  501. theme(text = element_text(size = 20, family = "arial"))#,
  502. print(plot_Zeich_N2)
  503. ggsave('Zeich_N2.svg', plot = plot_Zeich_N2, width = 4, height = 6, dpi = 300)
  504. ggsave('Zeich_N2_wider.svg', plot = plot_Zeich_N2, width = 5.5, height = 6, dpi = 300)
  505. # behaviour Zeich & SWS duration
  506. # repeated correlations: Zeich & SWS
  507. df.regression_Zeich_SWS = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
  508. SWS = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'SWS'),7],
  509. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
  510. )
  511. corr_overall_Zeich_SWS <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'SWS', dataset = df.regression_Zeich_SWS)
  512. # individual correlations
  513. results_Zeich_SWS_stim <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7], rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'stim' & rel_sleep_stim_20$type == 'SWS'),7], alternative = 'two.sided',method = 'spearman')
  514. results_Zeich_SWS_sham <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7], rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'sham' & rel_sleep_stim_20$type == 'SWS'),7], alternative = 'two.sided',method = 'pearson')
  515. # overall plot: Zeich & SWS
  516. df <- rbind.data.frame(
  517. data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$SWS, id = "stim"),
  518. data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$SWS, id = "sham")
  519. )
  520. plot_Zeich_SWS <- ggplot(df, aes(x, y, color = id, fill = id)) +
  521. geom_point(size = 3, alpha = 0.7) +
  522. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  523. stat_cor(method = "spearman",size = 7, family = 'arial') +
  524. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  525. theme_pubr() +
  526. labs(x = "FS", y = "% in SWS") +
  527. theme(text = element_text(size = 20, family = "arial"))
  528. print(plot_Zeich_SWS)
  529. ggsave('Zeich_SWS.svg', plot = plot_Zeich_SWS, width = 4, height = 6, dpi = 300)
  530. ggsave('Zeich_SWS_wider.svg', plot = plot_Zeich_SWS, width = 5.5, height = 6, dpi = 300)
  531. # behaviour Zeich & SO count total
  532. # repeated correlations: Zeich & SO count
  533. df.regression_Zeich_socount = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
  534. socount = sleep_so_20[which(sleep_so_20$type == 'counttotal'),4],
  535. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
  536. )
  537. corr_overall_Zeich_socount <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'socount', dataset = df.regression_Zeich_socount)
  538. # individual correlations
  539. results_Zeich_socount_stim <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7], sleep_so_20[which(sleep_so_20$stim == 'stim' & sleep_so_20$type == 'counttotal'),4], alternative = 'two.sided',method = 'pearson')
  540. results_Zeich_socount_sham <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7], sleep_so_20[which(sleep_so_20$stim == 'sham' & sleep_so_20$type == 'counttotal'),4], alternative = 'two.sided',method = 'pearson')
  541. # overall plot: Zeich & socount
  542. df <- rbind.data.frame(
  543. data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$socount, id = "stim"),
  544. data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$socount, id = "sham")
  545. )
  546. plot_Zeich_socount <- ggplot(df, aes(x, y, color = id, fill = id)) +
  547. geom_point(size = 3, alpha = 0.7) +
  548. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  549. stat_cor(method = "pearson",size = 7, family = 'arial') +
  550. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  551. theme_pubr() +
  552. labs(x = "FS", y = "SO count") +
  553. theme(text = element_text(size = 20, family = "arial"))
  554. print(plot_Zeich_socount)
  555. ggsave('Zeich_socount.svg', plot = plot_Zeich_socount, width = 4, height = 6, dpi = 300)
  556. ggsave('Zeich_socount_wider.svg', plot = plot_Zeich_socount, width = 5.5, height = 6, dpi = 300)
  557. # behaviour Zeich & travelling peak duration
  558. # repeated correlations: Zeich & travel peak duration
  559. df.regression_Zeich_travelpeakdur = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
  560. travelpeakdur = TSW_DS_20[which(TSW_DS_20$type == 'peakduration'),4],
  561. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
  562. )
  563. corr_overall_Zeich_travelpeakdur <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'travelpeakdur', dataset = df.regression_Zeich_travelpeakdur)
  564. # individual correlations
  565. results_Zeich_travelpeakduration_stim <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'peakduration'),4], alternative = 'two.sided',method = 'pearson')
  566. results_Zeich_travelpeakduration_sham <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'peakduration'),4], alternative = 'two.sided',method = 'pearson')
  567. # overall plot: Zeich & travelling peakduration
  568. df <- rbind.data.frame(
  569. data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$travelpeakdur, id = "stim"),
  570. data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$travelpeakdur, id = "sham")
  571. )
  572. plot_Zeich_travelpeakduration <- ggplot(df, aes(x, y, color = id, fill = id)) +
  573. geom_point(size = 3, alpha = 0.7) +
  574. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  575. stat_cor(method = "pearson",size = 7, family = 'arial') +
  576. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  577. theme_pubr() +
  578. labs(x = "FS", y = "peak to peak duration") +
  579. theme(text = element_text(size = 20, family = "arial"))
  580. print(plot_Zeich_travelpeakduration)
  581. ggsave('Zeich_travelpeakduration.svg', plot = plot_Zeich_travelpeakduration, width = 4, height = 6, dpi = 300)
  582. # behaviour Zeich & travelling distancemax
  583. # repeated correlations: Zeich & travel distancemax
  584. df.regression_Zeich_traveldistancemax = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
  585. traveldistancemax = TSW_DS_20[which(TSW_DS_20$type == 'distancemax'),4],
  586. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
  587. )
  588. corr_overall_Zeich_traveldistancemax <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'traveldistancemax', dataset = df.regression_Zeich_traveldistancemax)
  589. # individual correlations
  590. results_Zeich_traveldistancemax_stim <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'distancemax'),4], alternative = 'two.sided',method = 'pearson')
  591. results_Zeich_traveldistancemax_sham <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'distancemax'),4], alternative = 'two.sided',method = 'pearson')
  592. # overall plot: Zeich & travelling distancemax
  593. df <- rbind.data.frame(
  594. data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$traveldistancemax, id = "stim"),
  595. data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$traveldistancemax, id = "sham")
  596. )
  597. plot_Zeich_traveldistancemax <- ggplot(df, aes(x, y, color = id, fill = id)) +
  598. geom_point(size = 3, alpha = 0.7) +
  599. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  600. stat_cor(method = "pearson",size = 7, family = 'arial') +
  601. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  602. theme_pubr() +
  603. labs(x = "FS", y = "SO travel distancemax") +
  604. theme(text = element_text(size = 20, family = "arial"))
  605. print(plot_Zeich_traveldistancemax)
  606. ggsave('Zeich_traveldistancemax.svg', plot = plot_Zeich_traveldistancemax, width = 4, height = 6, dpi = 300)
  607. # behaviour Zeich & travelling speedmax
  608. # repeated correlations: Zeich & travel speedmax
  609. df.regression_Zeich_travelspeedmax = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
  610. travelspeedmax = TSW_DS_20[which(TSW_DS_20$type == 'speedmax'),4],
  611. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
  612. )
  613. corr_overall_Zeich_travelspeedmax <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'travelspeedmax', dataset = df.regression_Zeich_travelspeedmax)
  614. # individual correlations
  615. results_Zeich_travelspeedmax_stim <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'speedmax'),4], alternative = 'two.sided',method = 'spearman')
  616. results_Zeich_travelspeedmax_sham <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'speedmax'),4], alternative = 'two.sided',method = 'spearman')
  617. # overall plot: Zeich & travelling speedmax
  618. df <- rbind.data.frame(
  619. data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$travelspeedmax, id = "stim"),
  620. data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$travelspeedmax, id = "sham")
  621. )
  622. plot_Zeich_travelspeedmax <- ggplot(df, aes(x, y, color = id, fill = id)) +
  623. geom_point(size = 3, alpha = 0.7) +
  624. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  625. stat_cor(method = "spearman",size = 7, family = 'arial') +
  626. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  627. theme_pubr() +
  628. labs(x = "FS", y = "SO travel speedmax") +
  629. theme(text = element_text(size = 20, family = "arial"))
  630. ggsave('Zeich_travelspeedmax.svg', plot = plot_Zeich_travelspeedmax, width = 4, height = 6, dpi = 300)
  631. # behaviour Zeich & travelling clustersize
  632. # repeated correlations: Zeich & clustersize
  633. df.regression_Zeich_clustersize = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
  634. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7],
  635. clustersize = TSW_DS_20[which(TSW_DS_20$type == 'clustersize'),4]
  636. )
  637. corr_overall_Zeich_clustersize <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'clustersize', dataset = df.regression_Zeich_clustersize)
  638. # individual correlations
  639. results_Zeich_clustersize_stim <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'clustersize'),4], alternative = 'two.sided',method = 'pearson')
  640. results_Zeich_clustersize_sham <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'clustersize'),4], alternative = 'two.sided',method = 'pearson')
  641. # overall plot: Zeich & clustersize
  642. df <- rbind.data.frame(
  643. data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$clustersize, id = "stim"),
  644. data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$clustersize, id = "sham")
  645. )
  646. plot_Zeich_clustersize <- ggplot(df, aes(x, y, color = id, fill = id)) +
  647. geom_point(size = 3, alpha = 0.7) +
  648. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  649. stat_cor(method = "pearson",size = 7, family = 'arial') +
  650. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  651. theme_pubr() +
  652. labs(x = "FS", y = "SO cluster size") +
  653. theme(text = element_text(size = 20, family = "arial"))
  654. print(plot_Zeich_clustersize)
  655. ggsave('Zeich_clustersize.svg', plot = plot_Zeich_clustersize, width = 4, height = 6, dpi = 300)
  656. # behaviour Zeich & SO cluster count DS
  657. # repeated correlations: Zeich & cluster count DS
  658. df.regression_Zeich_clustercountDS = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
  659. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7],
  660. clustercountDS = TSW_DS_20[which(TSW_DS_20$type == 'clustercount'),4]
  661. )
  662. corr_overall_Zeich_clustercountDS <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'clustercountDS', dataset = df.regression_Zeich_clustercountDS)
  663. # individual correlation
  664. results_Zeich_clustercountDS_stim <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'clustercount'),4], alternative = 'two.sided',method = 'spearman')
  665. results_Zeich_clustercountDS_sham <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'clustercount'),4], alternative = 'two.sided',method = 'pearson')
  666. # overall plot: Zeich & clustercountDS
  667. df <- rbind.data.frame(
  668. data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$clustercountDS, id = "stim"),
  669. data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$clustercountDS, id = "sham")
  670. )
  671. plot_Zeich_clustercountDS <- ggplot(df, aes(x, y, color = id, fill = id)) +
  672. geom_point(size = 3, alpha = 0.7) +
  673. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  674. stat_cor(method = "spearman",size = 7, family = 'arial') +
  675. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  676. theme_pubr() +
  677. labs(x = "FS", y = "SO cluster count") +
  678. theme(text = element_text(size = 20, family = "arial"))
  679. print(plot_Zeich_clustercountDS)
  680. ggsave('Zeich_clustercountDS.svg', plot = plot_Zeich_clustercountDS, width = 4, height = 6, dpi = 300)
  681. # behaviour Zeich & SO cluster count relative
  682. # repeated correlations: Zeich & clustercount rel
  683. df.regression_Zeich_clustercountrel = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
  684. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7],
  685. clustercountrel = TSW_relative_DS_20[which(TSW_relative_DS_20$type == 'countbyduration'),4]
  686. )
  687. corr_overall_Zeich_clustercountrel <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'clustercountrel', dataset = df.regression_Zeich_clustercountrel)
  688. # individual correlations
  689. results_Zeich_clustercountrel_stim <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_relative_DS_20[which(TSW_relative_DS_20$stim == 'stim' & TSW_relative_DS_20$type == 'countbyduration'),4], alternative = 'two.sided',method = 'pearson')
  690. results_Zeich_clustercountrel_sham <- cor.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7], TSW_relative_DS_20[which(TSW_relative_DS_20$stim == 'sham' & TSW_relative_DS_20$type == 'countbyduration'),4], alternative = 'two.sided',method = 'spearman')
  691. # overall plot: Zeich & clustercount relative
  692. df <- rbind.data.frame(
  693. data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$clustercountrel, id = "stim"),
  694. data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$clustercountrel, id = "sham")
  695. )
  696. plot_Zeich_clustercountrel <- ggplot(df, aes(x, y, color = id, fill = id)) +
  697. geom_point(size = 3, alpha = 0.7) +
  698. geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
  699. stat_cor(method = "spearman",size = 7, family = 'arial') +
  700. scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
  701. theme_pubr() +
  702. labs(x = "FS", y = "SO cluster count (rel)") +
  703. theme(text = element_text(size = 20, family = "arial"))
  704. print(plot_Zeich_clustercountrel)
  705. ggsave('Zeich_clustercountrel.svg', plot = plot_Zeich_clustercountrel, width = 4, height = 6, dpi = 300)
  706. #### end ####
  707. #### Linear mixed-effects model (LMM) using lme4: Part 1####
  708. df.regression = data.frame(id = as.factor(as.character(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"])),
  709. conditions = as.factor(LGT_categories_stim_20$stim[LGT_categories_stim_20$category == "FG"]),
  710. FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7],
  711. Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7],
  712. N2 = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'N2'),7],
  713. SWS = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'SWS'),7],
  714. socount = sleep_so_20[which(sleep_so_20$type == 'counttotal'),4],
  715. clustercountDS = TSW_DS_20[which(TSW_DS_20$type == 'clustercount'),4],
  716. clustercountrel = TSW_relative_DS_20[which(TSW_relative_DS_20$type == 'countbyduration'),4],
  717. clustersize = TSW_DS_20[which(TSW_DS_20$type == 'clustersize'),4],
  718. travelpeakdur = TSW_DS_20[which(TSW_DS_20$type == 'peakduration'),4],
  719. traveldistancemax = TSW_DS_20[which(TSW_DS_20$type == 'distancemax'),4],
  720. travelspeedmax = TSW_DS_20[which(TSW_DS_20$type == 'speedmax'),4],
  721. socount_z = as.numeric(scale(sleep_so_20[which(sleep_so_20$type == 'counttotal'),4])),
  722. FG_z = as.numeric(scale(LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7])),
  723. clustersize_z = as.numeric(scale(TSW_DS_20[which(TSW_DS_20$type == 'clustersize'),4])),
  724. travelpeakdur_z = as.numeric(scale(TSW_DS_20[which(TSW_DS_20$type == 'peakduration'),4])),
  725. traveldistancemax_z = as.numeric(scale(TSW_DS_20[which(TSW_DS_20$type == 'distancemax'),4])),
  726. N2_z = as.numeric(scale(rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'N2'),7])),
  727. SWS_z = as.numeric(scale(rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'SWS'),7]))
  728. )
  729. # Install if necessary
  730. # install.packages("lme4")
  731. # install.packages("lmerTest")
  732. library(lme4)
  733. library(lmerTest)
  734. #### end ####
  735. #### Principal component analysis: traveling features ####
  736. library(dplyr) # For easy averaging
  737. # List your raw feature column names (NOT the z-scored ones yet)
  738. feature_cols <- c("travelpeakdur", "traveldistancemax", "clustersize")
  739. # Calculate the mean for each subject across the two conditions
  740. # This creates a dataset with 20 rows (one per person)
  741. pca_input_data <- df.regression %>%
  742. group_by(id) %>%
  743. summarise(across(all_of(feature_cols), mean, na.rm = TRUE))
  744. # Check dimensions: Should be 20 rows
  745. dim(pca_input_data)
  746. # Run PCA
  747. pca_result <- prcomp(pca_input_data[, feature_cols],
  748. center = TRUE,
  749. scale. = TRUE)
  750. # Inspect the results
  751. summary(pca_result)
  752. # Biplot: Arrows show how much each feature contributes to the components
  753. biplot(pca_result, scale = 0)
  754. # 1. Extract the rotation matrix (the "rules" of the PCA)
  755. rotation_matrix <- pca_result$rotation
  756. # 2. Select the feature columns from the ORIGINAL 40-row data
  757. # Ensure they are scaled exactly the same way as the PCA input
  758. # (prcomp scales internally, so we must manually scale our full data to match)
  759. full_data_features <- df.regression[, feature_cols]
  760. scaled_full_data <- scale(full_data_features,
  761. center = pca_result$center,
  762. scale = pca_result$scale)
  763. # 3. Calculate the PC scores for all 40 rows
  764. # Matrix multiplication: Data %*% Rotation
  765. pc_scores <- scaled_full_data %*% rotation_matrix
  766. # 4. Add the first Principal Component (PC1) to your main data frame
  767. df.regression$PC1_AllFeatures <- pc_scores[, 1]
  768. # Optional: Add PC2 if it also explains significant variance
  769. df.regression$PC2_AllFeatures <- pc_scores[, 2]
  770. # Verify it worked
  771. head(df.regression[, c("id", "conditions", "PC1_AllFeatures")])
  772. loadings_pc1 <- pca_result$rotation[, "PC1"]
  773. print(sort(loadings_pc1, decreasing = TRUE))
  774. #### end ####
  775. #### Linear mixed-effects model (LMM) using lme4: Part 2 SWS model ####
  776. # Model 1: The baseline (Control for SWS% and Condition)
  777. model_baseline <- lmer(FG_z ~ SWS_z + conditions + (1 | id), data = df.regression)
  778. # Model 2: The full model (PCA for travelling features)
  779. model_full_SWSPCA <- lmer(FG_z ~ SWS_z + conditions + PC1_AllFeatures + (1 | id), data = df.regression)
  780. #model_full_SWSpeakdur <- lmer(FG_z ~ SWS_z + conditions + travelpeakdur_z + (1 | id), data = df.regression)
  781. #model_full_SWSmaxdist <- lmer(FG_z ~ SWS_z + conditions + traveldistancemax_z + (1 | id), data = df.regression)
  782. #model_full_SWSclustersize <- lmer(FG_z ~ SWS_z + conditions + clustersize_z + (1 | id), data = df.regression)
  783. # Compare the two models
  784. anova(model_baseline, model_full_SWSPCA)
  785. summary(model_full_SWSPCA)
  786. # assumption checks for this model
  787. plot(model_full_SWSPCA) # Look for a random cloud. No "funnel" shape.
  788. qqnorm(resid(model_full_SWSPCA)) # Points should hug the diagonal line.
  789. qqline(resid(model_full_SWSPCA))
  790. # Quick visual check
  791. library(ggplot2)
  792. ggplot(df.regression, aes(x = SWS_z, y = FG_z, color = conditions)) +
  793. # Jitter points to avoid overlap
  794. geom_point(position = position_jitterdodge(jitter.width = 0.5, dodge.width = 0), size = 2.5, alpha = 0.8) +
  795. # Add regression lines separately for each condition
  796. geom_smooth(method = "lm", se = FALSE, linewidth = 1) +
  797. # Improve aesthetics
  798. theme_bw() +
  799. scale_color_manual(values = c("sham" = color_sham, "stim" = color_stim)) +
  800. labs(x = "Percentage of Slow Wave Sleep", y = "Memory Outcome", color = "Condition")
  801. # Check correlation between predictors (excluding the categorical Condition)
  802. cor(df.regression[, c("SWS_z", "PC1_AllFeatures")], use = "complete.obs")
  803. # Fit your full model (the one you want to check)
  804. # Note: VIF is calculated on the fixed effects structure
  805. lme_full <- lmer(FG_z ~ SWS_z + PC1_AllFeatures + conditions + (1 | id), data = df.regression)
  806. # Calculate VIF
  807. vif(lme_full)
  808. #### end ####
  809. #### Side: SWS & individual TSW features ####
  810. # Model 2: The full model (PCA for travelling features)
  811. model_full_SWSpeakdur <- lmer(FG_z ~ SWS_z + conditions + travelpeakdur_z + (1 | id), data = df.regression)
  812. model_full_SWSmaxdist <- lmer(FG_z ~ SWS_z + conditions + traveldistancemax_z + (1 | id), data = df.regression)
  813. model_full_SWSclustersize <- lmer(FG_z ~ SWS_z + conditions + clustersize_z + (1 | id), data = df.regression)
  814. # Compare the two models SWSpeakdur
  815. anova(model_baseline, model_full_SWSpeakdur)
  816. summary(model_full_SWSpeakdur)
  817. # assumption checks for this model
  818. # Check correlation between predictors (excluding the categorical Condition)
  819. cor(df.regression[, c("SWS_z", "travelpeakdur_z")], use = "complete.obs")
  820. # Fit your full model (the one you want to check)
  821. # Note: VIF is calculated on the fixed effects structure
  822. lme_full <- lmer(FG_z ~ SWS_z + travelpeakdur_z + conditions + (1 | id), data = df.regression)
  823. # Calculate VIF
  824. vif(lme_full)
  825. # Compare the two models SWSmax dist
  826. anova(model_baseline, model_full_SWSmaxdist)
  827. summary(model_full_SWSmaxdist)
  828. # assumption checks for this model
  829. # Check correlation between predictors (excluding the categorical Condition)
  830. cor(df.regression[, c("SWS_z", "traveldistancemax_z")], use = "complete.obs")
  831. # Fit your full model (the one you want to check)
  832. # Note: VIF is calculated on the fixed effects structure
  833. lme_full <- lmer(FG_z ~ SWS_z + traveldistancemax_z + conditions + (1 | id), data = df.regression)
  834. # Calculate VIF
  835. vif(lme_full)
  836. # Compare the two models SWSclustersize
  837. anova(model_baseline, model_full_SWSclustersize)
  838. summary(model_full_SWSclustersize)
  839. # assumption checks for this model
  840. # Check correlation between predictors (excluding the categorical Condition)
  841. cor(df.regression[, c("SWS_z", "clustersize_z")], use = "complete.obs")
  842. # Fit your full model (the one you want to check)
  843. # Note: VIF is calculated on the fixed effects structure
  844. lme_full <- lmer(FG_z ~ SWS_z + clustersize_z + conditions + (1 | id), data = df.regression)
  845. # Calculate VIF
  846. vif(lme_full)
  847. #### end ####
  848. #### Linear mixed-effects model (LMM) using lme4: Part 2 N2 model ####
  849. # Model 1: The baseline (Control for N2% and Condition)
  850. model_baseline <- lmer(FG_z ~ N2_z + conditions + (1 | id), data = df.regression)
  851. # Model 2: The full model (PCA for travelling features)
  852. model_full_N2PCA <- lmer(FG_z ~ N2_z + conditions + PC1_AllFeatures + (1 | id), data = df.regression)
  853. # Compare the two models
  854. anova(model_baseline, model_full_N2PCA)
  855. summary(model_full_N2PCA)
  856. # assumption checks for this model
  857. plot(model_full_N2PCA) # Look for a random cloud. No "funnel" shape.
  858. qqnorm(resid(model_full_N2PCA)) # Points should hug the diagonal line.
  859. qqline(resid(model_full_N2PCA))
  860. # Quick visual check
  861. library(ggplot2)
  862. ggplot(df.regression, aes(x = N2_z, y = FG_z, color = conditions)) +
  863. # Jitter points to avoid overlap
  864. geom_point(position = position_jitterdodge(jitter.width = 0.5, dodge.width = 0), size = 2.5, alpha = 0.8) +
  865. # Add regression lines separately for each condition
  866. geom_smooth(method = "lm", se = FALSE, linewidth = 1) +
  867. # Improve aesthetics
  868. theme_bw() +
  869. scale_color_manual(values = c("sham" = color_sham, "stim" = color_stim)) +
  870. labs(x = "Percentage of N2 Sleep", y = "Memory Outcome", color = "Condition")
  871. # Check correlation between predictors (excluding the categorical Condition)
  872. cor(df.regression[, c("N2_z", "PC1_AllFeatures")], use = "complete.obs")
  873. # Fit your full model (the one you want to check)
  874. # Note: VIF is calculated on the fixed effects structure
  875. lme_full <- lmer(FG_z ~ N2_z + PC1_AllFeatures + conditions + (1 | id), data = df.regression)
  876. # Calculate VIF
  877. vif(lme_full)
  878. #### end ####
  879. #### socount LMM model ####
  880. # Model 1: The baseline (Control for socount% and Condition)
  881. model_baseline <- lmer(FG_z ~ socount_z + conditions + (1 | id), data = df.regression)
  882. # Model 2: The full model (PCA for travelling features)
  883. #model_full_socountpeakdur <- lmer(FG_z ~ socount_z + conditions + travelpeakdur_z + (1 | id), data = df.regression)
  884. #model_full_socountmaxdist <- lmer(FG_z ~ socount_z + conditions + traveldistancemax_z + (1 | id), data = df.regression)
  885. #model_full_socountclustersize <- lmer(FG_z ~ socount_z + conditions + clustersize_z + (1 | id), data = df.regression)
  886. model_full_socountPCA <- lmer(FG_z ~ socount_z + conditions + PC1_AllFeatures + (1 | id), data = df.regression)
  887. # Compare the two models
  888. anova(model_baseline, model_full_socountPCA)
  889. summary(model_full_socountPCA)
  890. # assumption checks for this model
  891. plot(model_full_socountPCA) # Look for a random cloud. No "funnel" shape.
  892. qqnorm(resid(model_full_socountPCA)) # Points should hug the diagonal line.
  893. qqline(resid(model_full_socountPCA))
  894. # Quick visual check
  895. library(ggplot2)
  896. ggplot(df.regression, aes(x = socount_z, y = FG_z, color = conditions)) +
  897. # Jitter points to avoid overlap
  898. geom_point(position = position_jitterdodge(jitter.width = 0.5, dodge.width = 0), size = 2.5, alpha = 0.8) +
  899. # Add regression lines separately for each condition
  900. geom_smooth(method = "lm", se = FALSE, linewidth = 1) +
  901. # Improve aesthetics
  902. theme_bw() +
  903. scale_color_manual(values = c("sham" = color_sham, "stim" = color_stim)) +
  904. labs(x = "Percentage of socount Sleep", y = "Memory Outcome", color = "Condition")
  905. # Check correlation between predictors (excluding the categorical Condition)
  906. cor(df.regression[, c("socount_z", "PC1_AllFeatures")], use = "complete.obs")
  907. # Fit your full model (the one you want to check)
  908. # Note: VIF is calculated on the fixed effects structure
  909. lme_full <- lmer(FG_z ~ socount_z + PC1_AllFeatures + conditions + (1 | id), data = df.regression)
  910. # Calculate VIF
  911. vif(lme_full)
  912. #### end ####
  913. ##### mediation #####
  914. # create data frame and mutate conditions
  915. df.mediation <- df.regression %>%
  916. mutate(
  917. conditions = ifelse(conditions == "stim", 1, 0)
  918. )
  919. # --- Install/load packages ---
  920. if (!require(glmnet)) install.packages("glmnet")
  921. if (!require(lavaan)) install.packages("lavaan")
  922. # initiate libraries
  923. library(glmnet)
  924. library(lavaan)
  925. # Define the model: SWS -> PC1 -> Memory
  926. model_sws_med <- '
  927. # Path A: SWS % predicts Features (PC1)
  928. PC1_AllFeatures ~ a * SWS_z + conditions
  929. # Path B & C: Features and SWS predict Memory
  930. # b = effect of PC1 on Memory (controlling for SWS)
  931. # c_prime = direct effect of SWS on Memory (not via PC1)
  932. FG_z ~ c_prime * SWS_z + b * PC1_AllFeatures + conditions
  933. # Indirect Effect: SWS -> PC1 -> Memory
  934. indirect := a * b
  935. # Total Effect of SWS on Memory
  936. total := c_prime + (a * b)
  937. '
  938. # Fit the model
  939. # Cluster by ParticipantID to handle repeated measures
  940. fit_sws <- sem(model_sws_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
  941. summary(fit_sws, standardized = TRUE, ci = TRUE)
  942. # N2 mediation
  943. # Define the model: N2 -> PC1 -> Memory
  944. model_N2_med <- '
  945. # Path A: N2 % predicts Features (PC1)
  946. PC1_AllFeatures ~ a * N2_z + conditions
  947. # Path B & C: Features and N2 predict Memory
  948. # b = effect of PC1 on Memory (controlling for N2)
  949. # c_prime = direct effect of N2 on Memory (not via PC1)
  950. FG_z ~ c_prime * N2_z + b * PC1_AllFeatures + conditions
  951. # Indirect Effect: N2 -> PC1 -> Memory
  952. indirect := a * b
  953. # Total Effect of N2 on Memory
  954. total := c_prime + (a * b)
  955. '
  956. # Fit the model
  957. # Cluster by ParticipantID to handle repeated measures
  958. fit_N2 <- sem(model_N2_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
  959. summary(fit_N2, standardized = TRUE, ci = TRUE)
  960. # so count mediation
  961. # Define the model: socount -> PC1 -> Memory
  962. model_socount_med <- '
  963. # Path A: socount % predicts Features (PC1)
  964. PC1_AllFeatures ~ a * socount_z + conditions
  965. # Path B & C: Features and socount predict Memory
  966. # b = effect of PC1 on Memory (controlling for socount)
  967. # c_prime = direct effect of socount on Memory (not via PC1)
  968. FG_z ~ c_prime * socount_z + b * PC1_AllFeatures + conditions
  969. # Indirect Effect: socount -> PC1 -> Memory
  970. indirect := a * b
  971. # Total Effect of socount on Memory
  972. total := c_prime + (a * b)
  973. '
  974. # Fit the model
  975. # Cluster by ParticipantID to handle repeated measures
  976. fit_socount <- sem(model_socount_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
  977. summary(fit_socount, standardized = TRUE, ci = TRUE)
  978. #### end ####
  979. #### SWS and individual features mediation ####
  980. # Define the model: SWS -> peak duration -> Memory
  981. model_sws_peakdur_med <- '
  982. # Path A: SWS % predicts Features
  983. travelpeakdur_z ~ a * SWS_z + conditions
  984. # Path B & C: Features and SWS predict Memory
  985. # b = effect of features on Memory (controlling for SWS)
  986. # c_prime = direct effect of SWS on Memory (not via features)
  987. FG_z ~ c_prime * SWS_z + b * travelpeakdur_z + conditions
  988. # Indirect Effect: SWS -> features -> Memory
  989. indirect := a * b
  990. # Total Effect of SWS on Memory
  991. total := c_prime + (a * b)
  992. '
  993. # Fit the model
  994. # Cluster by ParticipantID to handle repeated measures
  995. fit_sws_peakdur <- sem(model_sws_peakdur_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
  996. summary(fit_sws_peakdur, standardized = TRUE, ci = TRUE)
  997. # Define the model: SWS -> distmax -> Memory
  998. model_sws_distmax_med <- '
  999. # Path A: SWS % predicts Features
  1000. traveldistancemax_z ~ a * SWS_z + conditions
  1001. # Path B & C: Features and SWS predict Memory
  1002. # b = effect of features on Memory (controlling for SWS)
  1003. # c_prime = direct effect of SWS on Memory (not via features)
  1004. FG_z ~ c_prime * SWS_z + b * traveldistancemax_z + conditions
  1005. # Indirect Effect: SWS -> features -> Memory
  1006. indirect := a * b
  1007. # Total Effect of SWS on Memory
  1008. total := c_prime + (a * b)
  1009. '
  1010. # Fit the model
  1011. # Cluster by ParticipantID to handle repeated measures
  1012. fit_sws_distmax <- sem(model_sws_distmax_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
  1013. summary(fit_sws_distmax, standardized = TRUE, ci = TRUE)
  1014. # Define the model: SWS -> clustersize -> Memory
  1015. model_sws_clustersize_med <- '
  1016. # Path A: SWS % predicts Features
  1017. clustersize_z ~ a * SWS_z + conditions
  1018. # Path B & C: Features and SWS predict Memory
  1019. # b = effect of features on Memory (controlling for SWS)
  1020. # c_prime = direct effect of SWS on Memory
  1021. FG_z ~ c_prime * SWS_z + b * clustersize_z + conditions
  1022. # Indirect Effect: SWS -> features -> Memory
  1023. indirect := a * b
  1024. # Total Effect of SWS on Memory
  1025. total := c_prime + (a * b)
  1026. '
  1027. # Fit the model
  1028. # Cluster by ParticipantID to handle repeated measures
  1029. fit_sws_clustersize <- sem(model_sws_clustersize_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
  1030. summary(fit_sws_clustersize, standardized = TRUE, ci = TRUE)
  1031. #### end ####

ana25_correlations_behaviour_PCA_LMM_mediation.R, no license · at the source

Overview

Authors: Nora M Roüast1, Deniz Kumral1,2, Steffen Gais3, Monika Schönauer1,2,4
ORCID iDs: Nora M Roüast
  1. Institute of Psychology, Neuropsychology, University of Freiburg, Freiburg im Breisgau, Germany
  2. BrainLinks-BrainTools, University of Freiburg, Freiburg im Breisgau, Germany
  3. Institute of Medical Psychology and Behavioral Neurobiology, University of Tübingen, Tübingen, Germany
  4. Bernstein Center Freiburg, University of Freiburg, Freiburg im Breisgau, Germany
Journal: iScience, volume 29, issue 7, article 116601
Dates: received 5 December 2025; accepted 11 June 2026; published online 25 June 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1016/j.isci.2026.116601 · PMID 42491684 · PMCID PMC13378391 · OpenAlex W7165893356
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: cognitive (subfield)
Methods: Spectral & time-frequency, Preprocessing, Connectivity, Statistics, Smoothing, state filtering, decompositions, Evoked potentials, fMRI & imaging, Physiology & signal measures
Keywords: sleep, memory consolidation, auditory stimulation, traveling waves, SWS, declarative memory
Topic: Sleep and Wakefulness Research (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Bundesministerium für Forschung, Technologie und Raumfahrt; German Research Foundation (RO6828/1-1, RO6828/1\u20132, GA730/3-1, SCHO1820/2\u20131)
Citations: not cited yet (Europe PMC); 77 references in the paper
Research resources: RStudio 2023.12.1 + 420 RRID:SCR_000432, MATLAB R2020b RRID:SCR_001622, R 4.5.3 (2026-03-11) RRID:SCR_001905, FieldTrip Version: 20230418 RRID:SCR_004849, EEGLAB version 2023.0 RRID:SCR_007292, Brain Products RRID:SCR_009443, lme4 RRID:SCR_015654

Abstract

Sleep plays a crucial role in memory consolidation, and various methods have attempted to enhance this process by using auditory stimulation. However, the broader impact of auditory stimulation on sleep physiology and memory retention is not fully understood. Here, we apply random or sham auditory stimulation during an afternoon nap to investigate its effects on neural activity and memory consolidation. Stimulation led to a specific reduction in slow-wave sleep, a decreased slow-wave count, and impaired declarative recall that correlated with the diminished sleep depth. Furthermore, we observed altered slow-wave traveling dynamics, with stimulation resulting in shorter traveling trajectories with less reach and reduced spatial spread, particularly impacting frontal regions. Disruptions in these features further predicted memory deficits. Our findings highlight the role of dynamic slow-wave properties in declarative memory consolidation and reveal some methodological limitations for using auditory cues during sleep, since they may disrupt complex processing patterns.

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

Repository

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

OSF wjzs9

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: MATLAB (60), R (7)
Size: 110 files, 67 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: FieldTrip (40 files), Statistics and Machine Learning Toolbox (9 files), rstatix (7 files), tidyverse (7 files), CircStat (4 files), Signal Processing Toolbox (3 files), ggplot2 (2 files), ggpubr (2 files), car (1 file), glmnet (1 file), lavaan (1 file), lme4 (1 file), lmerTest (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
67 files

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

Tracing map

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

What the map holds:

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

No dataset and no data link were found in the paper.

Data and code availability

All data necessary to replicate the findings reported in this paper have been deposited at the Open Science Framework: https://doi.org/10.17605/OSF.IO/WJZS9 and FreiData: https://doi.org/10.60493/8t6p9-xfq49.

Transcribed behavioral data reported in this paper have been deposited at the Open Science Framework: https://doi.org/10.17605/OSF.IO/WJZS9.

All original code has been deposited at the Open Science Framework: https://doi.org/10.17605/OSF.IO/WJZS9.

Any additional information required to reanalyze the data reported in this paper is available from the lead contact upon request.

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

Versions

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

Version 2, 28 September 2026

  • Authors: added Nora M Roüast (0000-0002-4112-358X); removed Nora M Roüast

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 6 keywords, 2 funders, 70 references, 7 RRIDs.

Cite

This paper

Roüast, N. M., Kumral, D., Gais, S., & Schönauer, M. (2026). Random auditory stimulation during sleep disturbs traveling slow waves and declarative memory. iScience, 29(7), 116601. https://doi.org/10.1016/j.isci.2026.116601

BibTeX

@article{rouast2026random,
author = {Roüast, Nora M and Kumral, Deniz and Gais, Steffen and Schönauer, Monika},
title = {{Random auditory stimulation during sleep disturbs traveling slow waves and declarative memory}},
journal = {iScience},
year = {2026},
month = jun,
volume = {29},
number = {7},
pages = {116601},
publisher = {Elsevier},
issn = {2589-0042},
doi = {10.1016/j.isci.2026.116601},
url = {https://doi.org/10.1016/j.isci.2026.116601},
pmid = {42491684},
pmcid = {PMC13378391}
}

RIS

TY - JOUR
AU - Roüast, Nora M
AU - Kumral, Deniz
AU - Gais, Steffen
AU - Schönauer, Monika
TI - Random auditory stimulation during sleep disturbs traveling slow waves and declarative memory
T2 - iScience
J2 - iScience
PY - 2026
DA - 2026/06/25
VL - 29
IS - 7
SP - 116601
SN - 2589-0042
PB - Elsevier
DO - 10.1016/j.isci.2026.116601
UR - https://doi.org/10.1016/j.isci.2026.116601
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.isci.2026.116601",
"type": "article-journal",
"title": "Random auditory stimulation during sleep disturbs traveling slow waves and declarative memory",
"container-title": "iScience",
"author": [
{
"family": "Roüast",
"given": "Nora M"
},
{
"family": "Kumral",
"given": "Deniz"
},
{
"family": "Gais",
"given": "Steffen"
},
{
"family": "Schönauer",
"given": "Monika"
}
],
"container-title-short": "iScience",
"volume": "29",
"issue": "7",
"page": "116601",
"DOI": "10.1016/j.isci.2026.116601",
"PMID": "42491684",
"PMCID": "PMC13378391",
"ISSN": "2589-0042",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.isci.2026.116601",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
25
]
]
}
}

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.1038/s42003-026-09988-y
Thalamic involvement defines distinct slow-wave subtypes in NREM sleep.
Journal: Communications biology
In common: 11 references
[2] doi:10.1016/j.celrep.2026.117646 [code]
Medial entorhinal-hippocampal desynchronization parallels the emergence of memory impairment in a mouse model of Alzheimer's disease pathology.
Journal: Cell reports
In common: CircStat, rstatix, car, 6 other tools, 1 reference
[3] doi:10.1371/journal.pbio.3003938 [code]
Theta oscillations tag episodic memories for sleep-dependent consolidation.
Journal: PLoS biology
In common: CircStat, FieldTrip, Signal Processing Toolbox, 1 other tool, cognitive, 6 references
[4] doi:10.1162/imag.a.105 [code]
Right posterior theta reflects human parahippocampal phase resetting by salient cues during goal-directed navigation
Journal: n/a
In common: lavaan, CircStat, car, 5 other tools, cognitive, 2 references
[5] doi:10.1523/eneuro.0076-26.2026 [code]
Exogenously Driven Neural Reactivation of Spatially Matching Visual Working-Memory Contents.
Journal: eNeuro
In common: rstatix, car, FieldTrip, 5 other tools, cognitive, 2 references
[6] doi:10.1016/j.neuroimage.2026.122115 [code]
Midfrontal theta power relates to response speeding following frustrative nonreward.
Journal: NeuroImage
In common: rstatix, car, lmerTest, 6 other tools, cognitive, 1 reference
[7] doi:10.1093/braincomms/fcag255 [code]
Impaired consolidation of spatial memory during sleep in patients with leucine-rich glioma-inactivated 1-associated limbic encephalitis.
Journal: Brain communications
In common: rstatix, ggpubr, ggplot2, 1 other tool, cognitive, 6 references
[8] doi:10.64898/2026.05.08.26348885 [code]
Insights from nine nights of self-applied, low-density sleep EEG during sleep restriction therapy: a proof-of-concept evaluation
Journal: medRxiv (preprint)
In common: rstatix, FieldTrip, lmerTest, 6 other tools, 1 reference
[9] doi:10.1038/s41467-026-69950-8 [code]
Dopaminergic processes predict temporal distortions in event memory.
Journal: Nature communications
In common: lavaan, rstatix, car, 5 other tools, cognitive
[10] doi:10.1371/journal.pbio.3003740 [code]
Sleep strengthens successor representations of learned sequences in humans.
Journal: PLoS biology
In common: CircStat, FieldTrip, Statistics and Machine Learning Toolbox, cognitive, 5 references

Contribute

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

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

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.