qdecr: Run vertex-wise analyses

Description Usage Arguments Details Value

View source: R/qdecr.R

Description

Runs vertex-wise analyses using a variety of statistical models

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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

id

the name of the id variable that matches the dataset to the Freesurfer output

data

a required argument that contains a data frame, a list of data frames or an imputed object that is supported by the 'imp2list' function (mice, mi, etc.).

vertex

the preposition to the vertex measure (default: "qdecr_")

margs

the arguments that should be provided to the function of interest (e.g. stats::lm)

model

the function to grab the arguments from (this will be removed in a later version)

target

the target template (default = "fsaverage")

hemi

hemisphere to analyze ("lh" or "rh")

measure

the vertex-wise measure to use ("thickness", "area", etc.)

fwhm

full width half max (default = 10 mm, for pial_lgi it is 5 mm)

mcz_thr

A 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_thr

the cluster-wise p-value threshold on top of all correction (default = 0.025, as there are 2 hemispheres)

mgh

NOT IMPLEMENTED; path to existing merged mgh file, default is NULL

mask

mgh file to mask analysis; default is to use the cortex label from the target

mask_path

path to the mask; default is the cortex mask that is provided with the QDECR package

project

the base name you want to assign to the output files

dir_subj

directory contain the surface-based maps (mgh files); defaults to SUBJECTS_DIR

dir_fshome

Freesurfer directory; defaults to FREESURFER_HOME

dir_tmp

directory to store the temporary big matrices; useful for shared memory; defaults to 'dir_out'

dir_out

the directory where to save the data to (defaults to the current directory)

dir_out_tree

if TRUE, creates a dir_out/project directory. If FALSE, all output is placed directory into dir_out

file_out_tree

if TRUE, adds the full project name to the output file names. By default it is the inverse of dir_out_tree

clean_up

NOT IMPLEMENTED; will be used for setting cleaning of other files

clean_up_bm

if TRUE, cleans all big matrices (.bk) that were generated in dir_tmp

clobber

if TRUE, ignores already existing directories and writes over them; if FALSE, stops and warns user that a given directory already exists

verbose

if TRUE, writes out standard log; if FALSE, no output is generated

debug

NOT IMPLEMENTED; will output the maximal log to allow for easy debugging

n_cores

the number of cores to be used

prep_fun

Name of the function that needs to be called for the preparation step (do not touch unless you know what you are doing!)

analysis_fun

Name of the function that needs to be called for the analysis step (do not touch unless you know what you are doing!)

chunk_size

Integer; the desired chunk size for the chunked lm

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.

Value

out


slamballais/QDECR documentation built on Jan. 9, 2022, 1:22 p.m.