{"id":28702851,"url":"https://github.com/epiforecasts/ringbp","last_synced_at":"2025-10-13T10:35:59.388Z","repository":{"id":70229949,"uuid":"235838274","full_name":"epiforecasts/ringbp","owner":"epiforecasts","description":"Simulate infectious disease transmission with contact tracing","archived":false,"fork":false,"pushed_at":"2025-09-22T13:49:32.000Z","size":331664,"stargazers_count":17,"open_issues_count":28,"forks_count":11,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-09-30T03:59:03.809Z","etag":null,"topics":["controlling-outbreaks","transmission"],"latest_commit_sha":null,"homepage":"http://epiforecasts.io/ringbp/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/epiforecasts.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-01-23T16:38:07.000Z","updated_at":"2025-09-22T13:45:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"de0d45db-08ba-4a22-9660-e1b26310fe8e","html_url":"https://github.com/epiforecasts/ringbp","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/epiforecasts/ringbp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fringbp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fringbp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fringbp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fringbp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epiforecasts","download_url":"https://codeload.github.com/epiforecasts/ringbp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fringbp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014646,"owners_count":26085555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["controlling-outbreaks","transmission"],"created_at":"2025-06-14T13:05:33.421Z","updated_at":"2025-10-13T10:35:59.382Z","avatar_url":"https://github.com/epiforecasts.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  out.width = \"100%\",\n  fig.path = \"man/figures/README-\"\n)\nset.seed(111)\n```\n\n# _{{ packagename }}_: Simulate infectious disease transmission with contact tracing\n\n\u003c!-- badges: start --\u003e\n![GitHub R package version](https://img.shields.io/github/r-package/v/{{ gh_repo }})\n[![R-CMD-check](https://github.com/{{ gh_repo }}/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/{{ gh_repo }}/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/{{ gh_repo }}/branch/main/graph/badge.svg)](https://app.codecov.io/gh/{{ gh_repo }}?branch=main)\n![GitHub contributors](https://img.shields.io/github/contributors/{{ gh_repo }})\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\u003c!-- badges: end --\u003e\n\n_{{ packagename }}_ is an R package that provides methods to simulate infectious\ndisease transmission in the presence of contact tracing. It was\ninitially developed to support a paper written in early 2020 to assess\nthe feasibility of controlling\nCOVID-19; see the [companion analysis code](https://github.com/cmmid/ringbp) and \n[paper](https://doi.org/10.1016/S2214-109X(20)30074-7) for more details.\n\n_{{ packagename }}_ is an R package that provides methods to simulate infectious disease transmission in the presence of contact tracing.\nIt was initially developed to support a paper written in early 2020 to assess the [feasibility of controlling COVID-19](https://github.com/cmmid/ringbp).\nFor more details on the methods implemented here, see the associated [paper](https://doi.org/10.1016/S2214-109X(20)30074-7).\n\n## Installation\n\nThe current development version of _{{ packagename }}_ can be installed from [GitHub](https://github.com/) using the `pak` package.\n\n```r\nif(!require(\"pak\")) install.packages(\"pak\")\npak::pak(\"{{ gh_repo }}\")\n```\n\n## Quick start\n\nThe main functionality of the package is in the `scenario_sim()` function.\nHere is an example for running 10 simulations of a given scenario:\n\n```{r scenario_sim}\nlibrary(\"ringbp\")\nlibrary(\"ggplot2\")\n\nres \u003c- scenario_sim(\n  n = 10, ## 10 simulations\n  initial_cases = 1, ## one initial case in each of the simulations \n  offspring = offspring_opts(\n    ## non-isolated individuals have R0 of 2.5 and a dispersion parameter\n    community = \\(n) rnbinom(n = n, mu = 2.5, size = 0.16), \n    ## isolated individuals have R0 of 0.5 and a dispersion  parameter\n    isolated = \\(n) rnbinom(n = n, mu = 0.5, size = 1)\n    ## by default asymptomatic individuals are assumed to have the same R0 \n    ## and dispersion as non-isolated individuals\n  ), \n  delays = delay_opts(\n    incubation_period = \\(x) stats::rweibull(n = x, shape = 2.322737, scale = 6.492272), \n    onset_to_isolation = \\(x) stats::rweibull(n = x, shape = 1.651524, scale = 4.287786)\n  ),\n  event_probs = event_prob_opts(\n    ## 10% asymptomatic infections\n    asymptomatic = 0.1, \n    ## 50% probability of onward infection time being before symptom onset\n    presymptomatic_transmission = 0.5,\n    ## 20% probability of ascertainment by contact tracing\n    symptomatic_ascertained = 0.2\n  ),\n  ## whether quarantine is in effect\n  interventions = intervention_opts(quarantine = FALSE),\n  sim = sim_opts(\n    ## don't simulate beyond 350 days\n    cap_max_days = 350, \n    ## don't simulate beyond 4500 infections\n    cap_cases = 4500\n  )\n)\n```\n\n### Plot of weekly cases\n\n```{r plot}\nggplot(\n  data = res, aes(x = week, y = cumulative, col = as.factor(sim))\n) +\n  geom_line(show.legend = FALSE, alpha = 0.3) +\n  scale_y_continuous(name = \"Cumulative number of cases\") +\n  theme_bw()\n```\n\n### Estimate extinction probability\n\n```{r extinct_prob}\nextinct_prob(res, cap_cases = 4500)\n```\n\n## Contributors\n\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\nAll contributions to this project are gratefully acknowledged using the [`allcontributors` package](https://github.com/ropensci/allcontributors) following the [all-contributors](https://allcontributors.org) specification. Contributions of any kind are welcome!\n\n### Code\n\n\n\u003ca href=\"https://github.com/epiforecasts/ringbp/commits?author=seabbs\"\u003eseabbs\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/commits?author=sbfnk\"\u003esbfnk\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/commits?author=jhellewell14\"\u003ejhellewell14\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/commits?author=timcdlucas\"\u003etimcdlucas\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/commits?author=amygimma\"\u003eamygimma\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/commits?author=joshwlambert\"\u003ejoshwlambert\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/commits?author=Bisaloo\"\u003eBisaloo\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/commits?author=actions-user\"\u003eactions-user\u003c/a\u003e\n\n\n\n### Issue Authors\n\n\n\u003ca href=\"https://github.com/epiforecasts/ringbp/issues?q=is%3Aissue+author%3Apearsonca\"\u003epearsonca\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/issues?q=is%3Aissue+author%3Asophiemeakin\"\u003esophiemeakin\u003c/a\u003e\n\n\n\n### Issue Contributors\n\n\n\u003ca href=\"https://github.com/epiforecasts/ringbp/issues?q=is%3Aissue+commenter%3Athimotei\"\u003ethimotei\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/issues?q=is%3Aissue+commenter%3Aadamkucharski\"\u003eadamkucharski\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/issues?q=is%3Aissue+commenter%3Adcadam\"\u003edcadam\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/ringbp/issues?q=is%3Aissue+commenter%3Ajamesmbaazam\"\u003ejamesmbaazam\u003c/a\u003e\n\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepiforecasts%2Fringbp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepiforecasts%2Fringbp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepiforecasts%2Fringbp/lists"}