From 97837f3538bf13162bfd7eee9f3b83c5ee3210ca 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 1230 -> 1207 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 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 9267826695ae3934a0d1ef548a5be702eef6e6da..4b6ec71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xf9OB%7hn-9c>qJ`;Yex&&ce`NcWi51kWb4)N331h}6eqR7bB(a?t8w^iSJ(+>w zO9-aXlZUC|5P?8IkPocUoAKd1Q`36y2TrI4q^;~s3evQwOQ2Uw3SoDpPz9jio(2kr zW^oZjO;w`<3?7wAOIaBqRK>Bfyb2Z~ixKL&%Y!U#!I4aYn^ACLvNUD~e>tfpi4H_K z5K$i&rb$_qki|uJB$BY26~qmpL=&SJA{d(Yg+u7#`w4`F0!mObRfVAu0%B6wmr7j+ zFI1RH8BVHr&oo?k!`ha02bdYXvx*N}y%B70j=%44ZwrKZg6-x$Lfarwc!a;5J6u+j zCP{IO9-!E=D0WITpZ$+r=F}Nva~Yj^MjB%_DGOYDmXA zCWqo5Y_b ZhF(sJ4BRLTwjiJJcO+AV2@21Mj-d8!|62e6 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