qdecr_fastlm: Vertex-wise linear regression

Description Usage Arguments Value

View source: R/qdecr_fastlm.R

Description

Vertex-wise linear regression

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
qdecr_fastlm(
  formula,
  data,
  id,
  hemi,
  weights = NULL,
  dir_out = getwd(),
  project,
  n_cores = 1,
  target = "fsaverage",
  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"),
  dir_subj = Sys.getenv("SUBJECTS_DIR"),
  dir_fshome = Sys.getenv("FREESURFER_HOME"),
  dir_tmp = dir_out,
  dir_out_tree = TRUE,
  file_out_tree = !dir_out_tree,
  clean_up_bm = TRUE,
  clean_up = TRUE,
  clobber = FALSE,
  verbose = TRUE,
  save = TRUE,
  save_data = TRUE,
  debug = FALSE,
  custom_measure = NULL,
  prep_fun = "prep_fastlm",
  analysis_fun = "analysis_chunkedlm",
  chunk_size = 1000
)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. See '?lm'.

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.).

id

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

hemi

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

weights

Optinal vector of weights for the observations. See '?lm'.

dir_out

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

project

the base name you want to assign to the output files

n_cores

the number of cores to be used

target

the target template (default = "fsaverage")

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

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_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_bm

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

clean_up

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

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

save

if TRUE, saves the output to a .rds file

save_data

if TRUE, includes the raw data + design matrices in the .rds file

debug

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

custom_measure

a string that starts with "qdecr_" followed by the name of a surface file that is not created by FreeSurfer by default (e.g. "qdecr_cc" or "qdecr_test"). Note that the surface files MUST be located in the surf subdirectory of each individual's FreeSurfer output, and the files must follow the naming conventions of the other .mgh files (e.g. "lh.test.fwhm10.fsaverage.mgh")

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

Value

returns an object of classes "vw_fastlm" and "vw".


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