Skip to content

Commit

Permalink
Finalized code for public release
Browse files Browse the repository at this point in the history
  • Loading branch information
jpes707 committed Sep 1, 2020
1 parent 34928d0 commit 9fa0efb
Show file tree
Hide file tree
Showing 311 changed files with 138,965 additions and 363,877 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Codebase for SIGSPATIAL ARIC 2020: Foot-Traffic Informed COVID-19 Simulation and

3. Download the SafeGraph Open Census Data [here](https://www.safegraph.com/open-census-data). Save it to `safegraph-data/safegraph_open_census_data`.

4. Get free access to the remaining SafeGraph data by following [these steps](https://www.safegraph.com/covid-19-data-consortium).
4. Get free access to the remaining SafeGraph data by following [these steps](https://www.safegraph.com/covid-19-data-consortium). A non-disclosure agreement must be signed as part of the process.

5. Download the SafeGraph Weekly Patterns (v2) data. Save it to `safegraph-data/safegraph_weekly_patterns_v2`.

Expand All @@ -20,8 +20,12 @@ Codebase for SIGSPATIAL ARIC 2020: Foot-Traffic Informed COVID-19 Simulation and

## Usage

* `county-parser.py` is used to extract locality data. Run this at least once, and then run `simulation.py`. The results will be located in `results/`.
* `county-parser.py` is used to extract locality data. Run this at least once, and then run `simulation.py`. To create custom simulation configurations, place new `.cfg` files in `config-files/`. Use `config-files/default-config.cfg` as a template.

* To create custom simulation configurations, place new `.cfg` files in `config-files/`. Use `config-files/default-config.cfg` as a template.
* `simulation-naive.py` is used to simulate community and household spread in a naive way by weighting POIs equally, ignoring the time of day, and using a constant dwell time. In most cases, the virus will only reach a very small number of agents because agents will not congregate at popular POIs, making this simulation version unrealistic.

* `mobility-stats.py` is used to evaluate mobility data assuming no virus has been introduced. It provides the total number of visitors to each POI within a specified timeframe.

* `sigspatial-trials.txt`, `sigspatial-trial-runner.py`, and any files in a folder that is titled `sigspatial-trials/` were used to generate results for the conference publication. These files will likely not be applicable in other cases.

* All results will be located in `results/`.
20 changes: 9 additions & 11 deletions config-files/default-config.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[Settings]

# preliminary parameters
LOCALITY = 'Fairfax' # can be a county, borough, or parish; independent cities (e.g. Baltimore City) are not currently compatible
STATE_ABBR = 'VA' # state abbreviation of where the locality is located
Expand Down Expand Up @@ -28,12 +26,12 @@ CLOSED_POI_TYPES = {} # closes the following POI types (from SafeGraph Core Pla

# virus parameters
# For COVID-19, a close contact is defined as ay individual who was within 6 feet of an infected person for at least 15 minutes starting from 2 days before illness onset (or, for asymptomatic patients, 2 days prior to positive specimen collection) until the time the patient is isolated. (https://www.cdc.gov/coronavirus/2019-ncov/php/contact-tracing/contact-tracing-plan/contact-tracing.html)
percent_asymptomatic = 0.4 # (recommended: 0.4) https://www.cdc.gov/coronavirus/2019-ncov/hcp/planning-scenarios.html
secondary_attack_rate = 0.05 # (recommended: 0.05) chance of contracting the virus on close contact with someone, DO NOT DIVIDE BY SIMULATION_TICKS_PER_HOUR https://jamanetwork.com/journals/jama/fullarticle/2768396
asymptomatic_relative_infectiousness = 0.75 # (recommended: 0.75) https://www.cdc.gov/coronavirus/2019-ncov/hcp/planning-scenarios.html
distribution_of_exposure = scipy.stats.gamma(4, 0, 0.75) # (recommended: 4, 0, 0.75) gamma distribution of the duration (days) between exposure and infectiousness, k=4 μ=3 => midpoint is 2.754 days https://www.nature.com/articles/s41591-020-0962-9
distribution_of_preclinical = scipy.stats.gamma(4, 0, 0.525) # (recommended: 4, 0, 0.525) gamma distribution of the duration (days) between infectiousness and symptoms for symptomatic cases, k=4 μ=2.1 => midpoint is 1.928 days https://www.nature.com/articles/s41591-020-0962-9
distribution_of_clinical = scipy.stats.gamma(4, 0, 0.725) # (recommended: 4, 0, 0.725) gamma distribution of the duration (days) between symptoms and non-infectiousness (recovery) for symptomatic cases, k=4 μ=2.9 => midpoint is 2.662 days https://www.nature.com/articles/s41591-020-0962-9
distribution_of_subclinical = scipy.stats.gamma(4, 0, 1.25) # (recommended: 4, 0, 1.25) gamma distribution of the duration (days) between infectiousness and non-infectiousness (recovery) for asymptomatic cases, k=4 μ=5 => midpoint is 4.590 days https://www.nature.com/articles/s41591-020-0962-9
total_chance_of_small_household_transmission = 0.204 # (recommended: 0.091) chance of an infected agent spreading the virus to a given household member over the agent's entire period of infection when the household size is six or less https://www.thelancet.com/journals/laninf/article/PIIS1473-3099(20)30471-0/fulltext
total_chance_of_large_household_transmission = 0.091 # (recommended: 0.204) chance of an infected agent spreading the virus to a given household member over the agent's entire period of infection when the household size is more than six https://www.thelancet.com/journals/laninf/article/PIIS1473-3099(20)30471-0/fulltext
PERCENT_ASYMPTOMATIC = 0.4 # (recommended: 0.4) https://www.cdc.gov/coronavirus/2019-ncov/hcp/planning-scenarios.html
SECONDARY_ATTACK_RATE = 0.05 # (recommended: 0.05) chance of contracting the virus on close contact with someone, DO NOT DIVIDE BY SIMULATION_TICKS_PER_HOUR https://jamanetwork.com/journals/jama/fullarticle/2768396
ASYMPTOMATIC_RELATIVE_INFECTIOUSNESS = 0.75 # (recommended: 0.75) https://www.cdc.gov/coronavirus/2019-ncov/hcp/planning-scenarios.html
DISTRIBUTION_OF_EXPOSURE = scipy.stats.gamma(4, 0, 0.75) # (recommended: 4, 0, 0.75) gamma distribution of the duration (days) between exposure and infectiousness, k=4 μ=3 => midpoint is 2.754 days https://www.nature.com/articles/s41591-020-0962-9
DISTRIBUTION_OF_PRECLINICAL = scipy.stats.gamma(4, 0, 0.525) # (recommended: 4, 0, 0.525) gamma distribution of the duration (days) between infectiousness and symptoms for symptomatic cases, k=4 μ=2.1 => midpoint is 1.928 days https://www.nature.com/articles/s41591-020-0962-9
DISTRIBUTION_OF_CLINICAL = scipy.stats.gamma(4, 0, 0.725) # (recommended: 4, 0, 0.725) gamma distribution of the duration (days) between symptoms and non-infectiousness (recovery) for symptomatic cases, k=4 μ=2.9 => midpoint is 2.662 days https://www.nature.com/articles/s41591-020-0962-9
DISTRIBUTION_OF_SUBCLINICAL = scipy.stats.gamma(4, 0, 1.25) # (recommended: 4, 0, 1.25) gamma distribution of the duration (days) between infectiousness and non-infectiousness (recovery) for asymptomatic cases, k=4 μ=5 => midpoint is 4.590 days https://www.nature.com/articles/s41591-020-0962-9
TOTAL_CHANCE_OF_SMALL_HOUSEHOLD_TRANSMISSION = 0.204 # (recommended: 0.091) chance of an infected agent spreading the virus to a given household member over the agent's entire period of infection when the household size is six or less https://www.thelancet.com/journals/laninf/article/PIIS1473-3099(20)30471-0/fulltext
TOTAL_CHANCE_OF_LARGE_HOUSEHOLD_TRANSMISSION = 0.091 # (recommended: 0.204) chance of an infected agent spreading the virus to a given household member over the agent's entire period of infection when the household size is more than six https://www.thelancet.com/journals/laninf/article/PIIS1473-3099(20)30471-0/fulltext
2 changes: 2 additions & 0 deletions docs/cbgs-to-topics-1.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>SIGSPATIAL ARIC 2020: Foot-Traffic Informed COVID-19 Simulation and Mitigation</title>
<link rel="shortcut icon" href="sigspatial.ico">

<script>
L_NO_TOUCH = false;
Expand Down
2 changes: 2 additions & 0 deletions docs/cbgs-to-topics-10.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>SIGSPATIAL ARIC 2020: Foot-Traffic Informed COVID-19 Simulation and Mitigation</title>
<link rel="shortcut icon" href="sigspatial.ico">

<script>
L_NO_TOUCH = false;
Expand Down
2 changes: 2 additions & 0 deletions docs/cbgs-to-topics-50.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>SIGSPATIAL ARIC 2020: Foot-Traffic Informed COVID-19 Simulation and Mitigation</title>
<link rel="shortcut icon" href="sigspatial.ico">

<script>
L_NO_TOUCH = false;
Expand Down
3 changes: 2 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<html>
<head>
<title>SIGSPATIAL ARIC 2020: Foot-Traffic Informed COVID-19 Simulation and Mitigation</title>
<link rel="shortcut icon" href="sigspatial.ico">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i" rel="stylesheet">
<link rel="stylesheet" href="stylesheet.css" media="screen" type="text/css">
</head>
<body>
<div class="wrapper">
<h1>SIGSPATIAL ARIC 2020: Foot-Traffic Informed COVID-19 Simulation and Mitigation</h1>
<p>Codebase: <a href="https://github.com/jpes707/safegraph-simulation">https://github.com/jpes707/safegraph-simulation</a></p>
<p>Topics to POIs heatmaps (top 100 POIs for all trials with 100k agents):</p>
<p>Topic POI heatmaps (top 100 POIs for all trials):</p>
<ul>
<li><a href="topics-to-pois-1.html" target="_blank">1 topic</a></li>
<li><a href="topics-to-pois-10.html" target="_blank">10 topics</a></li>
Expand Down
Binary file added docs/sigspatial.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions docs/topics-to-pois-1.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>SIGSPATIAL ARIC 2020: Foot-Traffic Informed COVID-19 Simulation and Mitigation</title>
<link rel="shortcut icon" href="sigspatial.ico">

<script>
L_NO_TOUCH = false;
Expand Down
2 changes: 2 additions & 0 deletions docs/topics-to-pois-10.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>SIGSPATIAL ARIC 2020: Foot-Traffic Informed COVID-19 Simulation and Mitigation</title>
<link rel="shortcut icon" href="sigspatial.ico">

<script>
L_NO_TOUCH = false;
Expand Down
2 changes: 2 additions & 0 deletions docs/topics-to-pois-50.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>SIGSPATIAL ARIC 2020: Foot-Traffic Informed COVID-19 Simulation and Mitigation</title>
<link rel="shortcut icon" href="sigspatial.ico">

<script>
L_NO_TOUCH = false;
Expand Down
34 changes: 17 additions & 17 deletions results/cbg-to-topic-maps/sigspatial-trials/2-1-1.html

Large diffs are not rendered by default.

Loading

0 comments on commit 9fa0efb

Please sign in to comment.