Skip to content

Commit

Permalink
add flag for recoding to any variant
Browse files Browse the repository at this point in the history
  • Loading branch information
saraloo committed Nov 13, 2023
1 parent a6c268e commit 087ae14
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion preprocessing/seir_recode_omicron.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ option_list <- list(
optparse::make_option(c("--res_config"), action = "store", default = Sys.getenv("RESUMED_CONFIG_PATH", NA), type = "character", help = "path to the previous config file"),
optparse::make_option(c("-c", "--config"), action = "store", default = Sys.getenv("CONFIG_PATH"), type = "character", help = "path to the config file"),
optparse::make_option(c("-p", "--flepi_path"), action="store", type='character', default = Sys.getenv("FLEPI_PATH", "flepiMoP/"), help="path to the flepiMoP directory"),
optparse::make_option(c("-v", "--recode_variant"), action="store", type='character', default = Sys.getenv("RECODE_VAR", "OMICRON"), help="variant you want to change all variant_types to"),
optparse::make_option(c("--in_filename"), action="store", type='character', default = Sys.getenv("IN_FILENAME"), help="seir file global intermediate name"), # This is the CONTINUED SEIR filename
optparse::make_option(c("--init_filename"), action="store", type='character', default = Sys.getenv("INIT_FILENAME"), help="init file global intermediate name") # This is the new init filename
)
Expand Down Expand Up @@ -71,7 +72,7 @@ seir_dt <- continued_seir %>% mutate(date = lubridate::as_date(date)) %>%
filter(mc_value_type == "prevalence") %>%
filter(date == transition_date) %>%
pivot_longer(cols = -c(starts_with("mc_"), date), names_to = "geoid", values_to = "value") %>%
mutate(mc_variant_type = "OMICRON") %>%
mutate(mc_variant_type = opt$recode_variant) %>%
group_by(across(c(-value))) %>%
summarise(value = sum(value, na.rm = TRUE)) %>%
dplyr::mutate(mc_name = paste(mc_infection_stage, mc_vaccination_stage, mc_variant_type, mc_age_strata, sep = "_"))
Expand Down

0 comments on commit 087ae14

Please sign in to comment.