Models of COVID-19 outbreak trajectories and hospital demand
|size (curr.)||2124 kB|
This tool is based on an SIR model (see about page for details) that simulates a COVID19 outbreak. The population is initially mostly susceptible (other than for initial cases). Individuals that recover from COVID19 are subsequently immune. Currently, the parameters of the model are not fit to data but are simply defaults. These might fit better for some localities than others. In particular the initial cases counts are often only rough estimates.
The primary purpose of the tool is to explore the dynamics of COVID19 cases and the associated strain on the health care system in the near future. The outbreak is influenced by infection control measures such as school closures, lock-down etc. The effect of such measures can be included in the simulation by adjusting the mitigation parameters. Analogously, you can explore the effect of isolation on specific age groups in the column “Isolated” in the table on severity assumptions and age specific isolation.
Most parameters can be adjusted in the tool and for many of them we provide presets (scenarios).
Input data for the tool and the basic parameters of the populations are collected in a separate repository neherlab/covid19_scenarios_data. Please add data on populations and parsers of publicly available case count data there.
The online application provides a friendly user interface with drop downs to choose model parameters, run the model, and export results in CSV format. A detailed process is below.
Select the population drop down and select a country/region to auto-populate the model’s parameters with respective UN population data. These parameters can be indivdually updated manually if necessary.
The epidemiology parameters are a combination of speed and region - specifying growth rate, seasonal variation, and duration of hospital stay. To choose a preset distribution, select one of the options from the epidemiology drop down to auto-populate the model’s parameters with the selected parameters.
Mitigation parameters represent the reduction of transmission through mitigation (infection control) measures over time. To select a preset, click on the mitigation dropdown and select one of the options. Otherwise, the points on the graph can be dragged and moved with the mouse. The parameter ranges from one (no infection control) to zero (complete prevention of all transmission).
Running the Model
Once the correct parameters are inputted, select the run button located in the Results section of the application. The model output will be displayed in 2 graphs: Cases through time and Distribution across groups and 2 tables: Populations and Totals/Peak.
The model’s results can be exported in CSV format by clicking the “export” button in the right hand corner.
Install the requirements:
Then in your terminal type:
git clone --recursive https://github.com/neherlab/covid19_scenarios cd covid19_scenarios/ cp .env.example .env yarn install yarn dev
(on Windows, substitute
This will trigger the development server and build process. Wait for the build to finish, then navigate to
http://localhost:3000 in a browser (last 5 versions of Chrome or Firefox are supported in development mode).
ℹ️ Hint: type “rs” in terminal to restart the build
ℹ️ Hit Ctrl+C in to shutdown the server
Run in docker container
Install the requirements:
- Docker > 19.0
- docker-compose >= 1.25
Run docker-compose with
UID=$(id -u) docker-compose -f docker/docker-compose.dev.yml up --build
UID should be set to your Unix user ID. On single-user setups these are usually 1000 on Linux and 523 on Mac.
As a developer you are most likely interested in the actual source code in
|File or directory||Contents|
|├📄run.ts/||Algorithm’s entry point|
|📁assets/||Input data, images, and text assets|
|├📁Main/||Simulator’s UI main component implementation|
|| ├📁Containment/||Containment widget|
|| ├📁Results/||Results panel|
|| ├📁Scenario/||Scenario panel|
|| ├📁state/||Main component’s state management (hooks)|
|| ├📁validation/||Form validation|
|| ├📄Main.tsx/||Simulator’s UI main component entry point|
|├📄App.tsx/||App main component|
|📁locales/||Locales for translation|
|📁server/||Server that serves production build artifacts|
|📁state/||App state management (Redux and sagas)|
|📄index.polyfilled.ts||Entry point wrapper with polyfills|
|📄index.tsx||Real entry point|
|📄routes.ts||Routes (URL-to-page mapping)|
In order to replicate the production build locally, use this command:
This should build the application in production mode and to start static server that will serve the app on
http://localhost:8080 (by default)
Release ccycle, continuous integration and deployment
For new contributers, follow the guide below to learn how to install required software, fork & clone, and submit changes using a pull request.
✨ Installing Required Software
Install Git by following GitHub’s instructions here
Yarn can be globally installed following these steps
🍴 Forking the Repo
Click the Fork button on the upper right-hand side of the repository’s page.
👯 Clone Forked Repository
Clone this repository recursively (including submodules) to your local machine. You can use the URL of your repo inside git command, for example:
git clone --recursive https://github.com/<YOUR_GITHUB_USERNAME>/covid19_scenarios
🔨 Start coding!
💻 Updating the Forked Repository
To ensure that the forked code stays updated, you’ll need to add a Git remote pointing back to the original repository and create a local branch.
git remote add upstream https://github.com/neherlab/covid19_scenarios
To create and checkout a branch,
- Create and checkout a branch
git checkout -b <new branch name>
- Make changes to the files
- Commit your changes to the branch using
git addand then
💪 Submitting changes using a Pull Request
To submit your code to the repository, you can submit a pull request.
Initially, the development was started in the Research group of Richard Neher at the Biozentrum, University of Basel (Basel, Switzerland) by Richard Neher (@rneher), Ivan Aksamentov (@ivan-aksamentov) and Nicholas Noll (@nnoll).
We are thankful to all our contributors, no matter how they contribute: in ideas, science, code, documentation or otherwise. Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Copyright (c) 2020 neherlab