From 5cd9688e9b5dbb76f9d6a21427fc4068e7a5e0d7 Mon Sep 17 00:00:00 2001 From: RJSheppard Date: Fri, 28 Jun 2024 11:43:46 +0100 Subject: [PATCH] p.v has a constant asymptomatic infectivity, in contrast to p.f where 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. --- R/disease_progression.R | 26 ++++++++++++++++++++------ R/human_infection.R | 26 ++++++++++++++++++++------ R/parameters.R | 1 - R/variables.R | 16 +++++++++++----- data-raw/parasite_parameters.csv | 1 - data/parasite_parameters.rda | Bin 1235 -> 1219 bytes tests/testthat/test-vivax.R | 2 +- vignettes/Plasmodium_vivax.Rmd | 14 ++++++++++++-- 8 files changed, 64 insertions(+), 22 deletions(-) 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 e88d078c..f4142ca5 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 af91a44547b016957d723bf6eed6532403eb3941..d59e365698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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