Software Open Access

Analysis Code: Digital contact tracing contributes little to COVID-19 outbreak containment

Burdinski, Angelique; Brockmann, Dirk; Maier, Benjamin F


DataCite XML Export

<?xml version='1.0' encoding='utf-8'?>
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.1/metadata.xsd">
  <identifier identifierType="DOI">10.5281/zenodo.5093607</identifier>
  <creators>
    <creator>
      <creatorName>Burdinski, Angelique</creatorName>
      <givenName>Angelique</givenName>
      <familyName>Burdinski</familyName>
      <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="http://orcid.org/">0000-0002-9305-1493</nameIdentifier>
      <affiliation>Humboldt Universität zu Berlin</affiliation>
    </creator>
    <creator>
      <creatorName>Brockmann, Dirk</creatorName>
      <givenName>Dirk</givenName>
      <familyName>Brockmann</familyName>
      <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="http://orcid.org/">0000-0001-5708-2922</nameIdentifier>
      <affiliation>Humboldt Universität zu Berlin</affiliation>
    </creator>
    <creator>
      <creatorName>Maier, Benjamin F</creatorName>
      <givenName>Benjamin F</givenName>
      <familyName>Maier</familyName>
      <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="http://orcid.org/">0000-0001-7414-8823</nameIdentifier>
      <affiliation>Humboldt Universität zu Berlin</affiliation>
    </creator>
  </creators>
  <titles>
    <title>Analysis Code: Digital contact tracing contributes little to COVID-19 outbreak containment</title>
  </titles>
  <publisher>Zenodo</publisher>
  <publicationYear>2021</publicationYear>
  <dates>
    <date dateType="Issued">2021-07-12</date>
  </dates>
  <resourceType resourceTypeGeneral="Software"/>
  <alternateIdentifiers>
    <alternateIdentifier alternateIdentifierType="url">https://zenodo.org/record/5093607</alternateIdentifier>
  </alternateIdentifiers>
  <relatedIdentifiers>
    <relatedIdentifier relatedIdentifierType="DOI" relationType="IsVersionOf">10.5281/zenodo.5093499</relatedIdentifier>
    <relatedIdentifier relatedIdentifierType="URL" relationType="IsPartOf">https://zenodo.org/communities/covid-19</relatedIdentifier>
  </relatedIdentifiers>
  <version>1.1</version>
  <rightsList>
    <rights rightsURI="https://opensource.org/licenses/MIT">MIT License</rights>
    <rights rightsURI="info:eu-repo/semantics/openAccess">Open Access</rights>
  </rightsList>
  <descriptions>
    <description descriptionType="Abstract">&lt;p&gt;# Digital Contact Tracing&lt;/p&gt;

&lt;p&gt;This package provides the simulation, analysis, and figure code for&lt;br&gt;
the manuscript &amp;quot;Digital contact tracing contributes little to COVID-19&lt;br&gt;
outbreak containment&amp;quot; by A. Burdinski, D. Brockmann, and B. F. Maier.&lt;/p&gt;

&lt;p&gt;## Prerequisites&lt;/p&gt;

&lt;p&gt;The analysis code was used and tested for Python 3.8 on CentOS 6.10, Ubuntui 18.04, and macOS 11.3.&lt;br&gt;
In order to run code in this collection, first install the requirements:&lt;/p&gt;

&lt;p&gt;```bash&lt;br&gt;
pip install -r requirements.txt&lt;br&gt;
```&lt;/p&gt;

&lt;p&gt;The requirements read&lt;/p&gt;

&lt;p&gt;```&lt;br&gt;
epipack==0.1.5&lt;br&gt;
bfmplot==0.0.10&lt;br&gt;
networkx==2.4&lt;br&gt;
qsuite==0.4.14&lt;br&gt;
smallworld==0.1.0&lt;br&gt;
simplejson==3.17.2&lt;br&gt;
rich==9.5.1&lt;br&gt;
tqdm==4.61.2&lt;br&gt;
```&lt;/p&gt;

&lt;p&gt;Models are implemented using [epipack](github.com/benmaier/epipack). To run&lt;br&gt;
large-scale simulations, we use [qsuite](github.com/benmaier/qsuite), a CLI&lt;br&gt;
to facilitate simulations on HPC clusters. `qsuite` will be installed when&lt;br&gt;
dependencies are installed from `requirements.txt`.&lt;/p&gt;

