-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added parameters csv file that contains falciparum and vivax specific…
… parameter sets. These parameter values are associated with the set that fixes b = 0.25 and sigma_squared = 1.67, as recommended by Michael White. These parameters are selected in the get_parameters() function by specifying parasite == "falciparum" or "vivax". The functions then selects the parasite-specific values and combines then withe the non-parasite specific values. In order to allow the vivax code to run without full functionality, we have included additional falciparum parameters in the vivax parameter set. These will be removed in the following stages. Pv parameter draws have been added, with code to read them into the package. Added tests to check parameters are behaving as expected. A new vignette has been started to reflect the P. vivax additions that have been made.
- Loading branch information
1 parent
4779cef
commit c3dc720
Showing
18 changed files
with
1,722 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,55 @@ | ||
## code to prepare parameter draws | ||
## code to prepare parameter draws: pf | ||
pd_pf <- read.csv("data-raw/parameter_draws_pf.csv") | ||
|
||
pd <- read.csv("data-raw/parameter_draws.csv") | ||
# Split individual draws_pf into a list of named parameter lists | ||
draws_pf <- 1:max(pd_pf$draw) | ||
parameter_draws_pf <- list() | ||
for(draw in draws_pf){ | ||
pars <- as.list(pd_pf[pd_pf$draw == draw, "value"]) | ||
names(pars) <- pd_pf[pd_pf$draw == draw, "parameter"] | ||
parameter_draws_pf[[draw]] <- pars | ||
} | ||
names(parameter_draws_pf) <- draws_pf | ||
|
||
usethis::use_data(parameter_draws_pf, overwrite = TRUE) | ||
|
||
## code to prepare parameter draws: pv | ||
## this dataset does not match the default parameters, but the code should still be functional. | ||
pd_pv <- read.csv("data-raw/parameter_draws_pv.csv", header = T) |> | ||
tibble::rownames_to_column(var = "draw") |> | ||
dplyr::mutate(phi0 = phi_D_max, | ||
phi1 = phi_D_min/phi_D_max) |> | ||
dplyr::select(-c(loglike, phi_D_min, phi_D_max)) |> | ||
tidyr::pivot_longer(cols = !draw, names_to = "parameter", values_to = "value") |> | ||
dplyr::mutate(parameter = dplyr::case_when( | ||
parameter == "u_par" ~ "ua", | ||
parameter == "phi_LM_max" ~ "philm_max", | ||
parameter == "phi_LM_min" ~ "philm_min", | ||
parameter == "A_LM_50pc" ~ "alm50", | ||
parameter == "K_LM" ~ "klm", | ||
parameter == "u_clin" ~ "ud", | ||
parameter == "phi0" ~ "phi0", | ||
parameter == "phi1" ~ "phi1", | ||
parameter == "A_D_50pc" ~ "ic0", | ||
parameter == "K_D" ~ "kc", | ||
parameter == "A_d_PCR_50pc" ~ "apcr50", | ||
parameter == "K_d_PCR" ~ "kpcr", | ||
parameter == "d_PCR_max" ~ "dpcr_max", | ||
parameter == "d_LM" ~ "da", | ||
parameter == "P_MI" ~ "pcm", | ||
parameter == "d_MI" ~ "rm" | ||
), | ||
draw = as.numeric(draw)) |> | ||
as.data.frame() | ||
|
||
# Split individual draws into a list of named parameter lists | ||
draws <- 1:max(pd$draw) | ||
parameter_draws <- list() | ||
for(draw in draws){ | ||
pars <- as.list(pd[pd$draw == draw, "value"]) | ||
names(pars) <- pd[pd$draw == draw, "parameter"] | ||
parameter_draws[[draw]] <- pars | ||
# Split individual draws_pf into a list of named parameter lists | ||
draws_pv <- 1:max(pd_pv$draw) | ||
parameter_draws_pv <- list() | ||
for(draw in draws_pv){ | ||
pars <- as.list(pd_pv[pd_pv$draw == draw, "value"]) | ||
names(pars) <- pd_pv[pd_pv$draw == draw, "parameter"] | ||
parameter_draws_pv[[draw]] <- pars | ||
} | ||
names(parameter_draws) <- draws | ||
names(parameter_draws_pv) <- draws_pv | ||
|
||
usethis::use_data(parameter_draws, overwrite = TRUE) | ||
usethis::use_data(parameter_draws_pv, overwrite = TRUE) |
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## code to prepare parasite parameters | ||
parasite_csv <- read.csv("data-raw/parasite_parameters.csv") | ||
parasite_parameters <- lapply(unique(parasite_csv$parasite), function(x){ | ||
parameters <- as.list(parasite_csv[parasite_csv$parasite==x,c("default")]) | ||
names(parameters) <- parasite_csv[parasite_csv$parasite==x,c("parameter")] | ||
return(parameters) | ||
}) | ||
names(parasite_parameters) <- unique(parasite_csv$parasite) | ||
usethis::use_data(parasite_parameters, overwrite = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
parasite,parameter,default,reference | ||
falciparum,dd,5, | ||
falciparum,dt,5, | ||
falciparum,da,195, | ||
falciparum,du,110, | ||
falciparum,init_ib,0, | ||
falciparum,init_ica,0, | ||
falciparum,init_iva,0, | ||
falciparum,init_icm,0, | ||
falciparum,init_ivm,0, | ||
falciparum,init_id,0, | ||
falciparum,rb,3650, | ||
falciparum,rc,10950, | ||
falciparum,rva,10950, | ||
falciparum,rid,3650, | ||
falciparum,rm,67.6952, | ||
falciparum,rvm,76.8365, | ||
falciparum,ub,7.2, | ||
falciparum,uc,6.06, | ||
falciparum,uv,11.4321, | ||
falciparum,ud,9.44512, | ||
falciparum,pcm,0.774368, | ||
falciparum,pvm,0.195768, | ||
falciparum,b0,0.59, | ||
falciparum,b1,0.5, | ||
falciparum,ib0,43.9, | ||
falciparum,kb,2.16, | ||
falciparum,fd0,0.007055, | ||
falciparum,ad,7993.5, | ||
falciparum,gammad,4.8183, | ||
falciparum,d1,0.160527, | ||
falciparum,id0,1.577533, | ||
falciparum,kd,0.476614, | ||
falciparum,phi0,0.792, | ||
falciparum,phi1,0.00074, | ||
falciparum,ic0,18.02366, | ||
falciparum,kc,2.36949, | ||
falciparum,theta0,0.0749886, | ||
falciparum,theta1,0.0001191, | ||
falciparum,iv0,1.09629, | ||
falciparum,kv,2.00048, | ||
falciparum,fv0,0.141195, | ||
falciparum,av,2493.41, | ||
falciparum,gammav,2.91282, | ||
falciparum,cd,0.068, | ||
falciparum,gamma1,1.82425, | ||
falciparum,cu,0.0062, | ||
falciparum,ct,0.021896, | ||
falciparum,de,12, | ||
falciparum,delay_gam,12.5, | ||
falciparum,dem,10, | ||
vivax,dd,5, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,dt,1, Pukrittayakamee (2008); Am J Trop Med Hyg | ||
vivax,da,16.942, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,dpcr_max,53.69, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,dpcr_min,10, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,kpcr,4.021, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,apcr50,9.8, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,init_iaa,0, | ||
vivax,init_iam,0, | ||
vivax,init_ica,0, | ||
vivax,init_icm,0, | ||
vivax,ra,3650, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,rc,10950, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,rm,64.584, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,ua,44.09, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,uc,4.29, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,pcm,0.306, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,b,0.25, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,philm_min,0.0131, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,philm_max,0.9329, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,klm,3.202, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,alm50,17.30, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,phi0,4.2857, White (2018); doi: 10.1038/s41467-018-05860-8; phi0 is equivalent to phi_D_max (4.2857) | ||
vivax,phi1,0.2186, White (2018); doi: 10.1038/s41467-018-05860-8; phi1 is equivalent to phi_D_min/phi_D_max (0.9368/4.2857) | ||
vivax,ic0,23.788, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,kc,5.41, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,cd,0.8, Kiattibutr (2017); doi: 10.1016/j.ijpara.2016.10.006 | ||
vivax,ca,0.1, Kiattibutr (2017); doi: 10.1016/j.ijpara.2016.10.006 | ||
vivax,cu,0.035, Kiattibutr (2017); doi: 10.1016/j.ijpara.2016.10.006 | ||
vivax,ct,0.4, Kiattibutr (2017); doi: 10.1016/j.ijpara.2016.10.006 | ||
vivax,de,10, Herrera (2011); DOI: doi: 10.4269/ajtmh.2011.09-0498 | ||
vivax,delay_gam,0, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,dem,8.4, Gething (2011); doi: 10.1186/1756-3305-4-92 | ||
vivax,f,0.02439024, White (2018); doi: 10.1186/s12936-018-2318-1 | ||
vivax,gammal,0.002610966, White (2018): doi: 10.1186/s12936-018-2318-1 | ||
vivax,init_hyp,0, | ||
vivax,kmax,10, White (2018); doi: 10.1038/s41467-018-05860-8 | ||
vivax,du,110,to_be_removed | ||
vivax,init_iva,0,to_be_removed | ||
vivax,init_ivm,0,to_be_removed | ||
vivax,init_ib,0,to_be_removed | ||
vivax,init_id,0,to_be_removed | ||
vivax,ub,7.2,to_be_removed | ||
vivax,uv,11.4321,to_be_removed | ||
vivax,ud,9.44512,to_be_removed | ||
vivax,pvm,0.195768,to_be_removed | ||
vivax,rvm,76.8365,to_be_removed | ||
vivax,rb,3650,to_be_removed | ||
vivax,rva,10950,to_be_removed | ||
vivax,rid,3650,to_be_removed | ||
vivax,b0,0.59,to_be_removed | ||
vivax,b1,0.5,to_be_removed | ||
vivax,ib0,43.9,to_be_removed | ||
vivax,kb,2.16,to_be_removed | ||
vivax,theta0,0.0749886,to_be_removed | ||
vivax,theta1,0.0001191,to_be_removed | ||
vivax,iv0,1.09629,to_be_removed | ||
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 | ||
vivax,d1,0.160527,to_be_removed | ||
vivax,id0,1.577533,to_be_removed | ||
vivax,kd,0.476614,to_be_removed |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.