GithubHelp home page GithubHelp logo

hongqin / covid-rt-estimates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from epiforecasts/covid-rt-estimates

0.0 1.0 0.0 16.33 GB

National and subnational estimates of the time-varying reproduction number for Covid-19

License: MIT License

Dockerfile 0.75% R 85.77% Shell 4.65% Python 8.82%

covid-rt-estimates's Introduction

National and subnational estimates of the time-varying reproduction number for Covid-19

This repository contains estimates of the time-varying reproduction number for every country in the world listed in the ECDC Covid-19 data source and subnational estimates for 9 countries. Summarised estimates can be found in national/cases/summary and national/deaths/summary (based on cases and deaths respectively). Estimates for each country can be found in national/cases/national and national/deaths/national. Subnational estimates can be found in the relevant country folder (subnational/country) with the same folder structure as for the national estimates. Estimates are generated using {EpiNow2} and presented on epiforecasts.io/covid (which also outlines the method used). An interactive visualisation is currently under development.

If using these estimates please consider citing our associated paper.

Updating the estimates

  1. Clone the repository.
git clone https://github.com/epiforecasts/covid-rt-estimates.git

Using a remote server

Run the following on the command line replacing path-to-key, username@public-ip-of-server, github-username, and github-pat with your information. Note this is not a secure way of transferring your GitHub PAT.

curl --fail https://raw.githubusercontent.com/epiforecasts/covid-rt-estimates/master/bin/update-via-ssh.sh > update-via-ssh.sh
sudo bash update-via-ssh.sh path-to-key username@public-ip-of-server github-username github-pat

See bin/update-via-ssh.sh for details on what this script is doing and the more detailed step by step instructions below.

Using Docker

  1. Log in to GitHub Docker package repository.
docker login docker.pkg.github.com

Script approach

  1. (Optional - must be done at least once) Update the docker container (by default this pulls a built image passing "build" instead triggers a build based on local files).
sudo bash bin/update-docker.sh
  1. Run the following in a bash terminal (see docker logs covidrtestimates for runtime information).
sudo bash bin/update-via-docker.sh

Step by step

  1. (Optional) Build the docker container locally.
docker build . -t covidrtestimates
  1. (Optional). Alternatively pull the built docker container.
docker pull docker.pkg.github.com/epiforecasts/covid-rt-estimates/covidrtestimates:latest
docker tag docker.pkg.github.com/epiforecasts/covid-rt-estimates/covidrtestimates:latest covidrtestimates
  1. Update the estimates (see docker logs covidrtestimates for runtime information).
sudo docker run -d --user rstudio --mount type=bind,source=$(pwd),target=/home/rstudio/covid-rt-estimates --name covidrtestimates covidrtestimates /bin/bash bin/update-estimates.sh

Using R

  1. Install dependencies.
devtools::install_dev_deps()
  1. Run Rscript R/run-region-updates.R.

Adding --help will show documentation and the command options. This can run all or some regions and subregions, control logging, exclude unstable regions and set the maximum execution time for each set of analysis.

Note: Currently regions are either global or country level but the region/subregion pattern could be reused on any level of parent/child geographic dataset.

A timing log will be output and updated in runtimes.csv. Times of -1 = error and 999999 = killed by timeout

Development environment

This analysis was developed in a docker container based on the epinow2 docker image.

To build the docker image run (from the covid-rt-estimates directory):

docker build . -t covidrtestimates

Alternatively to use the prebuilt image first login into the GitHub package repository using your GitHub credentials (if you have not already done so) and then run the following:

# docker login docker.pkg.github.com
docker pull docker.pkg.github.com/epiforecasts/covid-rt-estimates/covidrtestimates:latest
docker tag docker.pkg.github.com/epiforecasts/covid-rt-estimates/covidrtestimates:latest covidrtestimates

To run the docker image run:

docker run -d -p 8787:8787 --name covidrtestimates -e USER=covidrtestimates -e PASSWORD=covidrtestimates covidrtestimates

The rstudio client can be found on port :8787 at your local machines ip. The default username:password is covidrtestimates:covidrtestimates, set the user with -e USER=username, and the password with - e PASSWORD=newpasswordhere. The default is to save the analysis files into the user directory.

To mount a folder (from your current working directory - here assumed to be tmp) in the docker container to your local system use the following in the above docker run command (as given mounts the whole covidrtestimates directory to tmp).

--mount type=bind,source=$(pwd)/tmp,target=/home/covidrtestimates

To access the command line run the following:

docker exec -ti covidrtestimates bash

To add another country see SMG.md

covid-rt-estimates's People

Contributors

joehickson avatar seabbs avatar hamishgibbs avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.