• Task background connectivity are run in CONN using a similar procedure to memory-modulated gppi analyses. However, instead of including event-related covariates as parametric modulators, here trial and memory-related covariates are regresssed out, along with FD, aCompCor, and motion, at the first-level de-noising step.

  • Analyses use MNI-space unsmoothed data.

  • Connectivity measures thus reflect the ‘background’ or task-independent connections between bilateral ROIs, during either encoding or remember events. Thresholded at r > 0.25.

ROI-to-ROI connections

Encoding

##### Threshold for matrices:
th <- 0.25
model <- 'Task-Connectivity_weighted_ROI-to-ROI'
### fmri subjects:
subjects = list.dirs(path = paste(matrixPath,model,'/',sep = ""), full.names = FALSE, recursive = FALSE)
##### ROI x ROI for Encoding #######
event <- 'Encoding'
title <- event
# GET ROI-ROI connections  ------------------------------------------------------------------
connMatrixE <- format_conn(matrixPath, seeds, subjects, model, event)
### get p-values for each seed-target comparison --> connectivity significant?
type = 'greater'
connPValues <- get_conn_pValues(connMatrixE, seeds, sOrder, type, th)
### plot mean conn matrix
p <- plot_meanconn(connMatrixE, connPValues, seeds, sOrder, title, type, th)
plot(p)

ggsave(paste('Encoding_Background_ROI-ROI_',th,'.jpg',sep=""),plot=last_plot(),dpi=300,width=8,height=9.5)

Remember

##### ROI x ROI for Retrieval #######
event <- 'Retrieval'
title <- event
# GET ROI-ROI connections  ------------------------------------------------------------------
connMatrixR <- format_conn(matrixPath, seeds, subjects, model, event)
### get p-values for each seed-target comparison --> connectivity significant?
type = 'greater'
connPValues <- get_conn_pValues(connMatrixR, seeds, sOrder, type, th)
### plot mean conn matrix
p <- plot_meanconn(connMatrixR, connPValues, seeds, sOrder, title, type, th)
plot(p)

ggsave(paste('Retrieval_Background_ROI-ROI_',th,'.jpg',sep=""),plot=last_plot(),dpi=300,width=8,height=9.5)

Remember-Encoding

##### ROI x ROI for Difference #######
event <- 'Remember-Encoding'
title <- event
# GET ROI-ROI connections  ------------------------------------------------------------------
connMatrix <- connMatrixR - connMatrixE
### get p-values for each seed-target comparison --> connectivity significant?
type = 'two.sided'
connPValues <- get_conn_pValues(connMatrix, seeds, sOrder, type, th)
### plot mean conn matrix
p <- plot_meanconn(connMatrix, connPValues, seeds, sOrder, title, type, th)
plot(p)

ggsave(paste('Retrieval-Encoding_Background_ROI-ROI_',th,'.jpg',sep=""),plot=last_plot(),dpi=300,width=8,height=9.5)

Modularity

# Get modularity by subject onn thresholded, weighted matrix:
# Encoding and Retrieval:
mod <- run_modularity(connMatrixE, connMatrixR, subjects, th)
mod$Task <- as.factor(mod$Task)
mod$Subject <- as.factor(mod$Subject)
# plot
p <- ggplot(mod, aes(x = Task, y=Modularity, fill=Task)) +
    stat_summary(fun.y = mean, geom="bar", alpha = 0.6, color = 'gray10', position = position_dodge(1)) +
    geom_dotplot(binaxis='y', stackdir='center', dotsize=1, alpha = 0.8, position = position_dodge(1)) +
    stat_summary(fun.data = mean_se, geom = "errorbar", fun.args = list(mult = 1.96),
                 width = 0.45, color = "black", size = 0.65, position = position_dodge(1)) +
    scale_fill_manual(values = c('gray50','gray80')) + geom_hline(yintercept = 0) + ylab("Mean Q") +
    ggtitle("Modularity") +
    theme(plot.title = element_text(hjust = 0.5, size=28), axis.line = element_line(colour = "black"), 
          axis.text = element_text(size = 22), axis.title = element_text(size = 24), panel.background = element_blank(),
          legend.position="none", text = element_text(family="Helvetica")) 
plot(p)

ggsave(paste('Modularity_',th,'.jpg',sep=""), plot = last_plot(), dpi = 300, width = 4.2, height = 5)
# t-test on change in modularity:
pander(t.test(Modularity ~ Task, data=mod, paired=TRUE))

-------------------------------------------------------------
 Test statistic   df     P value      Alternative hypothesis 
---------------- ---- -------------- ------------------------
     3.295        27   0.002756 * *         two.sided        
-------------------------------------------------------------

Table: Paired t-test: `Modularity` by `Task` (continued below)

 
-------------------------
 mean of the differences 
-------------------------
         0.0595          
-------------------------
write.csv(mod, "Background_Modularity.csv", row.names=FALSE)

Between vs Within Network Connectivity

# Get modularity by subject onn thresholded, weighted matrix:
# Encoding and Retrieval:
network <- run_network(connMatrixE, connMatrixR, subjects, networks, th)
network$Measure <- as.factor(network$Measure)
network$Task <- as.factor(network$Task)
network$Subject <- as.factor(network$Subject)
# plots retrieval vs encoding within vs between network connectivity:
p <- ggplot(network, aes(x = Measure, y=Strength, fill=Task)) +
    stat_summary(fun.y = mean, geom="bar", alpha = 0.6, color = 'gray10', position = position_dodge(1)) +
    geom_dotplot(binaxis='y', stackdir='center', dotsize=1, alpha = 0.8, position = position_dodge(1)) +
    stat_summary(fun.data = mean_se, geom = "errorbar", fun.args = list(mult = 1.96),
                 width = 0.45, color = "black", size = 0.65, position = position_dodge(1)) +
    scale_fill_manual(values = c('gray50','gray80')) + geom_hline(yintercept = 0) + ylab("Mean Stength") + 
    ggtitle("Network Density") +
    theme(plot.title = element_text(hjust = 0.5, size=28), axis.line = element_line(colour = "black"), 
          axis.text = element_text(size = 22), axis.title = element_text(size = 24), panel.background = element_blank(),
          text = element_text(family="Helvetica")) 
plot(p) 

ggsave(paste('NetworkStrength_',th,'.jpg',sep=""), plot = last_plot(), dpi = 300, width = 6, height = 5)
#RUN ANOVA
pander(ezANOVA(data = network, dv = Strength, wid = Subject, 
        detailed = TRUE, within = .(Measure,Task)))


  * **ANOVA**:

    --------------------------------------------------------------------------------------
        Effect      DFn   DFd     SSn        SSd       F         p       p<.05     ges
    -------------- ----- ----- ---------- --------- ------- ----------- ------- ----------
     (Intercept)     1    27     15.07      1.633    249.2   3.718e-15     *      0.8873

       Measure       1    27     0.3201    0.06507   132.8   6.213e-12     *      0.1433

         Task        1    27     0.1102    0.2006    14.84   0.0006541     *     0.05445

     Measure:Task    1    27    0.006728   0.01589   11.43   0.002213      *     0.003502
    --------------------------------------------------------------------------------------


<!-- end of list -->
# within > between for both tasks (is PMAT structure valid?)
encoding <- subset(network, Task == 'Encoding')
pander(t.test(Strength ~ Measure, data=encoding, paired=TRUE))

----------------------------------------------------------------
 Test statistic   df       P value       Alternative hypothesis 
---------------- ---- ----------------- ------------------------
     -13.05       27   3.568e-13 * * *         two.sided        
----------------------------------------------------------------

Table: Paired t-test: `Strength` by `Measure` (continued below)

 
-------------------------
 mean of the differences 
-------------------------
         -0.1224         
-------------------------
retrieval <- subset(network, Task == 'Retrieval')
pander(t.test(Strength ~ Measure, data=retrieval, paired=TRUE))

----------------------------------------------------------------
 Test statistic   df       P value       Alternative hypothesis 
---------------- ---- ----------------- ------------------------
     -8.14        27   9.617e-09 * * *         two.sided        
----------------------------------------------------------------

Table: Paired t-test: `Strength` by `Measure` (continued below)

 
-------------------------
 mean of the differences 
-------------------------
        -0.09142         
-------------------------
write.csv(network, "Background_Density.csv", row.names=FALSE)
### save first level connectivity data
backgroundEncoding  <- connMatrixE # fisher z subject-specific connectivity matrices
backgroundRetrieval <- connMatrixR # ""
modularity <- mod
density <- network
ROIs <- seeds
save(ROIs, backgroundEncoding, backgroundRetrieval, modularity, density, file = "Background_connectivity_data.RData")
LS0tCnRpdGxlOiAiT3JiaXQgZk1SSSAtIFJPSSBCYWNrZ3JvdW5kIENvbm5lY3Rpdml0eSBBbmFseXNlcyIKb3V0cHV0OgogIGh0bWxfbm90ZWJvb2s6CiAgICBjb2RlX2ZvbGRpbmc6IGhpZGUKICAgIGZvbnRzaXplOiA2cHQKICAgIHRoZW1lOiBzcGFjZWxhYgogICAgdG9jOiB5ZXMKICAgIHRvY19mbG9hdDogeWVzCiAgaHRtbF9kb2N1bWVudDoKICAgIGRmX3ByaW50OiBwYWdlZAogICAgdG9jOiB5ZXMKLS0tCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+CmJvZHl7IC8qIE5vcm1hbCAgKi8KICAgICAgZm9udC1zaXplOiAxNHB4fQp0ZCB7ICAvKiBUYWJsZSAgKi8KICBmb250LXNpemU6IDEycHh9CmgxLnRpdGxlIHsKICBmb250LXNpemU6IDMwcHh9CmgxIHsgLyogSGVhZGVyIDEgKi8KICBmb250LXNpemU6IDI0cHh9CmgyIHsgLyogSGVhZGVyIDIgKi8KICAgIGZvbnQtc2l6ZTogMjBweH0KY29kZS5yeyAvKiBDb2RlIGJsb2NrICovCiAgICBm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