Skip to content

Commit

Permalink
Soft reset the combine all constant asymptomatic branch changes. I wi…
Browse files Browse the repository at this point in the history
…ll rebase in the next commit/push. This commit only really adds more vignette details, in addition to changes previously made in dev.
  • Loading branch information
RJSheppard committed Sep 17, 2024
1 parent fdb71eb commit 5cb5a1e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 48 deletions.
2 changes: 1 addition & 1 deletion R/disease_progression.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
2 changes: 1 addition & 1 deletion R/human_infection.R
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ schedule_infections <- function(
parameters$ca,
variables$recovery_rates,
1/parameters$da,
to_infect
to_infect_asym
)
}
}
Expand Down
5 changes: 2 additions & 3 deletions R/parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -631,4 +631,3 @@ set_parameter_draw <- function(parameters, draw){
}
return(parameters)
}

Binary file modified data/parasite_parameters.rda
Binary file not shown.
9 changes: 7 additions & 2 deletions man/get_parameters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 1 addition & 39 deletions 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 All @@ -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)

})
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 5cb5a1e

Please sign in to comment.