Reference
qdecr
Run vertex-wise analyses
On this page
Runs vertex-wise analyses using a variety of statistical models
Usage
qdecr(
id,
data,
vertex = "qdecr",
margs = NULL,
model = c("stats::lm", "QDECR::megha", "RcppEigen::fastLm", "stats::glm",
"survival::coxph", "default"),
target = "fsaverage",
hemi = c("lh", "rh"),
measure = c("thickness", "area", "area.pial", "curv", "jacobian_white", "pial",
"pial_lgi", "sulc", "volume", "w_g.pct", "white.H", "white.K"),
fwhm = ifelse(measure == "pial_lgi", 5, 10),
mcz_thr = 0.001,
cwp_thr = 0.025,
mgh = NULL,
mask = NULL,
mask_path = system.file("extdata", paste0(hemi, ".fsaverage.cortex.mask.mgh"),
package = "QDECR"),
project,
dir_subj = Sys.getenv("SUBJECTS_DIR"),
dir_fshome = Sys.getenv("FREESURFER_HOME"),
dir_tmp = dir_out,
dir_out,
dir_out_tree = TRUE,
file_out_tree = !dir_out_tree,
clean_up = TRUE,
clean_up_bm = TRUE,
clobber = FALSE,
verbose = TRUE,
debug = FALSE,
n_cores = 1,
prep_fun = "prep_fastlm",
analysis_fun = "analysis_chunkedlm",
chunk_size = 1000
)Arguments
idthe name of the id variable that matches the dataset to the Freesurfer output
dataa required argument that contains a data frame, a list of data frames or an imputed object that is supported by the
imp2listfunction (mice, mi, etc.).vertexthe preposition to the vertex measure (default: "qdecr_")
margsthe arguments that should be provided to the function of interest (e.g. stats::lm)
modelthe function to grab the arguments from (this will be removed in a later version)
targetthe target template (default = "fsaverage")
hemihemisphere to analyze ("lh" or "rh")
measurethe vertex-wise measure to use ("thickness", "area", etc.)
fwhmfull width half max (default = 10 mm, for pial_lgi it is 5 mm)
mcz_thrA numeric value for the Monte Carlo simulation threshold (default: 0.001). Any of the following are accepted (equivalent values separate by
/): 13/1.3/0.05, 20/2.0/0.01, 23/2.3/0.005, 30/3.0/0.001, 33/3.3/0.0005, 40/4.0/0.0001.cwp_thrthe cluster-wise p-value threshold on top of all correction (default = 0.025, as there are 2 hemispheres)
mghNOT IMPLEMENTED; path to existing merged mgh file, default is NULL
maskmgh file to mask analysis; default is to use the cortex label from the target
mask_pathpath to the mask; default is the cortex mask that is provided with the QDECR package
projectthe base name you want to assign to the output files
dir_subjdirectory contain the surface-based maps (mgh files); defaults to SUBJECTS_DIR
dir_fshomeFreesurfer directory; defaults to FREESURFER_HOME
dir_tmpdirectory to store the temporary big matrices; useful for shared memory; defaults to
dir_outdir_outthe directory where to save the data to (defaults to the current directory)
dir_out_treeif TRUE, creates a dir_out/project directory. If FALSE, all output is placed directory into dir_out
file_out_treeif TRUE, adds the full project name to the output file names. By default it is the inverse of dir_out_tree
clean_upNOT IMPLEMENTED; will be used for setting cleaning of other files
clean_up_bmif TRUE, cleans all big matrices (.bk) that were generated in dir_tmp
clobberif TRUE, ignores already existing directories and writes over them; if FALSE, stops and warns user that a given directory already exists
verboseif TRUE, writes out standard log; if FALSE, no output is generated
debugNOT IMPLEMENTED; will output the maximal log to allow for easy debugging
n_coresthe number of cores to be used
prep_funName of the function that needs to be called for the preparation step (do not touch unless you know what you are doing!)
analysis_funName of the function that needs to be called for the analysis step (do not touch unless you know what you are doing!)
chunk_sizeInteger; the desired chunk size for the chunked lm
Value
out
Details
This function is the worker function of the QDECR package. It allows .mgh format data as input and allows statistical analyses per vertex. A variety of statistical models have been implemented, such as linear regression.