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

Competing hazards recovery infection resolution #300

Merged
merged 40 commits into from
Aug 20, 2024

Commits on May 9, 2024

  1. competing_hazards.R: Giovanni designed two objects: CompetingOutcome …

    …(containing an outcome following resolution and rates that that outcome occurs for each individual in the population) and CompetingHazard (contains all CompetingOutcomes and process function to resolve hazards).
    
    processes.R: create_biting_process now replaced with create_infection_rates_process and biting_process, that uses essentially the same functional pathway, but which stops when the rates of infection are generated, storing them in the infection_outcome object within human_infection.R
    
    Similarly, disease_progression_process(es) are replaced with new functions: create_recovery_rates_process and calculate_recovery_rates, that get the recovery rates for each individual based on disease state.
    
    We then add these processes to the process list, including the resolution function create_infection_recovery_hazard_process$resolve.
    
    This process (create_infection_recovery_hazard_process) contains infection_outcome and recovery_outcome. infection_outcome calls infection_process_resolved_hazard, which follows the rest of the infection pathway functions: assigning new infections to different human states. Note that this requires probability of infection which gets used in the incidence renderer function.
    
    recovery_outcome also updates human states and infectivities.
    
    I've adjusted some of the tests to reflect the changes in functions required to generate results.
    
    Removed white space deletions.
    RJSheppard committed May 9, 2024
    Configuration menu
    Copy the full SHA
    b36be83 View commit details
    Browse the repository at this point in the history
  2. Added a stash source_human function to the competing hazards function…

    … for use in infection outcome.
    RJSheppard committed May 9, 2024
    Configuration menu
    Copy the full SHA
    0e05f75 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2024

  1. competing_hazards.R: Giovanni designed two objects: CompetingOutcome …

    …(containing an outcome following resolution and rates that that outcome occurs for each individual in the population) and CompetingHazard (contains all CompetingOutcomes and process function to resolve hazards).
    
    processes.R: create_biting_process now replaced with create_infection_rates_process and biting_process, that uses essentially the same functional pathway, but which stops when the rates of infection are generated, storing them in the infection_outcome object within human_infection.R
    
    Similarly, disease_progression_process(es) are replaced with new functions: create_recovery_rates_process and calculate_recovery_rates, that get the recovery rates for each individual based on disease state.
    
    We then add these processes to the process list, including the resolution function create_infection_recovery_hazard_process$resolve.
    
    This process (create_infection_recovery_hazard_process) contains infection_outcome and recovery_outcome. infection_outcome calls infection_process_resolved_hazard, which follows the rest of the infection pathway functions: assigning new infections to different human states. Note that this requires probability of infection which gets used in the incidence renderer function.
    
    recovery_outcome also updates human states and infectivities.
    
    I've adjusted some of the tests to reflect the changes in functions required to generate results.
    
    Removed white space deletions.
    RJSheppard committed May 22, 2024
    Configuration menu
    Copy the full SHA
    f47bb3e View commit details
    Browse the repository at this point in the history
  2. Added a stash source_human function to the competing hazards function…

    … for use in infection outcome.
    RJSheppard committed May 22, 2024
    Configuration menu
    Copy the full SHA
    c8c3245 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2024

  1. To correctly render ages and incidence, given the competing hazards s…

    …olution (any rendering in the infection outcome does not occur), I've split the incidence renderer into three functions: age rendering, n incidence rendering and p incidence rendering. This allows much more flexibility in when these are called in the code sequence. All age inputs are now consolidated and rendered in a single function. In addition, we intitate and populate these incidence columns with 0 when they are used.
    RJSheppard committed May 23, 2024
    Configuration menu
    Copy the full SHA
    c5947ef View commit details
    Browse the repository at this point in the history
  2. Removed "age" from age outputs in tests and vignettes.

    Corrected dt variables recovery rate assignment when antimalarial resistance is modelled.
    RJSheppard committed May 23, 2024
    Configuration menu
    Copy the full SHA
    4820186 View commit details
    Browse the repository at this point in the history
  3. Swap back to explicitly labelled age outputs.

    Merge branch 'competing_hazards_recovery_infection_resolution' of https://github.com/mrc-ide/malariasimulation into competing_hazards_recovery_infection_resolution
    
    # Conflicts:
    #	R/disease_progression.R
    #	R/human_infection.R
    RJSheppard committed May 23, 2024
    Configuration menu
    Copy the full SHA
    d563f6e View commit details
    Browse the repository at this point in the history

Commits on May 24, 2024

  1. Configuration menu
    Copy the full SHA
    b8980c1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    62791a2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1b30562 View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2024

  1. biting_process renamed as create_biting_process, where functionality …

    …now occurs in biting_process.R. Similarly, create_recovery_rates_process functionality is now in disease_progression.R
    
    stash_source_humans in competing hazard resolution is now redundant and has been removed from infection processes.
    
    recovery rates are now assigned to a variable which is updated as infections, recoveries (via update_infection) and deaths occur. This also takes into account recovery time of treated due to slow parasite clearance and replaced the dt variable. I've also noticed (I think) that Tr->S and U->S recoveries can be done in a single step, so have attempted to combine these at risk of making the code more complicated!
    
    Added a metapopulation incidence rendering wrapper function for initialising multiple renderers.
    
    Rewrote create_age_group_renderer for clarity following feedback.
    
    Some tests have been adjusted to reflect these changes.
    RJSheppard committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    352fbae View commit details
    Browse the repository at this point in the history
  2. competing_hazards.R: Giovanni designed two objects: CompetingOutcome …

    …(containing an outcome following resolution and rates that that outcome occurs for each individual in the population) and CompetingHazard (contains all CompetingOutcomes and process function to resolve hazards).
    
    processes.R: create_biting_process now replaced with create_infection_rates_process and biting_process, that uses essentially the same functional pathway, but which stops when the rates of infection are generated, storing them in the infection_outcome object within human_infection.R
    
    Similarly, disease_progression_process(es) are replaced with new functions: create_recovery_rates_process and calculate_recovery_rates, that get the recovery rates for each individual based on disease state.
    
    We then add these processes to the process list, including the resolution function create_infection_recovery_hazard_process$resolve.
    
    This process (create_infection_recovery_hazard_process) contains infection_outcome and recovery_outcome. infection_outcome calls infection_process_resolved_hazard, which follows the rest of the infection pathway functions: assigning new infections to different human states. Note that this requires probability of infection which gets used in the incidence renderer function.
    
    recovery_outcome also updates human states and infectivities.
    
    I've adjusted some of the tests to reflect the changes in functions required to generate results.
    
    Removed white space deletions.
    RJSheppard committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    8866b5a View commit details
    Browse the repository at this point in the history
  3. Added a stash source_human function to the competing hazards function…

    … for use in infection outcome.
    RJSheppard committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    7702e19 View commit details
    Browse the repository at this point in the history
  4. To correctly render ages and incidence, given the competing hazards s…

    …olution (any rendering in the infection outcome does not occur), I've split the incidence renderer into three functions: age rendering, n incidence rendering and p incidence rendering. This allows much more flexibility in when these are called in the code sequence. All age inputs are now consolidated and rendered in a single function. In addition, we intitate and populate these incidence columns with 0 when they are used.
    
    Rebasing
    RJSheppard committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    479c26e View commit details
    Browse the repository at this point in the history
  5. Removed "age" from age outputs in tests and vignettes.

    Corrected dt variables recovery rate assignment when antimalarial resistance is modelled.
    RJSheppard committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    6a4311a View commit details
    Browse the repository at this point in the history
  6. competing_hazards.R: Giovanni designed two objects: CompetingOutcome …

    …(containing an outcome following resolution and rates that that outcome occurs for each individual in the population) and CompetingHazard (contains all CompetingOutcomes and process function to resolve hazards).
    
    processes.R: create_biting_process now replaced with create_infection_rates_process and biting_process, that uses essentially the same functional pathway, but which stops when the rates of infection are generated, storing them in the infection_outcome object within human_infection.R
    
    Similarly, disease_progression_process(es) are replaced with new functions: create_recovery_rates_process and calculate_recovery_rates, that get the recovery rates for each individual based on disease state.
    
    We then add these processes to the process list, including the resolution function create_infection_recovery_hazard_process$resolve.
    
    This process (create_infection_recovery_hazard_process) contains infection_outcome and recovery_outcome. infection_outcome calls infection_process_resolved_hazard, which follows the rest of the infection pathway functions: assigning new infections to different human states. Note that this requires probability of infection which gets used in the incidence renderer function.
    
    recovery_outcome also updates human states and infectivities.
    
    I've adjusted some of the tests to reflect the changes in functions required to generate results.
    
    Removed white space deletions.
    RJSheppard committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    13748fd View commit details
    Browse the repository at this point in the history
  7. Added a stash source_human function to the competing hazards function…

    … for use in infection outcome.
    RJSheppard committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    98c982f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    16d83d3 View commit details
    Browse the repository at this point in the history
  9. biting_process renamed as create_biting_process, where functionality …

    …now occurs in biting_process.R. Similarly, create_recovery_rates_process functionality is now in disease_progression.R
    
    stash_source_humans in competing hazard resolution is now redundant and has been removed from infection processes.
    
    recovery rates are now assigned to a variable which is updated as infections, recoveries (via update_infection) and deaths occur. This also takes into account recovery time of treated due to slow parasite clearance and replaced the dt variable. I've also noticed (I think) that Tr->S and U->S recoveries can be done in a single step, so have attempted to combine these at risk of making the code more complicated!
    
    Added a metapopulation incidence rendering wrapper function for initialising multiple renderers.
    
    Rewrote create_age_group_renderer for clarity following feedback.
    
    Some tests have been adjusted to reflect these changes.
    RJSheppard committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    c649292 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c85ca93 View commit details
    Browse the repository at this point in the history
  11. Merge branch 'competing_hazards_recovery_infection_resolution' of htt…

    …ps://github.com/mrc-ide/malariasimulation into competing_hazards_recovery_infection_resolution
    
    Rebased using dev.
    RJSheppard committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    a6692e3 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2024

  1. Corrected age output names in Demography vignette to enable it to run…

    … (e.g., n_age... rather than n_...)
    RJSheppard committed Jun 26, 2024
    Configuration menu
    Copy the full SHA
    9142c58 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2024

  1. Configuration menu
    Copy the full SHA
    b6787f7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5fec286 View commit details
    Browse the repository at this point in the history
  3. Revert "Add print step to touchstone workflow"

    This reverts commit 5fec286.
    giovannic committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    598ade0 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2024

  1. Improve cumsum performance

    plietar committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    09e6e8c View commit details
    Browse the repository at this point in the history
  2. Remove outlining of function

    plietar committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    0f21bbc View commit details
    Browse the repository at this point in the history
  3. Optimize competing hazards.

    We only need to perform the selection for individuals that passed the
    occurs check, not the entire population.
    plietar committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    a58e064 View commit details
    Browse the repository at this point in the history
  4. Fix empty occurs case.

    plietar committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    1f7310b View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2024

  1. Configuration menu
    Copy the full SHA
    e2242b2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4c98559 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0bd7c10 View commit details
    Browse the repository at this point in the history
  4. Merge remote-tracking branch 'origin/dev' into competing_hazards_reco…

    …very_infection_resolution
    plietar committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    91697ba View commit details
    Browse the repository at this point in the history
  5. Add a bitset_at implementation that works with a logical index.

    Eventually this should go into individual.
    plietar committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    ded6876 View commit details
    Browse the repository at this point in the history
  6. Fix tests

    plietar committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    8f9bcfc View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2024

  1. Fix more tests

    plietar committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    f363b94 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. Add tests

    plietar committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    b339b7a View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2024

  1. Use new individual features

    plietar committed Jul 27, 2024
    Configuration menu
    Copy the full SHA
    f2cacfb View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'origin/dev' into competing_hazards_reco…

    …very_infection_resolution
    plietar committed Jul 27, 2024
    Configuration menu
    Copy the full SHA
    e1bc3c1 View commit details
    Browse the repository at this point in the history
  3. Fix output test

    plietar committed Jul 27, 2024
    Configuration menu
    Copy the full SHA
    babc34b View commit details
    Browse the repository at this point in the history