Skip to content

Commit

Permalink
p.v has a constant asymptomatic infectivity, in contrast to p.f where…
Browse files Browse the repository at this point in the history
… infectivity is affected by age and immunity. We must therefore change this when asymptomatic infectivity is assigned (when an individual become asymptomatic). This occurs in initial assignments, when someone becomes infected to an asymptomatic status infection and when a clinical diseased individual progresses to asymptomatic. We can use the existing update_infection() function for vivax in human_infection and in disease progression.

We can also now remove the gamma1 parameter from the vivax parameter list, used in the falciparum code.

The P.v vignette has been extended to include modelled infectivity details.
  • Loading branch information
RJSheppard authored and giovannic committed Oct 1, 2024
1 parent a5a6bc7 commit 97837f3
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 22 deletions.
26 changes: 20 additions & 6 deletions R/disease_progression.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,26 @@ progression_outcome_process <- function(
renderer
){

update_to_asymptomatic_infection(
variables,
parameters,
timestep,
variables$state$get_index_of("D")$and(target)
)
if(parameters$parasite == "falciparum"){
# p.f has immunity-determined asymptomatic infectivity
update_to_asymptomatic_infection(
variables,
parameters,
timestep,
variables$state$get_index_of("D")$and(target)
)
} else if (parameters$parasite == "vivax"){
# p.v has constant asymptomatic infectivity
update_infection(
variables$state,
"A",
variables$infectivity,
parameters$ca,
variables$progression_rates,
1/parameters$da,
variables$state$get_index_of("D")$and(target)
)
}

update_infection(
variables$state,
Expand Down
26 changes: 20 additions & 6 deletions R/human_infection.R
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,26 @@ schedule_infections <- function(
}

if(to_infect_asym$size() > 0) {
update_to_asymptomatic_infection(
variables,
parameters,
timestep,
to_infect_asym
)
if(parameters$parasite == "falciparum"){
# p.f has immunity-determined asymptomatic infectivity
update_to_asymptomatic_infection(
variables,
parameters,
timestep,
to_infect_asym
)
} else if (parameters$parasite == "vivax"){
# p.v has constant asymptomatic infectivity
update_infection(
variables$state,
'A',
variables$infectivity,
parameters$ca,
variables$progression_rates,
1/parameters$da,
to_infect_asym
)
}
}
}

Expand Down
1 change: 0 additions & 1 deletion R/parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -631,4 +631,3 @@ set_parameter_draw <- function(parameters, draw){
}
return(parameters)
}

16 changes: 11 additions & 5 deletions R/variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,17 @@ create_variables <- function(parameters) {

# Set the initial infectivity values for each individual
infectivity_values[diseased] <- parameters$cd
infectivity_values[asymptomatic] <- asymptomatic_infectivity(
initial_age[asymptomatic],
id$get_values(asymptomatic),
parameters
)
if(parameters$parasite == "falciparum"){
# p.f has immunity-determined asymptomatic infectivity
infectivity_values[asymptomatic] <- asymptomatic_infectivity(
initial_age[asymptomatic],
id$get_values(asymptomatic),
parameters
)
} else if (parameters$parasite == "vivax"){
# p.v has constant asymptomatic infectivity
infectivity_values[asymptomatic] <- parameters$ca
}
infectivity_values[subpatent] <- parameters$cu

# Initialise the infectivity variable
Expand Down
1 change: 0 additions & 1 deletion data-raw/parasite_parameters.csv
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ vivax,kv,2.00048,to_be_removed
vivax,fv0,0.141195,to_be_removed
vivax,av,2493.41,to_be_removed
vivax,gammav,2.91282,to_be_removed
vivax,gamma1,1.82425,to_be_removed
vivax,fd0,0.007055,to_be_removed
vivax,ad,7993.5,to_be_removed
vivax,gammad,4.8183,to_be_removed
Expand Down
Binary file modified data/parasite_parameters.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/testthat/test-vivax.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test_that('Test difference between falciparum and vivax parameter lists', {

expect_identical(
in_falciparum_not_vivax,
character(0)
c("gamma1") # asymptomatic infected infectivity towards mosquitos parameter
)

expect_identical(
Expand Down
14 changes: 12 additions & 2 deletions vignettes/Plasmodium_vivax.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,23 @@ Then we can run the simulation as normal:
simulation <- run_simulation(timesteps = 100, parameters = p)
```

## Parameters
## Model details

### Parameters

Our default *P. vivax* parameters are sourced from a version of the analysis in White et al. 2018 (doi: 10.1038/s41467-018-05860-8), where model parameters were fitted to data from Papua New Guinea. The chosen parameter set fixes `b = 0.25` and `sigma_squared = 1.67` (for consistency with the *P. falciparum* model). The default parameters for both parasite species can be found in `data/raw/parasite_parameters.csv`, while parameters common to both models are given in `R/parameters.R` under `get_parameters()`.

Values for the model fitting posterior distribution can be selected using the `set_parameter_draw()` function as found in the [Parameter Variation](https://mrc-ide.github.io/malariasimulation/articles/ParameterVariation.html) vignette.

## Model structure
### Structure

The *P. falciparum* model has five human disease compartments: susceptible (S), clinical disease (D), asymptomatic infection (A), sub-patent infection (U), and treated (Tr). Asymptomatic infections may or may not be detectable by light-microscopy.

The *P. vivax* model follows a similar structure to the *P. falciparum* model, and also has five human disease compartments. However, the human disease states modeled explicitly focus on parasite density and detectability, such that we have: susceptible (S), clinical disease (D), **light-microscopy detectable infection (A)**, **PCR detectable infection (U)**, and treated (Tr).

### Infectivity of LM-detectable infections

While the *P. falciparum* model calculates the onward infectivity of asymptomatic infections (`ca`) using the age and detectability immunity of each individual, the *P. vivax* model uses a constant infectivity for LM-detectable infections (`ca = 0.1`).

### Key Model References

Expand Down

0 comments on commit 97837f3

Please sign in to comment.