Skip to content

Commit

Permalink
update yaml actions
Browse files Browse the repository at this point in the history
  • Loading branch information
emprestige committed Aug 14, 2024
1 parent 3ae705b commit 138a13a
Show file tree
Hide file tree
Showing 4 changed files with 316 additions and 204 deletions.
2 changes: 1 addition & 1 deletion actions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ describe_cohort_older_adults_s1 describe_cohort_older_adults_s2 describe_cohort_
describe_cohort_adults_s1 describe_cohort_adults_s2 describe_cohort_adults_s3 describe_cohort_adults_s4 describe_cohort_adults_s5 describe_cohort_adults_s6 describe_cohort_adults_s7
describe_cohort_children_and_adolescents_s1 describe_cohort_children_and_adolescents_s2 describe_cohort_children_and_adolescents_s3 describe_cohort_children_and_adolescents_s4 describe_cohort_children_and_adolescents_s5 describe_cohort_children_and_adolescents_s6 describe_cohort_children_and_adolescents_s7
describe_cohort_infants_s1 describe_cohort_infants_s2 describe_cohort_infants_s3 describe_cohort_infants_s4 describe_cohort_infants_s5 describe_cohort_infants_s6 describe_cohort_infants_s7
collate_flow_chart_tables_older_adults collate_table1_tables_older_adults collate_rates_tables_older_adults collate_rsv_model_outputs_tables_older_adults collate_flu_model_outputs_tables_older_adults collate_covid_model_outputs_tables_older_adults collate_overall_and_all_cause_model_outputs_tables_older_adults collate_rsv_sensitivity_model_outputs_tables_older_adults collate_flu_sensitivity_model_outputs_tables_older_adults collate_covid_sensitivity_model_outputs_tables_older_adults collate_overall_and_all_cause_sensitivity_model_outputs_tables_older_adults collate_flow_chart_tables_adults collate_table1_tables_adults collate_rates_tables_adults collate_rsv_model_outputs_tables_adults collate_flu_model_outputs_tables_adults collate_covid_model_outputs_tables_adults collate_overall_and_all_cause_model_outputs_tables_adults collate_rsv_sensitivity_model_outputs_tables_adults collate_flu_sensitivity_model_outputs_tables_adults collate_covid_sensitivity_model_outputs_tables_adults collate_overall_and_all_cause_sensitivity_model_outputs_tables_adults collate_flow_chart_tables_children_and_adolescents collate_table1_tables_children_and_adolescents collate_rates_tables_children_and_adolescents collate_rsv_model_outputs_tables_children_and_adolescents collate_flu_model_outputs_tables_children_and_adolescents collate_covid_model_outputs_tables_children_and_adolescents collate_overall_and_all_cause_model_outputs_tables_children_and_adolescents collate_rsv_sensitivity_model_outputs_tables_children_and_adolescents collate_flu_sensitivity_model_outputs_tables_children_and_adolescents collate_covid_sensitivity_model_outputs_tables_children_and_adolescents collate_overall_and_all_cause_sensitivity_model_outputs_tables_children_and_adolescents collate_flow_chart_tables_infants collate_table1_tables_infants collate_rates_tables_infants collate_rsv_model_outputs_tables_infants collate_flu_model_outputs_tables_infants collate_covid_model_outputs_tables_infants collate_overall_and_all_cause_model_outputs_tables_infants collate_rsv_sensitivity_model_outputs_tables_infants collate_flu_sensitivity_model_outputs_tables_infants collate_covid_sensitivity_model_outputs_tables_infants collate_overall_and_all_cause_sensitivity_model_outputs_tables_infants
collate_flow_chart_tables_older_adults collate_table1_tables_older_adults collate_rates_tables_specific_primary_older_adults collate_rates_tables_sensitive_primary_older_adults collate_rates_tables_sensitive_secondary_older_adults collate_rsv_model_outputs_tables_older_adults collate_flu_model_outputs_tables_older_adults collate_covid_model_outputs_tables_older_adults collate_overall_and_all_cause_model_outputs_tables_older_adults collate_rsv_sensitivity_model_outputs_tables_older_adults collate_flu_sensitivity_model_outputs_tables_older_adults collate_covid_sensitivity_model_outputs_tables_older_adults collate_overall_and_all_cause_sensitivity_model_outputs_tables_older_adults collate_flow_chart_tables_adults collate_table1_tables_adults collate_rates_tables_specific_primary_adults collate_rates_tables_sensitive_primary_adults collate_rates_tables_sensitive_secondary_adults collate_rsv_model_outputs_tables_adults collate_flu_model_outputs_tables_adults collate_covid_model_outputs_tables_adults collate_overall_and_all_cause_model_outputs_tables_adults collate_rsv_sensitivity_model_outputs_tables_adults collate_flu_sensitivity_model_outputs_tables_adults collate_covid_sensitivity_model_outputs_tables_adults collate_overall_and_all_cause_sensitivity_model_outputs_tables_adults collate_flow_chart_tables_children_and_adolescents collate_table1_tables_children_and_adolescents collate_rates_tables_specific_primary_children_and_adolescents collate_rates_tables_sensitive_primary_children_and_adolescents collate_rates_tables_sensitive_secondary_children_and_adolescents collate_rsv_model_outputs_tables_children_and_adolescents collate_flu_model_outputs_tables_children_and_adolescents collate_covid_model_outputs_tables_children_and_adolescents collate_overall_and_all_cause_model_outputs_tables_children_and_adolescents collate_rsv_sensitivity_model_outputs_tables_children_and_adolescents collate_flu_sensitivity_model_outputs_tables_children_and_adolescents collate_covid_sensitivity_model_outputs_tables_children_and_adolescents collate_overall_and_all_cause_sensitivity_model_outputs_tables_children_and_adolescents collate_flow_chart_tables_infants collate_table1_tables_infants collate_rates_tables_specific_primary_infants collate_rates_tables_sensitive_primary_infants collate_rates_tables_sensitive_secondary_infants collate_rsv_model_outputs_tables_infants collate_flu_model_outputs_tables_infants collate_covid_model_outputs_tables_infants collate_overall_and_all_cause_model_outputs_tables_infants collate_rsv_sensitivity_model_outputs_tables_infants collate_flu_sensitivity_model_outputs_tables_infants collate_covid_sensitivity_model_outputs_tables_infants collate_overall_and_all_cause_sensitivity_model_outputs_tables_infants

