Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

full review pre-trial 03 #19

Closed
wants to merge 331 commits into from
Closed

full review pre-trial 03 #19

wants to merge 331 commits into from

Conversation

avallecam
Copy link
Member

This PR aims to collect edit suggestions before trial 03.

Rendered website: https://epiverse-trace.github.io/tutorials-late/

We encourage in-line specific changes in the files changed tab (read GitHub how-to guide steps 5 to 7)

@avallecam avallecam added the upcoming-training To prioritize label Apr 18, 2024
Copy link

⚠️ WARNING ⚠️

This pull request contains a mix of workflow files and regular files. This could be malicious. No preview will be created.

regular files:

  • .lintr
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • LICENSE.md
  • README.Rmd
  • README.md
  • config.yaml
  • episodes/compare-interventions.Rmd
  • episodes/data/ebola_cases.csv
  • episodes/fig/disease-reporting.jpg
  • episodes/fig/fig5a-normaldistribution.png
  • episodes/fig/incubation-period-serial-interval.jpg
  • episodes/fig/infectiousness-covid19.jpg
  • episodes/fig/pkgs-hexlogos.png
  • episodes/fig/reproduction-generation-time.png
  • episodes/fig/reproduction-number-pre-symptomatic.png
  • episodes/fig/rt-adjusting-delays.png
  • episodes/fig/seria-interval-fitted-distributions.jpg
  • episodes/fig/serial-interval-covid-sars.jpg
  • episodes/fig/serial-interval-observed.jpeg
  • episodes/fig/serial-interval-pairs.jpg
  • episodes/fig/time-periods.jpg
  • episodes/introduction.Rmd
  • episodes/model-choices.Rmd
  • episodes/modelling-interventions.Rmd
  • episodes/simulating-transmission.Rmd
  • episodes/template.Rmd

workflow files:

  • .github/workflows/README.md
  • .github/workflows/lint.yaml
  • .github/workflows/sandpaper-version.txt


**Mathematical Modelling** : [Introduction to infectious disease models](https://doi.org/10.1038/s41592-020-0856-2), [state variables](../learners/reference.md#state), [model parameters](../learners/reference.md#parsode), [initial conditions](../learners/reference.md#initial), [ordinary differential equations](../learners/reference.md#ordinary).

**Epidemic theory** : [Transmission](https://doi.org/10.1155/2011/267049), [Reproduction number](https://doi.org/10.3201/eid2501.171901).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Epidemic theory** : [Transmission](https://doi.org/10.1155/2011/267049), [Reproduction number](https://doi.org/10.3201/eid2501.171901).
**Epidemic theory** : [Transmission](https://doi.org/10.1155/2011/267049), [ and reproduction number](https://doi.org/10.3201/eid2501.171901).


Learners should familiarise themselves with following concept dependencies before working through this tutorial:

**Mathematical Modelling** : [Introduction to infectious disease models](https://doi.org/10.1038/s41592-020-0856-2), [state variables](../learners/reference.md#state), [model parameters](../learners/reference.md#parsode), [initial conditions](../learners/reference.md#initial), [ordinary differential equations](../learners/reference.md#ordinary).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Mathematical Modelling** : [Introduction to infectious disease models](https://doi.org/10.1038/s41592-020-0856-2), [state variables](../learners/reference.md#state), [model parameters](../learners/reference.md#parsode), [initial conditions](../learners/reference.md#initial), [ordinary differential equations](../learners/reference.md#ordinary).
**Mathematical Modelling** : [Introduction to infectious disease models](https://doi.org/10.1038/s41592-020-0856-2), [state variables](../learners/reference.md#state), [model parameters](../learners/reference.md#parsode), [initial conditions](../learners/reference.md#initial), [ and ordinary differential equations](../learners/reference.md#ordinary).

## Simulating disease spread

To simulate infectious disease trajectories, we must first select a mathematical model to use.
There is a library of models to choose from in `epidemics`. Models in `epidemics` are prefixed with `model` and suffixed by the name of infection (e.g. Ebola) or a different identifier (e.g. default), and whether the model has a R or [C++](../learners/reference.md#cplusplus) code base.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good to link the reader with the documentation of {epidemics} for further details.

episodes/simulating-transmission.Rmd Outdated Show resolved Hide resolved
library(dplyr)
library(tidyverse)
library(DiagrammeR)
library(webshot)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
library(webshot)
library(tracetheme)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, we use {webshot} to print the Diagrammer. See this to-keep issue epiverse-trace/tutorials#98

color = intervention_type,
linetype = intervention_type
) +
stat_summary(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
stat_summary(
ggplot2::stat_summary(

geom = "line",
linewidth = 1
) +
scale_y_continuous(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scale_y_continuous(
ggplot2::scale_y_continuous(

scale_y_continuous(
labels = scales::comma
) +
labs(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
labs(
ggplot2::labs(

x = "Simulation time (days)",
y = "Individuals"
) +
theme_bw(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
theme_bw(
ggplot2::theme_bw(

episodes/modelling-interventions.Rmd Outdated Show resolved Hide resolved
@Degoot-AM
Copy link
Contributor

@avallecam, I enjoyed reading this tutorials and suggest a number of changes to be made. Below are my general remarks:

  • My review did not include the comparing scenario as it yet to be completed.
  • I found this tutorial a bit lengthy, you may consider breaking it down
  • Fail to generate the in-fly transmission diagrams embedded with episodes locally in machine using the workbench framework. I got the following error message Error in (function (url = NULL, file = "webshot.png", vwidth = 992, vheight = 744, : webshot.js returned failure value: 1. I do not know whether this a general problem or specific to my machine, but is worth to check it out.
  • Use tracetheme package in the making the graphs.
  • Link the tutorials together to provide a smooth order to flaw.

Copy link
Member Author

@avallecam avallecam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the term preinfectious is used across the episodes. Is there a preference to use preinfectious over latent period?

Comment on lines 344 to 353
To create our population object, we call the function `population()` specifying a name, the contact matrix, the demography vector and the initial conditions.

```{r population}
uk_population <- population(
name = "UK",
contact_matrix = contact_matrix,
demography_vector = demography_vector,
initial_conditions = initial_conditions
)
```
Copy link
Member Author

@avallecam avallecam Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To create our population object, we call the function `population()` specifying a name, the contact matrix, the demography vector and the initial conditions.
```{r population}
uk_population <- population(
name = "UK",
contact_matrix = contact_matrix,
demography_vector = demography_vector,
initial_conditions = initial_conditions
)
```
To create our population object, from the `{epidemics}` package, we call the function `population()`, specifying a name, the contact matrix, the demography vector and the initial conditions.
```{r population}
uk_population <- epidemics::population(
name = "UK",
contact_matrix = contact_matrix,
demography_vector = demography_vector,
initial_conditions = initial_conditions
)

- `infectiousness_rate` = $\alpha$,
- `recovery_rate` = $\gamma$,

We will simulate a strain of influenza with pandemic potential with $R_0=1.46$, a preinfectious period of 3 days and infectious period of 7 days. Therefore our inputs will be:
Copy link
Member Author

@avallecam avallecam Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which one is clearer? latent period or preinfectious period?

Suggested change
We will simulate a strain of influenza with pandemic potential with $R_0=1.46$, a preinfectious period of 3 days and infectious period of 7 days. Therefore our inputs will be:
We will simulate a strain of influenza with pandemic potential with $R_0=1.46$, a preinfectious period of 3 days and infectious period of 7 days.
- `preinfectious_period <- 3.0`
- `infectious_period <- 7.0`
- `basic_reproduction <- 1.46`
Therefore our inputs will be:

Comment on lines 372 to 374
- `transmission_rate = 1.46 / 7.0`,
- `infectiousness_rate = 1.0 / 3.0`,
- `recovery_rate = 1.0 / 7.0`.
Copy link
Member Author

@avallecam avallecam Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consisteny with the callout box bellow

Suggested change
- `transmission_rate = 1.46 / 7.0`,
- `infectiousness_rate = 1.0 / 3.0`,
- `recovery_rate = 1.0 / 7.0`.
- `infectiousness_rate = 1/preinfectious_period`,
- `recovery_rate = 1/infectious_period`,
- `transmission_rate = basic_reproduction*recovery_rate`.

episodes/simulating-transmission.Rmd Outdated Show resolved Hide resolved
avallecam and others added 2 commits April 25, 2024 02:50
Co-authored-by: Abdoelnaser M Degoot <[email protected]>
Co-authored-by: Abdoelnaser M Degoot <[email protected]>
Copy link
Member Author

@avallecam avallecam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brief link edits


There are two intervention types for `model_default()`. Rate interventions on model parameters (`transmission_rate` $\beta$, `infectiousness_rate` $\sigma$ and `recovery_rate` $\gamma$) and contact matrix reductions `contacts`.

To implement both contact and rate interventions in the same simulation they must be passed as a list e.g. `intervention = list(transmission_rate = mask_mandate, contacts = close_schools)`. But if there are multiple interventions that target contact rates, these must be passed as one `contacts` input. See the [vignette on modelling overlapping interventions](https://epiverse-trace.github.io/epidemics/articles/multiple_interventions.html) for more detail.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To implement both contact and rate interventions in the same simulation they must be passed as a list e.g. `intervention = list(transmission_rate = mask_mandate, contacts = close_schools)`. But if there are multiple interventions that target contact rates, these must be passed as one `contacts` input. See the [vignette on modelling overlapping interventions](https://epiverse-trace.github.io/epidemics/articles/multiple_interventions.html) for more detail.
To implement both contact and rate interventions in the same simulation they must be passed as a list e.g. `intervention = list(transmission_rate = mask_mandate, contacts = close_schools)`. But if there are multiple interventions that target contact rates, these must be passed as one `contacts` input. See the [vignette on modelling overlapping interventions](https://epiverse-trace.github.io/epidemics/articles/modelling_multiple_interventions.html) for more detail.

episodes/compare-interventions.Rmd Outdated Show resolved Hide resolved
@avallecam
Copy link
Member Author

closing as redirected to main in #29

@avallecam avallecam closed this Apr 25, 2024
@avallecam avallecam deleted the full-review/pre-trial branch April 25, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upcoming-training To prioritize
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants