diff --git a/R/disease_progression.R b/R/disease_progression.R index 98710c44..436a52c0 100644 --- a/R/disease_progression.R +++ b/R/disease_progression.R @@ -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, diff --git a/R/human_infection.R b/R/human_infection.R index ae2cfe97..fdd8019c 100644 --- a/R/human_infection.R +++ b/R/human_infection.R @@ -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 + ) + } } } diff --git a/R/parameters.R b/R/parameters.R index be6c1ae2..6fe148eb 100644 --- a/R/parameters.R +++ b/R/parameters.R @@ -631,4 +631,3 @@ set_parameter_draw <- function(parameters, draw){ } return(parameters) } - diff --git a/R/variables.R b/R/variables.R index 66f0ce4f..cb3b1a17 100644 --- a/R/variables.R +++ b/R/variables.R @@ -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 diff --git a/data-raw/parasite_parameters.csv b/data-raw/parasite_parameters.csv index ed799e9c..d7198b98 100644 --- a/data-raw/parasite_parameters.csv +++ b/data-raw/parasite_parameters.csv @@ -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 diff --git a/data/parasite_parameters.rda b/data/parasite_parameters.rda index 92678266..4b6ec71d 100644 Binary files a/data/parasite_parameters.rda and b/data/parasite_parameters.rda differ diff --git a/tests/testthat/test-vivax.R b/tests/testthat/test-vivax.R index 9ce5fac8..0cf0bdf2 100644 --- a/tests/testthat/test-vivax.R +++ b/tests/testthat/test-vivax.R @@ -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( diff --git a/vignettes/Plasmodium_vivax.Rmd b/vignettes/Plasmodium_vivax.Rmd index 4f339a98..2cfeef45 100644 --- a/vignettes/Plasmodium_vivax.Rmd +++ b/vignettes/Plasmodium_vivax.Rmd @@ -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