The LabRI Shiny Application is designed for the estimation and verification of reference intervals in clinical laboratories. It runs on the user's computer after prior installation of R and RStudio, and provides a desktop-style workflow with automatic persistence of figures, spreadsheets, intermediate files, and HTML reports in local output folders.
This repository includes three key components:
install_packages.Rmdโ Ensures that all required R packages are correctly installed and updated, simplifying the configuration of the R environment for running the LabRI System.app.Rโ Launches the Shiny application, providing an intuitive graphical interface to execute the LabRI method interactively.LabRI_script.Rmdโ Primary script that implements theLabRI method, responsible for estimating and verifying reference intervals and producing comprehensive HTML reports.
๐ก A cloud-ready version of this application โ designed for deployment on Posit Connect, Posit Cloud, and institutional Shiny servers โ is also available: LabRI_shiny_connect. See the comparison table below.
The initial interface captures the analyst's name in the Name of the Responsible Specialist section and accepts .csv, .xls, or .xlsx uploads in the Define the Dataset section, where the relevant data column is selected. A status bar tracks processing progress.
The application can be obtained from this GitHub repository or as a compressed folder ready to run, with no additional installation steps beyond R and Shiny โ ideal for users who prefer to interact with the LabRI method through a graphical interface without relying on automation files or installers.
๐ ๐๐ผ๐ฐ๐ฎ๐น ๐ฒ๐ ๐ฒ๐ฐ๐๐๐ถ๐ผ๐ป ๐๐. ๐ฐ๐น๐ผ๐๐ฑ-๐ฟ๐ฒ๐ฎ๐ฑ๐ ๐๐ฒ๐ฟ๐๐ถ๐ผ๐ป
The LabRI Shiny tool is distributed in two complementary implementations that share the same analytical method but differ in their output-management strategy:
- LabRI Shiny Application (this repository) โ runs locally after R and RStudio are installed. Automatically creates
3_Outputs/Figures/,3_Outputs/Spreadsheets/, and4_Report_HTML/and writes figures, spreadsheets, intermediate files, and HTML reports to disk. Appropriate for single-user desktop workflows. - LabRI_shiny_connect โ cloud-ready implementation for Posit Connect, Posit Cloud, or institutional Shiny servers. Operates in session-based mode, with no persistent files written to the server directory. Outputs are rendered inside the Shiny interface or in temporary session files, and the HTML report can be downloaded manually by the user.
A public demonstration of the cloud-ready version is available at labrgroup-labri.share.connect.posit.cloud (Posit Connect Cloud Free plan โ intended as a showcase only, not for production use).
| Feature | LabRI Shiny Application (local execution) | LabRI_shiny_connect |
|---|---|---|
| Runs on the user's computer | Yes | Optional |
| Requires prior installation of R and RStudio | Yes | No (for end users in a deployed cloud environment) |
| Designed for Posit Connect / Posit Cloud | No | Yes |
| Automatically creates output folders | Yes | No |
| Automatically saves figures | Yes | No |
| Automatically saves spreadsheets | Yes | No |
| Automatically saves HTML reports to fixed folders | Yes | No |
Saves .RData / .Rhistory |
Possible | No |
| Uses temporary files only for session rendering | No | Yes |
| Displays report in the Shiny interface | Yes | Yes |
| Browser-based use without local execution | No | Yes |
The analytical method is identical in both implementations; only the output architecture differs. The local version is preferred for individual analytical work and for processing larger datasets without cloud memory constraints, while the cloud-ready version is preferred for institutional deployment, demonstrations, training environments, and multi-user access.
The LabRI Method is the analytical core of the LabRI System, implemented primarily in LabRI_script.Rmd. It is organized in two modules:
- Estimation Module โ adaptive, multi-criteria estimation of reference intervals via data cleaning, transformation, and clustering, using
refineR,reflimR, and the ExpectationโMaximization (EM) algorithm (mclust,mixR). - Verification Module โ three-level analysis assessing statistical uncertainty, equivalence, and concordance, ensuring the estimated intervals are reliable for clinical application.
This module provides an adaptive, multi-criteria approach for the indirect estimation of reference intervals, combining parametric and non-parametric percentile approaches according to the number of clusters in the truncated distribution.
- Multi-cluster distributions โ The reference limits estimated by
refineRandreflimRare combined through the Centroid of Winsorized Reference Limits: the Two-stage Winsorization sub-algorithm first estimates robust winsorized limits, then the HartiganโWong Centroid Reference Limits sub-algorithm computes the centroid (x = lower limit, y = upper limit) for a centralized, stable estimate. When clusters are sufficiently separated, the EM algorithm further refines the result. - Single-cluster distributions โ The EM algorithm applies parametric and non-parametric methods to derive the best reference interval estimate.
Multiple criteria and methods are combined to ensure robust and comprehensive estimation and verification.
Before routine clinical application โ and especially when reference intervals are derived from indirect methods โ laboratories must verify their reference intervals. The Verification Module performs a three-level analysis to assess whether compared reference limits are equivalent:
- First Level โ Statistical Uncertainty. Evaluates the magnitude of statistical uncertainty associated with the reference limits. If uncertainty is within acceptable bounds, the analysis proceeds to the second level.
- Second Level โ Distance Criterion Based on Equivalence Testing. Compares the LabRI-estimated reference limit with a comparative limit using equivalence testing to assess whether differences are large enough to be considered relevant from a practical or clinical standpoint.
- Third Level โ Concordance Evaluation. Triggered when the second level suggests Possible Equivalence or Probable Equivalence. Incorporates confidence intervals and applies Fleiss' Kappa, Lin's Concordance Correlation Coefficient, and Flagging Rates to support robust verification.
A usage tutorial covering the installation of R and RStudio and the operation of the Shiny tool is available on the Grupo Lab R website, which centralizes the documentation and supporting materials for the LabRI System and other tools developed by the group.
Submit suggestions and bugs at:
https://github.com/labrgrupo/LabRI_Tool/issues
Email:
alancdias@hotmail.com ยท labrgrupo@gmail.com
Link to the publication:
Distributed under the GPL-3.0 license.
