Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter and output documentation. #299

Merged
merged 30 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b8f3c27
I think the calculation for initial EIR values isn't quite right. I d…
RJSheppard May 8, 2024
b9b923c
Added PCR rendering to prevalence rendering function, adjusting tests…
RJSheppard May 8, 2024
1a70ff2
Removed overhanging changes associated with EIR calculation correctio…
RJSheppard May 8, 2024
6ec5e3d
There are a few parameter documentation things I think it would be go…
RJSheppard May 8, 2024
d1bd2af
Added proper links to the relevant function documentation in the get_…
RJSheppard May 9, 2024
69fc17f
Improved robustness of calculate initial EIR test.
RJSheppard May 9, 2024
435180d
Correcting typo in parameter documentation: set_betnets -> set_bednets.
RJSheppard May 9, 2024
6804095
Merge pull request #296 from mrc-ide/initial_eir_calculation_correction
RJSheppard May 20, 2024
c62decc
Corrected vignettes to reflect changes in n_detect_lm outputs.
RJSheppard May 20, 2024
ed29688
Removed epi_outputs function from documentation so that tests can pas…
RJSheppard May 20, 2024
254bce2
Depend on dqrng from CRAN again.
plietar May 15, 2024
75a0332
Fix warnings and deprecations.
plietar May 15, 2024
25c0956
Merge pull request #305 from mrc-ide/dqrng-release
plietar May 21, 2024
d868e19
Added PCR rendering to prevalence rendering function, adjusting tests…
RJSheppard May 8, 2024
2f9dd12
Removed overhanging changes associated with EIR calculation correctio…
RJSheppard May 8, 2024
d28bd2b
Corrected vignettes to reflect changes in n_detect_lm outputs.
RJSheppard May 20, 2024
5d95b83
Removed second psi multiplier from calculate_eir to allow tests to co…
RJSheppard May 22, 2024
21d8f9a
Merge branch 'lm_pcr_prevalence_explicit' of https://github.com/mrc-i…
RJSheppard May 22, 2024
2c1dab3
Removed mean(psi) multiplier from calculate_eir to allow tests to pass.
RJSheppard May 22, 2024
5e559a7
There are a few parameter documentation things I think it would be go…
RJSheppard May 8, 2024
7f12172
Added proper links to the relevant function documentation in the get_…
RJSheppard May 9, 2024
ec16cf6
Correcting typo in parameter documentation: set_betnets -> set_bednets.
RJSheppard May 9, 2024
288e428
Removed epi_outputs function from documentation so that tests can pas…
RJSheppard May 20, 2024
6c256ae
Merge branch 'parameter_documentation_ordering' of https://github.com…
RJSheppard May 22, 2024
69ea7b6
Merge pull request #298 from mrc-ide/lm_pcr_prevalence_explicit
RJSheppard May 23, 2024
23827d2
There are a few parameter documentation things I think it would be go…
RJSheppard May 8, 2024
8a86bee
Added proper links to the relevant function documentation in the get_…
RJSheppard May 9, 2024
7dae339
Correcting typo in parameter documentation: set_betnets -> set_bednets.
RJSheppard May 9, 2024
52cc8b5
Removed epi_outputs function from documentation so that tests can pas…
RJSheppard May 20, 2024
702fcc4
Merge branch 'parameter_documentation_ordering' of https://github.com…
RJSheppard May 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,13 @@ LazyData: true
Remotes:
mrc-ide/malariaEquilibrium,
mrc-ide/individual
Additional_repositories:
https://mrc-ide.r-universe.dev
Imports:
individual (>= 0.1.16),
malariaEquilibrium (>= 1.0.1),
Rcpp,
statmod,
MASS,
dqrng (>= 0.3.2.2),
dqrng (>= 0.4),
sitmo,
BH,
R6,
Expand Down
4 changes: 1 addition & 3 deletions R/biting_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ simulate_bites <- function(
calculate_eir <- function(species, solvers, variables, parameters, timestep) {
a <- human_blood_meal_rate(species, variables, parameters, timestep)
infectious <- calculate_infectious(species, solvers, variables, parameters)
age <- get_age(variables$birth$get_values(), timestep)
psi <- unique_biting_rate(age, parameters)
infectious * a * mean(psi)
infectious * a
}

effective_biting_rates <- function(a, .pi, p_bitten) {
Expand Down
7 changes: 2 additions & 5 deletions R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@
#' * n: number of humans between an inclusive age range at this timestep. This
#' defaults to n_730_3650. Other age ranges can be set with
#' prevalence_rendering_min_ages and prevalence_rendering_max_ages parameters.
#' * n_detect: number of humans with an infection detectable by microscopy between an inclusive age range at this timestep. This
#' * n_detect_lm (or pcr): number of humans with an infection detectable by microscopy (or pcr) between an inclusive age range at this timestep. This
#' defaults to n_detect_730_3650. Other age ranges can be set with
#' prevalence_rendering_min_ages and prevalence_rendering_max_ages parameters.
#' * p_detect: the sum of probabilities of detection by microscopy between an
#' * p_detect_lm (or pcr): the sum of probabilities of detection by microscopy (or pcr) between an
#' inclusive age range at this timestep. This
#' defaults to p_detect_730_3650. Other age ranges can be set with
#' prevalence_rendering_min_ages and prevalence_rendering_max_ages parameters.
#' * n_severe: number of humans with a severe infection between an inclusive
#' age range at this timestep. Age ranges can be set with
#' severe_prevalence_rendering_min_ages and severe_prevalence_rendering_max_ages parameters.
#' * n_inc: number of new infections for humans between an inclusive age range at this timestep.
#' incidence columns can be set with
#' incidence_rendering_min_ages and incidence_rendering_max_ages parameters.
Expand Down
370 changes: 195 additions & 175 deletions R/parameters.R

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions R/render.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ in_age_range <- function(birth, timestep, lower, upper) {

#' @title Render prevalence statistics
#'
#' @description renders prevalence numerators and denominators for indivduals
#' detected by microscopy and with severe malaria
#' @description renders prevalence numerators and denominators for individuals
#' detected by light microscopy and pcr, where those infected asymptomatically by
#' P. falciparum have reduced probability of infection due to detectability
#' immunity (reported as an integer sample: n_detect_lm, and summing over
#' detection probabilities: p_detect_lm)
#'
#' @param state human infection state
#' @param birth variable for birth of the individual
Expand All @@ -32,7 +35,8 @@ create_prevelance_renderer <- function(

clinically_detected <- state$get_index_of(c('Tr', 'D'))
detected <- clinically_detected$copy()$or(asymptomatic_detected)

pcr_detected <- state$get_index_of(c('Tr', 'D', 'A', 'U'))

for (i in seq_along(parameters$prevalence_rendering_min_ages)) {
lower <- parameters$prevalence_rendering_min_ages[[i]]
upper <- parameters$prevalence_rendering_max_ages[[i]]
Expand All @@ -43,17 +47,22 @@ create_prevelance_renderer <- function(
timestep
)
renderer$render(
paste0('n_detect_', lower, '_', upper),
paste0('n_detect_lm_', lower, '_', upper),
in_age$copy()$and(detected)$size(),
timestep
)
renderer$render(
paste0('p_detect_', lower, '_', upper),
paste0('p_detect_lm_', lower, '_', upper),
in_age$copy()$and(clinically_detected)$size() + sum(
prob[bitset_index(asymptomatic, in_age)]
),
timestep
)
renderer$render(
paste0('n_detect_pcr_', lower, '_', upper),
pcr_detected$copy()$and(in_age)$size(),
timestep
)
}
}
}
Expand Down
Loading
Loading