109 changes: 70 additions & 39 deletions create-project.R
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ action_finalise <- function(cohort) {

action(
name = glue("collate_flow_chart_tables_{cohort}"),
run = glue("r:latest analysis/flow_chart_table_collation.R {cohort}"),
run = glue("r:latest analysis/collation_code/flow_chart_table_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("process_flow_chart_data_{cohort}_s1"),
glue("process_flow_chart_data_{cohort}_s2"),
Expand All @@ -778,56 +778,72 @@ action_finalise <- function(cohort) {
glue("process_flow_chart_data_{cohort}_s6"),
glue("process_flow_chart_data_{cohort}_s7")),
moderately_sensitive = lst(
csv = glue("output/results/collated/{cohort}_flow_chart_collated.csv"),
csv = glue("output/collated/descriptive/{cohort}_flow_chart_collated.csv"),
)
),
action(
name = glue("collate_table1_tables_{cohort}"),
run = glue("r:latest analysis/table1_table_collation.R {cohort}"),
run = glue("r:latest analysis/collation_code/table1_table_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("describe_cohort_{cohort}_s1"),
glue("describe_cohort_{cohort}_s2"),
glue("describe_cohort_{cohort}_s3"),
glue("describe_cohort_{cohort}_s4"),
glue("describe_cohort_{cohort}_s5"),
glue("describe_cohort_{cohort}_s6"),
glue("describe_cohort_{cohort}_s7")),
moderately_sensitive = lst(
csv = glue("output/collated/descriptive/{cohort}_table1_collated.csv"))
),

action(
name = glue("collate_rates_tables_specific_primary_{cohort}"),
run = glue("r:latest analysis/collation_code/rates_table_specific_primary_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("describe_dataset_{cohort}_s1_specific_primary"),
glue("describe_dataset_{cohort}_s2_specific_primary"),
glue("describe_dataset_{cohort}_s3_specific_primary"),
glue("describe_dataset_{cohort}_s4_specific_primary"),
glue("describe_dataset_{cohort}_s5_specific_primary"),
glue("describe_dataset_{cohort}_s6_specific_primary"),
glue("describe_dataset_{cohort}_s7_specific_primary"),
glue("describe_dataset_{cohort}_s1_sensitive_primary"),
glue("describe_dataset_{cohort}_s7_specific_primary")),
moderately_sensitive = lst(
csv = glue("output/collated/descriptive/{cohort}_rates_specific_primary_collated.csv"))
),

action(
name = glue("collate_rates_tables_sensitive_primary_{cohort}"),
run = glue("r:latest analysis/collation_code/rates_table_sensitive_primary_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("describe_dataset_{cohort}_s1_sensitive_primary"),
glue("describe_dataset_{cohort}_s2_sensitive_primary"),
glue("describe_dataset_{cohort}_s3_sensitive_primary"),
glue("describe_dataset_{cohort}_s4_sensitive_primary"),
glue("describe_dataset_{cohort}_s5_sensitive_primary"),
glue("describe_dataset_{cohort}_s6_sensitive_primary"),
glue("describe_dataset_{cohort}_s7_sensitive_primary")),
moderately_sensitive = lst(
csv = glue("output/results/collated/{cohort}_table1_collated.csv"))
csv = glue("output/collated/descriptive/{cohort}_rates_sensitive_primary_collated.csv"))
),

action(
name = glue("collate_rates_tables_{cohort}"),
run = glue("r:latest analysis/rates_table_collation.R {cohort}"),
name = glue("collate_rates_tables_sensitive_secondary_{cohort}"),
run = glue("r:latest analysis/collation_code/rates_table_sensitive_secondary_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("process_dataset_{cohort}_s1_specific_primary"),
glue("process_dataset_{cohort}_s2_specific_primary"),
glue("process_dataset_{cohort}_s3_specific_primary"),
glue("process_dataset_{cohort}_s4_specific_primary"),
glue("process_dataset_{cohort}_s5_specific_primary"),
glue("process_dataset_{cohort}_s6_specific_primary"),
glue("process_dataset_{cohort}_s7_specific_primary"),
glue("process_dataset_{cohort}_s1_sensitive_primary"),
glue("process_dataset_{cohort}_s2_sensitive_primary"),
glue("process_dataset_{cohort}_s3_sensitive_primary"),
glue("process_dataset_{cohort}_s4_sensitive_primary"),
glue("process_dataset_{cohort}_s5_sensitive_primary"),
glue("process_dataset_{cohort}_s6_sensitive_primary"),
glue("process_dataset_{cohort}_s7_sensitive_primary")),
needs = list(glue("describe_dataset_{cohort}_s1_sensitive_secondary"),
glue("describe_dataset_{cohort}_s2_sensitive_secondary"),
glue("describe_dataset_{cohort}_s3_sensitive_secondary"),
glue("describe_dataset_{cohort}_s4_sensitive_secondary"),
glue("describe_dataset_{cohort}_s5_sensitive_secondary"),
glue("describe_dataset_{cohort}_s6_sensitive_secondary"),
glue("describe_dataset_{cohort}_s7_sensitive_secondary")),
moderately_sensitive = lst(
csv = glue("output/results/collated/{cohort}_rates_collated.csv"))
csv = glue("output/collated/descriptive/{cohort}_rates_sensitive_secondary_collated.csv"))
),

