Coder Social home page Coder Social logo

uofuepibio / epiworldrshiny Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 1.84 MB

Shiny webapp for epiworldR package

Home Page: https://uofuepibio.github.io/epiworldRShiny/

License: Other

Makefile 1.58% R 97.94% Dockerfile 0.48%
abm agent-based-modeling covid-19 epidemic-simulations epidemiology netsci network-analysis shinyapps shinydashboard simulation-modeling

epiworldrshiny's Introduction

epiworldRShiny: An RShiny Application for the epiworldR Package

R-CMD-check CRAN status

This R package provides a user-friendly application for epiworldR, a wrapper of the C++ library epiworld. It provides a general framework for modeling disease transmission using agent-based models. Some of the main features include:

  • Fast simulation with an average of 30 million agents/day per second.
  • 9 different epidemiological models to choose from.
  • Built-in capability for user-defined interventions.
  • Built-in capability to define population and disease parameters.
  • Informative visualizations and tables after running each simulation.

You can find more examples on the package’s website: https://uofuepibio.github.io/epiworldRShiny/

Installation

You can install the development version of epiworldRShiny from GitHub with:

devtools::install_github("UofUEpiBio/epiworldRShiny")

Or from CRAN

install.packages("epiworldRShiny")

To run this ShinyApp, you need to type the following:

epiworldRShiny::run_app()

Examples

Example #1

This first example demonstrates how to run the Shiny app, run a simulation, and observe results. Notice the sidebar contains many disease and model parameters that can be altered. Changing these parameters will affect the spread of the infectious disease in the simulated population. After running the simulation, a plot of the distribution of states over time, a plot of the disease’s reproductive number, a model summary, and a table of counts over time are displayed.

This example features: - SEIR network model for COVID-19
The day of peak infections occurs on day 12, maxing at about 18,000 infections.
- The disease spreads rapidly at the simulation’s beginning, drastically decreasing over the first ten days.
- Model summary
- State counts table

example 1 GIF

Example #2

This example features the implementation of the vaccine and school closure interventions to curb disease spread. All model output can be interpreted using the same logic from example #1.

Key features: - SEIRD network model for COVID-19
- Vaccine prevalence = 70%
- School closure prevalence = 50%
- Day of school closure implementation = 7
- Significantly decreased number of infections and deaths.
- The majority of the population recovered or was susceptible by day 30.

example 2 GIF

Example #3

The last example features the SEIR equity model. This model is unique because it accounts for demographic diversity in a population, such as race, gender, and age. This allows for comparing disease spread among different demographics, unlike the previous two examples.

Key features: - SEIR equity model for COVID-19 - 30% hispanic population, 70% non-hispanic - 52% female population - 30% of population younger than 20 years old - 30% of population between 20 and 60 years old - 40% of population older than 60.

example 3 GIF

epiworldrshiny's People

Contributors

derekmeyer37 avatar gvegayon avatar

Watchers

 avatar  avatar

Forkers

gvegayon

epiworldrshiny's Issues

Address observed issues in R CMD check

Create a docker image to simplify the deployment process

Because of the number of dependencies epiworldRShiny has, firing up the system to deployment on shinyapps.io takes too much time. A fix would be to keep a docker image we update ~1 month with all the dependencies to install epiworldRShiny.

NPI: Vaccines, Masking, school closures

This is based on the following user story:

As an Epidemiologist, I would like to add tools such as (vaccines, masking, school closures, etc.) so I can measure changes in disease spread due to public health interventions.

  • Working slider for % of Vaccines.
  • Working slider for % of Masking.
  • Working slider for % of School closures.
  • Define the proper language for each.

Issue with SEIR equity model

@gvegayon
There seems to be an issue with the equity model. I believe it has to do with this line in the model file (#42): epiworldRenv()$X <- X

Warning: Error in <-: invalid (NULL) left side of assignment
150: modelfun [/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/epiworldRShiny/models/shiny_seirconnequity.R#42]

I have not been able to figure it out. Take a look when you get a chance.

Checklist for CRAN release

Before sending to CRAN:

  • The package CI (GitHub Actions) runs without errors, warnings, or notes in all OS.
  • If there are any notes on R CMD check, those are OK (like 'size of the installed package').
  • The version is 0.1-0 in the DESCRIPTION file.
  • The description and title in the DESCRIPTION file are sound.
  • No extraneous file is included in R CMD build (e.g., .DS_store or README.Rmd).
  • The date in the DESCRIPTION file is updated.
  • Double check grammar in the models' description (markdown files under inst).
  • Make sure we have included the contributions from the Department of Health and Human Services.

cc @derekmeyer37

Add options for NPI

Currently, NPIs have defaults for various parameters. We need to make them optional and allow the user to specify them. Here are the places that need to be changed:

  • GUI:

    shiny::sliderInput(
    inputId = paste0(model_name, "_vaccine_prevalence"),
    label = "% of agents vaccinated",
    min = 0,
    max = 1,
    value = 0,
    step = 0.01,
    ticks = FALSE
    ),
    shiny::sliderInput(
    inputId = paste0(model_name, "_masking_prevalence"),
    label = "% of agents using masks",
    value = "0",
    min = 0,
    max = 1,
    step = 0.01,
    ticks = FALSE
    ),
    shiny::headerPanel(shiny::h4("School Closure")),
    shiny::sliderInput(
    inputId = paste0(model_name, "_school_closure_prevalence"),
    label = "Prevalence",
    value = "0",
    min = 0,
    max = 1,
    step = 0.01,
    ticks = FALSE
    ),
    shiny::numericInput(
    inputId = paste0(model_name, "_school_closure_day"),
    label = "Implementation day",
    value = "0",
    min = 0,
    max = 100,
    step = 1
    )

  • Server side:

    #' NPI adding function
    #' @param model epiworldR model.
    #' @param modelname Specified model.
    #' @param input User epiworldR model selection.
    #' @returns Returns an object of class epiworld_model, where model is
    #' substituted with the model name.
    #' @family npis
    #' @export
    npi_add_all <- function(model, modelname, input) {
    npi_add_vaccine(
    model = model,
    preval = input[[paste0(modelname, "_vaccine_prevalence")]]
    )
    npi_add_masking(
    model = model,
    preval = input[[paste0(modelname, "_masking_prevalence")]]
    )
    npi_add_school_closure(
    model = model,
    preval = input[[paste0(modelname, "_school_closure_prevalence")]],
    day = input[[paste0(modelname, "_school_closure_day")]]
    )
    }

Update README.Rmd featuring more of epiworldRShiny than epiworldR

We need the README.Rmd file to reflect the Shiny app, not the sim package. Here is the list of tasks:

  • Provide a more thoughtful description of the package and its features.
  • Add a couple of screenshots showing 2+ different models and outputs. If possible, a GIF showing the process from lunching to getting the results.
  • Add code of conduct (using the usethis R package).
  • Add a badge for the CI status (GitHub actions) like in epiworldR.

cc @derekmeyer37

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.