Skip to content

Commit

Permalink
p.v has a constant asymptomatic infectivity, in contrast to p.f where…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
RJSheppard committed Sep 17, 2024
1 parent 4779cef commit ac353fd
Show file tree
Hide file tree
Showing 21 changed files with 1,782 additions and 276 deletions.
28 changes: 24 additions & 4 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
#' Parameter draws
#' Parasite parameters
#'
#' 1000 draws from the joint posterior fit from
#' Parasite-specific parameters for P. falciparum and vivax for use in malariasimulation
#'
#' @format ## `parasite_parameters`
#' A
#'
#' @source <https://www.nature.com/articles/ncomms4136>, <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6097992/>
"parasite_parameters"

#' Parameter draws (P. falciparum)
#'
#' @format ## `parameter_draws`
#' A list of 1000 draws from the joint posterior fit from
#'
#' @format ## `parameter_draws_pf`
#' A list of lists of length 1000, each level contains a list of drawn parameters
#'
#' @source <https://www.nature.com/articles/ncomms4136>
"parameter_draws"
"parameter_draws_pf"

#' Parameter draws (P. vivax)
#'
#' 1000 draws from the joint posterior fit from
#'
#' @format ## `parameter_draws_pv`
#' A list of lists of length 1000, each level contains a list of drawn parameters
#'
#' @source <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6097992/>
"parameter_draws_pv"
26 changes: 20 additions & 6 deletions R/disease_progression.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
26 changes: 20 additions & 6 deletions R/human_infection.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
}
}

Expand Down
Loading

0 comments on commit ac353fd

Please sign in to comment.