export_glm_config: Output GLM configuration to a '.yaml' or 'json' file

View source: R/yaml_outputs.R

export_glm_configR Documentation

Output GLM configuration to a '.yaml' or 'json' file

Description

Output GLM configuration to a '.yaml' or 'json' file

Usage

export_glm_config(gpa, file = "glm_config.yaml")

Arguments

gpa

the 'glm_pipeline_arguments' object with relevant fields already populated, including '$l1_models', '$l2_models', and/or '$l3_models'.

file

the filename for the exported configuration file

Details

This function exports the configuration of level 1, 2, and 3 GLM models in a 'glm_pipeline_arguments' (aka 'gpa') object to a YAML or JSON file. This allows the user to setup their models from this configuration file, rather than having to go through the building process manually (with prompts).

Typically, the user will first run 'build_l1_models', 'build_l2_models' (for multi-run data), and 'build_l3_models', then run 'export_glm_config' so that the decisions made during the build process are codified in the resulting file.

Value

invisibly return the YAML/JSON syntax written to 'file'

Examples

## Not run: 
  gpa <- setup_glm_pipeline(analysis_name="flanker_test",
    output_directory="/proj/mnhallqlab/no_backup/flanker_gnomes",
    n_expected_runs = 2, tr = 2.0
    run_data = run_df, subject_data = subject_df, trial_data = trial_df,
    l1_models=NULL, l2_models=NULL, l3_models=NULL
  )

 # setup level 1 models through menu system
 gpa <- build_l1_models(gpa)

 # for multi-run data, setup level 2 models through menu system
 gpa <- build_l2_models(gpa)

 # setup level 3 models through menu system
 gpa <- build_l3_models(gpa)

 # export model configuration to YAML file
 export_glm_config(gpa, file="my_glm_config.yaml")

 # in future, we can build the models from the file, rather than menus
 gpa <- build_l1_models(gpa, from_spec_file="my_glm_config.yaml")
 gpa <- build_l2_models(gpa, from_spec_file="my_glm_config.yaml")
 gpa <- build_l3_models(gpa, from_spec_file="my_glm_config.yaml")

## End(Not run)

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