/Layered_Interactions_COVID_Model

Primary LanguageRGNU General Public License v3.0GPL-3.0

Layered Interactions COVID Model

This repository contains code and data to replicate findings in "The illusion of personal health decisions for infectious disease management: disease spread in social contact networks," by Matthew Michalska-Smith, Eva A Enns, Lauren A White, Marie L J Gilbertson, and Meggan E Craft

Also check out our interactive application for simulating disease on realistic human contact networks at: https://z.umn.edu/LINCS

Replication of paper To perform a complete replication of results in the aforementioned publication, run the script

run_disease_simulations.R from the command line with the following parameters:

Rscript run_disease_simulations.R [locale] [background] [number of simulations] [population size] [pseudo-risk?] [R0?] [random seed]

where:

locale can take the values of "Texas", "Florida", or "United States" and determines the household-size and age distributions in generating the contact network background is a real number between 0 and 1 (inclusive) and signifies the per-capita transmission rate connecting all individuals in the network. This value serves as a catch-all for transmission outside of the explicitly defined network layers (household, classroom, and workplace). number of simulations is the number of random combinations of classmate and co-worker transmission rates that will be used to simulate epidemics (note that each combination will be simulated over 10 replicates) population size is the number of individuals in the synthetic community. Note that the networks are actually generated by household, so this value is approximate. The number of household units will vary based on the average household size. pseudo-risk? is a logical flag (TRUE/FALSE) to determine whether or not the risk-tolerance regime simulations should be done as intended, or simply to subset the edges in a similar way. This is for disambiguating the effects of removing specific edges (i.e. those that are parts of the paths connecting vulnerable indidividuals to the rest of the population) to the effects of removing edges per se. R0? is a logical flag to determine whether full simulations should be run, or just the secondary infections from a single infectious individual in an otherwise susceptible population (i.e. to numerically calculate the reproduction number $R_0$). Note that (while the code should still function properly) there is currently no analysis that relies on both pseudo-risk? and R0? being TRUE, so these can be treated as mutually exclusive. random seed is an integer value used to set the seed of the random number generator in R prior to sampling classmate and co-worker transmission rates.

Finally, note that you will have to run the code for both the "Texas" and "Florida" locales for a given background rate in order for the figure script to work out-of-the-box.

For example:

Rscript run_disease_simulations.R Texas 0.001 100 100 FALSE FALSE 0
Rscript run_disease_simulations.R Florida 0.001 100 100 FALSE FALSE 0

Together, these take approximately 15 minutes and 300 Mb of RAM to run on a single core, but the code is readily modified (on line 127) to run in parallel.

This will produce an output file [background]_[ifelse(pseudo, 'pseudorisk', 'realrisk')]_[ifelse(rnaught, 'R0', 'full')]_[locale].csv in the results directory, which is used by plot_results.R to generate plots corresponding to those found in the manuscript. Note that, in general, these figures will have more panels than those in the main text, which were simplified to improve message clarity.

Rscript plot_results.R [background]

For example:

Rscript plot_results.R 0.001

This will produce at least four plots in a subdirectory of figures (more if you additionally ran the pseudo-risk? == TRUE and R0? == TRUE options for run_disease_simulation.R).