Suite of functions for Connectome-based Predictive Modeling (CPM). See and cite Finn et al., 2015; Rosenberg et al., 2016; Shen et al., 2017
cpmIV
Internal Validation method (Rosenberg et al., 2016; Shen et al., 2017). Using a leave-one-out approach,
this method correlates a behavioral statistic bstat
with each edge of a whole-brain network across
participants. Using the significant edges in the network thresh
, a connectome model
is built (without the participant's network). A linear regression model is fit, with the behavioral
statistic being regressed on the connectome model. The left out participants connectome model is then
used with the linear regression weights to compute their predicted behavioral score. This is repeated
for every participant. The predicted scores are correlated with their observed score. Significant values
suggest that the connectome is related to the behavioral statistic
cpmIVperm
Performs a permutation test of the results obtained by cpmIV
. The permutation test quantifies
whether the results obtained by the original cpmIV
are significantly different than a random model
(see Shen et al., 2017)
cpmEV
UNDER DEVELOPMENT. External Validation method (Beaty et al., 2018). Performs similar function as cpmIV
but uses data
to train train_na
the connectome model using a behavioral statistic train_b
.
This training connectome model is then used to predict another dataset valid_na
,
using the same behavioral statistic valid_b
. The full training dataset FALSE
or
the leave-one-out overlap = TRUE
approach can be used
cpmFP
Fingerprinting method (Finn et al., 2015). Uses CPM approach to identify participants across two sessions
cpmFPperm
Fingerprinting method (Finn et al., 2015). Uses permutation method to estimate the significance of
of the cpmFP
results
cpmPlot
Plots the CPM results
cpmIV(neuralarray, bstat, kfolds, covar, thresh = .01,
connections = c("separate", "overall"), groups = NULL,
method = c("mean", "sum"), model = c("linear","quadratic","cubic"),
corr = c("pearson","spearman"), nEdges,
standardize = FALSE, cores, progBar = TRUE, plots = TRUE)
cpmIVperm(iter = 1000, ...)
cpmEV(train_na, train_b, valid_na, valid_b, thresh = .01,
overlap = FALSE, progBar = TRUE)
cpmFP(session1, session2, progBar = TRUE)cpmFPperm(session1, session2, iter = 1000, progBar = TRUE)
cpmPlot(cpm.obj, visual.nets = FALSE)
Array from convertConnBrainMat
function
Behavioral statistic for each participant with neural data (a vector)
Numeric.
Number of k-fold validation samples.
Defaults to the number of participants in the sample (i.e., n),
which is also known as leave-one-out validation.
Recommended folds are 5
and 10
Covariates to be included in predicting relevant edges (time consuming).
Must be input as a list()
(see examples)
Sets an \(\alpha\) threshold for edge weights to be retained.
Defaults to .01
Character.
Should positive and negative correlations be separated or used together?
Defaults to "separate"
Allows grouping variables to be used for plotting points.
Must be a vector.
Defaults to NULL
Use "mean"
or "sum"
of edge strengths in the positive and negative connectomes.
Defaults to "mean"
Regression model to use for fitting the data.
Defaults to "linear"
Correlation method for assessing the relationship between the behavioral measure and edges between ROIs.
Defaults to "pearson"
.
Set to "spearman"
for non-linear or monotonic associations
Number of participants that are required to have an edge to appear in the plots. Defaults to 10 percent of edges in participants
Should the behavioral statistic (bstat
) be standardized?
Defaults to FALSE
Number of computer processing cores to use when performing covariate analyses. Defaults to n - 1 total number of cores. Set to any number between 1 and maximum amount of cores on your computer
Should progress bar be displayed?
Defaults to TRUE
.
Set to FALSE
for no progress bar
Should plots be plotted?
Defaults to TRUE
.
Set to FALSE
to hide plots
Training dataset
(an array from convertConnBrainMat
function)
Behavioral statistic for each participant for the training neural data (a vector)
Validation dataset
(an array from convertConnBrainMat
function)
Behavioral statistic for each participant for the validation neural data (a vector)
Should leave-one-out cross-validation be used?
Defaults to FALSE
(use full dataset, no leave-one-out).
Set to TRUE
to select edges that appear in every leave-one-out cross-validation network (time consuming)
Array from convertConnBrainMat
function
(first session)
Array from convertConnBrainMat
function
(second session)
Number of iterations to perform.
Defaults to 1000
cpm
object
Boolean.
Uses qgraph
to plot connectivity
between the networks as a network.
Defaults to FALSE
.
Set to TRUE
to visualize the networks
Additional arguments to be passed from a cpm
function
cpmIV
and cpmEV
:
Returns a list containing:
A matrix containing: r coefficient (r
), p-value (p-value
),
mean absolute error (mae
), root mean square error (rmse
)
Positive connectivity for input in BioImage Suite Connectivity Viewer
Negative connectivity for input in BioImage Suite Connectivity Viewer
cpmIVperm:
Returns a matrix containing p-values for positive and negative prediction models
cpmFP:
Returns a matrix containing the percentage and number of correctly identified subjects for sessions 1 and 2
cpmPlot:
Returns plot of connectivity differences between the positive and negative masks
Beaty, R. E., Kenett, Y. N., Christensen, A. P., Rosenberg, M. D., Benedek, M., Chen, Q., Fink, A., Qiu, J., Kwapil, T. R., Kane, M. J., & Silvia, P. J. (2018). Robust prediction of individual creative ability from brain functional connectivity. Proceedings of the National Academy of Sciences, 115, 1087-1092.
Finn, E. S., Shen, X., Scheinost, D., Rosenberg, M. D., Huang, J., Chun, M. M., Papademetris, X., Constable, R. T. (2015). Functional connectome fingerprinting: Identifying individuals using patterns of brain connectivity. Nature Neuroscience, 18, 1664-1671.
Rosenberg, M. D., Finn, E. S., Scheinost, D., Papademetris, X., Shen, X., Constable, R. T., Chun, M. M. (2016). A neuromarker of sustained attention from whole-brain functional connectivity. Nature Neuroscience, 19, 165-171.
Shen, X. Finn, E. S., Scheinost, D., Rosenberg, M. D., Chun, M. M., Papademetris, X., Constable, R. T. (2017). Using connectome-based predictive modeling to predict individual behavior from brain connectivity. Nature Protocols, 12, 506-518.
Wei, T. & Simko, V.(2017). R package "corrplot": Visualization of a correlation matrix (Version 0.84).
# NOT RUN {
# Load data
behav <- behavOpen
# }
# NOT RUN {
# Create path to temporary file
temp <- tempfile()
# Download to temporary file
googledrive::drive_download(
paste("https://drive.google.com/file/d/",
"1T7_mComB6HPxJxZZwwsLLSYHXsOuvOBt",
"/view?usp=sharing", sep = ""),
path = temp
)
# Load resting state brain data
load(temp)
# Run cpmIV
res <- cpmIV(neuralarray = restOpen, bstat = behav, cores = 4)
# Plot cpmIV results
cpmPlot(res)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab