Skip to content

Commit

Permalink
update analysis pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
pearsonca committed Oct 26, 2024
1 parent 8baaee1 commit 66d68b9
Show file tree
Hide file tree
Showing 26 changed files with 7 additions and 19 deletions.
6 changes: 3 additions & 3 deletions inst/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
input/*
output/*
figure/*
analysis/input/*
analysis/output/*
analysis/figure/*

.Rprofile
.DS_Store
Expand Down
10 changes: 2 additions & 8 deletions inst/analysis/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,19 @@ ${DATDIR}/population.rds: scripts/population.R | ${RENV} ${DATDIR}
${DATDIR}/lex.rds: scripts/lex.R | ${RENV} ${DATDIR}
$(call R)

${DATDIR}/odin.rda: scripts/odin.R | ${RENV} ${DATDIR}
$(call R)

# n.b. for additional pathogens, this would need to be expanded
${DATDIR}/disease_pars.rda: scripts/disease_pars.R $(call dat,population.rds lex.rds)
$(call R)

${DATDIR}/param_%.rda: scripts/param.R $(call dat,population.rds disease_pars.rda)
$(call R,$(subst _, ,$*))

allinputs: $(call dat,population.rds lex.rds odin.rda disease_pars.rda $(patsubst %,param_%.rda,${ALLSCN}))
allinputs: $(call dat,population.rds lex.rds disease_pars.rda $(patsubst %,param_%.rda,${ALLSCN}))

##### OUTPUTS ##################################################################
# simulation time series, distillations, ylls - by various methods

${OUTDIR}/sim_%.rds: scripts/simulate.R $(call dat,population.rds odin.rda param_%.rda) | ${OUTDIR}
${OUTDIR}/sim_%.rds: scripts/simulate.R $(call dat,population.rds param_%.rda) scripts/odin.R | ${OUTDIR}
$(call R,$(firstword $(subst _, ,$*)))

ALLSIM := $(patsubst %,${OUTDIR}/sim_%.rds,${ALLSCN})
Expand All @@ -85,9 +82,6 @@ ${OUTDIR}/yll_%.rds: scripts/yll.R ${DATDIR}/lex.rds ${OUTDIR}/distill_%.rds

allylls: $(patsubst %,${OUTDIR}/yll_%.rds,${ALLSCN})

# ${OUTDIR}/vaxthreshold_%.rds: $(call dat,population.rds odin.rda param_%.rda) | ${OUTDIR} scripts/yll.R ${DATDIR}/lex.rds ${OUTDIR}/distill_%.rds
# $(call R,$(firstword $(subst _, ,$*)))

${OUTDIR}/incidence.rds: scripts/incidence.R $(patsubst %,${OUTDIR}/sim_%.rds,${ALLSCN})
$(call R)

Expand Down
Binary file modified inst/analysis/figure/averted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified inst/analysis/figure/incidence.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified inst/analysis/figure/summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified inst/analysis/figure/yll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified inst/analysis/input/param_AFG_FLU.rda
Binary file not shown.
Binary file modified inst/analysis/input/param_AFG_SC2.rda
Binary file not shown.
Binary file modified inst/analysis/input/param_GBR_FLU.rda
Binary file not shown.
Binary file modified inst/analysis/input/param_GBR_SC2.rda
Binary file not shown.
Binary file modified inst/analysis/output/consolidated.rds
Binary file not shown.
Binary file modified inst/analysis/output/distill_AFG_FLU.rds
Binary file not shown.
Binary file modified inst/analysis/output/distill_AFG_SC2.rds
Binary file not shown.
Binary file modified inst/analysis/output/distill_GBR_FLU.rds
Binary file not shown.
Binary file modified inst/analysis/output/distill_GBR_SC2.rds
Binary file not shown.
Binary file modified inst/analysis/output/incidence.rds
Binary file not shown.
Binary file modified inst/analysis/output/sim_AFG_FLU.rds
Binary file not shown.
Binary file modified inst/analysis/output/sim_AFG_SC2.rds
Binary file not shown.
Binary file modified inst/analysis/output/sim_GBR_FLU.rds
Binary file not shown.
Binary file modified inst/analysis/output/sim_GBR_SC2.rds
Binary file not shown.
Binary file modified inst/analysis/output/yll_AFG_FLU.rds
Binary file not shown.
Binary file modified inst/analysis/output/yll_AFG_SC2.rds
Binary file not shown.
Binary file modified inst/analysis/output/yll_GBR_FLU.rds
Binary file not shown.
Binary file modified inst/analysis/output/yll_GBR_SC2.rds
Binary file not shown.
6 changes: 0 additions & 6 deletions inst/analysis/scripts/odin.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

require(odin)

.args <- if (interactive()) c(
file.path("input", "odin.rda")
) else commandArgs(trailingOnly = TRUE)

sir_odin <- odin::odin({

# Number of groups
Expand Down Expand Up @@ -104,5 +100,3 @@ epidemic_run <- function(
)

}

save(sir_odin, epidemic_run, file = tail(.args, 1))
4 changes: 2 additions & 2 deletions inst/analysis/scripts/simulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ source('scripts/odin.R')

.args <- if (interactive()) c(
file.path("input", "population.rds"),
file.path("input", "odin.rda"),
file.path("input", "param_GBR_FLU.rda"),
file.path("scripts", "odin.R"),
"GBR",
file.path("output", "sim_GBR_FLU.rds")
) else commandArgs(trailingOnly = TRUE)
Expand All @@ -16,7 +16,7 @@ pop_dt <- pop_dt[
]

load(.args[2])
load(.args[3])
source(.args[3])

epidemic_time_series <- function(
vacc_cov, # 4-vector of proportion of each model age group vaccinated
Expand Down

0 comments on commit 66d68b9

Please sign in to comment.