Skip to contents

It runs the single_lmm function across vertices in a single hemisphere.

Usage

hemi_vw_lmm(
  formula,
  data_list,
  subj_dir,
  outp_dir = NULL,
  FS_HOME = "",
  folder_id = "folder_id",
  hemi,
  measure = gsub("vw_", "", all.vars(formula)[1]),
  fwhm = 10,
  target = "fsaverage",
  mcz_thr = 30,
  cwp_thr = 0.025,
  seed = 3108,
  apply_cortical_mask = TRUE,
  save_ss = TRUE,
  model = "lme4::lmer",
  cluster,
  verbose = TRUE
)

Arguments

formula

: a string or model formula object specifying a LME model, e.g. vw_thickness ~ sex * age + site + (1|id).

data_list

: a list of dataframes containing phenotype information (generated by imp2list)

subj_dir

: a string containing the path to the neuroimaging (FreeSurfer pre-processed) 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 created inside subj_dir.

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

hemi

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

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.

mcz_thr

: (default = 0.001) numeric value for the Monte Carlo simulation threshold. 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, \* default * 33 / 3.3 / 0.0005, * 40 / 4.0 / 0.0001.

cwp_thr

: (default = 0.025, when both hemispheres are ran, else 0.05) the cluster-wise p-value threshold on top of all corrections.

seed

: (default = 3108) random seed.

apply_cortical_mask

: (default = TRUE) remove vertices that are not on the cortex.

save_ss

: (default = TRUE) save the super-subject matrix as an rds file for quicker processing in the future.

model

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

cluster

: the parallel cluster

verbose

: (default = TRUE)

Value

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

Author

Serena Defina, 2024.