-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes needed for paper revision, added combination of interventions
- Loading branch information
1 parent
244c7b3
commit fed7a5b
Showing
35 changed files
with
1,266 additions
and
809 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 |
---|---|---|
|
@@ -10,4 +10,5 @@ bbl | |
/Meta/ | ||
.Rproj.user/ | ||
.Rproj.user | ||
/.Rproj.user | ||
/.Rproj.user | ||
docs |
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
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
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 |
---|---|---|
|
@@ -116,6 +116,10 @@ def_vector_params = function(mosquito_species = "Anopheles gambiae", | |
#' match one of the Anopheles species provided in the package. | ||
#' To see all available Anopheles species, use the function | ||
#' \code{list_all_species()}. | ||
#' @param vec_params list object created with the \code{def_vector_params()} | ||
#' function. The mosquito species attribute of this object needs to match the | ||
#' previously defined \code{mosquito_species} argument to this function. | ||
#' Default value is equal to the default \code{def_vector_params()}. | ||
#' @param host_table data frame with custom host-specific values. | ||
#' Must be provided if custom parameter values should be used instead of | ||
#' the ones in the package database. | ||
|
@@ -158,7 +162,17 @@ def_vector_params = function(mosquito_species = "Anopheles gambiae", | |
#' @export | ||
#' | ||
def_host_params = function(mosquito_species = "Anopheles gambiae", | ||
vec_params = def_vector_params(), | ||
host_table = NULL, verbose = TRUE) { | ||
# Check if the mosquito species is the same as the one in the vec_params | ||
# First check if the given mosquito species is in the package database | ||
if(mosquito_species != vec_params$species_name) { | ||
err_msg = paste("Mosquito species name" , mosquito_species, | ||
"does not match with the species name from vec_params:", | ||
vec_params$species_name) | ||
stop(err_msg) | ||
} | ||
|
||
# Parameters specified by the user | ||
if(!is.null(host_table)) { | ||
# Check if input is correct | ||
|
@@ -167,7 +181,7 @@ def_host_params = function(mosquito_species = "Anopheles gambiae", | |
checkmate::assertDataFrame(host_table, any.missing = FALSE, | ||
col.names = "named", nrows = 2, | ||
add = assertCol) | ||
# with the same column names as vec_ent_params | ||
# with the same column names as host_ent_param | ||
checkmate::assertSubset(colnames(host_table), colnames(host_ent_param), | ||
empty.ok = FALSE, fmatch = FALSE) | ||
# and numeric, positive entries less than 1 except for the name of | ||
|
@@ -202,6 +216,9 @@ def_host_params = function(mosquito_species = "Anopheles gambiae", | |
host_param = as.list(host_p) | ||
} | ||
|
||
# Check if the host parameters are well defined | ||
hosts_p = calc_hosts_ent_params(vec_params, host_param, maxpop = 1000) | ||
|
||
return(host_param) | ||
} | ||
|
||
|
@@ -334,6 +351,14 @@ def_activity_patterns = function(activity = "default_Anopheles_gambiae") { | |
#' @export | ||
#' | ||
build_model_obj = function(vec_p, hosts_p, activity, total_pop) { | ||
# Check if the mosquito species is the same in the vec_p and hosts_p | ||
if(vec_p$species_name != unique(hosts_p$species_name)) { | ||
err_msg = paste("Mosquito species name", vec_p$species_name, | ||
"from argument vec_p does not match with the species name from hosts_p", | ||
unique(hosts_p$species_name)) | ||
stop(err_msg) | ||
} | ||
|
||
# Calculate the mosquito death rate for biting each host type and the host | ||
# availability rate | ||
assertNumeric(total_pop, lower = 1) | ||
|
@@ -455,9 +480,7 @@ build_model_obj = function(vec_p, hosts_p, activity, total_pop) { | |
#' LLIN insecticide type | ||
#' \item \code{LLIN_country:} only for LLINs, a string containing the country | ||
#' where the LLIN characteristics were measured | ||
#' \item \code{effects:} List of intervention survival and effects on the | ||
#' mosquito oviposition cycle (same format as defined above for the input | ||
#' attributes) | ||
#' \item \code{model_p:} model object provided as input | ||
#' } | ||
#' | ||
#' @author Monica Golumbeanu, \email{[email protected]} | ||
|
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
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
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,7 +1,7 @@ | ||
pandoc: 3.1.1 | ||
pandoc: '0' | ||
pkgdown: 2.0.7 | ||
pkgdown_sha: ~ | ||
articles: | ||
AnophelesModel: AnophelesModel.html | ||
last_built: 2023-10-17T20:04Z | ||
last_built: 2024-06-10T21:54Z | ||
|
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
Oops, something went wrong.