branchpro

Using branching processes to estimate the time-dependent reproduction number of a disease with imported cases

https://github.com/sabs-r3-epidemiology/branchpro

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Using branching processes to estimate the time-dependent reproduction number of a disease with imported cases

Basic Info
  • Host: GitHub
  • Owner: SABS-R3-Epidemiology
  • License: bsd-3-clause
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 395 MB
Statistics
  • Stars: 5
  • Watchers: 2
  • Forks: 2
  • Open Issues: 0
  • Releases: 3
Created over 5 years ago · Last pushed 10 months ago
Metadata Files
Readme License Citation

README.md

Branching Process Model

Run Unit Tests on multiple OS Run Unit Tests on multiple python versions Documentation Status codecov DOI

In this package, we use branching processes to model the time-dependent reproduction number (the number of cases each infected individual will subsequently cause) of an infectious disease.

All features of our software are described in detail in our full API documentation.

A web app for performing inference for branching process models is included in this package. Instructions for accessing the app are available here.

More details on branching process models and inference can be found in these papers:

References

[1] R. Creswell, D. Augustin, I. Bouros, H. J. Farm, S. Miao, A. Ahern, M. Robinson, A. Lemenuel-Diot, D. J. Gavaghan, B. C. Lambert and R. N. Thompson: Heterogeneity in the onwards transmission risk between local and imported cases affects practical estimates of the time-dependent reproduction number, Phil. Trans. R. Soc. A. 380: 20210308 (2022).

[2] Cori A, Ferguson NM, Fraser C, Cauchemez S. (2013). A new framework and software to estimate time-varying reproduction numbers during epidemics. American Journal of Epidemiology 178(9): 1505-12.

[3] Thompson RN, Stockwin JE, van Gaalen RD, Polonsky JA, Kamvar ZN, Demarsh PA, Dahlqwist E, Li S, Miguel E, Jombart T, Lessler J. (2019). Improved inference of time-varying reproduction numbers during infectious disease outbreaks. Epidemics 29: 100356.

Installation procedure


One way to install the module is to download the repositiory to your machine of choice and type the following commands in the terminal.

bash git clone https://github.com/SABS-R3-Epidemiology/branchpro.git cd ../path/to/the/file

A different method to install this is using pip:

bash pip install -e .

Usage

```python import branchpro import numpy as np

create a simple branching process model with prescribed initial R and serial interval

branchpro.BranchProModel(initialr=0.5, serialinterval=[0, 0.15, 0.52, 0.3, 0.01])

create branching process model with local and imported cases with prescribed initial R

and serial interval

set imported cases data

librmodel1 = branchpro.LocImpBranchProModel( initialr=2, serialinterval=np.array([1, 2, 3, 2, 1]), epsilon=1) librmodel1.setimportedcases(times=[1, 2.0, 4, 8], cases=[5, 10, 9, 2])

create the posterior of a branching process model for multiple daily serial intervals

and incidence data contained in the dataframe df; prior distribution is Gamma with

parameters alpha and beta (shape, rate)

branchpro.BranchProPosteriorMultSI( incdata=df, dailyserial_intervals=[[1, 2], [0, 1]], alpha=1, beta=0.2) ```

More examples on how to use the classes and features included in this repository can be found here.

Multiple group population models

In their most basic form, the branching processes modelling approach assume that all previous infections occurring on the same day contribute in equal measure to the present incidence of infection. However, this assumption is not generally true for most epidemic scenarios, where different population groups share different epidemic burdens.

Therefore, we have now extendend the branchpro package to offer users the possibility to run both running forward simulation and perform Rt inference for both the overall and group-specific reproduction numbers using a multiple-group population branching process. The approach implemented bypasses the need to use the next-generation matrix approach, as detailed in our preprint.

To recreate our analyses for the suitability of multiple group renewal equations and Rt inference, please rerun the notebooks found here.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

BSD-3-Clause

Owner

  • Name: SABS-R3-Epidemiology
  • Login: SABS-R3-Epidemiology
  • Kind: organization

GitHub Events

Total
  • Create event: 5
  • Issues event: 2
  • Release event: 3
  • Issue comment event: 2
  • Push event: 120
  • Pull request event: 8
  • Fork event: 1
Last Year
  • Create event: 5
  • Issues event: 2
  • Release event: 3
  • Issue comment event: 2
  • Push event: 120
  • Pull request event: 8
  • Fork event: 1

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 2
  • Total pull requests: 5
  • Average time to close issues: almost 2 years
  • Average time to close pull requests: 3 days
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.4
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 5
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.4
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • fcooper8472 (1)
  • I-Bouros (1)
Pull Request Authors
  • I-Bouros (3)
  • fcooper8472 (2)
  • rccreswell (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

requirements.txt pypi
  • gunicorn ==20.0.4
setup.py pypi
  • Dependencies *
  • dash >=2.0
  • dash_bootstrap_components >=0.12
  • dash_daq *
  • dash_defer_js_import *
  • diskcache *
  • matplotlib *
  • multiprocess *
  • numexpr *
  • numpy >=1.8
  • pandas *
  • plotly *
  • psutil *
  • scipy >=1.6
.github/workflows/check-copyright.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/coverage-test.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/doctest.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/flake8-style-test.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/os-unittests.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/python-version-unittests.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite