diff --git a/R/tar_factories.R b/R/tar_factories.R index 2aeac3e..50799ce 100644 --- a/R/tar_factories.R +++ b/R/tar_factories.R @@ -331,8 +331,8 @@ tar_fit_cfa <- function(config, data, theory, ) } -tar_prep_files_cpm <- function(params_subset = NULL) { - values <- config_files({{ params_subset }}) +tar_prep_files_cpm <- function(...) { + values <- set_config_cpm(...) c( tarchetypes::tar_eval( tar_target( @@ -368,14 +368,13 @@ tar_prep_files_cpm <- function(params_subset = NULL) { } # helper functions ---- -config_files <- function(params_subset = NULL) { - if (rlang::quo_is_null(rlang::enquo(params_subset))) params_subset <- TRUE +set_config_cpm <- function(...) { tidyr::expand_grid( params_fmri_tasks, params_xcpd, hypers_cpm ) |> - dplyr::filter({{ params_subset }}) |> + dplyr::filter(...) |> dplyr::mutate( file_fc = rlang::syms( sprintf( diff --git a/_scripts/g_factor.R b/_scripts/g_factor.R index 33f45e5..7fe4e37 100644 --- a/_scripts/g_factor.R +++ b/_scripts/g_factor.R @@ -22,6 +22,12 @@ options(clustermq.scheduler = "sge") options(clustermq.template = "clustermq.tmpl") tar_source() +config_cpm <- set_config_cpm( + atlas == "Schaefer217", + thresh_method == "alpha", + thresh_level == 0.01 +) + n_vars_total <- 76 n_steps <- 20 @@ -70,7 +76,7 @@ list( scores_g_imp ), tarchetypes::tar_map( - config_files(), + config_cpm, names = !starts_with("file"), tarchetypes::tar_rep( cpm_result, @@ -83,7 +89,9 @@ list( thresh_method, thresh_level ), .keep = "unused" - ) + ), + batches = 4, + reps = 5 ) ) ) diff --git a/_scripts/predict_phenotypes.R b/_scripts/predict_phenotypes.R index 6cb3a69..2b94b59 100644 --- a/_scripts/predict_phenotypes.R +++ b/_scripts/predict_phenotypes.R @@ -19,7 +19,7 @@ tar_option_set( tar_source() cpm_branches <- tarchetypes::tar_map( - config_files(), + set_config_cpm(), names = !starts_with("file"), tarchetypes::tar_rep( cpm_result,