-
Notifications
You must be signed in to change notification settings - Fork 15
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
Feat/vaccines #209
Feat/vaccines #209
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @giovannic
This looks good to me, just one small comment and the following genral one:
Renaming RTSS to vaccine throughout has the possibility to cause seme confusion/ambiguity as we also have other types of vaccine in the model, tbv. We could leave this for now (as it isn't urgent) and make sure that the documentation states clearly that vaccine
options refer to pre-erythrocytic vaccines only. I guess our other options would be to change all the new vaccines
to pev
, or to somehow include the tbv
implmentation under the vaccine
implementation (both of which seem a bit onerous to do!)
R/human_infection.R
Outdated
if (length(vaccinated) > 0) { | ||
vaccinated_index <- source_vector[vaccine_times > -1] | ||
antibodies <- calculate_rtss_antibodies( | ||
vaccinated_index <- source_vector[vaccinated] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see where vaccinated_index
gets used
@htopazian it might be helpful if you could re-run at least one of the previous RTSS scenarios with the new code as a check that we're getting the same result? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice Giovanni! A few comments in the file changes
@pwinskill great idea - looking pretty similar for the mass vax strategy with 100,000! |
29d3203
to
fdf4d8b
Compare
* correlation test passing * VaccineProfile class executing Fix infection integration tests Fix EPI regressions Fix regression tests Fix Vaccines vignette: * update vignette to use new vaccine API * update process and event creation for new vaccine code Fix R CMD check issues: * Fix correlation example * Update documentation for RTSS vaccine profiles update vaccine vignette Rename vaccine to pev Update vignettes for new function names Bump version and update NEWS Remove unused line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Giovanni, it is looking good and problems with epi boosters are fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thank ❤❤
A couple of sticking points highlighted in the comments
R/pev_parameters.R
Outdated
#' @param profile primary vaccine profile of type PEVProfile | ||
#' @param coverages a vector of coverages for the primary doses | ||
#' @param timesteps a vector of timesteps associated with coverages | ||
#' @param age for the target population, (in timesteps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not clear to me what this means - is it a single value (upper bound)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry...presumably age of first dose? Would be helpful to clarify in the help
#' @export | ||
set_pev_epi <- function( | ||
parameters, | ||
profile, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps for a seperate PR, but is there a reason why the primary profile is a single fixed profile, while the booster can vary? Would we not want flexibility for both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, is the idea that we could have seperate profiles for the primary doses? We would need a new model for that, since we only model protection after the final dose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not seperate for the 3 doses in the primary series, but seperate vaccines given for the primary series at different timepoints, eg.
Year 1: primary series = 3 doses of vaccine A
Year 2: primary series = 3 doses of vaccine B
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see! Yes, we could implement this feature if we want to model transition between vaccine types. Made an issue here: #228
not_recently_vaccinated <- variables$rtss_vaccinated$get_index_of( | ||
a = max(timestep - parameters$rtss_epi_min_wait, 0), | ||
not_recently_vaccinated <- variables$vaccinated_timestep$get_index_of( | ||
a = max(timestep - parameters$pev_epi_min_wait, 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following was failing for me, I think in relation to this section:
p <- get_parameters(overrides = list(
human_population = 1000,
individual_mosquitoes = FALSE
))
p <- p |>
set_pev_epi(
profile = rtss_profile,
coverages = c(0.99, 0.99, 0.99),
timesteps = 365 * (2:4) + 1,
age = 5 * 365,
min_wait = 180,
booster_profile = list(rtss_profile, rtss_profile, rtss_profile),
booster_timestep = c(190, 190, 190),
booster_coverage = c(0.8, 0.8, 0.8)
)
s <- run_simulation(timesteps = 365 * 7, parameters = p)
Setting min_wait = 0
resolved the issue. Is the a reasonable check we can make on what the user inputs here?
#' @description Parameters for a primary dose of RTS,S for use with the | ||
#' set_mass_pev and set_pev_epi functions | ||
#' @export | ||
rtss_profile <- create_pev_profile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really like how these profiles are set up btw 👍
9b80d68
to
b4093eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @giovannic!
Updates the vaccine modelling to allow arbitrary vaccine modelling parameters through the VaccineProfile class.
As an example of how
VaccineProfile
s are created, see the exportedrtss_profile
andrtss_booster_profile
objects in vaccine_parameters.RA future PR could be made to export new vaccine profiles.
Changes:
Review requests/notes: