4 - Configuring Diseases
This tutorial will teach you how to configure disease progressions and the assignment of progressions upon infection.
If you pass a Pathogen to the Simulation constructor, it will override the transmission_function or transmission_rate parameters. This means, that you need to manually pass you transmission parameters if you want to deviate from the default.
Static Mild Progression
In this example, we want to configure a disease where all infections lead to a mild progression. You can display the available progression categories (e.g., Mild or Critical) via the progression_categories() function:
progression_categories()Output
4-element Vector{Any}:
Asymptomatic
Critical
Mild
SeverePut a ? into the Julia REPL and call help?> Mild (or another progression) to learn about the parameters the constructor requires.
A progression category only describes the disease timeline. Host-level care and mortality (hospitalization, ICU, ventilation, death) are configured separately through a health progression. See Custom Health Progression.
Let's set up a mild progression where each agent will become infectious after two days. They will then become symptomatic one day three and recover one week later. Notice that all progression will have a minimum exposure of 1 and all additional parameters will be added on top. The Pathogen struct combines all disease-related parameters.
using GEMS
mild = Mild(
exposure_to_infectiousness_onset = 1, # 1+1
infectiousness_onset_to_symptom_onset = 1,
symptom_onset_to_recovery = 7)
p = Pathogen(
name = "10Day-Disease",
progressions = [mild])
sim = Simulation(pathogen = p)
run!(sim)
rd = ResultData(sim)
gemsplot(rd, type = (:TickCases, :InfectionDuration, :ProgressionCategories))Plot
The middle plot shows that all infections take exactly 10 days and the bottom plot indicates that all progressions were symptomatic.
Dynamic Mild Progression
This example takes the previous model but instead of using fixed times for the durations, we pass Poisson distributions that get the previous paramters as the lambda values:
using GEMS, Distributions
mild = Mild(
exposure_to_infectiousness_onset = Poisson(1), # 1+1
infectiousness_onset_to_symptom_onset = Poisson(1),
symptom_onset_to_recovery = Poisson(7))
p = Pathogen(
name = "10Day-Disease",
progressions = [mild])
sim = Simulation(pathogen = p)
run!(sim)
rd = ResultData(sim)
gemsplot(rd, type = (:TickCases, :InfectionDuration, :ProgressionCategories))Plot
As you can see, the disease durations are now drawn from distributions.
Yes, you can use any distribution from the Distributions.jl package and even create your own distribution using their framework.
Multiple Progressions
In this example we want to have two progressions: short asymptomatic and long mild progressions. If nothing else is specified, the Pathogen class will assign a progression category at random upon infection.
using GEMS, Distributions
asymp = Asymptomatic(
exposure_to_infectiousness_onset = Poisson(1), # 1+1
infectiousness_onset_to_recovery = Poisson(2))
mild = Mild(
exposure_to_infectiousness_onset = Poisson(1), # 1+1
infectiousness_onset_to_symptom_onset = Poisson(2),
symptom_onset_to_recovery = Poisson(14))
p = Pathogen(
name = "Two-Peaks-Disease",
progressions = [asymp, mild])
sim = Simulation(pathogen = p)
run!(sim)
rd = ResultData(sim)
gemsplot(rd, type = (:TickCases, :InfectionDuration, :ProgressionCategories))Plot
In the infection duration plot, we see two peaks. One is caused by the short asymptomatic infections and one by the much longer mild progressions. The bottom plot shows that all the number of asymptomatic and mild progressions are roughly the same across the age groups (caused by the random progression assignment).
Age-based Progression Assignment
Let's consider we want to parameterize a disease that causes mild progressions for kids under the age of 15 and is asymptomatic for all older people. For this, we use the ProgressionAssingment struct. the AgeBasedProgressionAssignment takes age-groups and progressions, and a stratification matrix that provides the chances of any agent of a particular age group ending up in any of the defined progressions.
using GEMS, Distributions
asymp = Asymptomatic(
exposure_to_infectiousness_onset = Poisson(1), # 1+1
infectiousness_onset_to_recovery = Poisson(2))
mild = Mild(
exposure_to_infectiousness_onset = Poisson(1), # 1+1
infectiousness_onset_to_symptom_onset = Poisson(2),
symptom_onset_to_recovery = Poisson(14))
pass = AgeBasedProgressionAssignment(
age_groups = ["0-14","15-"],
progression_categories = ["Asymptomatic", "Mild"],
stratification_matrix = [[0.0, 1.0],
[1.0, 0.0]])
p = Pathogen(
name = "Two-Peaks-Disease",
progressions = [asymp, mild],
progression_assignment = pass)
sim = Simulation(pathogen = p)
run!(sim)
rd = ResultData(sim)
gemsplot(rd, type = (:TickCases, :InfectionDuration, :ProgressionCategories))Plot
Complete Parameterization
This example will show you how to parameterize disease progressions, assignments and the tranmission function inside a Pathogen.
using GEMS, Distributions
asymp = Asymptomatic(
exposure_to_infectiousness_onset = Poisson(1), # 1+1
infectiousness_onset_to_recovery = Poisson(2))
mild = Mild(
exposure_to_infectiousness_onset = Poisson(1), # 1+1
infectiousness_onset_to_symptom_onset = Poisson(2),
symptom_onset_to_recovery = Poisson(14))
pass = AgeBasedProgressionAssignment(
age_groups = ["0-14","15-"],
progression_categories = ["Asymptomatic", "Mild"],
stratification_matrix = [[0.0, 1.0],
[1.0, 0.0]])
ctf = ConstantTransmissionRate(transmission_rate = 0.25)
p = Pathogen(
name = "Two-Peaks-Disease",
progressions = [asymp, mild],
progression_assignment = pass,
transmission_function = ctf)
sim = Simulation(pathogen = p)
run!(sim)
rd = ResultData(sim)
gemsplot(rd, type = (:TickCases, :InfectionDuration, :ProgressionCategories))Plot