Software Open Access

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

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


MARC21 XML Export

<?xml version='1.0' encoding='UTF-8'?>
<record xmlns="http://www.loc.gov/MARC21/slim">
  <leader>00000nmm##2200000uu#4500</leader>
  <controlfield tag="005">20210713014827.0</controlfield>
  <controlfield tag="001">5093607</controlfield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="u">Humboldt Universität zu Berlin</subfield>
    <subfield code="0">(orcid)0000-0001-5708-2922</subfield>
    <subfield code="a">Brockmann, Dirk</subfield>
  </datafield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="u">Humboldt Universität zu Berlin</subfield>
    <subfield code="0">(orcid)0000-0001-7414-8823</subfield>
    <subfield code="a">Maier, Benjamin F</subfield>
  </datafield>
  <datafield tag="856" ind1="4" ind2=" ">
    <subfield code="s">80194533</subfield>
    <subfield code="z">md5:4ef7db9e5d5f838e2957613dc9aa58a2</subfield>
    <subfield code="u">https://zenodo.org/record/5093607/files/DigCT.zip</subfield>
  </datafield>
  <datafield tag="542" ind1=" " ind2=" ">
    <subfield code="l">open</subfield>
  </datafield>
  <datafield tag="260" ind1=" " ind2=" ">
    <subfield code="c">2021-07-12</subfield>
  </datafield>
  <datafield tag="909" ind1="C" ind2="O">
    <subfield code="p">software</subfield>
    <subfield code="p">user-covid-19</subfield>
    <subfield code="o">oai:zenodo.org:5093607</subfield>
  </datafield>
  <datafield tag="100" ind1=" " ind2=" ">
    <subfield code="u">Humboldt Universität zu Berlin</subfield>
    <subfield code="0">(orcid)0000-0002-9305-1493</subfield>
    <subfield code="a">Burdinski, Angelique</subfield>
  </datafield>
  <datafield tag="245" ind1=" " ind2=" ">
    <subfield code="a">Analysis Code: Digital contact tracing contributes little to COVID-19 outbreak containment</subfield>
  </datafield>
  <datafield tag="980" ind1=" " ind2=" ">
    <subfield code="a">user-covid-19</subfield>
  </datafield>
  <datafield tag="540" ind1=" " ind2=" ">
    <subfield code="u">https://opensource.org/licenses/MIT</subfield>
    <subfield code="a">MIT License</subfield>
  </datafield>
  <datafield tag="650" ind1="1" ind2="7">
    <subfield code="a">cc-by</subfield>
    <subfield code="2">opendefinition.org</subfield>
  </datafield>
  <datafield tag="520" ind1=" " ind2=" ">
    <subfield code="a">&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;</subfield>
  </datafield>
  <datafield tag="773" ind1=" " ind2=" ">
    <subfield code="n">doi</subfield>
    <subfield code="i">isVersionOf</subfield>
    <subfield code="a">10.5281/zenodo.5093499</subfield>
  </datafield>
  <datafield tag="024" ind1=" " ind2=" ">
    <subfield code="a">10.5281/zenodo.5093607</subfield>
    <subfield code="2">doi</subfield>
  </datafield>
  <datafield tag="980" ind1=" " ind2=" ">
    <subfield code="a">software</subfield>
  </datafield>
</record>
255
2
views
downloads
All versions This version
Views 255246
Downloads 22
Data volume 160.4 MB160.4 MB
Unique views 246242
Unique downloads 22

Share

Cite as