iglu: Interpreting Glucose Data from Continuous Glucose Monitors

Elizabeth Chun, Steve Broll, D. S. Buchanan, John Muschelli, Nathaniel Fernandes, Irina GaynanovaOpenalex Unknown 2020 · DOI · OpenAlex

Abstract

The iglu package implements a wide range of metrics for measuring glucose control and glucose variability based on continuous glucose monitoring (CGM) data. The list of implemented metrics is summarized in Rodbard (2009). Additional visualization tools include time-series plots, lasagna plots, and ambulatory glucose profile (AGP) reports.

Introduction

Continuous Glucose Monitors (CGMs) have revolutionized diabetes management by providing glucose readings every few minutes, creating a rich but overwhelming stream of data. While dozens of metrics have been proposed in medical literature to quantify "glycemic variability" (how much a patient's sugar levels swing) and "glycemic control" (how often they stay in a healthy range), there has historically been a lack of standardized, easy-to-use software to calculate them. Researchers and clinicians often face "spaghetti code" scenarios where they must write custom scripts to process raw sensor data, leading to inconsistencies between studies.

iglu is a comprehensive R package designed to standardize the analysis of CGM data. It provides a centralized, open-source toolkit for calculating over 40 clinical metrics of glycemic control and variability, alongside advanced visualization tools like lasagna plots and automated AGP reports. It tackles the data interpretation challenge by providing a validated, transparent, and reproducible framework.

Methodological Framework

The package implements a wide array of algorithms ranging from basic descriptive statistics to complex risk indices. Key methodological features include:

  • Standard Clinical Metrics: Calculations for Time in Range (TIR), Mean Glucose, and Coefficient of Variation (CV).
  • Advanced Variability Markers: Implementation of sophisticated algorithms like MAGE (Mean Amplitude of Glycemic Excursions), CONGA (Continuous Overall Net Glycemic Action), and MODD (Mean Difference between glucose values at the same time of day).
  • Risk Indices: Tools to quantify the danger of extreme swings, such as the HBGI/LBGI (High/Low Blood Glucose Index) and the GRI (Glycemia Risk Index).
  • Data Preprocessing: Robust helper functions handle the idiosyncratic output formats of major CGM manufacturers like Dexcom and Abbott (Libre).
Standardized function parameters in iglu for calculating metrics over specific time windows and time zones.

Because some metrics (like MAGE) are computationally expensive when applied to thousands of data points, the package includes optimized functions to handle large-scale datasets efficiently. Furthermore, iglu functions include explicit parameters for interpolation and "allowable gaps," ensuring that missing data—common when sensors fail or are removed—doesn't unfairly skew variability results.

Advanced Visualization and Clinical Reporting

Traditional time-series plots for multiple patients often result in an unreadable "spaghetti" mess. iglu promotes "lasagna plots," which use color-coded horizontal grids to visualize glucose patterns across multiple days or subjects simultaneously without overlapping lines.

By implementing the Ambulatory Glucose Profile (AGP)—the international standard for clinical glucose reporting—the package allows researchers to produce reports that are immediately familiar to endocrinologists. The package allows for fine-tuned control over these reports, including the number of days to plot and the maximum allowable gap for interpolation.

Parameters for generating Ambulatory Glucose Profiles (AGP), including interpolation gap settings and daily plot indicators.

Accessibility and Datasets

Recognizing that not all clinicians are R users, the authors included iglu_shiny, a built-in web application that allows users to upload data and generate metrics/plots through a point-and-click interface. To facilitate benchmarking and tutorials, the package includes several built-in datasets, such as example_data_1_subject (Dexcom G4 data) and the example_data_hall dataset, which includes synchronized mealtime logs for 19 subjects.

Conclusion

While the documentation focuses on software capabilities rather than a specific clinical trial, its impact is measured by its breadth and interoperability. It successfully parses data from Dexcom, FreeStyle Libre, and Medtronic sensors and provides a single source of truth for the Glucose Management Indicator (GMI).

Future work will likely focus on maintaining compatibility with evolving sensor hardware and better integrating exogenous data streams, such as medication logs and exercise data, to provide deeper clinical context for the calculated metrics.

Summary updated

Abstract

Implements a wide range of metrics for measuring glucose control and glucose variability based on continuous glucose monitoring data. The list of implemented metrics is summarized in Rodbard (2009) &lt;<a href="https://doi.org/10.1089%2Fdia.2009.0015" target="_top">doi:10.1089/dia.2009.0015</a>&gt;. Additional visualization tools include time-series plots, lasagna plots and ambulatory glucose profile report.
BibTeX
@inproceedings{chun2020iglu,
  author = {Elizabeth Chun and Steve Broll and D. S. Buchanan and John Muschelli and Nathaniel Fernandes and Irina Gaynanova},
  title = {{iglu: Interpreting Glucose Data from Continuous Glucose Monitors}},
  booktitle = {Openalex Unknown},
  year = {2020},
  doi = {10.32614/cran.package.iglu},
}
Figure