action(
name = glue("collate_rsv_model_outputs_tables_{cohort}"),
run = glue("r:latest analysis/rsv_model_outputs_table_collation.R {cohort}"),
run = glue("r:latest analysis/collation_code/rsv_model_outputs_table_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("analyse_dataset_{cohort}_rsv_ethnicity_s1_specific_primary"),
glue("analyse_dataset_{cohort}_rsv_ethnicity_s2_specific_primary"),
Expand Down Expand Up @@ -879,12 +895,12 @@ action_finalise <- function(cohort) {
glue("analyse_dataset_{cohort}_rsv_full_s6_specific_primary"),
glue("analyse_dataset_{cohort}_rsv_full_s7_specific_primary")),
moderately_sensitive = lst(
csv = glue("output/results/collated/{cohort}_rsv_model_outputs_collated.csv"))
csv = glue("output/collated/analytic/{cohort}_rsv_model_outputs_collated.csv"))
),

action(
name = glue("collate_flu_model_outputs_tables_{cohort}"),
run = glue("r:latest analysis/flu_model_outputs_table_collation.R {cohort}"),
run = glue("r:latest analysis/collation_code/flu_model_outputs_table_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("analyse_dataset_{cohort}_flu_ethnicity_s1_specific_primary"),
glue("analyse_dataset_{cohort}_flu_ethnicity_s2_specific_primary"),
Expand Down Expand Up @@ -936,12 +952,12 @@ action_finalise <- function(cohort) {
glue("analyse_dataset_{cohort}_flu_full_s6_specific_primary"),
glue("analyse_dataset_{cohort}_flu_full_s7_specific_primary")),
moderately_sensitive = lst(
glue("output/results/collated/{cohort}_flu_model_outputs_collated.csv"))
glue("output/collated/analytic/{cohort}_flu_model_outputs_collated.csv"))
),

action(
name = glue("collate_covid_model_outputs_tables_{cohort}"),
run = glue("r:latest analysis/covid_model_outputs_table_collation.R {cohort}"),
run = glue("r:latest analysis/collation_code/covid_model_outputs_table_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("analyse_dataset_{cohort}_covid_ethnicity_s4_specific_primary"),
glue("analyse_dataset_{cohort}_covid_ethnicity_s5_specific_primary"),
Expand Down Expand Up @@ -972,12 +988,12 @@ action_finalise <- function(cohort) {
glue("analyse_dataset_{cohort}_covid_full_s6_specific_primary"),
glue("analyse_dataset_{cohort}_covid_full_s7_specific_primary")),
moderately_sensitive = lst(
csv = glue("output/results/collated/{cohort}_covid_model_outputs_collated.csv"))
csv = glue("output/collated/analytic/{cohort}_covid_model_outputs_collated.csv"))
),

action(
name = glue("collate_overall_and_all_cause_model_outputs_tables_{cohort}"),
run = glue("r:latest analysis/overall_and_all_cause_model_outputs_table_collation.R {cohort}"),
run = glue("r:latest analysis/collation_code/overall_and_all_cause_model_outputs_table_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("analyse_dataset_{cohort}_overall_and_all_cause_ethnicity_s1_specific_primary"),
glue("analyse_dataset_{cohort}_overall_and_all_cause_ethnicity_s2_specific_primary"),
Expand Down Expand Up @@ -1029,12 +1045,12 @@ action_finalise <- function(cohort) {
glue("analyse_dataset_{cohort}_overall_and_all_cause_full_s6_specific_primary"),
glue("analyse_dataset_{cohort}_overall_and_all_cause_full_s7_specific_primary")),
moderately_sensitive = lst(
csv = glue("output/results/collated/{cohort}_overall_and_all_cause_model_outputs_collated.csv"))
csv = glue("output/collated/analytic/{cohort}_overall_and_all_cause_model_outputs_collated.csv"))
),

action(
name = glue("collate_rsv_sensitivity_model_outputs_tables_{cohort}"),
run = glue("r:latest analysis/rsv_sensitivity_model_outputs_table_collation.R {cohort}"),
run = glue("r:latest analysis/collation_code/rsv_sensitivity_model_outputs_table_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("analyse_dataset_{cohort}_rsv_ethnicity_s1_sensitive_primary"),
glue("analyse_dataset_{cohort}_rsv_ethnicity_s2_sensitive_primary"),
Expand Down Expand Up @@ -1086,12 +1102,12 @@ action_finalise <- function(cohort) {
glue("analyse_dataset_{cohort}_rsv_full_s6_sensitive_primary"),
glue("analyse_dataset_{cohort}_rsv_full_s7_sensitive_primary")),
moderately_sensitive = lst(
csv = glue("output/results/collated/{cohort}_rsv_sensitivity_model_outputs_collated.csv"))
csv = glue("output/collated/analytic/{cohort}_rsv_sensitivity_model_outputs_collated.csv"))
),

action(
name = glue("collate_flu_sensitivity_model_outputs_tables_{cohort}"),
run = glue("r:latest analysis/flu_sensitivity_model_outputs_table_collation.R {cohort}"),
run = glue("r:latest analysis/collation_code/flu_sensitivity_model_outputs_table_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("analyse_dataset_{cohort}_flu_ethnicity_s1_sensitive_primary"),
glue("analyse_dataset_{cohort}_flu_ethnicity_s2_sensitive_primary"),
Expand Down Expand Up @@ -1143,12 +1159,12 @@ action_finalise <- function(cohort) {
glue("analyse_dataset_{cohort}_flu_full_s6_sensitive_primary"),
glue("analyse_dataset_{cohort}_flu_full_s7_sensitive_primary")),
moderately_sensitive = lst(
csv = glue("output/results/collated/{cohort}_flu_sensitivity_model_outputs_collated.csv"))
csv = glue("output/collated/analytic/{cohort}_flu_sensitivity_model_outputs_collated.csv"))
),

action(
name = glue("collate_covid_sensitivity_model_outputs_tables_{cohort}"),
run = glue("r:latest analysis/covid_sensitivity_model_outputs_table_collation.R {cohort}"),
run = glue("r:latest analysis/collation_code/covid_sensitivity_model_outputs_table_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("analyse_dataset_{cohort}_covid_ethnicity_s4_sensitive_primary"),
glue("analyse_dataset_{cohort}_covid_ethnicity_s5_sensitive_primary"),
Expand Down Expand Up @@ -1179,12 +1195,12 @@ action_finalise <- function(cohort) {
glue("analyse_dataset_{cohort}_covid_full_s6_sensitive_primary"),
glue("analyse_dataset_{cohort}_covid_full_s7_sensitive_primary")),
moderately_sensitive = lst(
csv = glue("output/results/collated/{cohort}_covid_sensitivity_model_outputs_collated.csv"))
csv = glue("output/collated/analytic/{cohort}_covid_sensitivity_model_outputs_collated.csv"))
),

action(
name = glue("collate_overall_and_all_cause_sensitivity_model_outputs_tables_{cohort}"),
run = glue("r:latest analysis/overall_and_all_cause_sensitivity_model_outputs_table_collation.R {cohort}"),
run = glue("r:latest analysis/collation_code/overall_and_all_cause_sensitivity_model_outputs_table_collation.R {cohort}"),
arguments = c(cohort),
needs = list(glue("analyse_dataset_{cohort}_overall_and_all_cause_ethnicity_s1_sensitive_primary"),
glue("analyse_dataset_{cohort}_overall_and_all_cause_ethnicity_s2_sensitive_primary"),
Expand Down Expand Up @@ -1236,7 +1252,7 @@ action_finalise <- function(cohort) {
glue("analyse_dataset_{cohort}_overall_and_all_cause_full_s6_sensitive_primary"),
glue("analyse_dataset_{cohort}_overall_and_all_cause_full_s7_sensitive_primary")),
moderately_sensitive = lst(
csv = glue("output/results/collated/{cohort}_overall_and_all_cause_sensitivity_model_outputs_collated.csv"))
csv = glue("output/collated/analytic/{cohort}_overall_and_all_cause_sensitivity_model_outputs_collated.csv"))
)
)
}
Expand Down Expand Up @@ -1596,4 +1612,19 @@ names(actions_list) %>% tibble(action=.) %>%
stop("Backend not recognised")
}

##filter actions based on prefix

actions_list %>%
names() %>%
str_subset("^collate_rates") %>%
tibble(action=.) %>%
mutate(
model = action=="" & lag(action!="", 1, TRUE),
model_number = cumsum(model),
) %>%
group_by(model_number) %>%
summarise(
sets = str_trim(paste(action, collapse=" "))
) %>% pull(sets) %>%
paste(collapse="\n") %>%
writeLines(here("filtered_actions.txt"))
Loading

0 comments on commit 138a13a

Please sign in to comment.