knitr::opts_chunk$set(echo = TRUE)
1) make a directory for the MarginalModelCifti package mkdir ~/MarginalModelCifti
2) enter the directory cd ~/MarginalModelCifti
3) clone the MarginalModelCifti repository git clone https://gitlab.com/Fair_lab/marginalmodelcifti.git ./
4) return to your initial home directory cd ..
5) Type R
6) After a prompt appears, make sure devtools is installed by typing install.packages("devtools")
7) Load devtools library(devtools)
8) install the MarginalModelCifti package install("MarginalModelCifti/")
NOTE: You may also want to clone the SurfConnectivity package, in case you do not have access to it.
a) make a directory for SurfConnectivity mkdir ~/SurfConnectivity
b) go into SurfConnectivity folder cd ~/SurfConnectivity
c) clone the SurfConnectivity repository here git clone https://gitlab.com/Fair_lab/surfconnectivity.git ./
NOTE: You may also want to clone the CommunityChisquared package, in case you do not have access to it.
i) make a directory for CommunityChisquared mkdir ~/CommunityChiSquaredAnalysis
ii) go into CommunityChisquared folder cd ~/CommunityChiSquaredAnalysis
iii) clone the CommunityChiSquared repostory here git clone https://github.com/DCAN-Labs/CommunityChiSquaredAnalysis.git ./
library(MarginalModelCifti)
projectsfolder="/mnt/rose/shared/projects/ABCD/avg_pconn_maker/" setwd(projectsfolder) getwd()
external_df="/mnt/rose/shared/projects/ABCD/avg_pconn_maker/cordova_analysis_margmod_pcs/gp1_10min_pconn.csv"
concfile="/mnt/rose/shared/projects/ABCD/avg_pconn_maker/cordova_analysis_margmod_pcs/group1_10min.conc"
structtype="pconn"
structtype
is set to "surface", set the below variable structfile to the corresponding surface file.structfile=NULL
matlab_path="/mnt/max/shared/code/external/utilities/Matlab2016bRuntime/v91"
surf_command="/mnt/max/shared/projects/FAIR_users/Feczko/code_in_dev/SurfConnectivity/"
formula
to make a formal notation within R.external_df
csv header.notation = formula(y~pc2_new)
corstr
to the correlation structure of the cases. Usually this should just be "independence".corstr="independence"
family_dist
to the appropriate distribution of your data, "gaussian" is the defaultfamily_dist="gaussian"
dist_type
to the distribution used for wild bootstrapping.dist_type="radenbacher"
z_thresh
to the z statistic threshold used for determining observed and permuted cluster sizesz_thresh = 2.3
nboot
to the number of wild bootstraps to perform.nboot
.nboot=4
p_thresh
to the p value threshold for assessing significant clusters.p_thresh=0.05
sigtype
to determine how to perform multiple comparison correction.sigtype="enrichment"
id_subjects
to the column header containing the subject id in the external_df
file.id_subjects="subjectkey"
output_directory
to where you want to save your outputsoutput_directory="/mnt/rose/shared/projects/ABCD/avg_pconn_maker/cordova_analysis_margmod_pcs/pc2_gp1_test"
ncores
to how many CPUs to run permutation testing in parallelncores=4
zcor
to a custom covariance matrix to denote participant similarity (e.g. a kinship or site matrix)zcor=NULL
fastSwE
enables the fast sandwich estimator.fastSwE=TRUE
adjustment=NULL
wave
to a csv file that denotes how subjects should be grouped and nestedwave = "/mnt/rose/shared/projects/ABCD/avg_pconn_maker/cordova_analysis_margmod_pcs/gp1_marg_nested.csv"
norm_external_data=TRUE
norm_internal_data=TRUE
marginal_outputs = FALSE
marginal_matrix = NULL
enrichment_path = "/mnt/max/shared/projects/FAIR_users/Feczko/code_in_dev/CommunityChisquaredAnalysis/"
modules = "/mnt/max/shared/projects/FAIR_users/Feczko/code_in_dev/CommunityChisquaredAnalysis/gordon_modules.csv"
wb_command = "/usr/local/bin/wb_command"
ConstructMarginalModel
commandall_maps <- ConstructMarginalModel(external_df=external_df,concfile=concfile,structtype=structtype,structfile=structfile,matlab_path=matlab_path,surf_command=surf_command,wave=wave,notation=notation,zcor=zcor,corstr=corstr,family_dist=family_dist,dist_type=dist_type,z_thresh=z_thresh,nboot=nboot,p_thresh=p_thresh,sigtype=sigtype,id_subjects=id_subjects,output_directory=output_directory,ncores=ncores,fastSwE=fastSwE,adjustment=adjustment,norm_external_data=norm_external_data,norm_internal_data=norm_internal_data,marginal_outputs=marginal_outputs,marginal_matrix=marginal_matrix,enrichment_path=enrichment_path,modules=modules,wb_command=wb_command)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.