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

Keeping track of secondary infections #262

Open
mghosh00 opened this issue Mar 6, 2024 · 4 comments · Fixed by #263 · May be fixed by #267
Open

Keeping track of secondary infections #262

mghosh00 opened this issue Mar 6, 2024 · 4 comments · Fixed by #263 · May be fixed by #267
Assignees
Labels
enhancement New feature or request

Comments

@mghosh00
Copy link
Contributor

mghosh00 commented Mar 6, 2024

Is your feature request related to a problem? Please describe.
We wish to record the number of people each person infects over the course of the epidemic (each time they are re-infected) so that we can find the R_t value at each time step. The dataframes produced will be further used in the sampling package EpiOS.

Describe the solution you'd like
I will change the Person class to record a list of secondary infections each person has during the epidemic. I will also update the simulation to record and output a dataframe containing this information.

@mghosh00 mghosh00 self-assigned this Mar 6, 2024
@mghosh00 mghosh00 added the enhancement New feature or request label Mar 6, 2024
@mghosh00
Copy link
Contributor Author

mghosh00 commented Mar 6, 2024

Classes and functions to update:

core

  • Person.__init__ (infection_start_time, secondary_infections)
  • Person.increment_secondary_infections new
  • tests

output

  • AgeStratifiedNewCasesWriter.write
  • NewCasesWriter.write
  • tests

property

  • PersonalFOI.person_susc
  • tests

routine

  • Simulation.configure (add boolean to inf_history_params)
  • Simulation.run_sweeps
  • Simulation.write_to_rt_file new
  • tests

sweep

  • PlaceSweep.__call__
  • HouseholdSweep.__call__
  • SpatialSweep.__call__
  • HostProgressionSweep.set_infectiousness
  • HostProgressionSweep._updates_infectiousness
  • tests

@mghosh00
Copy link
Contributor Author

mghosh00 commented Mar 6, 2024

Structure of output dataframe

Here is a template for what the output dataframe will look like (maybe not including R_t but is there to illustrate):

time person A person B person C person D ... person Z R_t
0.0 nan nan 5 nan ... 0 2.5
1.0 3 nan nan nan ... nan 3.0
2.0 nan nan nan nan ... nan 0.0
3.0 nan nan nan 3 ... nan 3.0
4.0 nan 6 nan nan ... 2 4.0

In this scenario, here are the lists of days in which each person becomes infected:
A: 1.0 - goes on to infect 3 others
B: 4.0 - goes on to infect 6 others
C: 0.0 - goes on to infect 5 others
D: 3.0 - goes on to infect 3 others
E: 0.0 - goes on to infect 0 others, reinfected at 4.0 goes on to infect 2 others

@mghosh00 mghosh00 mentioned this issue Mar 6, 2024
8 tasks
@mghosh00 mghosh00 linked a pull request Mar 6, 2024 that will close this issue
8 tasks
@mghosh00 mghosh00 reopened this Jun 19, 2024
@mghosh00
Copy link
Contributor Author

mghosh00 commented Jun 19, 2024

Tracking the serial interval of the epidemic

We wish to also take into account the serial interval. For every infection event, the time between the infector's infection_time and the infectee's infection_time will be recorded, and back-tracked to the timestep for which the infector was infected. Then we record a histogram of the these times for each timestep.

Example:

time person A person B person C person D person E person F
0.0 gets infected
1.0 infects B, C gets infected by A gets infected by A
2.0 infects D gets infected by B
3.0 infects E infects F gets infected by A gets infected by C

In this scenario, the serial interval vectors look like:
0.0: [1, 1, 3] - A infects B (1), C (1) and E (3)
1.0: [1, 2] - B infects D (1), C infects F (2)
2.0: [] - D infects no-one
3.0: [] - E and F infect no-one

@mghosh00
Copy link
Contributor Author

mghosh00 commented Jun 19, 2024

Classes and functions to update:

core

  • Person.__init__ (serial_intervals)
  • Person.set_exposure_period new
  • Person.store_serial_interval new
  • tests

routine

  • Simulation.configure (add boolean to inf_history_params)
  • Simulation.run_sweeps
  • Simulation.write_to_serial_file new
  • tests

sweep

  • PlaceSweep.__call__
  • HouseholdSweep.__call__
  • SpatialSweep.__call__
  • HostProgressionSweep.update_time_status_change
  • tests

@mghosh00 mghosh00 linked a pull request Jun 20, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant