GithubHelp home page GithubHelp logo

guibuzi / covid_multi_strain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lloydchapman/covid_multi_strain

0.0 0.0 0.0 17.85 MB

Code for 'Impact of vaccinations, boosters and lockdowns on COVID-19 waves in French Polynesia'

License: GNU General Public License v3.0

R 100.00%

covid_multi_strain's Introduction

Impact of vaccinations, boosters and lockdowns on COVID-19 incidence

This repository contains code and data for the analyses in the preprint 'Impact of vaccinations, boosters and lockdowns on COVID-19 waves in French Polynesia'. The aim of this work is to estimate the counterfactual impact of vaccinations, boosters and lockdowns on incidence of COVID-19 cases, hospitalisations and deaths in French Polynesia. We do this by fitting an age-structured multi-strain model of SARS-CoV-2 transmission to data on daily numbers of COVID-19 confirmed cases, hospitalisations and hospital deaths in French Polynesia from July 2020 to May 2022, and data from two sero-surveys conducted in February 2021 and November-December 2021 [1]. The model is written in the odin syntax and compiled to work with the dust discrete-time C++ simulation engine using odin.dust [2]. The code also uses the particle filter tools of the mcstate R package, but implements a bespoke adaptive MCMC algorithm for fitting the model.

Requirements

The eigen1, odin, dust, odin.dust and mcstate R packages are required to run the code. Since these packages are in constant development it is probably best to use the same versions of these packages as were used for this analysis:

eigen1 0.1.1
odin 1.3.2
dust 0.11.24
odin.dust 0.2.16 
mcstate 0.9.0

These can be installed in R with:

remotes::install_github(c(
  "mrc-ide/[email protected]",
  "mrc-ide/[email protected]",
  "mrc-ide/[email protected]",
  "mrc-ide/[email protected]",
  "mrc-ide/[email protected]"))

Installation

Clone/download this project onto your machine.

Data

All data required to run the code are contained in the data folder and are also available on Zenodo: doi:10.5281/zenodo.8320333

Running the code

The odin model code is contained in inst/odin/covid_multi_strain.R. If required, the model can be modified by editing this code, and then recompiled by calling

odin_dust("inst/odin/covid_multi_strain.R")

as in fit.R.

The whole analysis (fitting + counterfactual simulations) can be run by running the top-level script run.R:

source("run.R")

This runs the fitting function run_fitting() and the function for running the counterfactual simulations without vaccinations, boosters, and lockdowns, and with different lockdown timings run_simulations(). It produces output called MCMCoutput<run>.RDS and cntfctl_output<sim_run>.RDS in the output folder, where <run> and <sim_run> are the MCMC run and simulation sim_run numbers set in run.R, along with trace and posterior plots of the parameters and model fit produced by plot_fit.R and counterfactual outcome plots.

The breakdown of population immunity over time (Fig. 4 in the preprint) can be plotted with:

source("R/plot_immunity.R")

setting the run number in plot_immunity.R to match that in run.R.

Note that the fitting code takes ~2.5hrs to run 4 MCMC chains of 50,000 iterations in parallel (in R 4.1.0 on an 8-core MacBook Pro with an M1 chip and 16GB RAM).

Built With

Authors

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE.txt file for details

Citation

Chapman LAC, Aubry M, Maset N, Russell TW, Knock ES, Lees JA, Mallet H-P, Cao-Lormeau V-M, Kucharski AJ. Impact of vaccinations, boosters and lockdowns on COVID-19 waves in French Polynesia. medRxiv. 2023.

References

  1. Aubry M, Maset N, Chapman L, Simon A, Olivier S, Bos R, Chung K, Teiti I, Kucharski A, Mallet H-P, Cao-Lormeau V-M. Seroprevalence of sars-cov-2 antibodies in french polynesia and perspective for vaccine strategies. Preprints, 2022. doi:10.20944/preprints202212.0386.v1

  2. FitzJohn RG, Knock ES, Whittles LK, Perez-Guzman PN, Bhatia S, Guntoro F, Watson OJ, Whittaker C, Ferguson NM, Cori A, Baguelin M, and Lees JA. Reproducible parallel inference and simulation of stochastic state space models using odin, dust, and mcstate. Wellcome Open Research, 5:288, 12 2021. doi:10.12688/wellcomeopenres.16466.2

covid_multi_strain's People

Contributors

lloydchapman avatar adamkucharski 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.