From e920b3e514e717fc05ed524267d3b53e272fec51 Mon Sep 17 00:00:00 2001 From: Naeem Model Date: Mon, 6 Jan 2025 23:55:43 +0000 Subject: Update web app entry point - Rename 'app' -> 'web' - Return shiny app object in entry point function --- .../content/estimation/about-estimators.html | 31 +++++++++++++++++ .../content/estimation/about-estimators/id.html | 3 ++ .../content/estimation/about-estimators/idea.html | 4 +++ .../content/estimation/about-estimators/panel.html | 14 ++++++++ .../estimation/about-estimators/seq_bayes.html | 9 +++++ .../content/estimation/about-estimators/wp.html | 6 ++++ .../templates/content/estimation/estimates.html | 3 ++ .../estimation/estimates/add-estimators.html | 16 +++++++++ .../estimation/estimates/add-estimators/id.html | 1 + .../estimation/estimates/add-estimators/idea.html | 1 + .../estimation/estimates/add-estimators/mu.html | 22 ++++++++++++ .../estimates/add-estimators/parameters.html | 7 ++++ .../estimates/add-estimators/seq_bayes.html | 22 ++++++++++++ .../estimation/estimates/add-estimators/wp.html | 39 ++++++++++++++++++++++ .../estimation/estimates/estimates-table.html | 19 +++++++++++ 15 files changed, 197 insertions(+) create mode 100644 inst/web/templates/content/estimation/about-estimators.html create mode 100644 inst/web/templates/content/estimation/about-estimators/id.html create mode 100644 inst/web/templates/content/estimation/about-estimators/idea.html create mode 100644 inst/web/templates/content/estimation/about-estimators/panel.html create mode 100644 inst/web/templates/content/estimation/about-estimators/seq_bayes.html create mode 100644 inst/web/templates/content/estimation/about-estimators/wp.html create mode 100644 inst/web/templates/content/estimation/estimates.html create mode 100644 inst/web/templates/content/estimation/estimates/add-estimators.html create mode 100644 inst/web/templates/content/estimation/estimates/add-estimators/id.html create mode 100644 inst/web/templates/content/estimation/estimates/add-estimators/idea.html create mode 100644 inst/web/templates/content/estimation/estimates/add-estimators/mu.html create mode 100644 inst/web/templates/content/estimation/estimates/add-estimators/parameters.html create mode 100644 inst/web/templates/content/estimation/estimates/add-estimators/seq_bayes.html create mode 100644 inst/web/templates/content/estimation/estimates/add-estimators/wp.html create mode 100644 inst/web/templates/content/estimation/estimates/estimates-table.html (limited to 'inst/web/templates/content/estimation') diff --git a/inst/web/templates/content/estimation/about-estimators.html b/inst/web/templates/content/estimation/about-estimators.html new file mode 100644 index 0000000..db2898b --- /dev/null +++ b/inst/web/templates/content/estimation/about-estimators.html @@ -0,0 +1,31 @@ +
+ {{ + htmlTemplate("templates/content/estimation/about-estimators/panel.html", + id = "id", + header = "Incidence Decay (ID)", + reference_label = "Fisman et al. (PloS One, 2013)", + reference_url = "https://doi.org/10.1371/journal.pone.0083622" + ) + }} + {{ + htmlTemplate("templates/content/estimation/about-estimators/panel.html", + id = "idea", header = "Incidence Decay and Exponential Adjustment (IDEA)", + reference_label = "Fisman et al. (PloS One, 2013)", + reference_url = "https://doi.org/10.1371/journal.pone.0083622" + ) + }} + {{ + htmlTemplate("templates/content/estimation/about-estimators/panel.html", + id = "seq_bayes", header = "Sequential Bayes (seqB)", + reference_label = "Bettencourt and Riberio (PloS One, 2008)", + reference_url = "https://doi.org/10.1371/journal.pone.0002185" + ) + }} + {{ + htmlTemplate("templates/content/estimation/about-estimators/panel.html", + id = "wp", header = "White and Pagano (WP)", + reference_label = "White and Pagano (Statistics in Medicine, 2008)", + reference_url = "https://doi.org/10.1002/sim.3136" + ) + }} +
diff --git a/inst/web/templates/content/estimation/about-estimators/id.html b/inst/web/templates/content/estimation/about-estimators/id.html new file mode 100644 index 0000000..fc70b1c --- /dev/null +++ b/inst/web/templates/content/estimation/about-estimators/id.html @@ -0,0 +1,3 @@ +The Incidence Decay (ID) estimator uses the method of least squares to estimate R0. +This method assumes the serial interval is known, and is built under the SIR assumption. +We note that the use of this method might result in the underestimation of R0. diff --git a/inst/web/templates/content/estimation/about-estimators/idea.html b/inst/web/templates/content/estimation/about-estimators/idea.html new file mode 100644 index 0000000..67548f8 --- /dev/null +++ b/inst/web/templates/content/estimation/about-estimators/idea.html @@ -0,0 +1,4 @@ +The Incidence Decay and Exponential Adjustment (ID) estimator is an alternative formulation of the Incidence Decay (ID) model which includes a decay factor to reflect the often observed outbreak decline. +This addresses the potential underestimation of the R0 estimate when using the ID method. +The method of least squares is used to estimate R0, and similar to the ID model, the serial interval is assumed to be known and this method is developed assuming the SIR model. +We note that, since we need to obtain a minimizer of the decay factor to solve the optimization problem, we require that the number of cases in the dataset be at least 2. diff --git a/inst/web/templates/content/estimation/about-estimators/panel.html b/inst/web/templates/content/estimation/about-estimators/panel.html new file mode 100644 index 0000000..98fe155 --- /dev/null +++ b/inst/web/templates/content/estimation/about-estimators/panel.html @@ -0,0 +1,14 @@ +
+

+ +

+
+
+

Reference: {{ reference_label }}

+

{{ htmlTemplate(paste0("templates/content/estimation/about-estimators/", id, ".html")) }}

+
+
+
diff --git a/inst/web/templates/content/estimation/about-estimators/seq_bayes.html b/inst/web/templates/content/estimation/about-estimators/seq_bayes.html new file mode 100644 index 0000000..8f66ab4 --- /dev/null +++ b/inst/web/templates/content/estimation/about-estimators/seq_bayes.html @@ -0,0 +1,9 @@ +The sequential Bayes (seqB) estimator uses a Bayesian approach to estimate R0 which updates the reproductive number estimate as data accumulates over time. +This approach is based on the SIR model, and assumes that the mean of the serial distribution (ie. the serial interval (SI)) is known. +It is assumed that infectious counts are observed at periodic times (ie. daily, weekly). +This method cannot handle datasets where there are no new infections observed in a time interval, thus, to remedy this, +some manipulation may be necessary to make the times at which infectious counts are observed sufficiently course (ie. weeks instead of days). +Further, this method is also inappropriate in situations where long intervals between cases are observed in the initial stages of the epidemic. +Finally, the R0 approximation behaves similarly to a branching process, which means that throughout, the population size “available” to be infected remains constant. +We note that this assumption does not hold for the SIR/SEIR/SEAIR compartmental models. +As such, seqB estimates should only really be considered early on in an epidemic, ie. before the inflection point of an epidemic, if the dataset being used follows these models. diff --git a/inst/web/templates/content/estimation/about-estimators/wp.html b/inst/web/templates/content/estimation/about-estimators/wp.html new file mode 100644 index 0000000..c6f4580 --- /dev/null +++ b/inst/web/templates/content/estimation/about-estimators/wp.html @@ -0,0 +1,6 @@ +The White and Pagano (WP) estimator uses maximum likelihood estimation to estimate R0. +In this method, the serial interval (SI) is either known, or can be estimated along with R0. +It is assumed that the number of infectious individuals are observable at discrete time points (ie. daily or weekly). +Further, this method also assumes an underlying branching process, which means that throughout, the population size “available” to be infected remains constant. +We note that this assumption does not hold for the SIR/SEIR/SEAIR compartmental models. +As such, WP estimates should only really be considered early on in an epidemic, ie. before the inflection point of an epidemic, if the dataset being used follows these models. diff --git a/inst/web/templates/content/estimation/estimates.html b/inst/web/templates/content/estimation/estimates.html new file mode 100644 index 0000000..bc9124e --- /dev/null +++ b/inst/web/templates/content/estimation/estimates.html @@ -0,0 +1,3 @@ +{{ htmlTemplate("templates/content/estimation/estimates/estimates-table.html") }} +
+{{ htmlTemplate("templates/content/estimation/estimates/add-estimators.html") }} diff --git a/inst/web/templates/content/estimation/estimates/add-estimators.html b/inst/web/templates/content/estimation/estimates/add-estimators.html new file mode 100644 index 0000000..60111c7 --- /dev/null +++ b/inst/web/templates/content/estimation/estimates/add-estimators.html @@ -0,0 +1,16 @@ +

