https://github.com/neherlab/covid19_scenarios
Models of COVID-19 outbreak trajectories and hospital demand
https://github.com/neherlab/covid19_scenarios
coronavirus covid covid-19 data hospital model modelling ncov neherlab open-source opensource outbreak population research sars-cov-2 science simulation ventilator
Last synced: 15 days ago
JSON representation
Models of COVID-19 outbreak trajectories and hospital demand
- Host: GitHub
- URL: https://github.com/neherlab/covid19_scenarios
- Owner: neherlab
- License: mit
- Created: 2020-02-29T14:53:31.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-15T19:04:38.000Z (about 3 years ago)
- Last Synced: 2025-03-31T22:19:11.651Z (22 days ago)
- Topics: coronavirus, covid, covid-19, data, hospital, model, modelling, ncov, neherlab, open-source, opensource, outbreak, population, research, sars-cov-2, science, simulation, ventilator
- Language: JavaScript
- Homepage: https://covid19-scenarios.org
- Size: 56.5 MB
- Stars: 1,355
- Watchers: 49
- Forks: 350
- Open Issues: 44
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
COVID-19 Scenarios
Models of COVID-19 outbreak trajectories and hospital demand
Got questions or suggestions?
π Discover
Simulator
Source code repository
Data directory
Updates
π OverviewThis tool is based on the 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 the
[`/data` directory](https://github.com/neherlab/covid19_scenarios/tree/master/data). Please add data on populations and
parsers of publicly available case count data there.
π User's GuideThe 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.### Parameters: population
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 individually updated manually if necessary.### Parameters: epidemiology
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.### Parameters: mitigation
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.### Exporting Results
The model's results can be exported in CSV format by clicking the "export" button in the right hand corner.
π₯οΈ Developer's guide### Quick Start
#### Run natively
Install the requirements:
- git >= 2.0
- node.js >= 10 (we recommend installation through [nvm](https://github.com/nvm-sh/nvm) or
[nvm-windows](https://github.com/coreybutler/nvm-windows))
- 1.0 < yarn < 2.0Then in your terminal type:
```bash
git clone --recursive https://github.com/neherlab/covid19_scenarios
cd covid19_scenarios/
cp .env.example .env
yarn install
yarn dev```
(on Windows, substitute `cp` with `copy`)
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.25Run docker-compose with `docker/docker-compose.dev.yml` file:
```
UID=$(id -u) docker-compose -f docker/docker-compose.dev.yml up --build```
Variable `UID` should be set to your Unix user ID. On single-user setups these are usually 1000 on Linux and 523 on Mac.
### Directory Structure
As a developer you are most likely interested in the actual source code in `src/` directory.
| File or directory | Contents |
| ---------------------- | --------------------------------------------- |
| πalgorithims/ | Algorithm's implementation |
| βπmodel.ts/ | Model's implementation |
| βπrun.ts/ | Algorithm's entry point |
| πassets/ | Input data, images, and text assets |
| πcomponents/ | React components |
| βπForm/ | Form components |
| βπ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.scss/ | |
| | βπMain.tsx/ | Simulator's UI main component entry point |
| βπApp.tsx/ | App main component |
| πlocales/ | Locales for translation |
| πpages/ | Application's pages |
| πserver/ | Server that serves production build artifacts |
| πstate/ | App state management (Redux and sagas) |
| πstyles/ | Stylesheets |
| πtypes/ | Typescript typings |
| πindex.ejs | HTML template |
| πindex.polyfilled.ts | Entry point wrapper with polyfills |
| πindex.tsx | Real entry point |
| πlinks.ts | Navbar links |
| πroutes.ts | Routes (URL-to-page mapping) |### Production build
In order to replicate the production build locally, use this command:
```bash
yarn prod:watch
```
This should build the application in production mode and to start static server that will serve the app on
`http://localhost:8080` (by default)### Translations
The translation JSON files are in [src/i18n/resources](https://github.com/neherlab/covid19_scenarios/tree/master/src/i18n/resources)
You can edit them directly or using GitLocalize. Here are the direct links to GitLocalize for each language that has translations currently:- [:saudi_arabia: ar](https://gitlocalize.com/repo/4360/ar/src/i18n/resources/en/common.json)
- [:de: de](https://gitlocalize.com/repo/4360/de/src/i18n/resources/en/common.json)
- [:us: en](https://gitlocalize.com/repo/4360/en/src/i18n/resources/en/common.json)
- [:es: es](https://gitlocalize.com/repo/4360/es/src/i18n/resources/en/common.json)
- [:iran: fa](https://gitlocalize.com/repo/4360/fa/src/i18n/resources/en/common.json)
- [:fr: fr](https://gitlocalize.com/repo/4360/fr/src/i18n/resources/en/common.json)
- [:india: hi](https://gitlocalize.com/repo/4360/hi/src/i18n/resources/en/common.json)
- [:it: it](https://gitlocalize.com/repo/4360/it/src/i18n/resources/en/common.json)
- [:jp: ja](https://gitlocalize.com/repo/4360/ja/src/i18n/resources/en/common.json)
- [:kr: ko](https://gitlocalize.com/repo/4360/ko/src/i18n/resources/en/common.json)
- [:poland: pl](https://gitlocalize.com/repo/4360/pl/src/i18n/resources/en/common.json)
- [:portugal: pt](https://gitlocalize.com/repo/4360/pt/src/i18n/resources/en/common.json)
- [:ru: ru](https://gitlocalize.com/repo/4360/ru/src/i18n/resources/en/common.json)
- [:tr: tr](https://gitlocalize.com/repo/4360/tr/src/i18n/resources/en/common.json)
- [:cn: zh](https://gitlocalize.com/repo/4360/zh/src/i18n/resources/en/common.json)### Schemas
The directory `schemas/` contains JSON schemas which serve as a base for type checking, validation and serialization.
In particular, some of the types:
- are generated from schemas for both Python (as classes) and Typescript (as interfaces)
- are validated on runtime using corresponding libraries in these languages
- are (when appropriate) serialized and deserialized using generated serialization/deserialized functionsWe make emphasis on types that are shared across languages (e.g. Python to Typescript) as well as on types that
participate in input-output (e.g. URLs, Local Storage, File I/O) and require particularly careful validation and
serialization.If you are planning to change one of the types that happens to be generated, you need to modify the corresponding schema
first and them re-run the type generation.#### See also:
- [JSON Schema website](https://json-schema.org/)
- [Understanding JSON Schema](https://json-schema.org/understanding-json-schema/)### Release cycle, continuous integration and deployment
TODO
### Getting Started
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
1. Install Git by following GitHub's instructions
[here](https://help.github.com/en/github/getting-started-with-github/set-up-git)2. Node.js can be installed using nvm on [Mac/Linux](https://gist.github.com/d2s/372b5943bce17b964a79) and nvm-windows
on [Windows](https://docs.microsoft.com/en-us/windows/nodejs/setup-on-windows).3. Yarn can be globally installed following [these steps](https://classic.yarnpkg.com/en/docs/install/#mac-stable)
#### π΄ Forking the Repo
Click the Fork button on the upper right-hand side of the repositoryβs page.
#### π― Clone Forked Repository
Clone this repository to your local machine. You can use the URL of your repo inside git command, for example:
```bash
git clone https://github.com//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,
1. Create and checkout a branch
```
git checkout -b
```2. Make changes to the files
3. Commit your changes to the branch using `git add` and then `git commit`#### πͺ Submitting changes using a Pull Request
To submit your code to the repository, you can
[submit a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).
π Acknowledgements### Initial development
Initially, the development was started in the [Research group of Richard Neher](https://neherlab.org) at the
[Biozentrum, University of Basel](https://www.biozentrum.unibas.ch/home/) (Basel, Switzerland) by Richard Neher
([@rneher](https://github.com/rneher)), Ivan Aksamentov ([@ivan-aksamentov](https://github.com/ivan-aksamentov)) and
Nicholas Noll ([@nnoll](https://github.com/nnoll)).[Jan Albert](https://ki.se/en/mtc/jan-albert-group) from [Karolinska Institute](https://ki.se/en) (Stockholm, Sweden)
had the initial idea to develop this tool and suggested features and parameters, and
[Robert Dyrdak](https://staff.ki.se/people/robdyr) provided initial parameter estimates.
![]()
Ivan Aksamentov
@ivan-aksamentov### Contributors β¨
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](https://allcontributors.org/docs/en/emoji-key)):
Aditya Sharad
π» π§
Agon Hasani
π» π£
Alexis Iglauer
π» π£ π§
Andrew McKeever
π» π¬
Anson Chong
π» π¨
Arkadiusz Goralski
π» π
Arnaud
π» π
Ashwin Gokhale
π»
Bradley Betts
π» π§
Bruno RZN
π» π¬ π
Christian Wienbruch
π» π£
Christian-G-UT
π» π£
Danko Kozar
π» π¨
Danny Sepler
π» π¬ π
DarΓo HereΓ±ΓΊ
π π π» π£
David Hansen
π»
Di Guan
π»
Emmanuel Murillo SΓ‘nchez
π» π¬ π
Evan Krell
π» π£
Fabio Zanini
π» π£
Gabriel Homsi
π» π£
Gavin Jefferies
π» π π£ β οΈ π
Gustavo Ribeiro
π» π£
Hannes GranstrΓΆm
π» π¬ π
Hui Xiang Chua
π» π£ π§
Igor Savin
π» π¬ π
Ivan Aksamentov
π» π π π§ π¬ π
IvΓ‘n Yepes
π» π¬
Jacob Smith
π» π¬ π
Jill Adona
π» π£
John Yani
π» π£
Joram van den Boezem
π» π£
Jose Eduardo Kimura
π» π¨
JoΓ«l
π» π¬ π§
Juha
π π
Kamil Bobrowski
π» β οΈ π§
Kartik
π» π£
Manuel Blechschmidt
π» π¬ β οΈ
Maoz Gelbart
π» π£
Martin Vejmelka
π» π¬ π£
Max Tarsis
π» π¬ β οΈ
Mickey Pearce
π» π§
Miguel Serrano
π» π¬ π π§
Mika Laaksonen
π» π¨
MikaMaracuja
π» π£
Nataliya Karatkova
π» π¨
Nathan Springman
π» π¨
Nicholas Noll
π» π π£ π§ π
Nils Ole Tippenhauer
π» π£
Patrick Assaf
π» π¨
Patrik Varga
π» π§ π¬
Pete Bacon Darwin
π» π¬
Rachel Harvill
π» π¬ π
Rebecca Mullin
π» π¬
Rich Evans
π» π π£
Richard Neher
π» π π£ π§ π‘οΈ π
Rizky Maulana Nugraha
π» π§
Rui Lima
π» π¬ π
Rui Saraiva
π» π π¬ π§
Sam
π π
Sebastian Gierth
π» π¬ π π
TIAGO ANDRES VAZ
π» π£ π€
TeepaBlue
π»
Thomas Eckert
π» π
Tryggvi Gylfason
π» π¨
Valentin Druelle
π» π£ π€ π’
Victor Cordova
π» π¨
William Hiver
π» π
abrie
π» π β οΈ π
alebrand
π» π£
arieltonglet
π» π¨
aschelch
π» π¬ π
bharath6365
π» π¬
btoo
π» π π§
ceporche
π
joaopn
π» π
kmid5280
π» π¨
kupad95
π» π£
nono
π» π¬ π
pvillamartin
π» π£ π¨
r-s-rai
π» π¨
thoo1
π» π¨
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.
Contributions of any kind welcome!## License
[MIT License](LICENSE)
Copyright (c) 2020 neherlab