&lt;p&gt;In order to have the simulations run faster, consider installing&lt;br&gt;
[SamplableSet](https://github.com/gstonge/SamplableSet).&lt;/p&gt;

&lt;p&gt;The installation process will take a few seconds.&lt;/p&gt;

&lt;p&gt;## Main model&lt;/p&gt;

&lt;p&gt;The main model, including an example configuration,&lt;br&gt;
can be found in directory `main_model/`.&lt;/p&gt;

&lt;p&gt;### Example&amp;nbsp;&lt;/p&gt;

&lt;p&gt;To run the simulation, do&lt;/p&gt;

&lt;p&gt;```bash&lt;br&gt;
cd main_model/&lt;br&gt;
python example.py&lt;br&gt;
```&lt;/p&gt;

&lt;p&gt;In this example, 200 simulations are run, each on a&lt;br&gt;
distinctly sampled Erdos-Renyi network of `N = 10,000` nodes&lt;br&gt;
with mean degree `k = 20`,&lt;br&gt;
100 simulations on networks with a 30% app participation rate,&lt;br&gt;
and 100 simulations on networks with no tracing app.&lt;/p&gt;

&lt;p&gt;The code is expected to run for about 10 minutes on a &amp;quot;regular&amp;quot;&lt;br&gt;
desktop PC (tested on a 2020 Macbook Pro and a small 8-core webserver).&amp;nbsp;&lt;/p&gt;

&lt;p&gt;This is the expected output (see `main_model/example.png`).&lt;/p&gt;

&lt;p&gt;![Example](main_model/example.png)&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
### Usage&lt;/p&gt;

&lt;p&gt;Change directory as `cd main_model`. Import simulation code as&lt;/p&gt;

&lt;p&gt;```python&lt;br&gt;
from simulation import simulation code&lt;br&gt;
```&lt;/p&gt;

&lt;p&gt;Then, set the model parameters&lt;/p&gt;

&lt;p&gt;```python&lt;/p&gt;

&lt;p&gt;N = 10_000 # number of nodes&lt;/p&gt;

&lt;p&gt;model_parameters = dict(&lt;br&gt;
&amp;nbsp; &amp;nbsp; N = N,&lt;br&gt;
&amp;nbsp; &amp;nbsp; q = 0.3, # probability to identify&amp;amp;quarantine a symptomatic individual&lt;br&gt;
&amp;nbsp; &amp;nbsp; a = 0.3, # participation rate&lt;br&gt;
&amp;nbsp; &amp;nbsp; R0 = 2.5,&amp;nbsp;&lt;br&gt;
&amp;nbsp; &amp;nbsp; quarantiningS = True, # wether or not susceptible contacts are traced and isolated&lt;br&gt;
&amp;nbsp; &amp;nbsp; parameter = {&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#39;chi&amp;#39;:1/2.5, # delay between test and tracing trigger&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#39;recovery_rate&amp;#39; : 1/7, # 1/(symptomatic infectious period)&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#39;alpha&amp;#39; : 1/3, # latent period&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#39;beta&amp;#39; : 1/2, &amp;nbsp;# presymptomatic infectious period&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#39;number_of_contacts&amp;#39; : 20,&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#39;x&amp;#39;:0.17, # portion of asymptomatic infectious&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#39;I_0&amp;#39; : N*0.01, # initial prevalence&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#39;omega&amp;#39;:1/10, # 1/(average isolation period of susceptibles)&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;y&amp;quot; : 0.1, # ratio of people that induce next-generation tracing&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;z&amp;quot;: 0.64, # ratio of people sharing their test result&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;R0&amp;quot;: 2.5,&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;network_model&amp;quot;:&amp;#39;er_network&amp;#39;, # choose between&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # - er_network&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # - confignetwork&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # - exp_sw_network&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # - swnetwork&lt;br&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br&gt;
&amp;nbsp; &amp;nbsp; sampling_dt = 1, # sample simulation every day&lt;br&gt;
&amp;nbsp; &amp;nbsp; time = 1e7, &amp;nbsp; &amp;nbsp; &amp;nbsp;# maximum simulation time&lt;br&gt;
&amp;nbsp; &amp;nbsp; )&lt;br&gt;
```&lt;/p&gt;

&lt;p&gt;Obtain simulation timeseries by calling the simulation code as&amp;nbsp;&lt;/p&gt;

&lt;p&gt;```python&lt;br&gt;
t, result = simulation_code(model_parameters)&lt;/p&gt;

&lt;p&gt;import matplotlib.pyplot as plt&lt;/p&gt;

&lt;p&gt;plt.(t, result[&amp;#39;S&amp;#39;]+result[&amp;#39;Sa&amp;#39;])&lt;/p&gt;

&lt;p&gt;print(result.keys())&lt;br&gt;
```&lt;/p&gt;

&lt;p&gt;## Manuscript analyses&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Almost all simulations and analyses performed in the paper&lt;br&gt;
can be found in `analysis_collection/tracing_sim/`.&lt;/p&gt;

&lt;p&gt;All extracted (summarized) data can be found in&lt;br&gt;
`analysis_collection/data_new.json`.&lt;/p&gt;

&lt;p&gt;Code to produce the figures in the main text from distilled analysis&lt;br&gt;
results and analyses for the locally clustered network with&lt;br&gt;
exponential degree distribution can be found in&lt;br&gt;
`figures_main_text_and_new_network_model/`.&lt;/p&gt;

&lt;p&gt;Code for plots in the SI can be found in&lt;br&gt;
`analysis_collection/tools.py` except for Fig. S7-S8 -- those can&lt;br&gt;
be found in the respective directories&amp;nbsp;&lt;br&gt;
`analysis_collection/tracing_sim/results_deleting_edges_*`&lt;br&gt;
and `analysis_collection/tracing_sim/results_toy_model/`.&lt;/p&gt;

&lt;p&gt;In order to replicate the simulations, change to the directory containing the&lt;br&gt;
respective analysis and run `qsuite local`, e.g.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;```bash&lt;br&gt;
cd analysis_collection/tracing_sim/results_exponential_DF_NMEAS_100_ONLYSAVETIME_False/&lt;br&gt;
qsuite local&lt;br&gt;
```&lt;/p&gt;

&lt;p&gt;An illustration to justify the choice of `beta = 10^(-6)` for the small-world long-range&lt;br&gt;
redistribution parameter can be found by running&lt;br&gt;
`analysis_collection/small_world_parameter.py`.&lt;br&gt;
&amp;nbsp;&lt;/p&gt;</description>
  </descriptions>
</resource>
253
2
views
downloads
All versions This version
Views 253244
Downloads 22
Data volume 160.4 MB160.4 MB
Unique views 244240
Unique downloads 22

Share

Cite as