Skip to contents

This is is the main function in v0 of verywise. It checks the user inputs and runs the single_lmm function across all vertices.

Usage

run_vw_lmm(
  formula,
  pheno,
  subj_dir,
  outp_dir = NULL,
  hemi = c("both", "lh", "rh"),
  seed = 3108,
  n_cores = 1,
  FS_HOME = Sys.getenv("FREESURFER_HOME"),
  folder_id = "folder_id",
  verbose = TRUE,
  ...
)

Arguments

formula

: model formula object (this should specify a LME model)

pheno

: the phenotype data object (already loaded in the global environment) or a string containing a file path. Supported file extensions are: rds, csv, txt and sav.

subj_dir

: path to the FreeSurfer data, this expects a verywise structure.

outp_dir

: output path, where do you want results to be stored. If none is provided by the user, a "results" sub-directory will be created inside subj_dir.

hemi

: (default = "both") which hemispheres to run.

seed

: (default = 3108) random seed.

n_cores

: (default = 1) number of cores for parallel processing.

FS_HOME

: FreeSurfer directory, i.e. $FREESURFER_HOME.

folder_id

: (default = "folder_id") the name of the column in pheno that contains the directory names of the input neuroimaging data (e.g. "sub-10_ses-T1").

verbose

: (default = TRUE)

...

Arguments passed on to hemi_vw_lmm

measure

: (default = gsub("vw_", "", all.vars(formula)[1])) vertex-wise measure this should be the same as specified in formula

fwhm

: (default = 10) full-width half maximum value

target

: (default = "fsaverage") template on which to register vertex-wise data.

model

: (default = "lme4::lmer") # "stats::lm"

Value

A list of file-backed matrices containing pooled coefficients, SEs, t- and p- values and residuals.

Author

Serena Defina, 2024.