Factors Contributing to Short-Term Structural Variability in a Longitudinal MRI Dataset.
The 4 matches
- [1] § Results › Complementary Analysis I ↔ Patterns_longitudinal_manuscript/Step4_sPLS_final.R, lines 96–145 · score 0.91 · superior parietal lobule, superior occipital gyrus, angular gyrus, postcentral gyrus, medial segment, precuneus
- [2] § Results › Main Analysis ↔ Patterns_longitudinal_manuscript/Step4_sPLS_final.R, lines 96–145 · score 0.71 · middle temporal gyrus, middle occipital gyrus, inferior temporal, sPLS
- [3] § Method › Materials and Time‐Varying Predictors of Brain Changes ↔ Patterns_longitudinal_manuscript/Step4_sPLS_final.R, lines 47–94 · score 0.64 · room temperature, concentration, Estradiol, physical, Testosterone, PANAS
- [4] § Method › Materials and Time‐Varying Predictors of Brain Changes ↔ Patterns_longitudinal_manuscript/Step3_Imputation_2.0.R, lines 101–140 · score 0.56 · room temperature, Estradiol, Testosterone, PANAS, humidity, hours
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 · 419 lines · 21 KB · CC-BY-4.0 · 3 matches
- #spls analysis
- # Bioconductor install
- if (!requireNamespace("BiocManager", quietly = TRUE)){
- install.packages("BiocManager")
- }
- # Install BiocParallel
- BiocManager::install("BiocParallel")
- BiocManager::install(update = TRUE)
- # over GitHub
- install.packages("devtools") # restart no
- devtools::install_github("mixOmicsTeam/mixOmics", force = TRUE)
- #BiocManager::install("mixOmics")
- #install.packages("mixOmics")
- library(mixOmics) # import the mixOmics library
- install.packages("ggplot2")
- library(ggplot2)
- install.packages("MASS")
- library(MASS)
- install.packages("lattice")
- library(lattice)
- # -------------------------------------------------------------------------------------------------------------------------------
- ### Import my data
- install.packages("jsonlite")
- library(jsonlite)
- #######
- X_impu <- read.csv("/Users/Masterthesis_Mayla/Step8_spls/Data_for_spls/x_impu.csv")
- X_not_impu <- read.csv("/Users/Masterthesis_Mayla/Step8_spls/Data_for_spls/X_not_impu.csv")
- Y_ROI <- read.csv("/Users/Masterthesis_Mayla/Step8_spls/Data_for_spls/Y_ROI_final_Cobra_neuromorpho.csv")
- rm(Y_ROI)
- rm(X_impu)
- rm(X_not_impu)
- # change X and Y df into matrix
- X_impu <- as.matrix(X_impu[, sapply(X_impu, is.numeric)]) #change the numeric columns in a matrix
- Y_ROI <- as.matrix(Y_ROI[, sapply(Y_ROI, is.numeric)])
- X_not_impu <- as.matrix(X_not_impu[, sapply(X_not_impu, is.numeric)])
- ## Check Dimensions of dataframes
- dim(X_impu) # check the dimensions of the X dataframe
- dim(Y_ROI) # check the dimensions of the Y dataframe
- dim(X_not_impu)
- original_names <- c(
- "anxietyDuringScan", "atmPressume", "bloodPressure_diastolic_mmHg",
- "bloodPressure_systolic_mmHg", "cacao_last24hs_percentage", "cacao_last2hs_percentage",
- "caffein_last24hs_cups", "caffein_last2hs_cups", "calories_burned",
- "chocolate_last24hs_gramms", "chocolate_last2hs_gramms", "cigarettes_last24hs",
- "daysFromFirstScan", "dayDreams_last24hs", "easeOfConcentration_last24hs", "estradiol",
- "generalHealth_last24hs", "generalStress_last24hs", "hoursActiveSocialInteraction_last24hs",
- "hoursFree_last24hs", "hoursOfWork_last24hs", "hoursPassiveSocialInteraction_last24hs",
- "hoursSpentOutdoors_last24hs", "hoursSport_last24hs", "hoursUsingScreens_last24hs",
- "liquid_last24hs_liters", "marihuanaCigarettes_last24hs", "maxTemp_C", "menstrualCycleDay",
- "minTemp_C", "MR_HeliumLevel", "MR_Room_Humidity", "MR_Room_Temperature", "number_steps",
- "number_stories", "PANAS_afraid", "PANAS_active", "PANAS_alert", "PANAS_ashamed",
- "PANAS_attentive", "PANAS_determined", "PANAS_distressed", "PANAS_enthusiastic",
- "PANAS_excited", "PANAS_guilty", "PANAS_hostile", "PANAS_inspired", "PANAS_interested",
- "PANAS_irritable", "PANAS_jittery", "PANAS_nervous", "PANAS_proud", "PANAS_scared",
- "PANAS_strong", "PANAS_upset", "physicalPainDuringScan", "precip_form", "precip_mm",
- "relHumidity", "rememberDreams_fromLastNight", "ruminationDuringScan", "scanDate",
- "scanTime", "sleepQuality_lastNight", "sleptDuringScan", "sunshine_hrs", "sweets_last24hs_Likert",
- "testosterone", "time_bed", "time_slept_min", "walk_distance", "weight_kg", "wind_km_h"
- )
- # New names
- new_names <- c(
- "Anxiety during Scan", "Athmospheric pressure", "Blood pressure diastolic",
- "Blood pressure systolic", "Cacao intake (%) last 24 hs", "Cacao intake (%) last 2 hs",
- "Caffeine intake last 24 hs", "Caffeine intake last 2 hs", "Calories burned",
- "Chocolate intake (g) last 24 hs", "Chocolate intake (g) last 2 hs", "Cigarettes last 24 hs",
- "Days from first Scan", "Daydreams last 24 hs", "Ease of concentration", "Estradiol",
- "Genereal Health last 24 hs", "General Stress last 24 hs", "Active Social Interact last 24 hs",
- "Hours free last 24 hs", "Hours of Work last 24 hs", "Passive Social Interact last 24 hs",
- "Hours outdoors last 24 hs", "Hours Sport last 24 hs", "Hours using Screen last 24 hs",
- "liquid litres last 24 hs", "Marihuana Cigarettes last 24 hs", "Maximum Temperature",
- "Day of menstrual cycle", "Minimum Temperature", "MR Helium Level", "MR Room Humidity",
- "MR Room Temperature", "Number of steps", "Number of stories climbed", "PANAS afraid",
- "PANAS active", "PANAS alert", "PANAS ashamed", "PANAS attentive", "PANAS determined",
- "PANAS distressed", "PANAS enthusiastic", "PANAS excited", "PANAS guilty", "PANAS hostile",
- "PANAS inspired", "PANAS interested", "PANAS irritable", "PANAS jittery", "PANAS nervous",
- "PANAS proud", "PANAS scared", "PANAS strong", "PANAS upset", "Physical Pain during Scan",
- "Precipitation Form", "Precipitation mm", "Relative Humidity", "Remember Dreams", "Rumination during Scan",
- "Scandate", "Scantime", "Sleep Quality last Night", "Slept during Scan", "Sunshine hs", "Sweets last 24 hs",
- "Testosterone", "Time Bed", "Time slept min", "Walk Distance", "Weight kg", "Wind km/h"
- )
- # Create a named vector for mapping
- name_mapping <- setNames(new_names, original_names)
- # Replace column names in the dataframe
- colnames(X_impu) <- ifelse(colnames(X_impu) %in% names(name_mapping),
- name_mapping[colnames(X_impu)],
- colnames(X_impu))
- colnames(X_not_impu) <- ifelse(colnames(X_not_impu) %in% names(name_mapping),
- name_mapping[colnames(X_not_impu)],
- colnames(X_not_impu))
- original_names_Y <- c(
- "lStriatum", "lGloPal", "lTha", "lAntCerebLI_II", "lAntCerebLIII", "lAntCerebLIV", "lAntCerebLV", "lSupPostCerebLVI", "lSupPostCerebCI",
- "lSupPostCerebCII", "lSupPostCerebLVIIB", "lInfPostCerebLVIIIA", "lInfPostCerebLVIIIB", "lInfPostCerebLIX", "lInfPostCerebLX", "lAmy", "lHCA1",
- "lSub", "lCA4", "lCA2_3", "lStratum", "rStriatum", "rGloPal", "rTha", "rAntCerebLI_II", "rAntCerebLIII", "rAntCerebLIV", "rAntCerebLV",
- "rSupPostCerebLVI", "rSupPostCerebCI", "rSupPostCerebCII", "rSupPostCerebLVIIB", "rInfPostCerebLVIIIA", "rInfPostCerebLVIIIB", "rInfPostCerebLIX",
- "rInfPostCerebLX", "rAmy", "rHCA1", "rSub", "rCA4", "rCA2_3", "rStratum", "Right.Accumbens.Area.1", "Left.Accumbens.Area.1", "Right.Amygdala.1",
- "Left.Amygdala.1", "Right.Caudate.1", "Left.Caudate.1", "Right.Cerebellum.Exterior.1", "Left.Cerebellum.Exterior.1", "Right.Hippocampus.1",
- "Left.Hippocampus.1", "Right.Pallidum.1", "Left.Pallidum.1", "Right.Putamen.1", "Left.Putamen.1", "Right.Thalamus.Proper.1", "Left.Thalamus.Proper.1",
- "Right.Ventral.DC.1", "Left.Ventral.DC.1", "Optic.Chiasm.1", "Cerebellar.Vermal.Lobules.I.V.1", "Cerebellar.Vermal.Lobules.VI.VII.1",
- "Cerebellar.Vermal.Lobules.VIII.X.1", "Left.Basal.Forebrain.1", "Right.Basal.Forebrain.1", "Right.ACgG.anterior.cingulate.gyrus.1",
- "Left.ACgG.anterior.cingulate.gyrus.1", "Right.AIns.anterior.insula.1", "Left.AIns.anterior.insula.1", "Right.AOrG.anterior.orbital.gyrus.1",
- "Left.AOrG.anterior.orbital.gyrus.1", "Right.AnG.angular.gyrus.1", "Left.AnG.angular.gyrus.1", "Right.Calc.calcarine.cortex.1",
- "Left.Calc.calcarine.cortex.1", "Right.CO.central.operculum.1", "Left.CO.central.operculum.1", "Right.Cun.cuneus.1", "Left.Cun.cuneus.1",
- "Right.Ent.entorhinal.area.1", "Left.Ent.entorhinal.area.1", "Right.FO.frontal.operculum.1", "Left.FO.frontal.operculum.1", "Right.FRP.frontal.pole.1",
- "Left.FRP.frontal.pole.1", "Right.FuG.fusiform.gyrus.1", "Left.FuG.fusiform.gyrus.1", "Right.GRe.gyrus.rectus.1", "Left.GRe.gyrus.rectus.1",
- "Right.IOG.inferior.occipital.gyrus.1", "Left.IOG.inferior.occipital.gyrus.1", "Right.ITG.inferior.temporal.gyrus.1",
- "Left.ITG.inferior.temporal.gyrus.1", "Right.LiG.lingual.gyrus.1", "Left.LiG.lingual.gyrus.1", "Right.LOrG.lateral.orbital.gyrus.1",
- "Left.LOrG.lateral.orbital.gyrus.1", "Right.MCgG.middle.cingulate.gyrus.1", "Left.MCgG.middle.cingulate.gyrus.1", "Right.MFC.medial.frontal.cortex.1",
- "Left.MFC.medial.frontal.cortex.1", "Right.MFG.middle.frontal.gyrus.1", "Left.MFG.middle.frontal.gyrus.1", "Right.MOG.middle.occipital.gyrus.1",
- "Left.MOG.middle.occipital.gyrus.1", "Right.MOrG.medial.orbital.gyrus.1", "Left.MOrG.medial.orbital.gyrus.1",
- "Right.MPoG.postcentral.gyrus.medial.segment.1", "Left.MPoG.postcentral.gyrus.medial.segment.1", "Right.MPrG.precentral.gyrus.medial.segment.1",
- "Left.MPrG.precentral.gyrus.medial.segment.1", "Right.MSFG.superior.frontal.gyrus.medial.segment.1", "Left.MSFG.superior.frontal.gyrus.medial.segment.1",
- "Right.MTG.middle.temporal.gyrus.1", "Left.MTG.middle.temporal.gyrus.1", "Right.OCP.occipital.pole.1", "Left.OCP.occipital.pole.1",
- "Right.OFuG.occipital.fusiform.gyrus.1", "Left.OFuG.occipital.fusiform.gyrus.1", "Right.OpIFG.opercular.part.of.the.inferior.frontal.gyrus.1",
- "Left.OpIFG.opercular.part.of.the.inferior.frontal.gyrus.1", "Right.OrIFG.orbital.part.of.the.inferior.frontal.gyrus.1",
- "Left.OrIFG.orbital.part.of.the.inferior.frontal.gyrus.1", "Right.PCgG.posterior.cingulate.gyrus.1", "Left.PCgG.posterior.cingulate.gyrus.1",
- "Right.PCu.precuneus.1", "Left.PCu.precuneus.1", "Right.PHG.parahippocampal.gyrus.1", "Left.PHG.parahippocampal.gyrus.1",
- "Right.PIns.posterior.insula.1", "Left.PIns.posterior.insula.1", "Right.PO.parietal.operculum.1", "Left.PO.parietal.operculum.1",
- "Right.PoG.postcentral.gyrus.1", "Left.PoG.postcentral.gyrus.1", "Right.POrG.posterior.orbital.gyrus.1", "Left.POrG.posterior.orbital.gyrus.1",
- "Right.PP.planum.polare.1", "Left.PP.planum.polare.1", "Right.PrG.precentral.gyrus.1", "Left.PrG.precentral.gyrus.1", "Right.PT.planum.temporale.1",
- "Left.PT.planum.temporale.1", "Right.SCA.subcallosal.area.1", "Left.SCA.subcallosal.area.1", "Right.SFG.superior.frontal.gyrus.1",
- "Left.SFG.superior.frontal.gyrus.1", "Right.SMC.supplementary.motor.cortex.1", "Left.SMC.supplementary.motor.cortex.1",
- "Right.SMG.supramarginal.gyrus.1", "Left.SMG.supramarginal.gyrus.1", "Right.SOG.superior.occipital.gyrus.1",
- "Left.SOG.superior.occipital.gyrus.1", "Right.SPL.superior.parietal.lobule.1", "Left.SPL.superior.parietal.lobule.1",
- "Right.STG.superior.temporal.gyrus.1", "Left.STG.superior.temporal.gyrus.1", "Right.TMP.temporal.pole.1", "Left.TMP.temporal.pole.1",
- "Right.TrIFG.triangular.part.of.the.inferior.frontal.gyrus.1", "Left.TrIFG.triangular.part.of.the.inferior.frontal.gyrus.1",
- "Right.TTG.transverse.temporal.gyrus.1", "Left.TTG.transverse.temporal.gyrus.1"
- )
- # Changes for the loading plots
- new_names_Y_network_plot <- c(
- "L.Striatum", "L.GloPal", "L.Tha", "L.AntCereLI_II", "L.AntCereLIII", "L.AntCereLIV", "L.AntCereLV", "L.SupPoCereLVI",
- "L.SupPoCereCI", "L.SupPoCereCII", "L.SupPoCereLVIIB", "L.InfPoCereLVIIIA", "L.InfPoCereLVIIIB", "L.InfPoCereLIX",
- "L.InfPoCereLX", "L.Amy", "L.HCA1", "L.Sub", "L.CA4", "L.CA2_3", "L.Stratum", "R.Striatum", "R.GloPal", "R.Tha", "R.AntCereLI_II",
- "R.AntCereLIII", "R.AntCerebLIV", "R.AntCereLV", "R.SupPoCereLVI", "R.SupPoCereCI", "R.SupPoCereCII", "R.SupPoCereLVIIB",
- "R.InfPoCereLVIIIA", "R.InfPoCereLVIIIB", "R.InfPoCereLIX", "R.InfPoCereLX", "R.Amy", "R.HCA1", "R.Sub", "R.CA4", "R.CA2_3",
- "R.Stratum", "R.Accumb.Area", "L.Accumb.Area", "R.Amygdala", "L.Amygdala", "R.Caudate", "L.Caudate",
- "R.Cereb.Ext", "L.Cereb.Ext", "R.Hippoc", "L.Hippoc", "R.Pallidum", "L.Pallidum",
- "R.Putamen", "L.Putamen", "R.Thal.Prop", "L.Thal.Prop", "R.Ventral.DC", "L.Ventral.DC", "Optic.Chiasm",
- "Cereb.Vermal.Lob.I.V", "Cereb.Vermal.Lob.VI.VII", "Cereb.Vermal.Lob.VIII.X", "L.Basal.Forebrain",
- "R.Basal.Forebrain", "R.ACgG", "L.ACgG", "R.AIns",
- "L.AIns", "R.AOrG", "L.AOrG", "R.AnG",
- "L.AnG", "R.Calc", "L.Calc", "R.CO", "L.CO",
- "R.Cun", "L.Cun", "R.Ent", "L.Ent", "R.FO",
- "L.FO", "R.FRP", "L.FRP", "R.FuG", "L.FuG",
- "R.GRe", "L.GRe", "R.IOG", "L.IOG",
- "R.ITG", "L.ITG", "R.LiG", "L.LiG",
- "R.LOrG", "L.LOrG", "R.MCgG", "L.MCgG",
- "R.MFC", "L.MFC", "R.MFG", "L.MFG",
- "R.MOG", "L.MOG", "R.MOrG", "L.MOrG",
- "R.MPoG", "L.MPoG", "R.MPrG",
- "L.MPrG", "R.MSFG",
- "L.MSFG", "R.MTG", "L.MTG",
- "R.OCP", "L.OCP", "R.OFuG", "L.OFuG",
- "R.OpIFG", "L.OpIFG",
- "R.OrIFG", "L.OrIFG",
- "R.PCgG", "L.PCgG", "R.PCu", "L.PCu",
- "R.PHG", "L.PHG", "R.PIns", "L.PIns",
- "R.PO", "L.PO", "R.PoG", "L.PoG",
- "R.POrG", "L.POrG", "R.PP", "L.PP",
- "R.PrG", "L.PrG", "R.PT", "L.PT", "R.SCA",
- "L.SCA", "R.SFG", "L.SFG", "R.SMC",
- "L.SMC", "R.SMG", "L.SMG", "R.SOG",
- "L.SOG", "R.SPL", "L.SPL",
- "R.STG", "L.STG", "R.TMP", "L.TMP",
- "R.TrIFG", "L.TrIFG",
- "R.TTG", "L.TTG")
- name_mapping <- setNames(new_names_Y_network_plot, original_names_Y)
- colnames(Y_ROI) <- ifelse(colnames(Y_ROI) %in% names(name_mapping),
- name_mapping[colnames(Y_ROI)],
- colnames(Y_ROI))
- # -------------------------------------------------------------------------------------------
- # -------------------------------------------------------------------------------------------
- ### Multilevel ### (taking longitudinal data of all subjects into account)
- # -------------------------------------------------------------------------------------------
- # -------------------------------------------------------------------------------------------
- # Design matrix
- table(X_impu[, 1])
- # Number of measures:
- # Person 1: 50, Person 2: 12, Person 3: 50,
- # Person 4: 11, Person 5: 45, Person 6: 47,
- # Person 7: 40, Person 8: 49
- repeat.indiv <- c(rep(1, 50), rep(2, 12), rep(3, 50), rep(4, 11),
- rep(5, 45), rep(6, 47), rep(7, 40), rep(8, 49))
- # create Design matrix
- # basically contains the ‘Person’ column from my data
- # specifies for the spls command how the measurement repetition is handled
- design <- data.frame(sample = repeat.indiv)
- # --------------------------------------------------------------------------------------------------
- ### SPLS Multilevel Basic Model
- # --------------------------------------------------------------------------------------------------
- ### Basic Multilevel Model with imputed data: X_impu
- spls.4comp.multi.basic <- spls(X_impu, Y_ROI, ncomp = 4, mode = 'regression', multilevel = design)
- # --------------------------------------------------------------------------------------------------
- ### TUNING
- # --------------------------------------------------------------------------------------------------
- # set range of test values for number of variables to use from X dataframe
- list.keepX <- c(3:12)
- # set range of test values for number of variables to use from Y dataframe
- list.keepY <- c(5:164)
- # ---------------------------------------------------------
- ### Tune.splslevel ###
- ### Wrapper function to be able to understand the output
- tune.splslevel.wrapper <- function(X,
- Y,
- design,
- ncomp,
- test.keepX,
- test.keepY) {
- ncomps <- 1:ncomp # set range of ncomp values to use
- final.obj <- list() # initialise returned object
- # default values are -1 for debugging
- atX <- rep(-1, length(ncomps)-1) # already.tested.X
- atY <- rep(-1, length(ncomps)-1) # already.tested.Y
- for (ncomp in ncomps) {
- # previously calculated optimal keepX/Y value
- tmp.atX <- c(atX[1:ncomp-1])
- tmp.atY <- c(atY[1:ncomp-1])
- # need to be NULL for first iteration
- if (ncomp==1) { tmp.atX <- NULL; tmp.atY <- NULL }
- cat("=== NCOMP:", ncomp, "===\n")
- model <- suppressMessages(tune.splslevel(X, Y, multilevel=design,
- mode="regression",
- ncomp=ncomp,
- test.keepX = test.keepX,
- test.keepY = test.keepY,
- already.tested.X = tmp.atX,
- already.tested.Y = tmp.atY))
- # extract position in cor.value which corresponds to max
- opt.pos <- which(model$cor.value==max(model$cor.value), arr.ind=T)
- # set these for future iterations
- atX[ncomp] <- test.keepX[opt.pos[1]]
- atY[ncomp] <- test.keepY[opt.pos[2]]
- # add to returned object
- final.obj[["X"]][ncomp] <- test.keepX[opt.pos[1]]
- final.obj[["Y"]][ncomp] <- test.keepY[opt.pos[2]]
- final.obj[["cor"]][ncomp] <- max(model$cor.value)
- }
- # determine ncomp with optimal correlation
- cor.max <- which(final.obj[["cor"]]==max(final.obj[["cor"]]))
- final.obj[["opt.ncomp"]] <- cor.max
- return(final.obj)
- }
- # set range of test values for number of variables to use from X dataframe
- #list.keepX <- c(3:10)
- # set range of test values for number of variables to use from Y dataframe
- #list.keepY <- c(5:15)
- tune.spls.4comp.multi.wrapper <- tune.splslevel.wrapper(X = X_impu, Y = Y_ROI,
- design,
- ncomp = 4,
- test.keepX = list.keepX,
- test.keepY = list.keepY)
- #plot(tune.spls.multi.wrapper)
- # extract optimal number of variables for X and Y dataframe and number of components
- optimal.keepX <- tune.spls.4comp.multi.wrapper$X
- optimal.keepY <- tune.spls.4comp.multi.wrapper$Y
- optimal.ncomp <- length(optimal.keepX)
- # -----------------------------------------
- ### Final model
- # final: not imputed canonical
- spls.final.4comp.multilevel.canonical <- spls(X = X_not_impu, Y = Y_ROI, # generate a tuned sPLS model
- multilevel = design,
- ncomp = 4,
- keepX = optimal.keepX,
- keepY = optimal.keepY,
- mode = 'canonical')
- ### -----------------------------------------------------------------------------
- ### Plots ###
- ### mulitlevel spls tuned ###
- ### -----------------------------------------------------------------------------
- # extract loadings of Y variables to do a plot of the brain with regions visible that correlate positively with component 1 / negatively with component 1
- # same for component 2 (in one plot?)
- Loadings_Y_canonical <- spls.final.4comp.multilevel.canonical$loadings$Y
- write.csv(Loadings_Y, file = "/Users/Masterthesis_Mayla/Step8_spls/Results/Loadings_Y_final_4comp_cobneuro_canonical.csv", row.names = TRUE)
- Loadings_Y_regression <- spls.final.multilevel.regression$loadings$Y
- write.csv(Loadings_Y, file = "/Users/Masterthesis_Mayla/Step8_spls/Results/Loadings_Y_final_4comp_cobneuro_regression.csv", row.names = TRUE)
- dev.off()
- par(oma=c(0.5,7,0.5,1)) # bottom, left, top, right
- # Loadings
- ?plotLoadings
- plotLoadings(spls.final.4comp.multilevel.canonical, comp = 1, contrib = max, method = "median", subtitle = c('Questionnairy Loadings Comp 1', "Brain Loadings Comp 1"), size.name = 1.4)
- plotLoadings(spls.final.4comp.multilevel.canonical, comp = 2, contrib = max, method = "median", subtitle = c('Questionnairy Loadings Comp 2', "Brain Loadings Comp 2"), size.name = 1.4)
- plotLoadings(spls.final.4comp.multilevel.canonical, comp = 3, contrib = max, method = "median", subtitle = c('Questionnairy Loadings Comp 3', "Brain Loadings Comp 3"), size.name = 1.4)
- plotLoadings(spls.final.4comp.multilevel.canonical, comp = 4, contrib = max, method = "median", subtitle = c('Questionnairy Loadings Comp 4', "Brain Loadings Comp 4"), size.name = 1.4)
- # Correlation Cirle
- dev.off()
- ?plotVar
- #for component 1 and 2
- plotVar(spls.final.4comp.multilevel.canonical,
- cex = c(4,4), # font size of variable names
- # overlap = FALSE # creates two separate plots for X and Y; default is TRUE
- )
- # or component 1 and 3
- plotVar(spls.final.4comp.multilevel.canonical,
- comp = c(1,3),
- cex = c(4,4), # font size of variable names
- # overlap = FALSE # creates two separate plots for X and Y; default is TRUE
- )
- # or component 1 and 4
- plotVar(spls.final.4comp.multilevel.canonical,
- comp = c(1,4),
- cex = c(4,4), # font size of variable names
- # overlap = FALSE # creates two separate plots for X and Y; default is TRUE
- )
- # or component 2 and 3
- plotVar(spls.final.4comp.multilevel.canonical,
- comp = c(2,3),
- cex = c(4,4), # font size of variable names
- # overlap = FALSE # creates two separate plots for X and Y; default is TRUE
- )
- # or component 2 and 4
- plotVar(spls.final.4comp.multilevel.canonical,
- comp = c(2,4),
- cex = c(4,4), # font size of variable names
- # overlap = FALSE # creates two separate plots for X and Y; default is TRUE
- )
- # or component 4 and 3
- plotVar(spls.final.4comp.multilevel.canonical,
- comp = c(3,4),
- cex = c(4,4), # font size of variable names
- # overlap = FALSE # creates two separate plots for X and Y; default is TRUE
- )
- # Inividuals
- #plotIndiv(spls.final.multilevel.canonical, comp = c(1,2))
- #plotIndiv(spls.final.multilevel.canonical, rep.space = "XY",
- # group = design$sample,
- # col.per.group = color.mixo(1:8),
- # legend = TRUE, legend.title = 'Subject')
- # Variance explained
- spls.final.4comp.multilevel.canonical$prop_expl_var
- # Network Plot
- color.edge <- color.GreenRed(50) # set the colours of the connecting lines
- X11()
- par(oma=c(0.5,0.5,0.5,0.5)) # bottom, left, top, right
- dev.off()
- # To open a new window for Rstudio
- network(spls.final.4comp.multilevel.canonical, comp = 1:4,
- cutoff = 0.4, # only show connections with a correlation above 0.7
- shape.node = c("circle", "rectangle"),
- color.node = c("steelblue", "salmon2"),
- color.edge = color.edge,
- size.node = 1,
- cex.node.name = 0.7)
- ?cim
- X11()
- dev.off()
- par(oma=c(3,2,2,6))
- cim(spls.final.4comp.multilevel.canonical)
Step4_sPLS_final.R, under CC-BY-4.0 · at the source
Overview
- Structural Brain Mapping Group, Department of Neurology Jena University Hospital Jena Germany
- Department of Biological Psychology and Cognitive Neuroscience Institute for Psychology, Friedrich‐Schiller University of Jena Jena Germany
- Department of Psychiatry and Psychotherapy Jena University Hospital Jena Germany
- German Center for Mental Health (DZPG), Jena‐Halle‐Magdeburg Germany
- German Center for Neurodegenerative Diseases (DZNE) Magdeburg Germany
- Institute of Cognitive Neurology and Dementia Research (IKND), Otto‐von‐Guericke University Magdeburg Germany
- Center for Environmental Neuroscience, Max Planck Institute for Human Development Berlin Germany
Abstract
When planning longitudinal magnetic resonance imaging (MRI) studies, it is advisable to consider various (confounding) factors that could influence brain structural changes over time. The goal of this study was to identify factors that contribute to intraindividual variability of brain structure within a short period of time. We employed multilevel sparse partial least squares regression to investigate the changes in regional gray matter volume in the longitudinal Day2day MRI dataset. The findings suggest that the changes in regional GM volume estimations were primarily driven by image quality, while the outdoor temperature and time since baseline appeared as the main predictors of volumetric changes in insular and diencephalic brain regions. We additionally investigated factors associated with variability in image quality. The findings underscore the importance of maintaining adequate participant arousal during scanning.
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 4 matches between paragraphs and lines of code.
figshare 28839635
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
- 30 September 2026: the link answers (HTTP 200)
6 files
- Patterns_longitudinal_ma
nuscript/ , R, 59 linesStep1_clean_SleepandActi vityData.R - Patterns_longitudinal_ma
nuscript/ , R, 101 linesStep2_Matching_Questionn aire_and_Fitbit.R - Patterns_longitudinal_ma
nuscript/ , R, 306 lines, 1 matchStep3_Imputation_2.0.R - Patterns_longitudinal_ma
nuscript/ , R, 419 lines, 3 matchesStep4_sPLS_final.R - Patterns_longitudinal_ma
nuscript/ , MATLAB, 117 linesplot_region2surf.m - Patterns_longitudinal_ma
nuscript/ , R, 207 linesscore_plots.R
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;
- 6 scripts, each with its path and the digest of its content;
- 4 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 Statement
The Day2day data is available freely on request from Prof. Dr. Simone Kühn. The code to replicate the findings is available at Figshare (DOI: 10.6084/
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, 30 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 4 keywords, 8 MeSH terms, 4 funders, 59 references.
Cite
This paper
Kalc, P., ter Veer, M., Dahnke, R., Ziegler, G., Kühn, S., & Gaser, C. (2026). Factors Contributing to Short-Term Structural Variability in a Longitudinal MRI Dataset. Human brain mapping, 47(4), e70500. https://
BibTeX
@article{kalc2026factors
author = {Kalc, Polona and ter Veer, Mayla and Dahnke, Robert and Ziegler, Gabriel and Kühn, Simone and Gaser, Christian},
title = {{Factors Contributing to Short-Term Structural Variability in a Longitudinal MRI Dataset}},
journal = {Human brain mapping},
year = {2026},
month = mar,
volume = {47},
number = {4},
pages = {e70500},
publisher = {Wiley},
issn = {1065-9471},
doi = {10.1002/
url = {https://
pmid = {41817026},
pmcid = {PMC13093422}
}
RIS
TY - JOUR
AU - Kalc, Polona
AU - ter Veer, Mayla
AU - Dahnke, Robert
AU - Ziegler, Gabriel
AU - Kühn, Simone
AU - Gaser, Christian
TI - Factors Contributing to Short-Term Structural Variability in a Longitudinal MRI Dataset
T2 - Human brain mapping
J2 - Hum Brain Mapp
PY - 2026
DA - 2026/
VL - 47
IS - 4
SP - e70500
SN - 1065-9471
PB - Wiley
DO - 10.1002/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1002/
"type": "article-journal",
"title": "Factors Contributing to Short-Term Structural Variability in a Longitudinal MRI Dataset",
"container-title": "Human brain mapping",
"author": [
{
"family": "Kalc",
"given": "Polona"
},
{
"family": "ter Veer",
"given": "Mayla"
},
{
"family": "Dahnke",
"given": "Robert"
},
{
"family": "Ziegler",
"given": "Gabriel"
},
{
"family": "Kühn",
"given": "Simone"
},
{
"family": "Gaser",
"given": "Christian"
}
],
"container-title-short":
"volume": "47",
"issue": "4",
"page": "e70500",
"DOI": "10.1002/
"PMID": "41817026",
"PMCID": "PMC13093422",
"ISSN": "1065-9471",
"publisher": "Wiley",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
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.7554/elife.109461 [code]
- The effect of physical activity on brain structure and cognitive function in the population-based cohort of LIFE-Adult Study.Journal: eLifeIn common: tidyverse, structural MRI / diffusion, 4 references, author Polona Kalc
- [2] doi:10.1038/s41467-026-71831-z [code]
- Dysfunction of the episodic memory network in the Alzheimer's disease cascade.Journal: Nature communicationsIn common: CAT12, GIfTI library for MATLAB, author Gabriel Ziegler
- [3] doi:10.1038/s41593-026-02289-x [code]
- Cerebellar aging is spatially heterogeneous and supports cognitive resilience in later life.Journal: Nature neuroscienceIn common: cowplot, patchwork, ggplot2, 1 other tool, structural MRI / diffusion, 2 references
- [4] doi:10.1162/imag.a.1337 [code]
- Data quality biases normative models derived from fetal brain MRI.Journal: Imaging neuroscience (Cambridge, Mass.)In common: cowplot, patchwork, ggplot2, 1 other tool, structural MRI / diffusion, 2 references
- [5] doi:10.1038/s42003-026-10276-y [code]
- The cellular correlates and adolescent reorganisation of cortical myelination networks in the common marmoset.Journal: Communications biologyIn common: CAT12, GIfTI library for MATLAB, patchwork, 1 other tool, structural MRI / diffusion
- [6] doi:10.1002/hbm.70605 [code]
- BrainEnrich: Revealing Biological Insights for Imaging-Derived Phenotypes Through Transcriptomic Enrichment.Journal: Human brain mappingIn common: GIfTI library for MATLAB, cowplot, patchwork, 2 other tools
- [7] doi:10.1038/s41597-026-07423-9 [code]
- Unraveling the Complexity of Multilingual Comprehension: Neuroimaging and Linguistic Profiling in 700+ Adults.Journal: Scientific dataIn common: CAT12, cowplot, ggplot2, 1 other tool, methods / tools
- [8] doi:10.1186/s13195-026-02054-z [code]
- Pathways to resilience: relationships between cognitive reserve, psychological debt, and Alzheimer's disease biomarkers.Journal: Alzheimer's research & therapyIn common: ggplot2, tidyverse, author Gabriel Ziegler
- [9] doi:10.1038/s41467-026-74565-0 [code]
- The functional neurobiology of dispositions towards negative emotions.Journal: Nature communicationsIn common: GIfTI library for MATLAB, cowplot, ggplot2, 1 other tool, 1 reference
- [10] doi:10.1002/hbm.70512 [code]
- Precision Imaging for Intraindividual Investigation of the Reward Response.Journal: Human brain mappingIn common: patchwork, ggplot2, tidyverse, methods / tools, 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, 6 scripts, and 4 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:e165f703516fc698…
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.
