Skip to content

labrgrupo/LabRI_shiny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

158 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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 the LabRI 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.

๐Ÿ‘‡ Click here to download the LabRI Shiny Application ๐Ÿ‘‡

Download LabRI Shiny Application

๐ŸŒ ๐—Ÿ๐—ผ๐—ฐ๐—ฎ๐—น ๐—ฒ๐˜…๐—ฒ๐—ฐ๐˜‚๐˜๐—ถ๐—ผ๐—ป ๐˜ƒ๐˜€. ๐—ฐ๐—น๐—ผ๐˜‚๐—ฑ-๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐˜† ๐˜ƒ๐—ฒ๐—ฟ๐˜€๐—ถ๐—ผ๐—ป

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/, and 4_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.

Adaptive behavior

  • Multi-cluster distributions โ€” The reference limits estimated by refineR and reflimR are 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.

Multi-criteria design

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:

  1. 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.
  2. 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.
  3. 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.

๐Ÿ‘‡ Click here to visit the Grupo Lab R website ๐Ÿ‘‡

Grupo Lab R Website

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.


About

๐—Ÿ๐—ฎ๐—ฏ๐—ฅ๐—œ ๐—ฆ๐—ต๐—ถ๐—ป๐˜† ๐—”๐—ฝ๐—ฝ๐—น๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป: Tool for estimating reference intervals using the indirect sampling method.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages