Skip to content

lin-lab/COVID19-Viz

Repository files navigation

COVID-19 Spread Mapper

RShiny visualization of time-varying COVID-19 spread metrics, such as the effective reproduction number (Rt), case rate, and death rate. Based on data from the Johns Hopkins University Center for Systems Science and Engineering (JHU-CSSE) Coronavirus Resource Center.

The calculation method of these metrics is described in our preprint.

Code to calculate Rt is located in our COVID19-Rt Github repo, and data preprocessing code is located in the COVID-data-cleaning repo.

How to Run the app

If you downloaded the app locally, have all the dependencies, and wish to run it, simply open the app.R file in RStudio and click the Run App button.

Download our Data

Please see the data files in the clean_data_pois folder for the cleaned data that was displayed on the website. These were calculated from our preprint.

The clean_data folder has Rt estimates that were generated using EpiEstim (Cori, A., et al., 2013). These files are not used anymore for our site but are provided for archival purposes.

Code Structure

Main Code

  • The code to download the data is in 01_download_rt.sh.
  • The code to clean the Rt data and merge it with the shapefiles is in 02_clean_data.R. This code generates some rds files that are stored in clean_data_pois.
  • The RShiny app code is in app.R.
  • Running the prep_data.sh bash file will run 01_download_rt.sh, 02_clean_data.R, and 03_upload_to_aws.sh. You only need to do this if you want to reproduce the data cleaning and merging steps. The third step will not work because you aren't authorized to upload to our AWS folder.

Auxiliary Code

  • 04_minify_js.sh contains a script to minimize our custom javascript code. Running this produces a minified javascript file, which speeds up loading time of the webpage.
  • assets: Miscellaneous images, html, and static markdown pages and includes in our site.
  • src: Folder containing auxiliary R code.
  • www: Folder containing javascript code.
  • raw_data: Folder where the downloaded data from 01_download_rt.sh goes.

Build Docker

This builds a Docker container that mimics how the site is deployed in practice.

docker build -t local-covid-rt

docker run -p 8080:8080 -e PORT=8080 local-covid-rt

Open web browser to http://localhost:8080.

Instructions for Deploying on Heroku with HMDC

The website is deployed via Heroku. See here for instructions on how to set it up and for more info.