Skip to content

lmullany/spline_cluster_detector_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

For the most up-to-date version of this app, see: https://github.com/CDCgov/Rnssp-shiny-apps

Spline-Based Cluster Detection Shiny App

Description

An R Shiny app for visualizing the spline-based cluster classification/detection approach. This app estimates spatio-temporal clusters of target events in a test interval relative to the frequency of those events in a preceding baseline interval. The method used to estimate observed and expected cases in each location, and to identify clusters is similar to the approach used in SaTScan™ (https://www.satscan.org/), but the statistical significance of the clusters is determined using a set of classifiers that have learned the tri-variate relationship between observed, log of the observed to expected ratio, and signficance of the space-time permutation statistic. As estimation of the latter can be computationally expensive, leveraging a trained classifier can provide an approximation of the statistic in a fraction of time that would be necessary to run the full permutation-based procedure.

A table of location, dates, and counts of the event of interest is required as input into the cluster identification approach. The app provides three method for providing such an input:

  1. upload a local file (.csv of .cas)
  2. build a table builder or data details API using simple URL builder
  3. input an ad-hoc url

Once data are uploaded, the app allows for data exploration (time series plots, summary statistics, heatmap), cluster identification (with details about each cluster identified), map generation with clusters highlighted, and automatic generation of html report for sharing results.

Credentials

While the app will work with a local file upload option, Rnssp credentials are required to use the API version. Options include:

  1. Saving an rds file with credentials locally, and loading that file when asked
  2. Entering credentials via username and password when asked (i.e. within app when api request is made)
  3. Reading an rds file within a project-level .Rprofile file, to bypass the request for credentials each time the app is launched. To do this:
saveRDS(Rnssp::create_profile(), file="rnssp_creds.rds")

and then create the .Rprofile file within the root of this repo

myProfile <- readRDS("rnssp_creds.rds")

Requirements

Requires the following libraries

library(shiny)
library(cli)
library(geosphere)
library(data.table)
library(bslib)
library(bsicons)
library(DT)
library(ggplot2)
library(leaflet)
library(leaflet.extras)
library(tigris)
library(sf)
library(shinyjs)
library(shinycssloaders)
library(Rnssp)
library(plotly)
library(kableExtra)

Problems and Solutions noted by Users:

  1. a common error regarding tabset construction will be raised if bslib package version is not updated to at least 0.9.0 (or higher)
  2. not all the above packages are available at "https://rs-packages.biosense.wan/prod-cran/latest", so if you are installing the above pre-reqs on Biosense Posit, you may need to explicitly indicate the repo in the install.packages() function. For example: try install.packages("bsicons", repos = "https://cloud.r-project.org") instead of install.packages("bsicons")

Launch the app:

The easiest way to launch the app is to run:

shiny::runGitHub("lmullany/spline_cluster_detector_app")

Note that the above required packages must be first installed (and updated to latest versions) in order to run this app

Contacts:

Copyright

© 2024 The Johns Hopkins University Applied Physics Laboratory LLC.

Development of this software was sponsored by the U.S. Government under contract no. 75D30124C19958

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages