Skip to content

Latest commit

 

History

127 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

STEHealth-Application 🌏💻

STEHealth (It stands for Spatiotemporal Epidemiological Health) is a shiny application for analyzing space-time pattern, cluster detection, and association with risk factors of health outcomes, which allows users to import their own data, analyze, and visualize.

This application is part of Spatiotemporal analysis with application development for epidemiological study of suicide mortality: From global perspectives to a case study in Thailand 💀📝 senior project of the Princess Srisavangavadhana Faculty of Medicine, Chulabhorn Royal Academy and the Department of Computer Engineering, King Mongkut's University of Technology Thonburi.

Poster_Project

💡Feature

  1. Upload data for analysis into the application — supports both CSV and Excel (.xlsx/.xls) files, or get started instantly with built-in sample datasets (Pollution & Health datasets from the CARBayesST R package).

  2. Analysis for spatial and spatiotemporal epidemiological studies, including cluster detection and association with risk factors — the latter reports both the area-level relative risk (how the effect varies by area) and the Overall (region-wide) relative risk, estimated as a fixed effect and directly comparable to region-wide results reported in reference papers such as CARBayesST.

  3. Download results of the analysis directly from the application.

“STEHealth_Manual”
Cluster detection

“STEHealth_Manual”
Association with risk factors

🔎Target users

  1. Primary: Epidemiologists and Public health researchers
  2. Secondary: Public health professionals and Policy makers

📝Developer Team

  1. Papin Thanutchapat; Space-time pattern detection model and association with risk factors for suicide.
  2. Chiraphat Phoncharoenwirote; Insights information of spatiotemporal epidemiology of suicide mortality and association with risk factors analysis.
  3. Ornrakorn Mekchaiporn; Application design and development.

📚Advisor

  1. Dr. Unchalisa Taetragool; Department of Computer Engineering, Faculty of Engineering, King Mongkut's University of Technology Thonburi
  2. Asst. Prof. Dr. Chawarat Rotejanaprasert; Department of Tropical Hygiene, Faculty of Tropical Medicine, Mahidol University
  3. Asst. Prof. Dr. Peerut Chienwichai; Princess Srisavangavadhana College of Medicine, Chulabhorn Royal Academy

Usage & Access 💻

STEHealth Application is fully deployed on the cloud via Hugging Face Spaces. No installation is required. You can access and use the application directly through your web browser from any device.

👉 Launch STEHealth Application Here

Deployment Architecture 🚀

Deploying STEHealth to the cloud involved addressing complex dependency challenges between modern R spatial packages and the R-INLA computational engine. We achieved a high-performance, stable cloud deployment on Hugging Face Spaces using the following updated strategy:

  • Modern Docker Infrastructure: We utilized the latest rocker/shiny base image, transitioning to R 4.5+ and Ubuntu 24.04 (Noble). This ensures access to the latest security patches and high-performance system libraries.
  • Next-Generation Spatial Stack: We migrated from legacy libraries (like rgdal) to the modern sf (Simple Features) and spdep stack. By leveraging dynamic package management instead of time-locked snapshots, the application stays compatible with current geospatial standards.
  • Optimized Model Integration: To maintain peak analytical accuracy, we integrate the R-INLA Testing Build, specifically configured to remain compatible with advanced R environments. This bypasses traditional GLIBC and shared library conflicts (e.g., libproj) common in complex epidemiological modeling.
  • Containerized Portability: The entire environment is encapsulated in a custom Docker container, exposing Port 7860 for seamless integration with Hugging Face's infrastructure, ensuring that the local development environment perfectly matches the cloud production state.

Sample Data 📁

The application includes three ready-to-use sample datasets, selectable directly in the app via the Use Sample Data dropdown on the Upload Data page — no need to download or upload anything to try the application. Each is labelled with a badge showing whether it supports Spatial-Temporal or Spatial models, and comes with a View Data Dictionary button describing its columns. The raw files are also available for download, both via the Download sample data (.csv) button in-app and here on GitHub:

1. Thailand Suicide Mortality 2011-2021 (used for case study in this project)

Consists of a Thailand shapefile and a csv file (Suicide Mortality and Risk Factors in Thailand from 2011 to 2021).

2. Pollution & Health Data 2007-2011 (from the CARBayesST R package)

Covers the Greater Glasgow and Clyde health board in Scotland (271 Intermediate Zones). Contains pm10, jsa (Job Seekers Allowance proportion), and price (average property price) as covariates, with respiratory hospital admissions as the outcome. Supports Spatial-Temporal models (2007-2011).

3. Pollution & Health Data, 2007 Only

The same dataset and shapefile as above, filtered to a single year (2007). Since it has no time dimension, this dataset is intended for testing the Spatial model.

Manual📗

🚧 Note: The manual is currently under revision to reflect the latest updates and the new Cloud Deployment on Hugging Face Spaces.

This manual includes step-by-step instructions on how to use each page of the application. Click here to read more

STEHealth_Manual

Deployment & Infrastructure

Hugging Face Spaces Cloud platform for hosting the machine learning and Shiny web application.
Docker Containerization technology used to create a reproducible environment and manage complex spatial/system dependencies.

Software & R Packages

R Language and environment for statistical computing and graphics (Version 4.5+, see Deployment Architecture above).
shiny Makes it easy to build interactive web apps straight from R.
shinydashboard Use with Shiny to create dashboards.
shinydashboardPlus Extend shinydashboard with AdminLTE2 components.
shinyjs Perform common JavaScript operations in Shiny apps.
shinyBS Adds additional Twitter Bootstrap components to Shiny.
shinyWidgets Collection of custom input controls and UI components for Shiny applications.
bsplus Adds Bootstrap-powered JavaScript functionality (e.g. tooltips, popovers) to Shiny apps.
dplyr A fast, consistent tool for working with data frame-like objects.
ggplot2 Creates elegant data visualisations using the grammar of graphics.
leaflet Create Interactive Web Maps with the JavaScript 'Leaflet' Library.
leaflet.extras Adds extra functionality to leaflet via additional Leaflet plugins.
RColorBrewer Provides color schemes for maps and other graphics.
sf Simple Features: modern support for spatial vector data, used for shapefile handling (replaces the legacy rgdal).
spdep Spatial Dependence: Weighting Schemes, Statistics.
R-INLA Performs full Bayesian analysis on generalised additive mixed models using Integrated Nested Laplace Approximations. The app uses the Testing Build, kept compatible with the modern R/Ubuntu environment described above (see Deployment Architecture).
readxl Reads Excel (.xls/.xlsx) files, used for the Excel upload option on the Upload Data page.
DT Renders interactive data tables (e.g. the area-level significance table on the Association with Risk Factors tab).
capture Add a button in Shiny application to take a screenshot of a specified element.

🩹Limitations

  • Auto-Sleep Mode: The application may enter sleep mode after 48 hours of inactivity to save resources. It will automatically wake up and restart upon your next visit, which might take 1-2 minutes to load.
  • The application supports only English.
  • Recommended screen size is at least 1440x900 pixels for the best viewing experience on desktop browsers.

References📖

  1. Moraga, P. (2017). SpatialEpiApp: A Shiny web application for the analysis of spatial and spatio-temporal disease data. Spatial and Spatio-temporal Epidemiology, 23, 47–57. https://doi.org/10.1016/j.sste.2017.08.001

  2. Lee, D., Rushworth, A., & Napier, G. (2018). Spatio-Temporal Areal Unit Modeling in R with Conditional Autoregressive Priors Using the CARBayesST Package. Journal of Statistical Software, 84(9), 1–39. https://doi.org/10.18637/jss.v084.i09

Credits Section📄

About

STEHealth is a shiny application for analyzing space-time patterns, cluster detection, and association with risk factors of health outcomes.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages