The longitudinal development of intrinsic timescales in infancy and their relation to alpha brain rhythm.
The 9 matches · 2 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
- [1] § Materials and methods › Analysis › Relationship between intrinsic timescales and properties of alpha activity ↔ 5_Tau_Correlations_AlphaProperties.R, lines 40–128 · score 0.72 · alpha band, alpha properties, oscillatory power, peak frequency, R2, fit
- [2] § Materials and methods › Analysis › Longitudinal analysis ↔ 4_Tau_Development_LMMAnalysis.R, lines 71–128 · score 0.70 · random slope, random intercept, lme4, LMM, Squared, covariates
- [3] § Materials and methods › Electroencephalography parameters › Intrinsic timescales ↔ tau_estimate.py, lines 167–234 · score 0.67 · exponential fit models, autocorrelation decays, optimization, curves, lag, timescale
- [4] § Materials and methods › Analysis › Relationship between intrinsic timescales and properties of alpha activity ↔ AdditionalScripts/SAF_ModelFit_OscillatoryPowerSpectrum.R, the whole file · a weak match · score 0.61 · power spectrum, oscillatory power, peak frequency, fit, band, models
- [5] § Materials and methods › Electroencephalography parameters › Alpha-band oscillatory parameters and rhythmicity ↔ AdditionalScripts/SAF_ModelFit_OscillatoryPowerSpectrum.R, the whole file · a weak match · score 0.61 · oscillatory power, power spectrum, peak frequency, absolute, band, exploratory
- [6] § Materials and methods › Electroencephalography parameters › Intrinsic timescales ↔ tau_estimate.py, lines 167–234 · score 0.60 · exponential fit, curve fit, optimize, decay, autocorrelation, epoch
- [7] § Results › Early development of the intrinsic timescales ↔ 4_Tau_Development_LMMAnalysis.R, lines 71–128 · score 0.55 · random intercept, best model, slope, LMM, Squared, exploratory
- [8] § Materials and methods › Electroencephalography parameters › Alpha-band oscillatory parameters and rhythmicity ↔ 5_Tau_Correlations_AlphaProperties.R, lines 395–436 · score 0.54 · Lagged coherence, alpha band, metric, burst, properties
- [9] § Materials and methods › Electroencephalography parameters › Alpha-band oscillatory parameters and rhythmicity ↔ 5_Tau_Correlations_AlphaProperties.R, lines 40–128 · score 0.51 · alpha band, oscillatory power, R2, fit, peak, models
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 · 684 lines · 30 KB · MIT · 3 matches
- # ITS Tau correlation with the oscillatory and rhythmic alpha variables ---------------------------
- ## Load the required packages -------------------------------------------------
- required_packages <- c(
- "tidyverse", # Load this first because it includes ggplot2 and dplyr
- "ggpubr",
- "psych",
- "reshape2",
- "flextable",
- "rempsyc",
- "ppcor",
- "boot")
- new_packages <- required_packages[!required_packages %in% installed.packages()[,"Package"]]
- if (length(new_packages) > 0) {
- install.packages(new_packages)
- }
- sapply(required_packages, library, character.only = TRUE)
- ## Functions and plot settings ------------------------------------------------
- ## Plot themes -----------------
- settheme = theme(strip.text.x = element_text(size = 9.5, face = "bold"), strip.text.y = element_text(size = 9.5, face = "bold")) +
- theme(axis.text.x = element_text(size = 10), axis.text.y = element_text(size = 10), title = element_text(size = 10), axis.title.x = element_text(size = 10, face = "bold"), axis.title.y = element_text(size = 10, face = "bold"))
- ## Partial correlation function for bootstrapping-----------------------
- partial_corr <- function(data, indices) {
- cormat <- data[indices, ] # Resample with replacement
- pcor_results <- ppcor::pcor.test(cormat$tau, cormat$voi, cormat[c("pernan", "rsq")], method = "spearman") # alpha oscillatory power also controls for R2
- return(pcor_results$estimate)}
- partial_corr_lag <- function(data, indices) {
- cormat <- data[indices, ] # Resample with replacement
- pcor_results <- ppcor::pcor.test(cormat$tau, cormat$voi, cormat[c("pernan")], method = "spearman")
- return(pcor_results$estimate)}
- #set seed for reproducibility
- set.seed(42)
- ## Load the data ---------------------------------------------------------------
- ## Data parameters -------------------------------------------------------------
- cohorts = c('exploratory', 'validation')
- # Where do you want to save the results?
- tablepath = "~/Library/CloudStorage/OneDrive-Personal/Documentos/Papers_msi/Thesis/Shared_Code_and_Data/"
- ## Tau data load, preparation, and analysis ------------------------------------
- for (cohort in cohorts) {
- if (cohort == "exploratory") {
- taudata <- read_csv("Desktop/Tau_data/tau_development_exploratory_v4.csv")%>%
- rename(sex = Gender, area = Area, channel_number = channel, channel = Label)
- } else {
- taudata <- read_csv("Desktop/Tau_data/tau_development_validation_v4.csv")%>%
- rename(sex = Gender, area = Area, channel_number = channel, channel = Label)}
- # Exclude 9999 events (social/high movement) and the epochs with low convergence
- taudata_space <- taudata%>%filter(pernan < .25, event != 9999)%>%
- group_by(subject, sex, ses_age, channel, area)%>% # Average the remaining epochs
- summarise(tau = mean(tauimp, na.rm = T),
- pernan = mean(is.na(tauorg), na.rm = T))%>%filter(pernan < .25)
- taudata_space <- dplyr::select(taudata_space, subject, sex, ses_age, channel, area, tau, pernan) #select only the relevant variables
- taudata <- taudata%>%filter(pernan < .25, event != 9999)%>% # Create a dataset with one value per electrode and area
- mutate(trials = mean(n()) / length(unique(channel)), .by = c(subject, ses_age))%>%
- group_by(subject, sex, ses_age, channel, area)%>%
- summarise(tau = mean(tauimp, na.rm = T),
- trials = mean(trials, na.rm = T),
- pernan = mean(pernan, na.rm = T))
- colnames(taudata) <- c("suj", "sex", "sesage", "elect", "area", "tau","trials", "pernan")
- colnames(taudata_space) <- c("suj", "sex", "sesage", "elect", "area", "tau","pernan")
- ## 1) Oscillatory alpha activity ----------------------------------------------
- ### Load the oscillatory alpha activity data --------------------------------
- pow <- read_csv("~/Library/CloudStorage/OneDrive-Personal/Documentos/Papers_msi/Thesis/Shared_Code_and_Data/pow_20Hz_6m_16m_ITS.csv")
- pow <- filter(pow, band == "Alpha" & rsquared > .949) # Select only the alpha band and the epochs with good R2
- fit_descriptives <- pow%>%filter(incluelect == 1, !is.na(trials), develop_f == 1, suj %in% taudata$suj)%>%
- group_by(sesage)%>%
- summarise(mtrials = mean(trials, na.rm = T),
- sdtrials = sd(trials, na.rm = T),
- mrsquared = mean(rsquared, na.rm = T),
- sdrsquared = sd(rsquared, na.rm = T))
- pow <- pow%>%dplyr::select(suj, sex, sesage, elect, area, oscpow, abspow, relpow, slope, offset, rsquared, peak, freq)%>%
- group_by(suj, sex, sesage, elect, area)%>%
- summarise(osc = mean(oscpow, na.rm= TRUE),
- peak = mean(peak, na.rm = TRUE),
- freq = mean(freq, na.rm = TRUE),
- rsq = mean(rsquared, na.rm = T))
- descriptives <- pow%>%filter(suj %in% taudata$suj) # model fit, power, and peak frequency descriptives
- descriptives <- dplyr::select(descriptives, suj, sex, sesage, area, osc, peak, freq, rsq)%>%
- group_by(suj, sex, sesage, area)%>%
- summarise(osc = mean(osc, na.rm = T),
- freq= mean(freq[peak==1], na.rm = T),
- rsq = mean(rsq, na.rm = T))
- descriptives <- melt(descriptives, id.vars = c("suj", "sex", "sesage", "area"))%>% # parse the descriptives to more standardized name
- group_by(sesage, sex, variable, area)%>%
- summarise(m = mean(as.double(value), na.rm = T),
- sd =sd(value,na.rm = T))
- descriptives$m <- round(descriptives$m, 2) # round descriptives to the second decimal point
- descriptives$sd <- round(descriptives$sd, 2)
- descriptives$stat <- paste(descriptives$m, " (", descriptives$sd, ")", sep ="") # create a statistic column with the mean and sd as m (sd)
- descriptives <- descriptives%>%dplyr::select(-m,-sd) # remove the mean and sd columns
- desctable <- dcast(descriptives, variable + sesage + sex ~ area) # reshape the descriptive table
- desctable <- nice_table(desctable, separate.header = F) # Formated table
- path2table = paste(tablepath, "oscpow_descriptives_", cohort, ".docx", sep="")
- save_as_docx(desctable,path = path2table) # save the table
- pow <- melt(pow, id.vars = c("suj", "sex", "sesage", "elect", "area", "peak"))
- varnames <- as.vector(unique(pow$variable))[1:2] # frequency and oscillatory power
- ses <- c(6,9,16)
- ### Within-participant correlations between alpha oscillatory activity and tau --------------------
- session = NA
- variable = NA
- rs = NA
- n = NA
- ci_min = NA
- ci_max = NA
- pval = NA
- sesidx = 0
- loopidx = 1
- for (age in ses){
- sesidx = sesidx + 1
- varidx = 0
- data1 <- taudata%>%filter(sesage == age)%>% # prepare tau data filtering only the relevant age
- group_by(suj, sex)%>%summarise(tau = mean(tau, na.rm = TRUE),
- trials = mean(trials, na.rm = TRUE),
- pernan = mean(trials, na.rm = TRUE))
- for (items in varnames) {
- varidx = varidx + 1
- if (varnames[varidx] != "freq"){ # we divide into frequency and oscillatory because frequency can only be computed in electrodes that had an oscillatory peak (i.e., peak == 1)
- data2 <- pow%>%filter(sesage == ses[sesidx] & (variable == varnames[varidx] | variable == "rsq"))%>% # select the variable of interest and the rsq
- group_by(suj, variable)%>%summarise(M = mean(value, na.rm = T))%>%dcast(suj ~ variable)
- colnames(data2) <- c("suj", "voi", "rsq") # rename the variable of interest to "voi" so it matches the general function below
- } else {
- data2 <- pow%>%filter(sesage == ses[sesidx] & (variable == varnames[varidx] | variable == "rsq") & peak == 1)%>%
- group_by(suj, variable)%>%summarise(M = mean(value, na.rm = T))%>%dcast(suj ~ variable)
- colnames(data2) <- c("suj", "voi", "rsq")
- }
- cormat <-merge(data1,data2, by = "suj") #merge tau and oscpow with tau data
- cor_results <- pcor.test(cormat$tau, cormat$voi, cormat[c("pernan", "rsq")], method = "spearman") #partial correlation controlling for rsq and percentage of nan electrodes
- boot_results <- boot(cormat, partial_corr, R = 5000) # bootstrap the partial correlation to create the confidence intervals
- ci <- boot.ci(boot_results, type = "perc") # save the CI
- #store the results
- session[loopidx] = age
- variable[loopidx] = items
- rs[loopidx] = cor_results$estimate
- n[loopidx] = cor_results$n
- ci_min[loopidx] = ci$percent[4]
- ci_max[loopidx] = ci$percent[5]
- pval[loopidx] = cor_results$p
- loopidx = loopidx + 1
- }
- }
- session <- c(session)
- variable <- c(variable)
- rs <- c(rs)
- n <- c(n)
- ci_min <- c(ci_min)
- ci_max <- c(ci_max)
- pval <- c(pval)
- pval <- p.adjust(pval, method = "fdr") # correct with FDR
- results_correlation <- data.frame(n, session, variable, rs, pval, ci_min, ci_max, stringsAsFactors = TRUE) # create data frame with the results
- results_correlation$significance[results_correlation$pval < .001] <- "***" # significance levels after FDR
- results_correlation$significance[results_correlation$pval < .01 & results_correlation$pval > .001] <- "**"
- results_correlation$significance[results_correlation$pval < .05 & results_correlation$pval > .01] <- "*"
- results_correlation$significance[results_correlation$pval < .1 & results_correlation$pval > .05] <- ""
- results_correlation$significance[results_correlation$pval > .1] <- ""
- results_correlation$session[results_correlation$session==6] <- "6-mo." #rename the ages
- results_correlation$session[results_correlation$session==9] <- "9-mo."
- results_correlation$session[results_correlation$session==16] <- "16-mo."
- results_correlation$session <- factor(results_correlation$session, levels = c("6-mo.", "9-mo.", "16-mo.")) #reorder the ages
- results_table <- dplyr::select(results_correlation, c("session", "n", "variable", "rs", "ci_min", "ci_max", "significance")) #select significant variables
- results_table$rs <- round(results_table$rs, 2) #round parameters
- results_table$ci_min <- round(results_table$ci_min,2)
- results_table$ci_max <- round(results_table$ci_max,2)
- results_table$stats <- paste(results_table$rs, results_table$significance, " [", results_table$ci_min, " - ", results_table$ci_max, "]", sep ="") #create a single correlation value as r-significance [ci]
- results_table <- dplyr::select(results_table, c("session", "variable", "n", "stats")) # Keep only the relevant columns
- results_table <- dcast(results_table, session + n ~ variable, value.var = "stats") #format the table
- path2table = paste(tablepath, "tau_correlation_powvars_", cohort, ".docx", sep ="")
- save_as_docx(nice_table(results_table),path = path2table) #save a formated table as docx
- #### Within-participant correlation plots --------------------------------------
- powplot <- pow%>% filter(variable != 'rsq')%>%
- group_by(suj, sesage)%>%
- summarise(freq = mean(value[variable == "freq" & peak == 1], na.rm = TRUE),
- osc = mean(value[variable == "osc"], na.rm = TRUE))
- powplot <- melt(powplot, id.vars = c("suj", "sesage")) # reshape to long format
- tauplot <- taudata%>% # prepare tau data filtering only the relevant age
- group_by(suj, sesage)%>%summarise(tau = mean(tau, na.rm = TRUE),
- trials = mean(trials, na.rm = TRUE),
- pernan = mean(trials, na.rm = TRUE))
- plotdataset <- merge(powplot, tauplot, by = c("suj", "sesage"))
- plotdataset$sesage[plotdataset$sesage == 6] <- "6-mo."
- plotdataset$sesage[plotdataset$sesage == 9] <- "9-mo."
- plotdataset$sesage[plotdataset$sesage == 16] <- "16-mo."
- path2plot <- paste(tablepath, "individualcor_its_osc_", cohort, ".svg", sep ="")
- plot_osc = ggplot(filter(plotdataset, variable == "osc"), aes(y=tau, x=value)) +
- geom_smooth(method = "lm", se = T, color = "black", alpha = .30, fill = "grey75") + ggpubr::theme_pubr() +
- geom_point(aes(color = "lightpink")) +
- facet_grid(.~factor(sesage, levels = c("6-mo.", "9-mo.", "16-mo.")), scales = "free") +
- theme(legend.position = "none") +
- settheme +
- xlab("Oscillatory Power") +
- ylab("Tau (s)")
- plot_freq = ggplot(filter(plotdataset, variable == "freq"), aes(y=tau, x=value)) +
- geom_smooth(method = "lm", se = T, color = "black", alpha = .30, fill = "grey75") + ggpubr::theme_pubr() +
- geom_point(aes(color = "lightpink")) +
- facet_grid(.~factor(sesage, levels = c("6-mo.", "9-mo.", "16-mo.")), scales = "free") +
- theme(legend.position = "none") +
- settheme +
- xlab("Peak Frequency (Hz)") +
- ylab("Tau (s)")
- ggpubr::ggarrange(plot_osc, plot_freq, nrow = 2)
- ggsave(path2plot, width = 14.2, height = 11, units = "cm")
- ### Space correlations between alpha oscillatory actiivty and tau --------------
- varnames <- as.vector(unique(pow$variable))[1:2]
- ses <- c(6,9,16)
- session = NA
- variable = NA
- rs = NA
- n = NA
- ci_min = NA
- ci_max = NA
- pval = NA
- loopidx = 1
- for (sesi in ses){
- data1 <- taudata_space%>%filter(sesage == sesi)%>% #Now we reorder by electrode
- group_by(elect)%>%summarise(tau = mean(tau, na.rm = TRUE),
- pernan = mean(pernan, na.rm = TRUE))
- for (vari in varnames) {
- varidx = varidx + 1
- if (vari != "freq"){
- data2 <- pow%>%filter(sesage == sesi & (variable == vari | variable == "rsq"))%>%
- group_by(elect, variable)%>%summarise(M = mean(value, na.rm = T))%>%dcast(elect ~ variable)
- colnames(data2) <- c("elect", "voi", "rsq")
- } else {
- data2 <- pow%>%filter(sesage == sesi & (variable == vari | variable == "rsq") & peak == 1)%>%
- group_by(elect, variable)%>%summarise(M = mean(value, na.rm = T))%>%dcast(elect ~ variable)
- colnames(data2) <- c("elect", "voi", "rsq")
- }
- cormat <-merge(data1,data2, by = "elect")
- cor_results <- pcor.test(cormat$tau, cormat$voi, cormat[c("pernan", "rsq")], method = "spearman")
- boot_results <- boot(cormat, partial_corr, R = 5000)
- ci <- boot.ci(boot_results, type = "perc")
- session[loopidx] = sesi
- variable[loopidx] = vari
- rs[loopidx] = cor_results$estimate
- n[loopidx] = cor_results$n
- ci_min[loopidx] = ci$percent[4]
- ci_max[loopidx] = ci$percent[5]
- pval[loopidx] = cor_results$p
- loopidx = loopidx + 1
- }
- }
- session <- c(session)
- varaible <- c(variable)
- rs <- c(rs)
- n <- c(n)
- ci_min <- c(ci_min)
- ci_max <- c(ci_max)
- pval <- c(pval)
- pval <- p.adjust(pval, method = "fdr")
- results_correlation <- data.frame(n, session, variable, rs, pval, ci_min, ci_max, stringsAsFactors = TRUE)
- results_correlation$significance[results_correlation$pval < .001] <- "***"
- results_correlation$significance[results_correlation$pval < .01 & results_correlation$pval > .001] <- "**"
- results_correlation$significance[results_correlation$pval < .05 & results_correlation$pval > .01] <- "*"
- results_correlation$significance[results_correlation$pval < .1 & results_correlation$pval > .05] <- ""
- results_correlation$significance[results_correlation$pval > .1] <- ""
- results_correlation$session[results_correlation$session==6] <- "6-mo."
- results_correlation$session[results_correlation$session==9] <- "9-mo."
- results_correlation$session[results_correlation$session==16] <- "16-mo."
- results_correlation$session <- factor(results_correlation$session, levels = c("6-mo.", "9-mo.", "16-mo."))
- results_table <- dplyr::select(results_correlation, c("session", "n", "variable", "rs", "ci_min", "ci_max", "significance"))
- results_table$rs <- round(results_table$rs, 2)
- results_table$ci_min <- round(results_table$ci_min,2)
- results_table$ci_max <- round(results_table$ci_max,2)
- results_table$stats <- paste(results_table$rs, results_table$significance, " [", results_table$ci_min, " - ", results_table$ci_max, "]", sep ="")
- results_table <- dplyr::select(results_table, c("session", "variable", "n", "stats"))
- results_table <- dcast(results_table, session + n ~ variable, value.var = "stats")
- path2table = paste(tablepath, "tau_correlation_powvars_space_", cohort, ".docx", sep ="")
- save_as_docx(nice_table(results_table),path = path2table)
- #### Space correlation plots --------------------------------------------------
- powplot <- pow%>% filter(variable != 'rsq')%>%
- group_by(sesage, elect, area)%>%
- summarise(freq = mean(value[variable == "freq" & peak == 1], na.rm = TRUE),
- osc = mean(value[variable == "osc"], na.rm = TRUE))
- powplot <- melt(powplot, id.vars = c("sesage", "elect", "area")) # reshape to long format
- tauplot <- taudata_space%>%
- group_by(sesage, elect, area)%>%summarise(tau = mean(tau, na.rm = TRUE))
- plotdataset <- merge(powplot, tauplot, by = c("sesage", "elect", "area"))
- plotdataset$sesage[plotdataset$sesage == 6] <- "6-mo."
- plotdataset$sesage[plotdataset$sesage == 9] <- "9-mo."
- plotdataset$sesage[plotdataset$sesage == 16] <- "16-mo."
- plotdataset$sesage <- factor(plotdataset$sesage, levels = c("6-mo.", "9-mo.", "16-mo."))
- path2plot <- paste(tablepath, "spatial_stability_its_osc_", cohort, ".svg", sep ="")
- plot_osc = ggplot(filter(plotdataset, variable == "osc"), aes(y=tau, x=value)) + geom_point(aes(color = area)) +
- geom_smooth(method = "lm", color = "black", se = T, alpha = .30, fill = "grey75") +
- scale_color_manual(values =c("#C4961A","#D16103", "#C3D7A4", "#52854C", "#4E84C4", "#293352")) +
- theme_pubr() + facet_grid(.~factor(sesage, levels = c("6-mo.", "9-mo.", "16-mo.")), scales = "free") +
- settheme +
- labs(x = "Oscillatory Power",
- y = "Tau (s)",
- color = "Area")
- plot_freq = ggplot(filter(plotdataset, variable == "freq"), aes(y=tau, x=value)) + geom_point(aes(color = area)) +
- geom_smooth(method = "lm", color = "black", se = T, alpha = .30, fill = "grey75") +
- scale_color_manual(values =c("#C4961A","#D16103", "#C3D7A4", "#52854C", "#4E84C4", "#293352")) +
- theme_pubr() + facet_grid(.~factor(sesage, levels = c("6-mo.", "9-mo.", "16-mo.")), scales = "free") +
- settheme +
- labs(x = "Frequency (Hz)",
- y = "Tau (s)",
- color = "Area")
- ggarrange(plot_osc, plot_freq, nrow = 2, common.legend = T, legend = "bottom")
- ggsave(path2plot, width = 16, height = 12, units = "cm")
- ## 2) Lagged coherence correlations --------------------------------------------
- #Load the raw lagged coherence data and compute the metrics of interest
- #pow <- read_csv("~/Library/CloudStorage/OneDrive-Personal/Documentos/Papers_msi/Thesis/Shared_Code_and_Data/pow_burst_rythm_6m_36m_ITS.csv") #Load the lagged coherence data
- #pow <- filter(pow, band == "Alpha") # We keep only the alpha band
- #pow <- pow%>%dplyr::select(suj, sex, sesage, elect, incluelect, area, lag, lag_pow)%>% # Relevant variables
- #group_by(suj, sex, sesage, elect, area)%>%
- #summarise(rhythmlag = mean(lag_pow[lag>2.5&lag<3.5], na.rm= TRUE), # Burst lags
- #burstlag = mean(lag_pow[lag<2.5], na.rm = TRUE)) # Rhythm lags
- ### Save for future use
- #write.csv(pow, "~/Library/CloudStorage/OneDrive-Personal/Documentos/Papers_msi/Thesis/Shared_Code_and_Data/lagged_coherence_alpha_6_16m_metrics.csv", row.names = F)
- # Load the dataset with the lagged coherence data
- pow <- read_csv("~/Library/CloudStorage/OneDrive-Personal/Documentos/Papers_msi/Thesis/Shared_Code_and_Data/lagged_coherence_alpha_6_16m_metrics.csv")
- descriptives <- pow%>%filter(suj %in% taudata$suj)
- descriptives <- melt(descriptives, id.vars = c("suj", "sex", "sesage", "elect", "area"))%>% #Descriptive table
- group_by(sesage, sex, variable, area)%>%
- summarise(m = mean(as.double(value), na.rm = T),
- sd =sd(value,na.rm = T))
- descriptives$m <- round(descriptives$m, 2)
- descriptives$sd <- round(descriptives$sd, 2)
- descriptives$stat <- paste(descriptives$m, " (", descriptives$sd, ")", sep ="")
- descriptives <- descriptives%>%dplyr::select(-m,-sd)
- desctable <- dcast(descriptives, variable + sesage + sex ~ area)
- desctable <- nice_table(desctable, separate.header = F)
- path2table = paste(tablepath, "lagcoh_descriptives_", cohort, ".docx", sep="")
- save_as_docx(desctable,path = path2table)
- pow <- melt(pow, id.vars = c("suj", "sex", "sesage", "elect", "area"))
- varnames <- as.vector(unique(pow$variable))
- ses <- c(6,9,16)
- #### Within-subject correlations between lagged coherence and tau -------------
- session = NA
- variable = NA
- rs = NA
- n = NA
- ci_min = NA
- ci_max = NA
- pval = NA
- loopidx = 1
- for (sesi in ses){
- data1 <- taudata%>%filter(sesage == sesi)%>%
- group_by(suj)%>%summarise(tau = mean(tau, na.rm = TRUE),
- pernan = mean(pernan, na.rm = TRUE))
- for (vari in varnames) {
- if (vari != "freq"){
- data2 <- pow%>%filter(sesage == sesi & variable == vari)%>%
- group_by(suj)%>%summarise(voi = mean(value, na.rm = TRUE))}
- else {
- data2 <- filter(pow, peak == 1)
- data2 <- data2%>%filter(sesage == sesi & variable == vari)%>%
- group_by(suj)%>%summarise(voi = mean(value, na.rm = TRUE))
- }
- cormat <-merge(data1,data2, by = "suj")
- cor_results <- pcor.test(cormat$tau, cormat$voi, cormat[c("pernan")], method = "spearman")
- boot_results <- boot(cormat, partial_corr_lag, R = 5000) # Different correlation function because we cannot control for R2
- ci <- boot.ci(boot_results, type = "perc")
- session[loopidx] = sesi
- variable[loopidx] = vari
- rs[loopidx] = cor_results$estimate
- n[loopidx] = cor_results$n
- ci_min[loopidx] = ci$percent[4]
- ci_max[loopidx] = ci$percent[5]
- pval[loopidx] = cor_results$p
- loopidx = loopidx + 1
- }
- }
- session <- c(session)
- varaible <- c(variable)
- rs <- c(rs)
- n <- c(n)
- ci_min <- c(ci_min)
- ci_max <- c(ci_max)
- pval <- c(pval)
- pval <- p.adjust(pval, method = "fdr")
- results_correlation <- data.frame(n, session, variable, rs, pval, ci_min, ci_max, stringsAsFactors = TRUE)
- results_correlation$significance[results_correlation$pval < .001] <- "***"
- results_correlation$significance[results_correlation$pval < .01 & results_correlation$pval > .001] <- "**"
- results_correlation$significance[results_correlation$pval < .05 & results_correlation$pval > .01] <- "*"
- results_correlation$significance[results_correlation$pval < .1 & results_correlation$pval > .05] <- ""
- results_correlation$significance[results_correlation$pval > .1] <- ""
- results_correlation$session[results_correlation$session==6] <- "6-mo."
- results_correlation$session[results_correlation$session==9] <- "9-mo."
- results_correlation$session[results_correlation$session==16] <- "16-mo."
- results_correlation$session <- factor(results_correlation$session, levels = c("6-mo.", "9-mo.", "16-mo."))
- results_table <- dplyr::select(results_correlation, c("session", "n", "variable", "rs", "ci_min", "ci_max", "significance"))
- results_table$rs <- round(results_table$rs, 2)
- results_table$ci_min <- round(results_table$ci_min,2)
- results_table$ci_max <- round(results_table$ci_max,2)
- results_table$stats <- paste(results_table$rs, results_table$significance, " [", results_table$ci_min, " - ", results_table$ci_max, "]", sep ="")
- results_table <- dplyr::select(results_table, c("session", "variable", "n", "stats"))
- results_table <- dcast(results_table, session + n ~ variable, value.var = "stats")
- path2table = paste(tablepath, "tau_correlation_brythm_", cohort, ".docx", sep ="")
- save_as_docx(nice_table(results_table),path = path2table)
- #### Within participants correlation plots ------------------------------------
- powplot <- pow%>%group_by(suj, sesage, variable)%>%
- summarise(value = mean(value, na.rm = TRUE))
- tauplot <- taudata%>% # prepare tau data filtering only the relevant age
- group_by(suj, sesage)%>%summarise(tau = mean(tau, na.rm = TRUE))
- plotdataset <- merge(powplot, tauplot, by = c("suj", "sesage"))
- plotdataset <- filter(plotdataset, variable == "rhythmlag" | variable == "burstlag")
- plotdataset$sesage[plotdataset$sesage == 6] <- "6-mo."
- plotdataset$sesage[plotdataset$sesage == 9] <- "9-mo."
- plotdataset$sesage[plotdataset$sesage == 16] <- "16-mo."
- plotdataset$sesage <- factor(plotdataset$sesage, levels = c("6-mo.", "9-mo.", "16-mo."))
- path2plot <- paste(tablepath, "individualcor_its_lcoh_", cohort, ".svg", sep ="")
- plot_osc = ggplot(filter(plotdataset, variable == "burstlag"), aes(y=tau, x=value)) +
- geom_smooth(method = "lm", se = T, color = "black", alpha = .30, fill = "grey75") + ggpubr::theme_pubr() +
- geom_point(aes(color = "lightpink")) +
- facet_grid(.~factor(sesage, levels = c("6-mo.", "9-mo.", "16-mo.")), scales = "free") +
- theme(legend.position = "none") +
- settheme +
- xlab("Lagged Coh. Burst") +
- ylab("Tau (s)")
- plot_freq = ggplot(filter(plotdataset, variable == "rhythmlag"), aes(y=tau, x=value)) +
- geom_smooth(method = "lm", se = T, color = "black", alpha = .30, fill = "grey75") + ggpubr::theme_pubr() +
- geom_point(aes(color = "lightpink")) +
- facet_grid(.~factor(sesage, levels = c("6-mo.", "9-mo.", "16-mo.")), scales = "free") +
- theme(legend.position = "none") +
- settheme +
- xlab("Lagged Coh. Rhythm") +
- ylab("Tau (s)")
- ggpubr::ggarrange(plot_osc, plot_freq, nrow = 2)
- ggsave(path2plot, width = 14.2, height = 11, units = "cm")
- #### Space correlations between lagged coherence and tau ----------------------
- varnames <- as.vector(unique(pow$variable))
- ses <- c(6,9,16)
- session = NA
- variable = NA
- rs = NA
- n = NA
- ci_min = NA
- ci_max = NA
- pval = NA
- loopidx = 1
- for (sesi in ses){
- data1 <- taudata_space%>%filter(sesage == sesi)%>%
- group_by(elect)%>%summarise(tau = mean(tau, na.rm = TRUE),
- pernan = mean(pernan, na.rm = TRUE))
- for (vari in varnames) {
- data2 <- pow%>%filter(sesage == sesi & variable == vari)%>%
- group_by(elect)%>%summarise(voi = mean(value, na.rm = TRUE))
- cormat <-merge(data1,data2, by = "elect")
- cor_results <- pcor.test(cormat$tau, cormat$voi, cormat[c("pernan")], method = "spearman")
- boot_results <- boot(cormat, partial_corr_lag, R = 5000)
- ci <- boot.ci(boot_results, type = "perc")
- session[loopidx] = sesi
- variable[loopidx] = vari
- rs[loopidx] = cor_results$estimate
- n[loopidx] = cor_results$n
- ci_min[loopidx] = ci$percent[4]
- ci_max[loopidx] = ci$percent[5]
- pval[loopidx] = cor_results$p
- loopidx = loopidx + 1
- }
- }
- session <- c(session)
- varaible <- c(variable)
- rs <- c(rs)
- n <- c(n)
- ci_min <- c(ci_min)
- ci_max <- c(ci_max)
- pval <- c(pval)
- pval <- p.adjust(pval, method = "fdr")
- results_correlation <- data.frame(n, session, variable, rs, pval, ci_min, ci_max, stringsAsFactors = TRUE)
- results_correlation$significance[results_correlation$pval < .001] <- "***"
- results_correlation$significance[results_correlation$pval < .01 & results_correlation$pval > .001] <- "**"
- results_correlation$significance[results_correlation$pval < .05 & results_correlation$pval > .01] <- "*"
- results_correlation$significance[results_correlation$pval < .1 & results_correlation$pval > .05] <- ""
- results_correlation$significance[results_correlation$pval > .1] <- ""
- results_correlation$session[results_correlation$session==6] <- "6-mo."
- results_correlation$session[results_correlation$session==9] <- "9-mo."
- results_correlation$session[results_correlation$session==16] <- "16-mo."
- results_correlation$session <- factor(results_correlation$session, levels = c("6-mo.", "9-mo.", "16-mo."))
- results_table <- dplyr::select(results_correlation, c("session", "n", "variable", "rs", "ci_min", "ci_max", "significance"))
- results_table$rs <- round(results_table$rs, 2)
- results_table$ci_min <- round(results_table$ci_min,2)
- results_table$ci_max <- round(results_table$ci_max,2)
- results_table$stats <- paste(results_table$rs, results_table$significance, " [", results_table$ci_min, " - ", results_table$ci_max, "]", sep ="")
- results_table <- dplyr::select(results_table, c("session", "variable", "n", "stats"))
- results_table <- dcast(results_table, session + n ~ variable, value.var = "stats")
- path2table = paste(tablepath, "tau_correlation_brythm_space_", cohort, ".docx", sep ="")
- save_as_docx(nice_table(results_table),path = path2table)
- #### Space correlation plots --------------------------------------------------
- plotdataset <- merge(pow, taudata_space, by = c("suj", "sex", "sesage", "elect", "area"))
- plotdataset <- plotdataset%>%group_by(elect, sesage, area, variable)%>%
- summarise(value = mean(value, na.rm = TRUE),
- tau = mean(tau, na.rm = TRUE))
- plotdataset <- filter(plotdataset, variable == "rhythmlag" | variable == "burstlag")
- plotdataset$sesage[plotdataset$sesage == 6] <- "6-mo."
- plotdataset$sesage[plotdataset$sesage == 9] <- "9-mo."
- plotdataset$sesage[plotdataset$sesage == 16] <- "16-mo."
- plotdataset$sesage <- factor(plotdataset$sesage, levels = c("6-mo.", "9-mo.", "16-mo."))
- path2plot <- paste(tablepath, "spatial_stability_its_burstlag_", cohort, ".svg", sep ="")
- plot_osc = ggplot(filter(plotdataset, variable == "burstlag"), aes(y=tau, x=value)) + geom_point(aes(color = area)) +
- geom_smooth(method = "lm", color = "black", se = T, alpha = .30, fill = "grey75") +
- scale_color_manual(values =c("#C4961A","#D16103", "#C3D7A4", "#52854C", "#4E84C4", "#293352")) +
- theme_pubr() + facet_grid(.~factor(sesage, levels = c("6-mo.", "9-mo.", "16-mo.")), scales = "free") +
- settheme +
- labs(x = "Lagged Coh. Burst",
- y = "Tau (s)",
- color = "Area")
- plot_freq = ggplot(filter(plotdataset, variable == "rhythmlag"), aes(y=tau, x=value)) + geom_point(aes(color = area)) +
- geom_smooth(method = "lm", color = "black", se = T, alpha = .30, fill = "grey75") +
- scale_color_manual(values =c("#C4961A","#D16103", "#C3D7A4", "#52854C", "#4E84C4", "#293352")) +
- theme_pubr() + facet_grid(.~factor(sesage, levels = c("6-mo.", "9-mo.", "16-mo.")), scales = "free") +
- settheme +
- labs(x = "Lagged Coh. Rhythm",
- y = "Tau (s)",
- color = "Area")
- ggarrange(plot_osc, plot_freq, nrow = 2, common.legend = T, legend = "bottom")
- ggsave(path2plot, width = 16, height = 12, units = "cm")
- }
5_Tau_Correlations_AlphaProperties.R at commit 03333a8, under MIT · at the source
Overview
- School of Psychology, Queen’s University Belfast, David Keir Building, 18-30 Malone Road, BELFAST, BT9 5BN, United Kingdom
- Department of Biobehavioural Sciences, Teachers College, Columbia University, Building 528, 525 W 120th St Suite 1159, New York, NY 10027, United States
- Mind, Brain and Behaviour Research Center, University of Granada, Campus de Cartuja, s/n 18071 Granada, Spain
- Department of Experimental Psychology, University of Granada, Campus Universitario de Cartuja, s/n18071 Granada, Spain
- School of Psychology, Trinity College Dublin, Pearse St, Dublin, 2, Ireland
- Trinity College Institute of Neuroscience, Trinity College Dublin, Dublin, Ireland
Abstract
Adult brain regions differ in the intrinsic timescales (INT) over which they integrate information. This spatial organization appears to emerge gradually: infants’ brain activity recorded during sleep with functional magnetic resonance imaging (fMRI) shows overall longer INT and a different spatial structure. However, since fMRI is sensitive to hemodynamic confounds and is affected by arousal state, these factors may have accounted for observed age-related differences. Here, we used electroencephalography (EEG) to investigate for the first time how INT develop in infancy in a longitudinal sample from 6 to 16-months-old (exploratory cohort, n = 45; validation cohort, n = 45) and adults (n = 10). Infants were awake and engaged in baseline visual protocol, and adults were recorded under comparable (and distinct) conditions. Infant intrinsic timescales shortened from 6 to 16-months but remained longer than those of adults at all ages. Finally, INT correlated with alpha lagged coherence, a metric of self-predictability and, to lesser extent, with alpha peak frequency, suggesting that alpha oscillatory activity may contribute to the emergence of INT. Identifying the mechanisms underlying longer INT early in infancy—a finding replicated across fMRI and EEG—is a crucial step toward understanding the neural computations that allow infants to extract and learn patterns from their environment.
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 9 matches between paragraphs and lines of code.
AnnaTruzzi/longitudinal_EEG_timescales
03333a87aa28e8d7454512295f706f80a79f11d7, 22 January 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
18 files
- 1_data_matlab_to_python.
py , Python, 56 lines - 2_select_subj_random.py, Python, 28 lines
- 3_eeg_intrinsic_timescal
es_estimation_pipeline.p , Python, 180 linesy - 3_tau_data_extraction.R, R, 117 lines
- 4_Tau_Development_LMMAna
lysis.R , R, 239 lines, 2 matches - 5_Tau_Correlations_Alpha
Properties.R , R, 684 lines, 3 matches - 6_eeg_ITS_GroupCompariso
ns& , Python, 199 linesLinearModels_pipeline_en velop.py - AdditionalScripts/
S1_tau_topomaps_csvcreat , R, 54 linesion.R - AdditionalScripts/
SA1_Tau_Development_Boot , R, 263 linesModels.R - AdditionalScripts/
SA2_Tau_DescriptivesbyCl , R, 216 linesuster.R - AdditionalScripts/
SAF_ModelFit_Oscillatory , R, 75 lines, 2 matchesPowerSpectrum.R - AdditionalScripts/
SF1_sociodemographic_gra , R, 110 linesph.R - AdditionalScripts/
SF2_Tau_development_main , R, 78 linestext_plots.R - AdditionalScripts/
SF3_tau_topomaps.m , MATLAB, 241 lines - linear_model_pipeline.py
, Python, 80 lines - tau_estimate.py, Python, 236 lines, 2 matches
- LICENSE, License, 21 lines
- README.md, Text, 78 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;
- 16 scripts, each with its path and the digest of its content;
- 9 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 availability
Raw data are confidential because they contain sensitive information about infants. The anonymized data reporting the estimated intrinsic timescales together with the code used to process and analyze the data are published in a public GitHub repository (https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 6 keywords, 13 MeSH terms, 4 funders, 55 references.
Cite
This paper
Truzzi, A., Rico-Picó, J., Rueda, M. R., & Cusack, R. (2026). The longitudinal development of intrinsic timescales in infancy and their relation to alpha brain rhythm. Cerebral cortex (New York, N.Y. : 1991), 36(6), bhag077. https://
BibTeX
@article{truzzi2026longi
author = {Truzzi, Anna and Rico-Picó, Josué and Rueda, Maria Rosario and Cusack, Rhodri},
title = {{The longitudinal development of intrinsic timescales in infancy and their relation to alpha brain rhythm}},
journal = {Cerebral cortex (New York, N.Y. : 1991)},
year = {2026},
month = jun,
volume = {36},
number = {6},
pages = {bhag077},
publisher = {Oxford University Press},
issn = {1047-3211},
doi = {10.1093/
url = {https://
pmid = {42341187},
pmcid = {PMC13293257}
}
RIS
TY - JOUR
AU - Truzzi, Anna
AU - Rico-Picó, Josué
AU - Rueda, Maria Rosario
AU - Cusack, Rhodri
TI - The longitudinal development of intrinsic timescales in infancy and their relation to alpha brain rhythm
T2 - Cerebral cortex (New York, N.Y. : 1991)
J2 - Cereb Cortex
PY - 2026
DA - 2026/
VL - 36
IS - 6
SP - bhag077
SN - 1047-3211
PB - Oxford University Press
DO - 10.1093/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1093/
"type": "article-journal",
"title": "The longitudinal development of intrinsic timescales in infancy and their relation to alpha brain rhythm",
"container-title": "Cerebral cortex (New York, N.Y. : 1991)",
"author": [
{
"family": "Truzzi",
"given": "Anna"
},
{
"family": "Rico-Picó",
"given": "Josué"
},
{
"family": "Rueda",
"given": "Maria Rosario"
},
{
"family": "Cusack",
"given": "Rhodri"
}
],
"container-title-short":
"volume": "36",
"issue": "6",
"page": "bhag077",
"DOI": "10.1093/
"PMID": "42341187",
"PMCID": "PMC13293257",
"ISSN": "1047-3211",
"publisher": "Oxford University Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
1
]
]
}
}
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.1162/imag.a.105 [code]
- Right posterior theta reflects human parahippocampal phase resetting by salient cues during goal-directed navigationJournal: n/aIn common: Pingouin, psych, EEGLAB, 12 other tools, EEG, 3 references
- [2] doi:10.1093/cercor/bhag113 [code]
- Long-term reliability and stability of parameterized resting state EEG: evidence from a five-year follow-up.Journal: Cerebral cortex (New York, N.Y. : 1991)In common: psych, easystats, MNE-Python, 11 other tools, EEG, 3 references
- [3] doi:10.7554/elife.107088 [code]
- Development of auditory and spontaneous movement responses to music over the first postnatal year.Journal: eLifeIn common: easystats, EEGLAB, FieldTrip, 12 other tools, developmental, EEG, 2 references
- [4] doi:10.1162/imag.a.1245 [code]
- Towards precision EEG connectomics: Evaluating the benefits of dense sampling.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Pingouin, psych, FieldTrip, 13 other tools, EEG
- [5] doi:10.1162/imag.a.1321 [code]
- Phase similarity between similar objects indicates representational merging across retrieval training but not sleep.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Pingouin, easystats, MNE-Python, 10 other tools, EEG, 2 references
- [6] doi:10.1016/j.nicl.2026.104012 [code]
- Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder.Journal: NeuroImage. ClinicalIn common: Pingouin, psych, lmerTest, 12 other tools
- [7] doi:10.1093/nc/niag029 [code]
- A data-driven approach to identifying and evaluating connectivity-based neural correlates of conscious visual perception.Journal: Neuroscience of consciousnessIn common: Pingouin, easystats, MNE-Python, 11 other tools, 1 reference
- [8] doi:10.1016/j.neuroimage.2026.122115 [code]
- Midfrontal theta power relates to response speeding following frustrative nonreward.Journal: NeuroImageIn common: psych, easystats, EEGLAB, 6 other tools, EEG, 3 references
- [9] doi:10.1038/s41597-026-07350-9 [code]
- An open multi-center MEG-EEG dataset for studying conscious visual perception.Journal: Scientific dataIn common: Pingouin, easystats, MNE-Python, 10 other tools, EEG, 1 reference
- [10] doi:10.1371/journal.pone.0353990 [code]
- Positive mood enhances accessibility of unrelated concepts in the first language but not in the foreign language.Journal: PloS oneIn common: multcomp, psych, EEGLAB, 6 other tools, EEG, 2 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, 16 scripts, and 9 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:581dea6786629125…
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
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