Add estimators

+
+ + + + + {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/parameters.html", id = "id") }} + {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/parameters.html", id = "idea") }} + {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/parameters.html", id = "seq_bayes") }} + {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/parameters.html", id = "wp") }} +
diff --git a/inst/web/templates/content/estimation/estimates/add-estimators/id.html b/inst/web/templates/content/estimation/estimates/add-estimators/id.html new file mode 100644 index 0000000..7c35e55 --- /dev/null +++ b/inst/web/templates/content/estimation/estimates/add-estimators/id.html @@ -0,0 +1 @@ +{{ htmlTemplate("templates/content/estimation/estimates/add-estimators/mu.html", id = "id") }} diff --git a/inst/web/templates/content/estimation/estimates/add-estimators/idea.html b/inst/web/templates/content/estimation/estimates/add-estimators/idea.html new file mode 100644 index 0000000..781349f --- /dev/null +++ b/inst/web/templates/content/estimation/estimates/add-estimators/idea.html @@ -0,0 +1 @@ +{{ htmlTemplate("templates/content/estimation/estimates/add-estimators/mu.html", id = "idea") }} diff --git a/inst/web/templates/content/estimation/estimates/add-estimators/mu.html b/inst/web/templates/content/estimation/estimates/add-estimators/mu.html new file mode 100644 index 0000000..8781574 --- /dev/null +++ b/inst/web/templates/content/estimation/estimates/add-estimators/mu.html @@ -0,0 +1,22 @@ + + +
+ + + + +
+ +
+ +
diff --git a/inst/web/templates/content/estimation/estimates/add-estimators/parameters.html b/inst/web/templates/content/estimation/estimates/add-estimators/parameters.html new file mode 100644 index 0000000..5250e31 --- /dev/null +++ b/inst/web/templates/content/estimation/estimates/add-estimators/parameters.html @@ -0,0 +1,7 @@ +
+
Parameters
+ {{ htmlTemplate(paste0("templates/content/estimation/estimates/add-estimators/", id, ".html")) }} + +
diff --git a/inst/web/templates/content/estimation/estimates/add-estimators/seq_bayes.html b/inst/web/templates/content/estimation/estimates/add-estimators/seq_bayes.html new file mode 100644 index 0000000..028fabc --- /dev/null +++ b/inst/web/templates/content/estimation/estimates/add-estimators/seq_bayes.html @@ -0,0 +1,22 @@ +
+ +
+ {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/mu.html", id = "seq_bayes") }} +
+ +
+ + + + + + +
+
diff --git a/inst/web/templates/content/estimation/estimates/add-estimators/wp.html b/inst/web/templates/content/estimation/estimates/add-estimators/wp.html new file mode 100644 index 0000000..511170f --- /dev/null +++ b/inst/web/templates/content/estimation/estimates/add-estimators/wp.html @@ -0,0 +1,39 @@ + + +
+
+ +
+
+ +
+
+ +
+ {{ htmlTemplate("templates/content/estimation/estimates/add-estimators/mu.html", id = "wp") }} +
+ +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+
diff --git a/inst/web/templates/content/estimation/estimates/estimates-table.html b/inst/web/templates/content/estimation/estimates/estimates-table.html new file mode 100644 index 0000000..4704d03 --- /dev/null +++ b/inst/web/templates/content/estimation/estimates/estimates-table.html @@ -0,0 +1,19 @@ +

Estimates table

+ +
+ {{ DT::dataTableOutput(outputId = "estimates_table") }} +
+ + + + + + + Export table + -- cgit v1.2.3