Skip to content

Commit

Permalink
Merge pull request #21 from epiforecasts/feature-make-data-updating-m…
Browse files Browse the repository at this point in the history
…ore-robust

Feature: make data updating more robust
  • Loading branch information
seabbs authored Dec 28, 2021
2 parents 12380e0 + 6b3a69f commit aa04bbe
Show file tree
Hide file tree
Showing 98 changed files with 33,693 additions and 33,672 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: omicron.sgtf.forcast
Title: Real-time estimation of the time-varying transmission advantage of Omicron in England using S-Gene Target Status as a Proxy
Version: 1.1.0
Version: 1.2.0
Authors@R:
c(person(given = "Sam Abbott",
role = c("aut", "cre"),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2021-12-28

- Updated data and results archiving to be by date of access rather than by the maximum date available in the data. This has the download of making an update occur every day the pipeline runs regardless of if the data has been updated but the upside of protecting archived data from retrospective updates.

- Updates dating of all archived data and results to be by date of access rather than by maximum available date in the data.

# 2021-12-26

- Automation has been improved so that new data is checked for every two hours. A new model run is only started if not result exist for the current data snapshot or if new SGTF data is detected.
Expand Down
3 changes: 2 additions & 1 deletion R/munge-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ cumulative_percentage <- function(cases, pop) {
c_q5 = cumsum(q5) / population,
c_q95 = cumsum(q95) / population,
c_q20 = cumsum(q20) / population,
c_q80 = cumsum(q80) / population)
c_q80 = cumsum(q80) / population) %>%
ungroup()
return(cases_pop)
}
22 changes: 17 additions & 5 deletions R/plot-summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ plot_summary <- function(sgtf_posterior, cum_per, bias_posterior,

# omicron transmission advantage
advantage <- summary(sgtf_posterior, type = "voc_advantage") %>%
mutate(value_type = "Omicron: current transmission advantage")
mutate(value_type = "Omicron: current transmission advantage") %>%
group_by(region) %>%
slice_max(date) %>%
ungroup()

# growth
growth <- summary(sgtf_posterior, type = "growth") %>%
filter(type == "Omicron") %>%
mutate(value_type = "Omicron: current growth rate")
mutate(value_type = "Omicron: current growth rate") %>%
group_by(region) %>%
slice_max(date) %>%
ungroup()

# cumulative pop
cumpercent <- cum_per %>%
Expand All @@ -28,11 +34,17 @@ plot_summary <- function(sgtf_posterior, cum_per, bias_posterior,
mutate(value_type = "Omicron: cumulative % population",
region = as.character(region),
type = "Omicron",
across(starts_with("q"), ~ . * 100))
across(starts_with("q"), ~ . * 100)) %>%
group_by(region) %>%
slice_max(date) %>%
ungroup()

# bias
sampling <- summary(bias_posterior, type = "voc_advantage") %>%
mutate(value_type = "Current bias: any-SGT vs no-SGT result")
mutate(value_type = "Current bias: any-SGT vs no-SGT result") %>%
group_by(region) %>%
slice_max(date) %>%
ungroup()

# join --------------------------------------------------------------------
region_factor <- as.character(sgtf_posterior$region)
Expand All @@ -46,7 +58,7 @@ plot_summary <- function(sgtf_posterior, cum_per, bias_posterior,

summary_data <- bind_rows(advantage, growth, cumpercent, sampling) %>%
filter(
date == date_forecast_start & type %in% c("Omicron", "SGT-result")
type %in% c("Omicron", "SGT-result")
) %>%
mutate(region = recode_factor(region, !!!region_factor),
ref_line = as.numeric(recode(value_type, !!!reference_lines)))
Expand Down
Binary file removed data/estimates/bias/2021-12-18/data.rds
Binary file not shown.
Binary file removed data/estimates/bias/2021-12-18/diagnostics.rds
Binary file not shown.
Binary file removed data/estimates/bias/2021-12-18/posterior.rds
Binary file not shown.
Binary file removed data/estimates/bias/2021-12-19/data.rds
Binary file not shown.
Binary file removed data/estimates/bias/2021-12-19/diagnostics.rds
Binary file not shown.
Binary file removed data/estimates/bias/2021-12-19/posterior.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-20/data.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-20/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-20/posterior.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-21/data.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-21/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-21/posterior.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-22/data.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-22/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-22/posterior.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-23/data.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-23/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-23/posterior.rds
Binary file not shown.
Binary file added data/estimates/bias/2021-12-24/data.rds
Binary file not shown.
Binary file added data/estimates/bias/2021-12-24/diagnostics.rds
Binary file not shown.
Binary file added data/estimates/bias/2021-12-24/posterior.rds
Binary file not shown.
Binary file added data/estimates/bias/2021-12-25/data.rds
Binary file not shown.
Binary file added data/estimates/bias/2021-12-25/diagnostics.rds
Binary file not shown.
Binary file added data/estimates/bias/2021-12-25/posterior.rds
Binary file not shown.
Binary file removed data/estimates/bias/2021-12-26/data.rds
Binary file not shown.
Binary file removed data/estimates/bias/2021-12-26/diagnostics.rds
Binary file not shown.
Binary file removed data/estimates/bias/2021-12-26/posterior.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-27/data.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-27/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/bias/2021-12-27/posterior.rds
Binary file not shown.
Binary file added data/estimates/bias/2021-12-28/data.rds
Binary file not shown.
Binary file added data/estimates/bias/2021-12-28/diagnostics.rds
Binary file not shown.
Binary file added data/estimates/bias/2021-12-28/posterior.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-16/diagnostics.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-16/loo.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-16/posterior.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-18/data.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-18/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-18/loo.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-18/posterior.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-19/data.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-19/diagnostics.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-19/loo.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-19/posterior.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-20/data.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-20/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-20/loo.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-20/posterior.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-21/data.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-21/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-21/loo.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-21/posterior.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-22/data.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-22/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-22/loo.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-22/posterior.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-23/data.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-23/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-23/loo.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-23/posterior.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-24/data.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-24/diagnostics.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-24/loo.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-24/posterior.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-25/data.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-25/diagnostics.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-25/loo.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-25/posterior.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-26/data.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-26/diagnostics.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-26/loo.rds
Binary file not shown.
Binary file removed data/estimates/sgtf/2021-12-26/posterior.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-27/data.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-27/diagnostics.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-27/loo.rds
Binary file not shown.
Binary file modified data/estimates/sgtf/2021-12-27/posterior.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-28/data.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-28/diagnostics.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-28/loo.rds
Binary file not shown.
Binary file added data/estimates/sgtf/2021-12-28/posterior.rds
Binary file not shown.
441 changes: 0 additions & 441 deletions data/public/2021-12-14-cases-by-sgtf.csv

This file was deleted.

File renamed without changes.
Loading

0 comments on commit aa04bbe

Please sign in to comment.