Browse Source

Move global vars to top of main()

Bryan Roessler 7 tháng trước cách đây
mục cha
commit
f4581d7fcb
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      qhtcp-workflow/apps/r/calculate_interaction_zscores.R

+ 3 - 3
qhtcp-workflow/apps/r/calculate_interaction_zscores.R

@@ -586,6 +586,9 @@ main <- function() {
     out_dir_qc <- file.path(exp_path, "zscores", "qc")
     dir.create(out_dir, recursive = TRUE, showWarnings = FALSE)
     dir.create(out_dir_qc, recursive = TRUE, showWarnings = FALSE)
+
+    variables <- c("L", "K", "r", "AUC") # fields to filter and calculate across
+    group_vars <- c("OrfRep", "conc_num", "conc_num_factor") # default fields to group by
     
     message("Loading and filtering data")
     df <- load_and_process_data(args$easy_results_file, sd = exp_sd)
@@ -612,9 +615,6 @@ main <- function() {
         filter(., if_all(c(L), is.finite))
       }
     
-    variables <- c("L", "K", "r", "AUC") # fields to filter and calculate across
-    group_vars <- c("OrfRep", "conc_num", "conc_num_factor") # fields to group by
-
     # Set some constants
     max_conc <- max(df$conc_num_factor)
     l_half_median <- (median(df_above_tolerance$L, na.rm = TRUE)) / 2