Random auditory stimulation during sleep disturbs traveling slow waves and declarative memory.
The 20 matches
- [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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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] § 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
- rm(list = ls())
- # correlate behavioural outputs with sleep architecture, SO features, and TSW
- MAINPATH <- ("D:/Nora/SPIN/data/")
- PATH_IN_behavioural <- "D:/Nora/SPIN/results/behavioural/"
- PATH_IN_behavioural <- "D:/Nora/SPIN/results_clean/behavioural/"
- PATH_IN_architecture <- "D:/Nora/SPIN/results_clean/sleep_architecture"
- PATH_IN_SO <- "D:/Nora/SPIN/results_clean/so_features/"
- PATH_IN_TSW <- "D:/Nora/SPIN/results_clean/traveling_waves/"
- PATH_IN_coupling <- "D:/Nora/SPIN/results_clean/coupling/"
- PATH_OUT <- ("D:/Nora/SPIN/results_clean/correlation/")
- # Set cd
- setwd(MAINPATH)
- # initiate libraries
- library(tidyr)
- library(dplyr)
- library(rstatix)
- library(plotrix)
- library(ggpubr)
- library(viridis)
- library(svglite)
- #install.packages('rmcorr')
- library(rmcorr)
- library(ggplot2)
- library(car)
- ### define colors according to 'coolwarm' Matlab
- color_sham <- rgb(0.1276, 0.3162, 0.8584) # old: "#0085BCFF"
- color_stim <- rgb(0.7524, 0.0084, 0.0218) # old: '#FF9E61FF'
- axes_color <- rgb(0.1500, 0.1500, 0.1500) # to match matlab plots
- axisLineWidth <- 0.5 # to match matlab plots
- #### Behavioural: Data read in & transformation ####
- # Set cd
- setwd(MAINPATH)
- # read in data behavioural
- subject_notes <- read.csv("subject_notes.csv")
- subject_notes_20 <- subject_notes[c(1:10, 12:13, 15:19, 22:23, 25),]
- colnames(subject_notes_20) <- as.factor(c('ID', 'cond_time', 'sex', 'age'))
- # Set cd
- setwd(PATH_IN_behavioural)
- # LGT
- LGT_categories_stim_20 <- read.csv("LGT_data_categories_stim_20.csv")
- LGT_categories_stim_20 <- cbind(subject_notes_20,LGT_categories_stim_20)
- LGT_tests_stim_20 <- read.csv("LGT_data_tests_stim_20.csv")
- LGT_tests_stim_20 <- cbind(subject_notes_20,LGT_tests_stim_20)
- colnames(LGT_tests_stim_20)[6] <- 'stim_Turk'
- colnames(LGT_tests_stim_20)[12] <- 'sham_Turk'
- LGT_categories_stim_20 <- LGT_categories_stim_20 %>%
- gather(conditions, measure, stim_LGS:sham_VG) %>%
- separate(conditions, c('stim', 'category')) %>%
- arrange(ID, stim)
- LGT_tests_stim_20 <- LGT_tests_stim_20 %>%
- gather(conditions, measure, stim_Stadt:sham_Zeich) %>%
- separate(conditions, c('stim', 'test')) %>%
- arrange(ID, stim)
- #### end ####
- #### Sleep architecture: data read in & transformation ####
- # Set cd
- setwd(PATH_IN_architecture)
- # sorted by stimulation
- sleep_stim_20 <- read.csv("sleep_architecture_stim_20.csv")
- sleep_stim_20 <- cbind(subject_notes_20,sleep_stim_20)
- abs_sleep_stim_20 <- sleep_stim_20[,c(1:14, 23:32)]
- 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')
- rel_sleep_stim_20 <- sleep_stim_20[,c(1:4, 15:22, 33:40)]
- 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')
- # transform to long format
- abs_sleep_stim_20 <- abs_sleep_stim_20 %>%
- gather(conditions, duration, stim_duration:sham_REM) %>%
- separate(conditions, c('stim', 'type')) %>%
- arrange(ID, stim)
- rel_sleep_stim_20 <- rel_sleep_stim_20 %>%
- gather(conditions, proportion, stim_sleep:sham_sleeponset) %>%
- separate(conditions, c('stim', 'type')) %>%
- arrange(ID, stim)
- #### end ####
- #### SO count: Data read in & transformation ####
- # Set cd
- setwd(PATH_IN_SO)
- sleep_so_20 <- read.csv("spin_sleep_so.csv")
- sleep_so_20$id <- as.factor(sleep_so_20$id)
- # transform to long format
- sleep_so_20 <- sleep_so_20 %>%
- gather(conditions, output, stim_counttotal:sham_ampNREM) %>%
- separate(conditions, c('stim','type')) %>%
- arrange(id, stim)
- #### end ####
- #### TSW: Data read in & transformation ####
- # Set cd
- setwd(PATH_IN_TSW)
- # read in data
- TSW_DS_20 <- read.csv("spin_TSW_DS.csv")
- TSW_DS_20$id <- as.factor(TSW_DS_20$id)
- TSW_relative_DS_20 <- read.csv("spin_TSW_relative_DS.csv")
- TSW_relative_DS_20$id <- as.factor(TSW_relative_DS_20$id)
- # transform to long format
- TSW_DS_20 <- TSW_DS_20 %>%
- gather(conditions, output, clustercount_sham:speedmax_stim) %>%
- separate(conditions, c('type','stim')) %>%
- arrange(id, stim)
- TSW_relative_DS_20 <- TSW_relative_DS_20 %>%
- gather(conditions, output, countbyduration_sham:countbysocount_stim) %>%
- separate(conditions, c('type','stim')) %>%
- arrange(id, stim)
- #### end ####
- #### SO spindle coupling: Data read in & transformation ####
- # Set cd
- setwd(PATH_IN_coupling)
- coupling_20 <- read.csv("proportion_SOs_summary.csv")
- coupling_20$id <- as.factor(coupling_20$id)
- # transform to long format
- coupling_20 <- coupling_20 %>%
- gather(conditions, output, frontal_stim:parietal_sham) %>%
- separate(conditions, c('type','stim')) %>%
- arrange(id, stim)
- #### end ####
- #### Normality and data setup ####
- # Set cd
- setwd(PATH_OUT)
- # check normal distribution
- normality_travel_peakduration <- list()
- normality_travel_duration <- list()
- normality_travel_distance <- list()
- normality_travel_distancemax <- list()
- normality_travel_speed <- list()
- normality_travel_speedmax <- list()
- normality_travel_clustersize <- list()
- normality_LGT_fig <- list()
- normality_Zeich <- list()
- normality_so_count <- list()
- normality_cluster_count <- list()
- normality_cluster_count_DS <- list()
- normality_cluster_count_rel <- list()
- normality_sleep_N2 <- list()
- normality_sleep_SWS <- list()
- normality_coupling_frontal <- list()
- normality_coupling_parietal <- list()
- for (types in 1:4){
- criteria <- LGT_categories_stim_20$stim[types]
- print(criteria)
- normality <- shapiro.test(TSW_DS_20[which(TSW_DS_20$stim == criteria & TSW_DS_20$type == 'clustercount'),4])
- normality_cluster_count_DS[criteria] <- normality$p.value
- normality <- shapiro.test(TSW_DS_20[which(TSW_DS_20$stim == criteria & TSW_DS_20$type == 'peakduration'),4])
- normality_travel_peakduration[criteria] <- normality$p.value
- normality <- shapiro.test(TSW_DS_20[which(TSW_DS_20$stim == criteria & TSW_DS_20$type == 'distancemax'),4])
- normality_travel_distancemax[criteria] <- normality$p.value
- normality <- shapiro.test(TSW_DS_20[which(TSW_DS_20$stim == criteria & TSW_DS_20$type == 'speedmax'),4])
- normality_travel_speedmax[criteria] <- normality$p.value
- normality <- shapiro.test(TSW_DS_20[which(TSW_DS_20$stim == criteria & TSW_DS_20$type == 'clustersize'),4])
- normality_travel_clustersize[criteria] <- normality$p.value
- normality <- shapiro.test(TSW_relative_DS_20[which(TSW_relative_DS_20$stim == criteria & TSW_relative_DS_20$type == 'countbyduration'),4])
- normality_cluster_count_rel[criteria] <- normality$p.value
- normality <- shapiro.test(LGT_tests_stim_20[which(LGT_tests_stim_20$stim == criteria & LGT_tests_stim_20$test == 'Zeich'),7])
- normality_Zeich[criteria] <- normality$p.value
- normality <- shapiro.test(LGT_categories_stim_20[which(LGT_categories_stim_20$stim == criteria & LGT_categories_stim_20$category == 'FG'),7])
- normality_LGT_fig[criteria] <- normality$p.value
- normality <- shapiro.test(sleep_so_20[which(sleep_so_20$stim == criteria & sleep_so_20$type == 'counttotal'),4])
- normality_so_count[criteria] <- normality$p.value
- normality <- shapiro.test(rel_sleep_stim_20[which(rel_sleep_stim_20$stim == criteria & rel_sleep_stim_20$type == 'N2'),7])
- normality_sleep_N2[criteria] <- normality$p.value
- normality <- shapiro.test(rel_sleep_stim_20[which(rel_sleep_stim_20$stim == criteria & rel_sleep_stim_20$type == 'SWS'),7])
- normality_sleep_SWS[criteria] <- normality$p.value
- normality <- shapiro.test(coupling_20[which(coupling_20$stim == criteria & coupling_20$type == 'frontal'),4])
- normality_coupling_frontal[criteria] <- normality$p.value
- normality <- shapiro.test(coupling_20[which(coupling_20$stim == criteria & coupling_20$type == 'parietal'),4])
- normality_coupling_parietal[criteria] <- normality$p.value}
- # correlations
- 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"]),
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'stim' & LGT_categories_stim_20$category == 'FG'),7],
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'stim' & LGT_tests_stim_20$test == 'Zeich'),7],
- N2 = rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'stim' & rel_sleep_stim_20$type == 'N2'),7],
- SWS = rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'stim' & rel_sleep_stim_20$type == 'SWS'),7],
- socount = sleep_so_20[which(sleep_so_20$stim == 'stim' & sleep_so_20$type == 'counttotal'),4],
- clustercountDS = TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'clustercount'),4],
- clustercountrel = TSW_relative_DS_20[which(TSW_relative_DS_20$stim == 'stim' & TSW_relative_DS_20$type == 'countbyduration'),4],
- clustersize = TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'clustersize'),4],
- travelpeakdur = TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'peakduration'),4],
- traveldistancemax = TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'distancemax'),4],
- travelspeedmax = TSW_DS_20[which(TSW_DS_20$stim == 'stim' & TSW_DS_20$type == 'speedmax'),4],
- coupling_frontal = coupling_20[which(coupling_20$stim == 'stim' & coupling_20$type == 'frontal'),4],
- coupling_parietal = coupling_20[which(coupling_20$stim == 'stim' & coupling_20$type == 'parietal'),4]
- )
- 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"]),
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$stim == 'sham' & LGT_categories_stim_20$category == 'FG'),7],
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$stim == 'sham' & LGT_tests_stim_20$test == 'Zeich'),7],
- N2 = rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'sham' & rel_sleep_stim_20$type == 'N2'),7],
- SWS = rel_sleep_stim_20[which(rel_sleep_stim_20$stim == 'sham' & rel_sleep_stim_20$type == 'SWS'),7],
- socount = sleep_so_20[which(sleep_so_20$stim == 'sham' & sleep_so_20$type == 'counttotal'),4],
- clustercountDS = TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'clustercount'),4],
- clustercountrel = TSW_relative_DS_20[which(TSW_relative_DS_20$stim == 'sham' & TSW_relative_DS_20$type == 'countbyduration'),4],
- clustersize = TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'clustersize'),4],
- travelpeakdur = TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'peakduration'),4],
- traveldistancemax = TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'distancemax'),4],
- travelspeedmax = TSW_DS_20[which(TSW_DS_20$stim == 'sham' & TSW_DS_20$type == 'speedmax'),4],
- coupling_frontal = coupling_20[which(coupling_20$stim == 'sham' & coupling_20$type == 'frontal'),4],
- coupling_parietal = coupling_20[which(coupling_20$stim == 'sham' & coupling_20$type == 'parietal'),4]
- )
- #### end ####
- #### Correlations figural memory ####
- # behaviour FG & N2 duration
- # repeated correlations: FG & N2
- df.regression_FG_N2 = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- N2 = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'N2'),7],
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
- )
- corr_overall_FG_N2 <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'N2', dataset = df.regression_FG_N2)
- # individual correlations
- 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')
- 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')
- # overall plot: FG & N2
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$N2, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$N2, id = "sham")
- )
- plot_FG_N2 <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "% in N2") +
- theme(text = element_text(size = 20, family = "arial"))#,
- print(plot_FG_N2)
- ggsave('FG_N2.svg', plot = plot_FG_N2, width = 4, height = 6, dpi = 300)
- ggsave('FG_N2_wider.svg', plot = plot_FG_N2, width = 5.5, height = 6, dpi = 300)
- # behaviour FG & SWS duration
- # repeated correlations: FG & SWS
- df.regression_FG_SWS = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- SWS = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'SWS'),7],
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
- )
- corr_overall_FG_SWS <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'SWS', dataset = df.regression_FG_SWS)
- # individual correlations
- 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')
- 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')
- # overall plot: FG & SWS
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$SWS, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$SWS, id = "sham")
- )
- plot_FG_SWS <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "spearman",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "% in SWS") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_FG_SWS)
- ggsave('FG_SWS.svg', plot = plot_FG_SWS, width = 4, height = 6, dpi = 300)
- ggsave('FG_SWS_wider.svg', plot = plot_FG_SWS, width = 5.5, height = 6, dpi = 300)
- # behaviour FG & SO count total
- # repeated correlations: FG & SO count
- df.regression_FG_socount = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- socount = sleep_so_20[which(sleep_so_20$type == 'counttotal'),4],
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
- )
- corr_overall_FG_socount <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'socount', dataset = df.regression_FG_socount)
- # individual correlations
- 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')
- 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')
- # overall plot: FG & socount
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$socount, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$socount, id = "sham")
- )
- plot_FG_socount <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO count") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_FG_socount)
- ggsave('FG_socount.svg', plot = plot_FG_socount, width = 4, height = 6, dpi = 300)
- ggsave('FG_socount_wider.svg', plot = plot_FG_socount, width = 5.5, height = 6, dpi = 300)
- # behaviour FG & travelling peak duration
- # repeated correlations: FG & travel peak duration
- df.regression_FG_travelpeakdur = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- travelpeakdur = TSW_DS_20[which(TSW_DS_20$type == 'peakduration'),4],
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
- )
- corr_overall_FG_travelpeakdur <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'travelpeakdur', dataset = df.regression_FG_travelpeakdur)
- # individual correlations
- 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')
- 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')
- # overall plot: FG & travelling peakduration
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$travelpeakdur, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$travelpeakdur, id = "sham")
- )
- plot_FG_travelpeakduration <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "peak to peak duration") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_FG_travelpeakduration)
- ggsave('FG_travelpeakduration.svg', plot = plot_FG_travelpeakduration, width = 4, height = 6, dpi = 300)
- # behaviour FG & travelling distancemax
- # repeated correlations: FG & travel distancemax
- df.regression_FG_traveldistancemax = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- traveldistancemax = TSW_DS_20[which(TSW_DS_20$type == 'distancemax'),4],
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
- )
- corr_overall_FG_traveldistancemax <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'traveldistancemax', dataset = df.regression_FG_traveldistancemax)
- # individual correlations
- 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')
- 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')
- # overall plot: FG & travelling distancemax
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$traveldistancemax, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$traveldistancemax, id = "sham")
- )
- plot_FG_traveldistancemax <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO travel distancemax") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_FG_traveldistancemax)
- ggsave('FG_traveldistancemax.svg', plot = plot_FG_traveldistancemax, width = 4, height = 6, dpi = 300)
- # behaviour FG & travelling speedmax
- # repeated correlations: FG & travel speedmax
- df.regression_FG_travelspeedmax = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- travelspeedmax = TSW_DS_20[which(TSW_DS_20$type == 'speedmax'),4],
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
- )
- corr_overall_FG_travelspeedmax <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'travelspeedmax', dataset = df.regression_FG_travelspeedmax)
- # individual correlations
- 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')
- 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')
- # overall plot: FG & travelling speedmax
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$travelspeedmax, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$travelspeedmax, id = "sham")
- )
- plot_FG_travelspeedmax <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "spearman",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO travel speedmax") +
- theme(text = element_text(size = 20, family = "arial"))
- ggsave('FG_travelspeedmax.svg', plot = plot_FG_travelspeedmax, width = 4, height = 6, dpi = 300)
- # behaviour FG & travelling clustersize
- # repeated correlations: FG & clustersize
- df.regression_FG_clustersize = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7],
- clustersize = TSW_DS_20[which(TSW_DS_20$type == 'clustersize'),4]
- )
- corr_overall_FG_clustersize <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'clustersize', dataset = df.regression_FG_clustersize)
- # individual correlations
- 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')
- 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')
- # overall plot: FG & clustersize
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$clustersize, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$clustersize, id = "sham")
- )
- plot_FG_clustersize <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO cluster size") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_FG_clustersize)
- ggsave('FG_clustersize.svg', plot = plot_FG_clustersize, width = 4, height = 6, dpi = 300)
- # behaviour FG & SO cluster count DS
- # repeated correlations: FG & cluster count DS
- df.regression_FG_clustercountDS = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7],
- clustercountDS = TSW_DS_20[which(TSW_DS_20$type == 'clustercount'),4]
- )
- corr_overall_FG_clustercountDS <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'clustercountDS', dataset = df.regression_FG_clustercountDS)
- # individual correlation
- 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')
- 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')
- # overall plot: FG & clustercountDS
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$clustercountDS, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$clustercountDS, id = "sham")
- )
- plot_FG_clustercountDS <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO cluster count") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_FG_clustercountDS)
- ggsave('FG_clustercountDS.svg', plot = plot_FG_clustercountDS, width = 4, height = 6, dpi = 300)
- # behaviour FG & SO cluster count relative
- # repeated correlations: FG & clustercount rel
- df.regression_FG_clustercountrel = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7],
- clustercountrel = TSW_relative_DS_20[which(TSW_relative_DS_20$type == 'countbyduration'),4]
- )
- corr_overall_FG_clustercountrel <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'clustercountrel', dataset = df.regression_FG_clustercountrel)
- # individual correlations
- 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')
- 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')
- # overall plot: FG & clustercount relative
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$clustercountrel, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$clustercountrel, id = "sham")
- )
- plot_FG_clustercountrel <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "spearman",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO cluster count (rel)") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_FG_clustercountrel)
- ggsave('FG_clustercountrel.svg', plot = plot_FG_clustercountrel, width = 4, height = 6, dpi = 300)
- # behaviour FG & coupling frontal
- # repeated correlations: FG & coupling
- df.regression_FG_couplingfrontal = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- coupling = coupling_20[which(coupling_20$type == 'frontal'),4],
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
- )
- corr_overall_FG_couplingfrontal <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'coupling', dataset = df.regression_FG_couplingfrontal)
- # individual correlations
- 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')
- 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')
- # overall plot: FG & coupling frontal
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$coupling_frontal, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$coupling_frontal, id = "sham")
- )
- plot_FG_couplingfrontal <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "spearman",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "% in coupling") +
- theme(text = element_text(size = 20, family = "arial"))#,
- print(plot_FG_couplingfrontal)
- ggsave('FG_couplingfrontal.svg', plot = plot_FG_couplingfrontal, width = 4, height = 6, dpi = 300)
- ggsave('FG_couplingfrontal_wider.svg', plot = plot_FG_couplingfrontal, width = 5.5, height = 6, dpi = 300)
- # behaviour FG & coupling parietal
- # repeated correlations: FG & coupling
- df.regression_FG_couplingparietal = data.frame(id = as.factor(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"]),
- coupling = coupling_20[which(coupling_20$type == 'parietal'),4],
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7]
- )
- corr_overall_FG_couplingparietal <- rmcorr(participant = "id", measure1 = 'FG', measure2 = 'coupling', dataset = df.regression_FG_couplingparietal)
- # individual correlations
- 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')
- 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')
- # overall plot: FG & coupling parietal
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$FG, y = df.regression_stim$coupling_parietal, id = "stim"),
- data.frame(x = df.regression_sham$FG, y = df.regression_sham$coupling_parietal, id = "sham")
- )
- plot_FG_couplingparietal <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "spearman",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "% in coupling") +
- theme(text = element_text(size = 20, family = "arial"))#,
- print(plot_FG_couplingparietal)
- ggsave('FG_couplingparietal.svg', plot = plot_FG_couplingparietal, width = 4, height = 6, dpi = 300)
- ggsave('FG_couplingparietal_wider.svg', plot = plot_FG_couplingparietal, width = 5.5, height = 6, dpi = 300)
- #### end ####
- #### correlations with Zeichen subtest ####
- # behaviour Zeich & N2 duration
- # repeated correlations: Zeich & N2
- df.regression_Zeich_N2 = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
- N2 = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'N2'),7],
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
- )
- corr_overall_Zeich_N2 <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'N2', dataset = df.regression_Zeich_N2)
- # individual correlations
- 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')
- 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')
- # overall plot: Zeich & N2
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$N2, id = "stim"),
- data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$N2, id = "sham")
- )
- plot_Zeich_N2 <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "% in N2") +
- theme(text = element_text(size = 20, family = "arial"))#,
- print(plot_Zeich_N2)
- ggsave('Zeich_N2.svg', plot = plot_Zeich_N2, width = 4, height = 6, dpi = 300)
- ggsave('Zeich_N2_wider.svg', plot = plot_Zeich_N2, width = 5.5, height = 6, dpi = 300)
- # behaviour Zeich & SWS duration
- # repeated correlations: Zeich & SWS
- df.regression_Zeich_SWS = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
- SWS = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'SWS'),7],
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
- )
- corr_overall_Zeich_SWS <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'SWS', dataset = df.regression_Zeich_SWS)
- # individual correlations
- 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')
- 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')
- # overall plot: Zeich & SWS
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$SWS, id = "stim"),
- data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$SWS, id = "sham")
- )
- plot_Zeich_SWS <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "spearman",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "% in SWS") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_Zeich_SWS)
- ggsave('Zeich_SWS.svg', plot = plot_Zeich_SWS, width = 4, height = 6, dpi = 300)
- ggsave('Zeich_SWS_wider.svg', plot = plot_Zeich_SWS, width = 5.5, height = 6, dpi = 300)
- # behaviour Zeich & SO count total
- # repeated correlations: Zeich & SO count
- df.regression_Zeich_socount = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
- socount = sleep_so_20[which(sleep_so_20$type == 'counttotal'),4],
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
- )
- corr_overall_Zeich_socount <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'socount', dataset = df.regression_Zeich_socount)
- # individual correlations
- 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')
- 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')
- # overall plot: Zeich & socount
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$socount, id = "stim"),
- data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$socount, id = "sham")
- )
- plot_Zeich_socount <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO count") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_Zeich_socount)
- ggsave('Zeich_socount.svg', plot = plot_Zeich_socount, width = 4, height = 6, dpi = 300)
- ggsave('Zeich_socount_wider.svg', plot = plot_Zeich_socount, width = 5.5, height = 6, dpi = 300)
- # behaviour Zeich & travelling peak duration
- # repeated correlations: Zeich & travel peak duration
- df.regression_Zeich_travelpeakdur = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
- travelpeakdur = TSW_DS_20[which(TSW_DS_20$type == 'peakduration'),4],
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
- )
- corr_overall_Zeich_travelpeakdur <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'travelpeakdur', dataset = df.regression_Zeich_travelpeakdur)
- # individual correlations
- 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')
- 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')
- # overall plot: Zeich & travelling peakduration
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$travelpeakdur, id = "stim"),
- data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$travelpeakdur, id = "sham")
- )
- plot_Zeich_travelpeakduration <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "peak to peak duration") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_Zeich_travelpeakduration)
- ggsave('Zeich_travelpeakduration.svg', plot = plot_Zeich_travelpeakduration, width = 4, height = 6, dpi = 300)
- # behaviour Zeich & travelling distancemax
- # repeated correlations: Zeich & travel distancemax
- df.regression_Zeich_traveldistancemax = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
- traveldistancemax = TSW_DS_20[which(TSW_DS_20$type == 'distancemax'),4],
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
- )
- corr_overall_Zeich_traveldistancemax <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'traveldistancemax', dataset = df.regression_Zeich_traveldistancemax)
- # individual correlations
- 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')
- 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')
- # overall plot: Zeich & travelling distancemax
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$traveldistancemax, id = "stim"),
- data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$traveldistancemax, id = "sham")
- )
- plot_Zeich_traveldistancemax <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO travel distancemax") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_Zeich_traveldistancemax)
- ggsave('Zeich_traveldistancemax.svg', plot = plot_Zeich_traveldistancemax, width = 4, height = 6, dpi = 300)
- # behaviour Zeich & travelling speedmax
- # repeated correlations: Zeich & travel speedmax
- df.regression_Zeich_travelspeedmax = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
- travelspeedmax = TSW_DS_20[which(TSW_DS_20$type == 'speedmax'),4],
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7]
- )
- corr_overall_Zeich_travelspeedmax <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'travelspeedmax', dataset = df.regression_Zeich_travelspeedmax)
- # individual correlations
- 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')
- 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')
- # overall plot: Zeich & travelling speedmax
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$travelspeedmax, id = "stim"),
- data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$travelspeedmax, id = "sham")
- )
- plot_Zeich_travelspeedmax <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "spearman",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO travel speedmax") +
- theme(text = element_text(size = 20, family = "arial"))
- ggsave('Zeich_travelspeedmax.svg', plot = plot_Zeich_travelspeedmax, width = 4, height = 6, dpi = 300)
- # behaviour Zeich & travelling clustersize
- # repeated correlations: Zeich & clustersize
- df.regression_Zeich_clustersize = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7],
- clustersize = TSW_DS_20[which(TSW_DS_20$type == 'clustersize'),4]
- )
- corr_overall_Zeich_clustersize <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'clustersize', dataset = df.regression_Zeich_clustersize)
- # individual correlations
- 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')
- 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')
- # overall plot: Zeich & clustersize
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$clustersize, id = "stim"),
- data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$clustersize, id = "sham")
- )
- plot_Zeich_clustersize <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "pearson",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO cluster size") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_Zeich_clustersize)
- ggsave('Zeich_clustersize.svg', plot = plot_Zeich_clustersize, width = 4, height = 6, dpi = 300)
- # behaviour Zeich & SO cluster count DS
- # repeated correlations: Zeich & cluster count DS
- df.regression_Zeich_clustercountDS = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7],
- clustercountDS = TSW_DS_20[which(TSW_DS_20$type == 'clustercount'),4]
- )
- corr_overall_Zeich_clustercountDS <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'clustercountDS', dataset = df.regression_Zeich_clustercountDS)
- # individual correlation
- 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')
- 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')
- # overall plot: Zeich & clustercountDS
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$clustercountDS, id = "stim"),
- data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$clustercountDS, id = "sham")
- )
- plot_Zeich_clustercountDS <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "spearman",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO cluster count") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_Zeich_clustercountDS)
- ggsave('Zeich_clustercountDS.svg', plot = plot_Zeich_clustercountDS, width = 4, height = 6, dpi = 300)
- # behaviour Zeich & SO cluster count relative
- # repeated correlations: Zeich & clustercount rel
- df.regression_Zeich_clustercountrel = data.frame(id = as.factor(LGT_tests_stim_20$ID[LGT_tests_stim_20$test == "Zeich"]),
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7],
- clustercountrel = TSW_relative_DS_20[which(TSW_relative_DS_20$type == 'countbyduration'),4]
- )
- corr_overall_Zeich_clustercountrel <- rmcorr(participant = "id", measure1 = 'Zeich', measure2 = 'clustercountrel', dataset = df.regression_Zeich_clustercountrel)
- # individual correlations
- 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')
- 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')
- # overall plot: Zeich & clustercount relative
- df <- rbind.data.frame(
- data.frame(x = df.regression_stim$Zeich, y = df.regression_stim$clustercountrel, id = "stim"),
- data.frame(x = df.regression_sham$Zeich, y = df.regression_sham$clustercountrel, id = "sham")
- )
- plot_Zeich_clustercountrel <- ggplot(df, aes(x, y, color = id, fill = id)) +
- geom_point(size = 3, alpha = 0.7) +
- geom_smooth(method = "lm", alpha = 0.2, size = 1.5) +
- stat_cor(method = "spearman",size = 7, family = 'arial') +
- scale_color_manual(values = c(stim = color_stim, sham = color_sham), aesthetics = c("color", "fill")) +
- theme_pubr() +
- labs(x = "FS", y = "SO cluster count (rel)") +
- theme(text = element_text(size = 20, family = "arial"))
- print(plot_Zeich_clustercountrel)
- ggsave('Zeich_clustercountrel.svg', plot = plot_Zeich_clustercountrel, width = 4, height = 6, dpi = 300)
- #### end ####
- #### Linear mixed-effects model (LMM) using lme4: Part 1####
- df.regression = data.frame(id = as.factor(as.character(LGT_categories_stim_20$ID[LGT_categories_stim_20$category == "FG"])),
- conditions = as.factor(LGT_categories_stim_20$stim[LGT_categories_stim_20$category == "FG"]),
- FG = LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7],
- Zeich = LGT_tests_stim_20[which(LGT_tests_stim_20$test == 'Zeich'),7],
- N2 = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'N2'),7],
- SWS = rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'SWS'),7],
- socount = sleep_so_20[which(sleep_so_20$type == 'counttotal'),4],
- clustercountDS = TSW_DS_20[which(TSW_DS_20$type == 'clustercount'),4],
- clustercountrel = TSW_relative_DS_20[which(TSW_relative_DS_20$type == 'countbyduration'),4],
- clustersize = TSW_DS_20[which(TSW_DS_20$type == 'clustersize'),4],
- travelpeakdur = TSW_DS_20[which(TSW_DS_20$type == 'peakduration'),4],
- traveldistancemax = TSW_DS_20[which(TSW_DS_20$type == 'distancemax'),4],
- travelspeedmax = TSW_DS_20[which(TSW_DS_20$type == 'speedmax'),4],
- socount_z = as.numeric(scale(sleep_so_20[which(sleep_so_20$type == 'counttotal'),4])),
- FG_z = as.numeric(scale(LGT_categories_stim_20[which(LGT_categories_stim_20$category == 'FG'),7])),
- clustersize_z = as.numeric(scale(TSW_DS_20[which(TSW_DS_20$type == 'clustersize'),4])),
- travelpeakdur_z = as.numeric(scale(TSW_DS_20[which(TSW_DS_20$type == 'peakduration'),4])),
- traveldistancemax_z = as.numeric(scale(TSW_DS_20[which(TSW_DS_20$type == 'distancemax'),4])),
- N2_z = as.numeric(scale(rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'N2'),7])),
- SWS_z = as.numeric(scale(rel_sleep_stim_20[which(rel_sleep_stim_20$type == 'SWS'),7]))
- )
- # Install if necessary
- # install.packages("lme4")
- # install.packages("lmerTest")
- library(lme4)
- library(lmerTest)
- #### end ####
- #### Principal component analysis: traveling features ####
- library(dplyr) # For easy averaging
- # List your raw feature column names (NOT the z-scored ones yet)
- feature_cols <- c("travelpeakdur", "traveldistancemax", "clustersize")
- # Calculate the mean for each subject across the two conditions
- # This creates a dataset with 20 rows (one per person)
- pca_input_data <- df.regression %>%
- group_by(id) %>%
- summarise(across(all_of(feature_cols), mean, na.rm = TRUE))
- # Check dimensions: Should be 20 rows
- dim(pca_input_data)
- # Run PCA
- pca_result <- prcomp(pca_input_data[, feature_cols],
- center = TRUE,
- scale. = TRUE)
- # Inspect the results
- summary(pca_result)
- # Biplot: Arrows show how much each feature contributes to the components
- biplot(pca_result, scale = 0)
- # 1. Extract the rotation matrix (the "rules" of the PCA)
- rotation_matrix <- pca_result$rotation
- # 2. Select the feature columns from the ORIGINAL 40-row data
- # Ensure they are scaled exactly the same way as the PCA input
- # (prcomp scales internally, so we must manually scale our full data to match)
- full_data_features <- df.regression[, feature_cols]
- scaled_full_data <- scale(full_data_features,
- center = pca_result$center,
- scale = pca_result$scale)
- # 3. Calculate the PC scores for all 40 rows
- # Matrix multiplication: Data %*% Rotation
- pc_scores <- scaled_full_data %*% rotation_matrix
- # 4. Add the first Principal Component (PC1) to your main data frame
- df.regression$PC1_AllFeatures <- pc_scores[, 1]
- # Optional: Add PC2 if it also explains significant variance
- df.regression$PC2_AllFeatures <- pc_scores[, 2]
- # Verify it worked
- head(df.regression[, c("id", "conditions", "PC1_AllFeatures")])
- loadings_pc1 <- pca_result$rotation[, "PC1"]
- print(sort(loadings_pc1, decreasing = TRUE))
- #### end ####
- #### Linear mixed-effects model (LMM) using lme4: Part 2 SWS model ####
- # Model 1: The baseline (Control for SWS% and Condition)
- model_baseline <- lmer(FG_z ~ SWS_z + conditions + (1 | id), data = df.regression)
- # Model 2: The full model (PCA for travelling features)
- model_full_SWSPCA <- lmer(FG_z ~ SWS_z + conditions + PC1_AllFeatures + (1 | id), data = df.regression)
- #model_full_SWSpeakdur <- lmer(FG_z ~ SWS_z + conditions + travelpeakdur_z + (1 | id), data = df.regression)
- #model_full_SWSmaxdist <- lmer(FG_z ~ SWS_z + conditions + traveldistancemax_z + (1 | id), data = df.regression)
- #model_full_SWSclustersize <- lmer(FG_z ~ SWS_z + conditions + clustersize_z + (1 | id), data = df.regression)
- # Compare the two models
- anova(model_baseline, model_full_SWSPCA)
- summary(model_full_SWSPCA)
- # assumption checks for this model
- plot(model_full_SWSPCA) # Look for a random cloud. No "funnel" shape.
- qqnorm(resid(model_full_SWSPCA)) # Points should hug the diagonal line.
- qqline(resid(model_full_SWSPCA))
- # Quick visual check
- library(ggplot2)
- ggplot(df.regression, aes(x = SWS_z, y = FG_z, color = conditions)) +
- # Jitter points to avoid overlap
- geom_point(position = position_jitterdodge(jitter.width = 0.5, dodge.width = 0), size = 2.5, alpha = 0.8) +
- # Add regression lines separately for each condition
- geom_smooth(method = "lm", se = FALSE, linewidth = 1) +
- # Improve aesthetics
- theme_bw() +
- scale_color_manual(values = c("sham" = color_sham, "stim" = color_stim)) +
- labs(x = "Percentage of Slow Wave Sleep", y = "Memory Outcome", color = "Condition")
- # Check correlation between predictors (excluding the categorical Condition)
- cor(df.regression[, c("SWS_z", "PC1_AllFeatures")], use = "complete.obs")
- # Fit your full model (the one you want to check)
- # Note: VIF is calculated on the fixed effects structure
- lme_full <- lmer(FG_z ~ SWS_z + PC1_AllFeatures + conditions + (1 | id), data = df.regression)
- # Calculate VIF
- vif(lme_full)
- #### end ####
- #### Side: SWS & individual TSW features ####
- # Model 2: The full model (PCA for travelling features)
- model_full_SWSpeakdur <- lmer(FG_z ~ SWS_z + conditions + travelpeakdur_z + (1 | id), data = df.regression)
- model_full_SWSmaxdist <- lmer(FG_z ~ SWS_z + conditions + traveldistancemax_z + (1 | id), data = df.regression)
- model_full_SWSclustersize <- lmer(FG_z ~ SWS_z + conditions + clustersize_z + (1 | id), data = df.regression)
- # Compare the two models SWSpeakdur
- anova(model_baseline, model_full_SWSpeakdur)
- summary(model_full_SWSpeakdur)
- # assumption checks for this model
- # Check correlation between predictors (excluding the categorical Condition)
- cor(df.regression[, c("SWS_z", "travelpeakdur_z")], use = "complete.obs")
- # Fit your full model (the one you want to check)
- # Note: VIF is calculated on the fixed effects structure
- lme_full <- lmer(FG_z ~ SWS_z + travelpeakdur_z + conditions + (1 | id), data = df.regression)
- # Calculate VIF
- vif(lme_full)
- # Compare the two models SWSmax dist
- anova(model_baseline, model_full_SWSmaxdist)
- summary(model_full_SWSmaxdist)
- # assumption checks for this model
- # Check correlation between predictors (excluding the categorical Condition)
- cor(df.regression[, c("SWS_z", "traveldistancemax_z")], use = "complete.obs")
- # Fit your full model (the one you want to check)
- # Note: VIF is calculated on the fixed effects structure
- lme_full <- lmer(FG_z ~ SWS_z + traveldistancemax_z + conditions + (1 | id), data = df.regression)
- # Calculate VIF
- vif(lme_full)
- # Compare the two models SWSclustersize
- anova(model_baseline, model_full_SWSclustersize)
- summary(model_full_SWSclustersize)
- # assumption checks for this model
- # Check correlation between predictors (excluding the categorical Condition)
- cor(df.regression[, c("SWS_z", "clustersize_z")], use = "complete.obs")
- # Fit your full model (the one you want to check)
- # Note: VIF is calculated on the fixed effects structure
- lme_full <- lmer(FG_z ~ SWS_z + clustersize_z + conditions + (1 | id), data = df.regression)
- # Calculate VIF
- vif(lme_full)
- #### end ####
- #### Linear mixed-effects model (LMM) using lme4: Part 2 N2 model ####
- # Model 1: The baseline (Control for N2% and Condition)
- model_baseline <- lmer(FG_z ~ N2_z + conditions + (1 | id), data = df.regression)
- # Model 2: The full model (PCA for travelling features)
- model_full_N2PCA <- lmer(FG_z ~ N2_z + conditions + PC1_AllFeatures + (1 | id), data = df.regression)
- # Compare the two models
- anova(model_baseline, model_full_N2PCA)
- summary(model_full_N2PCA)
- # assumption checks for this model
- plot(model_full_N2PCA) # Look for a random cloud. No "funnel" shape.
- qqnorm(resid(model_full_N2PCA)) # Points should hug the diagonal line.
- qqline(resid(model_full_N2PCA))
- # Quick visual check
- library(ggplot2)
- ggplot(df.regression, aes(x = N2_z, y = FG_z, color = conditions)) +
- # Jitter points to avoid overlap
- geom_point(position = position_jitterdodge(jitter.width = 0.5, dodge.width = 0), size = 2.5, alpha = 0.8) +
- # Add regression lines separately for each condition
- geom_smooth(method = "lm", se = FALSE, linewidth = 1) +
- # Improve aesthetics
- theme_bw() +
- scale_color_manual(values = c("sham" = color_sham, "stim" = color_stim)) +
- labs(x = "Percentage of N2 Sleep", y = "Memory Outcome", color = "Condition")
- # Check correlation between predictors (excluding the categorical Condition)
- cor(df.regression[, c("N2_z", "PC1_AllFeatures")], use = "complete.obs")
- # Fit your full model (the one you want to check)
- # Note: VIF is calculated on the fixed effects structure
- lme_full <- lmer(FG_z ~ N2_z + PC1_AllFeatures + conditions + (1 | id), data = df.regression)
- # Calculate VIF
- vif(lme_full)
- #### end ####
- #### socount LMM model ####
- # Model 1: The baseline (Control for socount% and Condition)
- model_baseline <- lmer(FG_z ~ socount_z + conditions + (1 | id), data = df.regression)
- # Model 2: The full model (PCA for travelling features)
- #model_full_socountpeakdur <- lmer(FG_z ~ socount_z + conditions + travelpeakdur_z + (1 | id), data = df.regression)
- #model_full_socountmaxdist <- lmer(FG_z ~ socount_z + conditions + traveldistancemax_z + (1 | id), data = df.regression)
- #model_full_socountclustersize <- lmer(FG_z ~ socount_z + conditions + clustersize_z + (1 | id), data = df.regression)
- model_full_socountPCA <- lmer(FG_z ~ socount_z + conditions + PC1_AllFeatures + (1 | id), data = df.regression)
- # Compare the two models
- anova(model_baseline, model_full_socountPCA)
- summary(model_full_socountPCA)
- # assumption checks for this model
- plot(model_full_socountPCA) # Look for a random cloud. No "funnel" shape.
- qqnorm(resid(model_full_socountPCA)) # Points should hug the diagonal line.
- qqline(resid(model_full_socountPCA))
- # Quick visual check
- library(ggplot2)
- ggplot(df.regression, aes(x = socount_z, y = FG_z, color = conditions)) +
- # Jitter points to avoid overlap
- geom_point(position = position_jitterdodge(jitter.width = 0.5, dodge.width = 0), size = 2.5, alpha = 0.8) +
- # Add regression lines separately for each condition
- geom_smooth(method = "lm", se = FALSE, linewidth = 1) +
- # Improve aesthetics
- theme_bw() +
- scale_color_manual(values = c("sham" = color_sham, "stim" = color_stim)) +
- labs(x = "Percentage of socount Sleep", y = "Memory Outcome", color = "Condition")
- # Check correlation between predictors (excluding the categorical Condition)
- cor(df.regression[, c("socount_z", "PC1_AllFeatures")], use = "complete.obs")
- # Fit your full model (the one you want to check)
- # Note: VIF is calculated on the fixed effects structure
- lme_full <- lmer(FG_z ~ socount_z + PC1_AllFeatures + conditions + (1 | id), data = df.regression)
- # Calculate VIF
- vif(lme_full)
- #### end ####
- ##### mediation #####
- # create data frame and mutate conditions
- df.mediation <- df.regression %>%
- mutate(
- conditions = ifelse(conditions == "stim", 1, 0)
- )
- # --- Install/load packages ---
- if (!require(glmnet)) install.packages("glmnet")
- if (!require(lavaan)) install.packages("lavaan")
- # initiate libraries
- library(glmnet)
- library(lavaan)
- # Define the model: SWS -> PC1 -> Memory
- model_sws_med <- '
- # Path A: SWS % predicts Features (PC1)
- PC1_AllFeatures ~ a * SWS_z + conditions
- # Path B & C: Features and SWS predict Memory
- # b = effect of PC1 on Memory (controlling for SWS)
- # c_prime = direct effect of SWS on Memory (not via PC1)
- FG_z ~ c_prime * SWS_z + b * PC1_AllFeatures + conditions
- # Indirect Effect: SWS -> PC1 -> Memory
- indirect := a * b
- # Total Effect of SWS on Memory
- total := c_prime + (a * b)
- '
- # Fit the model
- # Cluster by ParticipantID to handle repeated measures
- fit_sws <- sem(model_sws_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
- summary(fit_sws, standardized = TRUE, ci = TRUE)
- # N2 mediation
- # Define the model: N2 -> PC1 -> Memory
- model_N2_med <- '
- # Path A: N2 % predicts Features (PC1)
- PC1_AllFeatures ~ a * N2_z + conditions
- # Path B & C: Features and N2 predict Memory
- # b = effect of PC1 on Memory (controlling for N2)
- # c_prime = direct effect of N2 on Memory (not via PC1)
- FG_z ~ c_prime * N2_z + b * PC1_AllFeatures + conditions
- # Indirect Effect: N2 -> PC1 -> Memory
- indirect := a * b
- # Total Effect of N2 on Memory
- total := c_prime + (a * b)
- '
- # Fit the model
- # Cluster by ParticipantID to handle repeated measures
- fit_N2 <- sem(model_N2_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
- summary(fit_N2, standardized = TRUE, ci = TRUE)
- # so count mediation
- # Define the model: socount -> PC1 -> Memory
- model_socount_med <- '
- # Path A: socount % predicts Features (PC1)
- PC1_AllFeatures ~ a * socount_z + conditions
- # Path B & C: Features and socount predict Memory
- # b = effect of PC1 on Memory (controlling for socount)
- # c_prime = direct effect of socount on Memory (not via PC1)
- FG_z ~ c_prime * socount_z + b * PC1_AllFeatures + conditions
- # Indirect Effect: socount -> PC1 -> Memory
- indirect := a * b
- # Total Effect of socount on Memory
- total := c_prime + (a * b)
- '
- # Fit the model
- # Cluster by ParticipantID to handle repeated measures
- fit_socount <- sem(model_socount_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
- summary(fit_socount, standardized = TRUE, ci = TRUE)
- #### end ####
- #### SWS and individual features mediation ####
- # Define the model: SWS -> peak duration -> Memory
- model_sws_peakdur_med <- '
- # Path A: SWS % predicts Features
- travelpeakdur_z ~ a * SWS_z + conditions
- # Path B & C: Features and SWS predict Memory
- # b = effect of features on Memory (controlling for SWS)
- # c_prime = direct effect of SWS on Memory (not via features)
- FG_z ~ c_prime * SWS_z + b * travelpeakdur_z + conditions
- # Indirect Effect: SWS -> features -> Memory
- indirect := a * b
- # Total Effect of SWS on Memory
- total := c_prime + (a * b)
- '
- # Fit the model
- # Cluster by ParticipantID to handle repeated measures
- fit_sws_peakdur <- sem(model_sws_peakdur_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
- summary(fit_sws_peakdur, standardized = TRUE, ci = TRUE)
- # Define the model: SWS -> distmax -> Memory
- model_sws_distmax_med <- '
- # Path A: SWS % predicts Features
- traveldistancemax_z ~ a * SWS_z + conditions
- # Path B & C: Features and SWS predict Memory
- # b = effect of features on Memory (controlling for SWS)
- # c_prime = direct effect of SWS on Memory (not via features)
- FG_z ~ c_prime * SWS_z + b * traveldistancemax_z + conditions
- # Indirect Effect: SWS -> features -> Memory
- indirect := a * b
- # Total Effect of SWS on Memory
- total := c_prime + (a * b)
- '
- # Fit the model
- # Cluster by ParticipantID to handle repeated measures
- fit_sws_distmax <- sem(model_sws_distmax_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
- summary(fit_sws_distmax, standardized = TRUE, ci = TRUE)
- # Define the model: SWS -> clustersize -> Memory
- model_sws_clustersize_med <- '
- # Path A: SWS % predicts Features
- clustersize_z ~ a * SWS_z + conditions
- # Path B & C: Features and SWS predict Memory
- # b = effect of features on Memory (controlling for SWS)
- # c_prime = direct effect of SWS on Memory
- FG_z ~ c_prime * SWS_z + b * clustersize_z + conditions
- # Indirect Effect: SWS -> features -> Memory
- indirect := a * b
- # Total Effect of SWS on Memory
- total := c_prime + (a * b)
- '
- # Fit the model
- # Cluster by ParticipantID to handle repeated measures
- fit_sws_clustersize <- sem(model_sws_clustersize_med, data = df.mediation, cluster = "id", se = "bootstrap", bootstrap = 5000)
- summary(fit_sws_clustersize, standardized = TRUE, ci = TRUE)
- #### end ####
ana25_correlations_behaviour_PCA_LMM_mediation.R, no license · at the source
Overview
- Institute of Psychology, Neuropsychology, University of Freiburg, Freiburg im Breisgau, Germany
- BrainLinks-BrainTools, University of Freiburg, Freiburg im Breisgau, Germany
- Institute of Medical Psychology and Behavioral Neurobiology, University of Tübingen, Tübingen, Germany
- Bernstein Center Freiburg, University of Freiburg, Freiburg im Breisgau, Germany
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
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
67 files
- analysis/
SchlafEin.m , MATLAB, 1,259 lines - analysis/
ana03_artefact.m , MATLAB, 78 lines - analysis/
ana04_timefreq_analysis. , MATLAB, 44 linesm - analysis/
ana05_timefrequency_cond , MATLAB, 202 linesitions.m - analysis/
ana06_timefrequency_stat , MATLAB, 96 linesistics.m - analysis/
ana07_timefrequency_plot , MATLAB, 198 linesting.m - analysis/
ana08_frequency_conditio , MATLAB, 295 linesns.m - analysis/
ana09_frequency_statisti , MATLAB, 94 lines, 1 matchcs.m - analysis/
ana10_sleep_architecture , MATLAB, 231 lines, 1 match.m - analysis/
ana10_sleep_architecture , R, 248 lines_stats.R - analysis/
ana11_spindle_SO_detecti , MATLAB, 307 lines, 1 matchon.m - analysis/
ana12_spindle_SO_conditi , MATLAB, 104 lineson.m - analysis/
ana13_spindle_SO_count.m , MATLAB, 278 lines - analysis/
ana13_spindle_SO_count_s , R, 190 linestats.R - analysis/
ana14_clusterSOs.m , MATLAB, 100 lines - analysis/
ana15_travelSOs.m , MATLAB, 300 lines, 1 match - analysis/
ana15_travelSOs_plotting , MATLAB, 481 linesexample.m - analysis/
ana16_TSW_analysis.m , MATLAB, 474 lines - analysis/
ana16_TSW_analysis_stats , R, 125 lines.R - analysis/
ana16_TSW_analysis_stats , R, 134 lines, 1 match_SWS.R - analysis/
ana17_TSW_electrodes.m , MATLAB, 608 lines, 1 match - analysis/
ana18_spindle_frequency. , MATLAB, 308 lines, 2 matchesm - analysis/
ana19_spindle_frequency_ , MATLAB, 125 linesmean.m - analysis/
ana20_spindle_features.m , MATLAB, 125 lines - analysis/
ana20_spindle_features_s , R, 118 linestats.R - analysis/
ana21_ERP_analysis.m , MATLAB, 244 lines - analysis/
ana22_ERP_stats.m , MATLAB, 758 lines, 1 match - analysis/
ana23_behavioural_readin , MATLAB, 348 lines, 1 match.m - analysis/
ana24_behavioural_mean.m , MATLAB, 340 lines, 1 match - analysis/
ana25_correlations_behav , R, 1,327 lines, 3 matchesiour_PCA_LMM_mediation.R - analysis/
ana26_behaviouralbykcomp , MATLAB, 135 lineslex.m - analysis/
ana26_behaviouralbykcomp , R, 215 lineslex_stats.R - analysis/
ana27_hearingthreshold_c , MATLAB, 108 lines, 2 matchesalculation.m - analysis/
ana28_triggertiming.m , MATLAB, 44 lines - analysis/
append_participants_deri , MATLAB, 74 linesvatives_fieldtrip.m - analysis/
artifact_rejection.m , MATLAB, 278 lines - analysis/
average_reference.m , MATLAB, 7 lines - analysis/
cluster_SOs.m , MATLAB, 87 lines - analysis/
config_artreject_trial.m , MATLAB, 9 lines - analysis/
config_file_paths.m , MATLAB, 41 lines - analysis/
coupling_analysis/ , MATLAB, 102 linesaverage_across_channels. m - analysis/
coupling_analysis/ , MATLAB, 176 lines, 1 matchprep1.m - analysis/
coupling_analysis/ , MATLAB, 216 linesprep2.m - analysis/
coupling_analysis/ , MATLAB, 56 linesstatistics_v2.m - analysis/
coupling_analysis/ , MATLAB, 121 linesstatistics_v3.m - analysis/
coupling_analysis/ , MATLAB, 421 lines, 1 matchstatistics_v4.m - analysis/
detectSOs.m , MATLAB, 203 lines - analysis/
detectSpindles.m , MATLAB, 160 lines, 1 match - analysis/
gather_EOG_artifacts.m , MATLAB, 47 lines - analysis/
gather_jump_artifacts.m , MATLAB, 27 lines - analysis/
gather_muscle_artifacts. , MATLAB, 28 linesm - analysis/
get_layout.m , MATLAB, 46 lines - analysis/
get_neighbour_structure. , MATLAB, 111 linesm - analysis/
get_stage_data.m , MATLAB, 12 lines - analysis/
inspect_current_stage.m , MATLAB, 22 lines - analysis/
interpolate.m , MATLAB, 37 lines - analysis/
interpolate_and_rerefere , MATLAB, 105 linesnce.m - analysis/
interpolate_and_rerefere , MATLAB, 131 linesnce_mastoid.m - analysis/
plot_interpolation.m , MATLAB, 26 lines - analysis/
plot_timefrequency.m , MATLAB, 61 lines - analysis/
raincloudplots.m , MATLAB, 164 lines - analysis/
rawdata_2_bids.m , MATLAB, 107 lines - analysis/
signal_processing.m , MATLAB, 218 lines, 1 match - analysis/
trialbased_frequencyanal , MATLAB, 188 linesysis_whole.m - analysis/
trialbased_timefrequency , MATLAB, 70 linesanalysis.m - analysis/
trialfun_5sec_trials.m , MATLAB, 41 lines - analysis/
trialfun_nap.m , MATLAB, 14 lines
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://
Transcribed behavioral data reported in this paper have been deposited at the Open Science Framework: https://
All original code has been deposited at the Open Science Framework: https://
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://
BibTeX
@article{rouast2026rando
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/
url = {https://
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/
VL - 29
IS - 7
SP - 116601
SN - 2589-0042
PB - Elsevier
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"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":
"volume": "29",
"issue": "7",
"page": "116601",
"DOI": "10.1016/
"PMID": "42491684",
"PMCID": "PMC13378391",
"ISSN": "2589-0042",
"publisher": "Elsevier",
"URL": "https://
"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 biologyIn 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 reportsIn 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 biologyIn 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 navigationJournal: n/aIn 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: eNeuroIn 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: NeuroImageIn 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 communicationsIn 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 evaluationJournal: 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 communicationsIn 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 biologyIn 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 67 scripts, and 20 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:0783eecbe0f3c0ed…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[.
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.
