Skip to content

ojal/KenyaSerology

Repository files navigation

KenyaSerology

This repository contains the openly available data and code in order to reproduce the results of Revealing the extent of the first wave of the COVID-19 pandemic in Kenya based on serological and PCR-test data, and/or, use the package with data from another setting.

Prerequisites and recommended background knowledge:

  • Access and basic familiarity with the Julia programming language.
  • The underlying dynamical system representing the unobserved infection process is a modification to the basic SEIR model that is described in this paper, albeit we implement a continuous time rather than discrete version of the model.
  • Solutions of the infection process are generated using the performant, and well documented, package SciML/DifferentialEquations.jl. Familiarisation with this package is desirable.
  • Hamiltonian MCMC (HMC) is implemented using the dynamicHMC.jl package. The log-likelihood function for parameters is directly defined in KenyaSerology, and log-likelihood gradients (necessary for HMC) are calculated using forward-mode automatic differentiation. The combination of ODE solutions and log-likelihood function gradients in code was inspired by DiffEqBayes.jl. A good conceptual introduction to HMC can be found here.

Data sets in this repository

/opendatacsvsfolder contains .csv datafiles (see supplementary information for the main manuscript to read data file captions). This data is also present on the repository in the form of .jld2 datafiles, which are directly used in the tutorial notebooks (see below).

Supplementary Information

Please find the supplementary information containing further details on the data analysis, and mathematical/statistical reasoning and assumptions behind the model in /supplementary_info as a Word file.

Tutorial notebooks

To aid reproducability and reusability of this model we are currently writing a series of notebooks that either elucidate our methodology, or directly reproduce results in the paper. These cover the basic ideas behind the model (how the contact rates are generated, the underlying transmission model etc) and the methods used to draw inferences from the data (the interaction between time-since-infection and detectability by different tests) and make predictions (as well as visualising these predictions).

The notebooks are given as .jmd files, and require Weave.jl to create html output files. Usage of julia markdown with Weave is very similar to the popular R markdown .rmd with knitr.

It is recommended that before running the code on this repository locally you activate the KenyaSerology environment by navigating your REPL working directory to where you have locally cloned this repository and entering ] for the package mode and then activate ., followed by instantiate. This will download and use the relevant versions of the Julia packages.

County-specific plots

The overall model for Kenya consisted of 47 county specific models, aggregated to make national totals. The prediction intervals for PCR positive swab tests, population exposure, deaths and time-varying reproductive ratio (full R(t) rather than effective R(t)) can be found in the countyplot folder.