-
Notifications
You must be signed in to change notification settings - Fork 14
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
recovery_rates variable has been renamed as (disease) progression_rates. #334
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.
Great stuff. Thank you for this!
I've requested some minor documentation and performance improvements. But almost there for me.
R/mda_processes.R
Outdated
detectable <- calculate_asymptomatic_detectable( | ||
#' @title Update individuals during MDA/PMC | ||
#' @description Updates individuals disease states, infectivity, dt and drug variables | ||
#' @param target bitset for individuals who have been successfully treated |
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.
#' @param target bitset for individuals who have been successfully treated | |
#' @param target a list containing the successfully treated, the drug used and resistance parameters |
R/mda_processes.R
Outdated
to_treated <- clinical$or(asymptomatic$and(detectable))$and(target$successfully_treated) | ||
|
||
if(parameters$antimalarial_resistance) { | ||
dt_update_vector <- target$dt_spc_combined[target$successfully_treated$to_vector() %in% to_treated$to_vector()] |
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.
dt_update_vector <- target$dt_spc_combined[target$successfully_treated$to_vector() %in% to_treated$to_vector()] | |
dt_update_vector <- target$dt_spc_combined[ | |
target$successfully_treated$copy()$and(to_treated)$to_vector() | |
] |
R/human_infection.R
Outdated
#' @param renderer simulation renderer | ||
#' @noRd |
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.
#' @param renderer simulation renderer | |
#' @noRd | |
#' @param renderer simulation renderer | |
#' @param int_name the intervention name to use for rendering, use "" for frontline treatment | |
#' @noRd |
R/mda_processes.R
Outdated
renderer$render(paste0('n_', int_name, '_treated'), length(target), timestep) | ||
treated <- bitset_at(individual::Bitset$new(parameters$human_population)$not(), target) |
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.
treated <- bitset_at(individual::Bitset$new(parameters$human_population)$not(), target) | |
treated <- individual::Bitset$new(parameters$human_population)$insert(target) |
R/pmc.R
Outdated
target <- in_age[sample_intervention(in_age, 'pmc', coverage, correlations)] | ||
|
||
renderer$render('n_pmc_treated', length(target), timestep) | ||
treated <- bitset_at(individual::Bitset$new(parameters$human_population)$not(), target) |
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.
treated <- bitset_at(individual::Bitset$new(parameters$human_population)$not(), target) | |
treated <- individual::Bitset$new(parameters$human_population)$insert(target) |
|
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 @RJSheppard - looks good to me
I've created two new functions to standardise drug and resistance calculations across treatment and mass treatments: calculate_successful_treatments and update_mass_drug_admin calculate_successful_treatments handles the durg efficacy and antimalarial resistance, generating key outputs for each intervention type and returning a bitset of those treated, a vector of the drugs used to treat those individuals and a vector of treated delays for those individual if resistance (SPC) is switched on. This function is called during calculate_treated, create_mda_listeners and create_pmc_process. update_mass_drug_admin calls update_infection twice,assigning D and LM-detectable A infections to Tr, while non-LM detectable A infections, U and Tr infections to S. Those assigned to S have 0 infectivity and 0 dt, while those who are assigned to Tr are assigned a fraction of their infectivity in the current timestep and dt from the parameter set or calculated using antimalarial resistance.
7053b8f
to
2556bd6
Compare
I've created two new functions to standardise drug and resistance calculations across treatment and mass treatments:
calculate_successful_treatments
and
update_mass_drug_admin
calculate_successful_treatments handles the durg efficacy and antimalarial resistance, generating key outputs for each intervention type and returning a bitset of those treated, a vector of the drugs used to treat those individuals and a vector of treated delays for those individual if resistance (SPC) is switched on. This function is called during calculate_treated, create_mda_listeners and create_pmc_process.
update_mass_drug_admin calls update_infection twice, assigning D and LM-detectable A infections to Tr, while non-LM detectable A infections, U and Tr infections to S. Those assigned to S have 0 infectivity and 0 dt, while those who are assigned to Tr are assigned a fraction of their infectivity in the current timestep and dt from the parameter set or calculated using antimalarial resistance.