get_l1_confounds: helper function to generate confounds txt file for inclusion...

View source: R/get_l1_confounds.R

get_l1_confoundsR Documentation

helper function to generate confounds txt file for inclusion as additional regressors

Description

helper function to generate confounds txt file for inclusion as additional regressors

Usage

get_l1_confounds(
  run_df = NULL,
  id = NULL,
  session = NULL,
  run_number = NULL,
  gpa,
  demean = TRUE
)

Arguments

run_df

a single-row data.frame containing information about the run whose confounds should be calculated

id

The subject id

session

The session number

run_number

The run number

gpa

a glm_pipeline_arguments object containing pipeline specification

demean

whether to demean confounds after calculation

Details

This function checks for whether an l1 confounds file already exists in the expected location. If it does not, the l1 confounds file will be generated according to the $confound_settings$l1_confound_regressors variable. If that is NULL, no confounds will be created.

Confounds are generated by looking for motion parameters based on $confound_settings$motion_params_file and $confound_settings$confound_input_file. These are integrated, then columns that are requested in $confound_settings$l1_confound_regressors are written to a text file in the analysis subfolder for each subject

Likewise, any run-level exclusions are tested according to $confound_settings$exclude_run. This should be a quoted expression that can tested against the confounds data.frame such that a single TRUE/FALSE is returned indicating whether a run is excluded (TRUE) or retained (FALSE) for higher-level analyses.

Value

a list containing: confounds=<location of l1 confounds file>, exclude_run=<TRUE/FALSE denoting run exclusion, exclude_data=<location of file containing columns used to calculate run exclusion>


UNCDEPENdLab/fmri.pipeline documentation built on April 3, 2025, 3:21 p.m.