Software Open Access

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

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

Citation Style Language JSON Export

  "publisher": "Zenodo", 
  "DOI": "10.5281/zenodo.5093607", 
  "title": "Analysis Code: Digital contact tracing contributes little to COVID-19 outbreak containment", 
  "issued": {
    "date-parts": [
  "abstract": "<p># Digital Contact Tracing</p>\n\n<p>This package provides the simulation, analysis, and figure code for<br>\nthe manuscript &quot;Digital contact tracing contributes little to COVID-19<br>\noutbreak containment&quot; by A. Burdinski, D. Brockmann, and B. F. Maier.</p>\n\n<p>## Prerequisites</p>\n\n<p>The analysis code was used and tested for Python 3.8 on CentOS 6.10, Ubuntui 18.04, and macOS 11.3.<br>\nIn order to run code in this collection, first install the requirements:</p>\n\n<p>```bash<br>\npip install -r requirements.txt<br>\n```</p>\n\n<p>The requirements read</p>\n\n<p>```<br>\nepipack==0.1.5<br>\nbfmplot==0.0.10<br>\nnetworkx==2.4<br>\nqsuite==0.4.14<br>\nsmallworld==0.1.0<br>\nsimplejson==3.17.2<br>\nrich==9.5.1<br>\ntqdm==4.61.2<br>\n```</p>\n\n<p>Models are implemented using [epipack]( To run<br>\nlarge-scale simulations, we use [qsuite](, a CLI<br>\nto facilitate simulations on HPC clusters. `qsuite` will be installed when<br>\ndependencies are installed from `requirements.txt`.</p>\n\n<p>In order to have the simulations run faster, consider installing<br>\n[SamplableSet](</p>\n\n<p>The installation process will take a few seconds.</p>\n\n<p>## Main model</p>\n\n<p>The main model, including an example configuration,<br>\ncan be found in directory `main_model/`.</p>\n\n<p>### Example&nbsp;</p>\n\n<p>To run the simulation, do</p>\n\n<p>```bash<br>\ncd main_model/<br>\npython<br>\n```</p>\n\n<p>In this example, 200 simulations are run, each on a<br>\ndistinctly sampled Erdos-Renyi network of `N = 10,000` nodes<br>\nwith mean degree `k = 20`,<br>\n100 simulations on networks with a 30% app participation rate,<br>\nand 100 simulations on networks with no tracing app.</p>\n\n<p>The code is expected to run for about 10 minutes on a &quot;regular&quot;<br>\ndesktop PC (tested on a 2020 Macbook Pro and a small 8-core webserver).&nbsp;</p>\n\n<p>This is the expected output (see `main_model/example.png`).</p>\n\n<p>![Example](main_model/example.png)</p>\n\n<p><br>\n### Usage</p>\n\n<p>Change directory as `cd main_model`. Import simulation code as</p>\n\n<p>```python<br>\nfrom simulation import simulation code<br>\n```</p>\n\n<p>Then, set the model parameters</p>\n\n<p>```python</p>\n\n<p>N = 10_000 # number of nodes</p>\n\n<p>model_parameters = dict(<br>\n&nbsp; &nbsp; N = N,<br>\n&nbsp; &nbsp; q = 0.3, # probability to identify&amp;quarantine a symptomatic individual<br>\n&nbsp; &nbsp; a = 0.3, # participation rate<br>\n&nbsp; &nbsp; R0 = 2.5,&nbsp;<br>\n&nbsp; &nbsp; quarantiningS = True, # wether or not susceptible contacts are traced and isolated<br>\n&nbsp; &nbsp; parameter = {<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;chi&#39;:1/2.5, # delay between test and tracing trigger<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;recovery_rate&#39; : 1/7, # 1/(symptomatic infectious period)<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;alpha&#39; : 1/3, # latent period<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;beta&#39; : 1/2, &nbsp;# presymptomatic infectious period<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;number_of_contacts&#39; : 20,<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;x&#39;:0.17, # portion of asymptomatic infectious<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;I_0&#39; : N*0.01, # initial prevalence<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;omega&#39;:1/10, # 1/(average isolation period of susceptibles)<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;y&quot; : 0.1, # ratio of people that induce next-generation tracing<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;z&quot;: 0.64, # ratio of people sharing their test result<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;R0&quot;: 2.5,<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;network_model&quot;:&#39;er_network&#39;, # choose between<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # - er_network<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # - confignetwork<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # - exp_sw_network<br>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # - swnetwork<br>\n&nbsp; &nbsp; &nbsp; &nbsp; },<br>\n&nbsp; &nbsp; sampling_dt = 1, # sample simulation every day<br>\n&nbsp; &nbsp; time = 1e7, &nbsp; &nbsp; &nbsp;# maximum simulation time<br>\n&nbsp; &nbsp; )<br>\n```</p>\n\n<p>Obtain simulation timeseries by calling the simulation code as&nbsp;</p>\n\n<p>```python<br>\nt, result = simulation_code(model_parameters)</p>\n\n<p>import matplotlib.pyplot as plt</p>\n\n<p>plt.(t, result[&#39;S&#39;]+result[&#39;Sa&#39;])</p>\n\n<p>print(result.keys())<br>\n```</p>\n\n<p>## Manuscript analyses&nbsp;</p>\n\n<p>Almost all simulations and analyses performed in the paper<br>\ncan be found in `analysis_collection/tracing_sim/`.</p>\n\n<p>All extracted (summarized) data can be found in<br>\n`analysis_collection/data_new.json`.</p>\n\n<p>Code to produce the figures in the main text from distilled analysis<br>\nresults and analyses for the locally clustered network with<br>\nexponential degree distribution can be found in<br>\n`figures_main_text_and_new_network_model/`.</p>\n\n<p>Code for plots in the SI can be found in<br>\n`analysis_collection/` except for Fig. S7-S8 -- those can<br>\nbe found in the respective directories&nbsp;<br>\n`analysis_collection/tracing_sim/results_deleting_edges_*`<br>\nand `analysis_collection/tracing_sim/results_toy_model/`.</p>\n\n<p>In order to replicate the simulations, change to the directory containing the<br>\nrespective analysis and run `qsuite local`, e.g.&nbsp;</p>\n\n<p>```bash<br>\ncd analysis_collection/tracing_sim/results_exponential_DF_NMEAS_100_ONLYSAVETIME_False/<br>\nqsuite local<br>\n```</p>\n\n<p>An illustration to justify the choice of `beta = 10^(-6)` for the small-world long-range<br>\nredistribution parameter can be found by running<br>\n`analysis_collection/`.<br>\n&nbsp;</p>", 
  "author": [
      "family": "Burdinski, Angelique"
      "family": "Brockmann, Dirk"
      "family": "Maier, Benjamin F"
  "version": "1.1", 
  "type": "article", 
  "id": "5093607"
All versions This version
Views 253244
Downloads 22
Data volume 160.4 MB160.4 MB
Unique views 244240
Unique downloads 22


Cite as