From 5cb5a1ee7587d2a567d025c0a61c1c48f0da5996 Mon Sep 17 00:00:00 2001 From: RJSheppard Date: Tue, 17 Sep 2024 09:28:14 +0100 Subject: [PATCH] Soft reset the combine all constant asymptomatic branch changes. I will rebase in the next commit/push. This commit only really adds more vignette details, in addition to changes previously made in dev. --- R/disease_progression.R | 2 +- R/human_infection.R | 2 +- R/parameters.R | 5 ++--- data/parasite_parameters.rda | Bin 1235 -> 1219 bytes man/get_parameters.Rd | 9 ++++++-- tests/testthat/test-vivax.R | 40 +-------------------------------- vignettes/Plasmodium_vivax.Rmd | 14 ++++++++++-- 7 files changed, 24 insertions(+), 48 deletions(-) diff --git a/R/disease_progression.R b/R/disease_progression.R index 081b6942..436a52c0 100644 --- a/R/disease_progression.R +++ b/R/disease_progression.R @@ -51,7 +51,7 @@ progression_outcome_process <- function( "A", variables$infectivity, parameters$ca, - variables$recovery_rates, + variables$progression_rates, 1/parameters$da, variables$state$get_index_of("D")$and(target) ) diff --git a/R/human_infection.R b/R/human_infection.R index 374203dd..1b142280 100644 --- a/R/human_infection.R +++ b/R/human_infection.R @@ -521,7 +521,7 @@ schedule_infections <- function( parameters$ca, variables$recovery_rates, 1/parameters$da, - to_infect + to_infect_asym ) } } diff --git a/R/parameters.R b/R/parameters.R index 342b8b84..6fe148eb 100644 --- a/R/parameters.R +++ b/R/parameters.R @@ -278,8 +278,6 @@ #' * incidence_rendering_min_ages - the minimum ages for incidence #' outputs (includes asymptomatic microscopy +); default = turned off #' * incidence_rendering_max_ages - the corresponding max ages; default = turned off -#' * patent_incidence_rendering_min_ages - the minimum ages for patent incidence outputs (LM detectable), (p.v only); default = turned off -#' * patent_incidence_rendering_max_ages - the corresponding max ages (p.v only); default = turned off #' * clinical_incidence_rendering_min_ages - the minimum ages for clinical incidence outputs (symptomatic); default = 0 #' * clinical_incidence_rendering_max_ages - the corresponding max ages; default = 1825 #' * severe_incidence_rendering_min_ages - the minimum ages for severe incidence @@ -318,6 +316,8 @@ #' and PCR prevalence; default = -0.968 #' * rdt_coeff - the coefficient for the log logit relationship betweeen rdt #' and PCR prevalence; default = 1.186 +#' +#' miscellaneous: #' #' * mosquito_limit - the maximum number of mosquitoes to allow for in the #' simulation; default = 1.00E+05 @@ -631,4 +631,3 @@ set_parameter_draw <- function(parameters, draw){ } return(parameters) } - diff --git a/data/parasite_parameters.rda b/data/parasite_parameters.rda index af91a44547b016957d723bf6eed6532403eb3941..d59e365698b0402456aa2a773280f6c452ef4257 100644 GIT binary patch delta 1211 zcmV;s1VsDO3Bw5-LRx4!F+o`-Q(627fA#^JZ~y1-ksKO-_L&W)z%)Ws zRPjtCWCPMYCPtb7JxtVS^#&jVO$`B%c|$|g21X&1)WmI1P#O=?6G5OGP&9cahM52! zqsnhoKn9uyLq>*x27qax#0-Xj13&;WXaE@iWYZ%}85#`$02%;d8Z^@hp@Iki(?G~* z(9i(T4Kx^mkk9~V00vEe00STlnq+CCBSD}513(NzMw($XFhEHZB{rsw05kvxr~#ux zK*#_9X`mSfhJXM8>ODXJ000000BAG@fC5nkJtl2Zx}FtRdrfyT9rEd@$Z@e zOaj1E5E7AuwV8n+RdJ9i!=X5s6A3T_2^(t%ET_HuaCFr_TSXP>sJQT7Urg#>@orxq z7EY|;Ul4`v$)ibdJ;h+QdaDInPK}$jihg!-jzt&tO^0?>J;(Y>T^mnJFvKGahKrblKK zAI?C`Nu0S_3O;WrNvRS<;7Zc)&FaIa^3koTh{txCtCcZ^g(WpKHT$j2oxaATo*#gBD?bjF?LrDPf<$2t_PbK!S=#IjX7+ z3rD(*BFt(=J?|$EA_LexbLbiom|I@$pvyaOT5?~^2?+~vIYrdKwGyY81b(Dp(>d5{k!mf#+3PurMP4L_gL_)`&31dY&s?y%9Hmk4uB?`-2qekc;v(FHQ;j1%CF+_@Pwp z99J!jF;B74LRZzsC>{3I<_;-`OxTbMle{Y&=o=;cK{7G*3qNU0(bS4FtY;fr(B)=I z#~%QOY`yXhK~U>T3FZi+3iVIq{_qb^GD7fK%bzv<6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bxfq6OI1_pO z;b^W~Nlp#a8&YCLl&NJogDgR3iv?kX@WAIE+$J+v4pT?$Kpl;<*|rkV4OM8l-QiAcjr#{-7bhXyEQZ_8QRLOs&6d&Cv495rjUC9*TLP4-DU=XtL7H|Ln diff --git a/man/get_parameters.Rd b/man/get_parameters.Rd index 1715c6fd..f5473da5 100644 --- a/man/get_parameters.Rd +++ b/man/get_parameters.Rd @@ -303,8 +303,6 @@ Please set rendered age groups using the convenience function \item incidence_rendering_min_ages - the minimum ages for incidence outputs (includes asymptomatic microscopy +); default = turned off \item incidence_rendering_max_ages - the corresponding max ages; default = turned off -\item patent_incidence_rendering_min_ages - the minimum ages for patent incidence outputs (LM detectable), (p.v only); default = turned off -\item patent_incidence_rendering_max_ages - the corresponding max ages (p.v only); default = turned off \item clinical_incidence_rendering_min_ages - the minimum ages for clinical incidence outputs (symptomatic); default = 0 \item clinical_incidence_rendering_max_ages - the corresponding max ages; default = 1825 \item severe_incidence_rendering_min_ages - the minimum ages for severe incidence @@ -345,6 +343,13 @@ mixing: and PCR prevalence; default = -0.968 \item rdt_coeff - the coefficient for the log logit relationship betweeen rdt and PCR prevalence; default = 1.186 +<<<<<<< HEAD +======= +} + +miscellaneous: +\itemize{ +>>>>>>> 7236985 (Soft reset the combine all constant asymptomatic branch changes. I will rebase in the next commit/push. This commit only really adds more vignette details, in addition to changes previously made in dev.) \item mosquito_limit - the maximum number of mosquitoes to allow for in the simulation; default = 1.00E+05 \item individual_mosquitoes - boolean whether adult mosquitoes are modeled diff --git a/tests/testthat/test-vivax.R b/tests/testthat/test-vivax.R index f8d1fe00..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( @@ -38,41 +38,3 @@ test_that('Test difference between falciparum and vivax parameter lists', { ) ) }) - -test_that('Test age structure should not change vivax infectivity', { - falc_parameters <- get_parameters( - overrides = list( - human_population = 1, - init_id = 0.5)) - - vivax_parameters <- get_parameters( - parasite = "vivax", - overrides = list( - human_population = 1, - init_id = 0.5)) - - state_mock <- mockery::mock('A', cycle = T) - mockery::stub(create_variables, 'initial_state', state_mock) - state_vivax_mock <- mockery::mock(list(human_states = 'A', - hypnozoites_v = 0), cycle = T) - mockery::stub(create_variables, 'initial_state_vivax', state_vivax_mock) - - ages_mock <- mockery::mock(365, cycle = T) - mockery::stub(create_variables, 'calculate_initial_ages', ages_mock) - - falc_variables <- create_variables(falc_parameters) - vivax_variables <- create_variables(vivax_parameters) - - expect_equal(falc_variables$infectivity$get_values(), 0.06761596) - expect_equal(vivax_variables$infectivity$get_values(), 0.1) - - ages_mock <- mockery::mock(365*70, cycle = T) - mockery::stub(create_variables, 'calculate_initial_ages', ages_mock) - - falc_variables <- create_variables(falc_parameters) - vivax_variables <- create_variables(vivax_parameters) - - expect_equal(falc_variables$infectivity$get_values(), 0.03785879) - expect_equal(vivax_variables$infectivity$get_values(), 0.1) - -}) 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