Skip to main content
PLOS ONE logoLink to PLOS ONE
. 2021 Apr 1;16(4):e0248560. doi: 10.1371/journal.pone.0248560

Interpreting blood GLUcose data with R package iglu

Steven Broll 1,¤a, Jacek Urbanek 2, David Buchanan 1, Elizabeth Chun 3, John Muschelli 4, Naresh M Punjabi 2,¤b, Irina Gaynanova 1,*
Editor: Laura Pyle5
PMCID: PMC8016265  PMID: 33793578

Abstract

Continuous Glucose Monitoring (CGM) data play an increasing role in clinical practice as they provide detailed quantification of blood glucose levels during the entire 24-hour period. The R package iglu implements a wide range of CGM-derived metrics for measuring glucose control and glucose variability. The package also allows one to visualize CGM data using time-series and lasagna plots. A distinct advantage of iglu is that it comes with a point-and-click graphical user interface (GUI) which makes the package widely accessible to users regardless of their programming experience. Thus, the open-source and easy to use iglu package will help advance CGM research and CGM data analyses. R package iglu is publicly available on CRAN and at https://github.com/irinagain/iglu.

Introduction

Continuous Glucose Monitors (CGMs) are small wearable devices that record measurements of blood glucose levels at frequent time intervals. As CGM data provide a detailed quantification of the variation in blood glucose levels, CGMs play an increasing role in clinical practice [1]. While multiple CGM-derived metrics to assess the quality of glycemic control and glycemic variability have been developed [2], their complexity and variety pose computational challenges for clinicians and researchers. While some metrics (e.g. mean) can be directly calculated from the data, others require additional pre-processing steps, such as projecting glucose measurements on an equidistant time grid (e.g. CONGA, SDbdm) or the imputation of missing data.

We are aware of two existing R packages for CGM data analyses: CGManalyzer [3] and cgmanalysis [4]. These packages are primarily designed to read and organize CGM data, rather than provide an easy-to-use interface for a comprehensive evaluation of available CGM characteristics. While their analytical utility is undeniable, a substantial number of CGM metrics summarized in [2] is not available. Moreover, both packages require the users to have considerable programming experience, which might be a limiting factor for researchers seeking robust and accessible analytical solutions. EasyGV is another free CGM software in the form of a macro-enabled Excel workbook [5], and thus is more accessible compared to CGManalyzer and cgmanalysis. However, it only allows calculation of 10 metrics. Furthermore, unlike R, Excel is not a script-based programming language, which makes it less desirable for those users who want to create reproducible scripts for all data processing and metric calculation steps. Thus, there remains a need for open-source software that (i) computes most of the CGM metrics available from the literature, and (ii) meets the needs of researchers with varying levels of programming experience.

Our R package iglu calculates all CGM metrics summarized in [2] in addition to several others [6, 12, 19], a full list of currently implemented metrics is summarized in Table 1. A comparison of functionality with CGManalyzer [3] and cgmanalysis [4] is in Table 2. Additional improvements include advanced visualization with lasagna plots [21], and provided example CGM datasets that make it easy to get started. Finally, a distinct advantage of iglu over existing open-source CGM software is a point-and-click graphical user interface (GUI) which makes the package accessible to users with little to no R experience.

Table 1. Summary of CGM metrics implemented in iglu.

Metric name iglu function Reference Time-dependent
Active percent active_percent Danne et al. (2017) [6] Yes
ADRR adrr Kovatchev et al. (2006) [7] Yes
AUC auc Danne et al. (2017) [6] Yes
COGI cogi Leelarathna et al. (2019) [8] No
CONGA conga McDonnell et al. (2005) [9] Yes
CV cv_glu Rodbard (2009) [2] No
CV subtypes cv_measures Umpierrez & Kovatchev (2018) [10] Yes
eA1c ea1c Nathan et al. (2008) [11] No
GMI gmi Bergenstal et al. (2018) [12] No
GRADE grade Hill et al. (2007) [13] No
GRADEeu grade_eugly Hill et al. (2007) [13] No
GRADEhyper grade_hyper Hill et al. (2007) [13] No
GRADEhypo grade_hypo Hill et al. (2007) [13] No
GVP gvp Peyser et al. (2018) [14] Yes
HBGI hbgi Kovatchev et al. (2006) [7] No
LBGI lbgi Kovatchev et al. (2006) [7] No
Hyper Index hyper_index Rodbard (2009) [2] No
Hypo Index hypo_index Rodbard (2009) [2] No
IGC igc Rodbard (2009) [2] No
IQR iqr_glu No
J-index j_index Wojcicki (1995) [15] No
MAD mad_glu No
MAG mag Hermanides et al. (2010) [16] Yes
MAGE mage Service & Nelson (1980) [17] No
Mean mean_glu No
Median median_glu No
MODD modd Service & Nelson (1980) [17] Yes
M-value m_value Schlichtkrull et al. (1965) [18] No
Percent Above above_percent No
Percent Below below_percent No
Percent in range in_range_percent No
Quantiles quantile_glu No
Range range_glu No
ROC (Rate Of Change) roc Clarke & Kovatchev (2009) [19] Yes
SD of ROC sd_roc Clarke & Kovatchev (2009) [19] Yes
SD sd_glu No
SD subtypes sd_measures Rodbard (2009) [20] Yes

Table 2. Comparison of iglu functionality with existing R packages for CGM data.

Metric name CGManalyzer cgmanalysis iglu
Active percent ×
ADRR × ×
AUC ×
COGI × ×
CONGA
CV subtypes (mean, sd) ×
CV median × ×
eA1c ×
Excursions count (over/under) × ×
GMI ×
GRADE × ×
GVP × ×
HBGI/LBGI ×
IGC × ×
J-index ×
MAG × ×
MAGE ×
MODD
M-value × ×
Multiscale entropy × ×
Percent in range ×
Time in range ×
ROC (Rate of Change) × ×
SD subtypes × ×
Summary statistics
Day/night metrics (SD, min, max, AUC) × ×
GUI for calculation × ×

Features

Example data

The iglu package is designed to work with CGM data provided in the form of a data frame with three columns: id (subject identifier), time (date and time stamp) and gl (corresponding blood glucose measurement in mg/dL). The package comes with two example datasets that follow this structure. example_data_5_subject contains Dexcom G4 CGM measurements from subjects with Type II diabetes.

example_data_5_subject[1:2,]

   id           time   gl

1 Subject 1 2015-06-06 16:50:27 153

2 Subject 1 2015-06-06 17:05:27 137

example_data_1_subject is a subset corresponding to one subject. These data are part of a larger study analyzed in [22].

Illustration of metrics use

Table 1 summarizes all the metrics implemented in the package, which can be divided into two categories: time-independent and time-dependent. All the functions assume that the glucose value are given in mg/dL units. Each function has detailed documentation that describes all the input parameters (and their default values) as well as the specific algorithm used for metric calculation. Full documentation can be accessed from the R console after loading the iglu package (e.g. ? active_percent) or from the accompanying website (https://irinagain.github.io/iglu/).

One example of a time-independent metric is Hyperglycemia index [2], the corresponding iglu function returns a single value for each subject in a tibble object [23]. Subject id will always be printed in the id column, and metrics will be printed in the following columns.

hyper_index(example_data_5_subject)

# A tibble: 5 x 2

 id    hyper_index

 <fct>      <dbl>

1 Subject 1    0.391

2 Subject 2    4.17

3 Subject 3    1.18

4 Subject 4    0.358

5 Subject 5    2.21

In this example, Subject 2 has the largest Hyperglycemia index, indicating the worst hyperglycemia. This is reflected in percent of times Subject 2 spends above fixed glucose targets.

above_percent(example_data_5_subject)

# A tibble: 5 x 4

 id    above_140 above_180 above_250

 <fct>     <dbl>   <dbl>   <dbl>

1 Subject 1   26.7    8.40   0.446

2 Subject 2   96.8   74.4   26.7

3 Subject 3   51.5   18.9    5.74

4 Subject 4   32.9    4.97   0

5 Subject 5   70.8   38.1   11.6

The default target values of 140, 180 and 250 mg/dL in above_percent can be adjusted by the user.

Examples of time-dependent metrics include measures of glycemic variability such as CONGA [9] and standard deviation of rate of change [19]. In the example data, the standard deviation of rate of change is the highest for Subject 5:

sd_roc(example_data_5_subject)

# A tibble: 5 x 2

 id    sd_roc

 <fct>   <dbl>

1 Subject 1 0.620

2 Subject 2 0.642

3 Subject 3 0.831

4 Subject 4 0.617

5 Subject 5 1.05

This provides an additional level of CGM data interpretation, since frequent or large glucose fluctuations may contribute to diabetes-related complications independently from chronic hyperglycemia [24]. Other metrics of glycemic variability confirm the high fluctuations in Subject 5, with all but one of the subtypes of standard deviation being the largest for Subject 5 [20]:

sd_measures(example_data_5_subject)

# A tibble: 1 x 7

 id     SdW SdHHMM SdWSH SdDM  SdB SdBDM

 <fct>   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>

1 Subject 1 26.4  19.6 6.54 16.7 27.9 24.0

2 Subject 2 36.7  22.8 7.62 52.0 48.0 35.9

3 Subject 3 42.9  14.4 9.51 12.4 42.8 42.5

4 Subject 4 24.5  12.9 6.72 16.9 25.5 22.0

5 Subject 5 50.0  29.6 12.8 23.3 50.3 45.9

The calculations of these variability metrics require evenly spaced glucose measurements across time; however, this is not always the case in practice due to missing values and misalignment of CGM measurement times across subjects (e.g. measurement at 17:30 for Subject 1, but at 17:31 for Subject 2). In order to create a uniform evenly spaced grid of glucose measurements, iglu provides the function CGMS2DayByDay. This function is automatically called for metrics requiring the evenly spaced grid across days, however the user can also access the function directly. The function works on a single subject’s data, and has three outputs.

str(CGMS2DayByDay(example_data_1_subject))

List of 3

 $ gd2d     : num [1:14, 1:288] NA 112.2 92 90.1 143.1 …

 $ actual_dates: Date[1:14], format: “2015-06-06” “2015-06-07” …

 $ dt0      : num 5

The first part of the output, gd2d, is the interpolated grid of values. Each row corresponds to one day of measurements, and the columns correspond to an equi-distant time grid covering a 24 hour time span. The grid is chosen to match the frequency of the sensor (5 minutes in this example leading to (24*60)/5 = 288 columns), which is returned as dt0. The linear interpolation is only performed between observed CGM values that are less than inter_gap minutes apart, otherwise missing values are inserted. By default, the function uses inter_gap = 45 minutes, however this value can be adjusted by the user. The returned actual_dates allows one to map the rows in gd2d back to original dates. The achieved alignment of glucose measurement times across the days enables both the calculation of corresponding metrics, and the creation of lasagna plots discussed in the next section.

Finally, iglu also allows one to assess the reliability of estimated CGM metrics by providing information on the number of days of data collection together with % of time the CGM device was active during those days (% of non-missing measurements). This information is automatically provided as part of the standardized AGP output discussed in the next section, and can also be obtained directly by calling the function active_percent.

active_percent(example_data_5_subject)

# A tibble: 5 x 5

 id    active_percent ndays   start_date    end_date

 <fct>       <dbl> <drtn>    <dttm>        <dttm>

1 Subject 1     79.8 12.7 days 2015-06-06 16:50:27 2015-06-19 08:59:36

2 Subject 2     58.9 16.7 days 2015-02-24 17:31:29 2015-03-13 09:38:01

3 Subject 3     92.1 5.8 days 2015-03-10 15:36:26 2015-03-16 10:11:05

4 Subject 4     98.7 12.9 days 2015-03-13 12:44:09 2015-03-26 10:01:58

5 Subject 5     95.8 10.6 days 2015-02-28 17:40:06 2015-03-11 08:04:28

According to [25], 10-14 days of CGM measurements are generally sufficient for assessing outcomes in clinical trials, and for determining potential adjustments to diabetes management based on retrospective review. Given these recommendations, the estimates of CGM parameters for Subject 3 are less reliable than the estimates for other subjects in the example dataset.

To investigate the agreement of metrics calculations with existing software, we selected a subset of metrics for cross-comparison of CGManalyzer, cgmanalysis and iglu on the example dataset. We found that the summary statistics (min, max, mean, quantiles, total SD) are in perfect agreement for all 5 subjects across all three packages. Additionally, cgmanalysis and iglu have perfect agreement in the values of GMI, eA1C, CV, % of glucose values in range and J-index. There is a slight (less than 1%) disagreement in % of time CGM is active between iglu and cgmanalysis, which we suspect is due to varying rounding precision. There is also some disagreement in all three packages in CONGA values (using a common parameter of n = 1 hour), which we suspect is due to differences in handling missing values and in grid interpolation schemes. Overall, the results show good agreement between the three packages as the calculated metrics either match perfectly or are close. Table 3 shows explicit values for Mean, SD, % time CGM is active, GMI, J-index and CONGA (n = 1 hour) for all five subjects across all three packages.

Table 3. Comparison of selected metrics across R packages using example dataset.

Metric name Subject id CGManalyzer cgmanalysis iglu
Mean Subject 1 123.7 123.7 123.7
Subject 2 218.5 218.5 218.5
Subject 3 154.0 154.0 154.0
Subject 4 129.7 129.7 129.7
Subject 5 174.6 174.6 174.6
SD Subject 1 33.3 33.3 33.3
Subject 2 52.4 52.4 52.4
Subject 3 44.8 44.8 44.8
Subject 4 29.1 29.1 29.1
Subject 5 55.6 55.6 55.6
% Time CGM is Active Subject 1 × 79.0 79.8
Subject 2 × 58.0 58.9
Subject 3 × 92.0 92.1
Subject 4 × 98.0 98.7
Subject 5 × 95.0 95.8
GMI Subject 1 × 6.3 6.3
Subject 2 × 8.5 8.5
Subject 3 × 7.0 7.0
Subject 4 × 6.4 6.4
Subject 5 × 7.5 7.5
J-index Subject 1 × 24.6 24.6
Subject 2 × 73.3 73.3
Subject 3 × 39.5 39.5
Subject 4 × 25.2 25.2
Subject 5 × 54.4 54.4
CONGA (n = 1 hour) Subject 1 24.7 25.7 25.9
Subject 2 19.9 25.1 25.7
Subject 3 38.2 41.0 39.5
Subject 4 23.2 22.6 23.3
Subject 5 49.0 50.0 49.3

Visualizations

The iglu package has several visualization capabilities, which are summarized in Table 4. The main function is plot_glu, which by default provides a time series plot for each subject. The glucose values are plotted on a linear scale, however an optional log parameter can be used to display glucose on a semilogarithmic scale [26]. Fig 1 illustrates the default output on example data with the horizontal red lines indicating user-specified target range, the default range is [70, 180] mg/dL [27]. The visual inspection of the plots confirm the previous conclusions from comparison of Hyperglycemia index and metrics of glycemic variability across subjects: the majority of measurements for Subject 2 are above 180 mg/dL, however the variability is larger for Subject 5.

Table 4. Summary of iglu visualization capabilities.

Function call Visualization description Main parameters
plot_glu Multiple plot types: time series and lasagna plottype, lasagnatype
plot_lasagna Lasagna plot of glucose values for multiple subjects datatype, lasagnatype
plot_lasagna_1subject Lasagna plot of glucose values for a single subject lasagnatype
plot_roc Time series of glucose values colored by rate of change (ROC) subjects, timelag
hist_roc Histogram of rate of change (ROC) values subjects, timelag
agp Ambulatory Glucose Profile (AGP) maxd, daily

Fig 1. Time series plots for five subjects.

Fig 1

Selected target range is [70, 180] mg/dL.

Another visualization type is provided via lasagna plots [21], which use a color grid rather than a number scale to visualize trends in data over time. The lasagna plots in iglu can be single-subject or multi-subject. The single-subject lasagna plot has rows corresponding to each day of measurements with a color grid indicating glucose values (Fig 2A). An optional within-time sorting across days allows one to investigate average glucose patterns as a function of 24 hour time periods (Fig 2B). The multi-subject lasagna plot has rows corresponding to subjects, with a color grid indicating glucose values across the whole time domain, or average glucose values across days. The highest glucose values are displayed in red, whereas the lowest are displayed in blue. Thus, the numerical glucose values are mapped to color using the gradient from blue to red (Fig 2), which corresponds to the default ‘blue-red’ color scheme. An alternative ‘red-orange’ color scheme can be selected by the user by corresponding modification of the ‘color_scheme’ parameter (using the gradient from red to green to yellow to orange, with green corresponding to values in specified glucose range). Fig 2C displays a customized multi-subject lasagna plot for example data that displays average glucose values across days for each subject; this plot is produced by the following call.

Fig 2. Lasagna plots.

Fig 2

(A) unsorted and (B) time-sorted lasagna plot for Subject 1; (C) unsorted customized multi-subject lasagna plot based on average values across days.

plot_lasagna(example_data_5_subject, datatype = “average”,

                 midpoint = 140, limits = c(60, 400))

The midpoint specifies the glucose value (in mg/dL) at which the color transitions from blue to red (the default is 105 mg/dL), whereas the limits specify the range (the default is [50, 500] mg/dL). From Fig 2 one can for example infer that the glucose values for Subject 1 tend to be the highest in late afternoon (≈ 15:00—20:00). One can also infer that Subject 1 tends to have the lowest glucose values during night time hours (0:00—6:00) compared to the other four subjects.

While lasagna plots are very similar to stacked bar charts introduced in [28], there are two main differences. First, the stacked bar charts split the glucose values into a fixed number of categories (based on specified glucose cutoffs), where the same color is used within each category. In contrast, the lasagna plots use gradient fill, thus the gradient of the color changes continuously with the change in glucose values. We believe this provides more detailed information on the subject’s glucose profile. Secondly, the stacked bar charts in [28] are created for one subject at a time. In contrast, iglu allows one to create lasagna plots for multiple subjects at once. Using datatype = ‘average’ with lasagnatype = ‘subjectsorted’ facilitates direct cross-comparison of glucose distributions across subjects, whereas lasagnatype = ‘timesorted’ facilitates assessment of population-level trends. Fig 3 shows both types of plots. Fig 3A shows that Subject 2 has the highest levels of hyperglycemia, whereas Subjects 1 and 4 have the lowest levels of hyperglycemia. Fig 3B shows that among the 5 subjects, hyperglycemia is most common in the later afternoon, with the times around 4pm (16:00) and 9pm (21:00) showing the highest glucose values.

Fig 3. Multi-subject lasagna plots in ‘red-orange’ color scheme.

Fig 3

(A) sorted within each subject and (B) sorted within each time point across subjects.

In addition to visualizing absolute glucose values, iglu also allows one to visualize local changes in glucose variability as measured by rate of change [19]. There are two types of visualizations associated with rate of change. The first is a time series plot of glucose values where each point is colored by the rate of change at that given time. Points colored in white have a stable rate of change, meaning the glucose is neither significantly increasing nor decreasing at that time point. Points colored red or blue represent times at which the glucose is significantly rising or falling, respectively. Thus colored points represent times of glucose variability, while white points represent glucose stability. Fig 4A shows a side by side comparison of rate of change time-series plots for two subjects. Subject 1 shows significantly less glucose variability than Subject 5. The function call to produce this plot is as follows.

Fig 4. Rate of change visualizations.

Fig 4

(A) time-series and (B) histogram plots of rate of change for two selected subjects from example dataset.

plot_roc(example_data_5_subject, subjects = c(“Subject 1”, “Subject 5”))

Fig 4B shows a side by side comparison of rate of change histogram plots for the same subjects. Once again, the colors show in what direction and how quickly the glucose is changing. The histogram plots allow one to immediately assess the variation in rate of change. Extreme values on either end of the histogram indicate very rapid rises or drops in glucose—a high degree of local variability. In Fig 4, Subject 1 once again shows lower glucose variability by having a narrower histogram with most values falling between -2 mg/dl/min and 2 mg/dl/min. Subject 5 has a shorter, more widely distributed histogram indicating greater glucose variability. The function call to produce this plot is as follows.

hist_roc(example_data_5_subject, subjects = c(“Subject 1”, “Subject 5”))

Finally, iglu allows one to generate an Ambulatory Glucose Profile (AGP) report in accordance with recommendations in [29]. Fig 5 shows an example report for Subject 1, which includes information on data collection period, time spent in standardized glycemic ranges (cutoffs of 54, 70, 180 and 250 mg/dL) displayed as a stacked bar chart [28], glucose variability as measured by %CV, and visualization of quantiles of the glucose profile across days together with daily glucose views.

Fig 5. Ambulatory Glucose Profile (AGP) for Subject 1 generated by iglu.

Fig 5

Relationship between metrics

To illustrate the relationships between different metrics and their interpretation, we calculated all metrics for example data of 5 subjects. Fig 6 shows the heatmap of resulting metrics (centered and scaled across all subjects to aid visualization) created using R package pheatmap [30]. The hierarchical clustering of glucose metrics results in six meaningful groups with the following interpretation (from top to bottom): (1) in range metrics; (2) hypoglycemia metrics; (3) hyperglycemia metrics; (4) a mixture of variability and hyperglycemia metrics; (5) CVsd (standard deviation of CV, coefficient of variation, across days); (6) glucose variability metrics. Interestingly, while CVsd is a measure of glucose variability, it behaves quite differently from other variability metrics in these 5 subjects. The hierarchical clustering of subjects confirms our previous observations that Subject 2 has the worst hyperglycemia (highest values for metrics in group (2)), whereas Subject 5 has the highest glucose variability (highest values for metrics in group (6)). The relationship between a reduced list of metrics has also been studied in [31, 32] using sparse principal component analysis. While [31, 32] focus on selection of a few key metrics to describe glucose variability, our goal here is exploratory analysis to illustrate differences and similarities between all metrics on a given dataset.

Fig 6. Heatmap of all metrics calculated using iglu for 5 subjects with Type II diabetes.

Fig 6

Hierarchical clustering is performed on centered and scaled metric values using distance correlation and complete linkage. The cluster tree for metrics is cut at 6 groups, which can be interpreted as follows (from top to bottom): (1) in range metrics; (2) hypoglycemia metrics; (3) hyperglycemia metrics; (4) a mixture of variability and hyperglycemia metrics; (5) CVsd (standard deviation of CV, coefficient of variation, across days); (6) glucose variability metrics. The heatmap supports that Subject 2 has the worst hyperglycemia and Subject 5 has the highest glucose variability.

GUI via shiny application

The iglu package comes with a shiny application [33], which provides a point-and-click graphical user interface (GUI) for all metric calculations and visualizations. The interface can be accessed from R console by calling

iglu::iglu_shiny()

or directly at https://irinagain.shinyapps.io/shiny_iglu/. The users can load their CGM data in .csv format, and export metrics output to the user’s clipboard or to .csv, .xlsx, or .pdf files (Fig 7A and 7B). Fig 7C shows an example of shiny interface for creating customized visualization plots based on user-loaded data.

Fig 7. Shiny GUI interface for iglu.

Fig 7

(A) loading CGM data in .csv format; (B) calculating user-specified quantiles for each subject; (C) creating customized lasagna plot for the selected subject.

Conclusion

The iglu package is designed to simplify computations of CGM-derived glucose metrics, and assist in CGM data visualization. The current version includes all of the metrics summarized in [2] as well as many others (see Table 1). New metrics will be incorporated into the future versions as they develop. More details on the package functionality together with the full documentation are provided in the package website at https://irinagain.github.io/iglu/.

Several limitations exist when compared to existing CGM software. First, the R interface assumes that the CGM data is already loaded into R as a data frame, which requires users to have sufficient R knowledge for data processing. The Shiny app currently only allows one to load CGM data in .csv format, and thus it also requires initial pre-processing by the user, albeit not necessarily in R. This is not the case for CGManalyzer or cgmanalysis, which can work directly with specialized data formats from many popular CGMs. Nevertheless, continuous development of new CGM meters coupled with varying data formats across meters present definite challenges for any CGM software. Secondly, while the list of metrics implemented in iglu is more comprehensive compared to other R packages on CGM (Table 3), it still lacks some functionality that may be desired as part of the AGP output [6], specifically the count of hypoglycemia/hyperglycemia excursions, and separation of metrics into sleep/wake time periods. Thirdly, while the agreement of metric values across software packages is encouraging, it does not necessarily signify the agreement with gold standard (see also the discussion in [4]). Furthermore, a comprehensive cross-comparison across packages is quite difficult as it requires a careful adjustment for potential differences in default parameters used in metrics calculations, in handling of missing values, and in underlying algorithms used. However, we believe that the explicit metric values provided in Table 3 coupled with public availability of our example dataset will serve as a useful preliminary step towards this endeavor. We hope to address some of these limitations in future iterations by leveraging complimentary existing open-source CGM software and our own updates to iglu.

From the context of CGM data applications, we acknowledge that an extensive list of metrics may have little utility for individual patient care in day to day clinical practice beyond the commonly used % of glucose values in range, Mean, CV, etc. Despite this, the iglu has important strengths that merit discussion. First, given that CGM is likely to be incorporated in clinical studies outside the realm of Type 1 diabetes, having accessibility to methods for summarizing CGM measures that extend the typical panel is of value. Second, CGM measures provide dynamic characterization of glucose trajectories which can be of immense value when considering the potential impact of conditions that are associated with acute temporal changes in pathophysiological mechanisms that can impact glucose homeostasis. For example, sleep apnea is a common condition that affects 9% of women and 25% of men in the general population. It is well known that sleep apnea is associated with nocturnal repetitive increases in sympathetic activity due to cyclical hypoxemia and recurrent arousals from sleep. Thus, to determine whether these acute changes which are known to increase sympathetic nervous system activity can influence glucose homeostasis measures that capture the dynamic nature of glucose trajectories are needed. Even in clinical scenarios where acute pathophysiological changes are not present, metrics that help probe the temporal nature of glucose are of value. For example, obesity is associated with metabolic flexibility. Having detailed CGM measures that help define the various rate of change (increase and decrease in glucose levels) can provide insight into how conditions such as obesity and polycystic ovary syndrome, alter the diurnal nature of glucose profiles. Furthermore, given the detailed nature of CGM data and the increasing use of acquiring such data, we believe that convenient methods for analyzing CGM data are desperately needed to facilitate the use of CGM methodology by investigators in observational studies and randomized clinical trials.

In summary, while there are existing open-source R packages for CGM data analyses [3, 4], these packages focus more on CGM data reading than exhaustive metric implementation, and require programming experience. Instead, iglu focuses on comprehensive implementation of available CGM metrics and ease of use via accompanying GUI application. All data loading, parameter selection, metric calculations and visualizations are available via point-and-click graphical user interface. This makes iglu accessible to a wide range of users, which coupled with the free and open-source nature of iglu will help advance CGM research and CGM data analyses.

Acknowledgments

The authors are thankful to Marielle Hicban, Mary Martin, Nhan Nguyen, Pratik Patel and John Schwenck for assisting in writing several metric functions in version 2.0.0 of iglu package.

Data Availability

The data underlying the results presented in the study are available as part of the iglu package. The package can be accessed from https://CRAN.R-project.org/package=iglu.

Funding Statement

This work was supported by the National Institutes of Health [HL11716, HL146709 to N.P.]; and an agreement from the Johns Hopkins University [80045538 to I.G.]. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

References

  • 1. Rodbard D. Continuous Glucose Monitoring: A Review of Successes, Challenges, and Opportunities. Diabetes technology & therapeutics. 2016;18(S2):S2–3–S2–13. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2. Rodbard D. Interpretation of Continuous Glucose Monitoring Data: Glycemic Variability and Quality of Glycemic Control. Diabetes technology & therapeutics. 2009;11(s1):S–55–S–67. [DOI] [PubMed] [Google Scholar]
  • 3. Zhang XD, Zhang Z, Wang D. CGManalyzer—an R package for analyzing continuous glucose monitoring studies. Bioinformatics. 2018;34(9):1609–1611. 10.1093/bioinformatics/btx826 [DOI] [PubMed] [Google Scholar]
  • 4. Vigers T, Chan CL, Snell-Bergeon J, Bjornstad P, Zeitler PS, Forlenza G, et al. cgmanalysis: An R package for descriptive analysis of continuous glucose monitor data. PLoS ONE. 2019;14(10):e0216851–12. 10.1371/journal.pone.0216851 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5. Hill NR, Oliver NS, Choudhary P, Levy JC, Hindmarsh P, Matthews NR Normal reference range for mean tissue glucose and glycemic variability derived from continuous glucose monitoring for subjects without diabetes in different ethnic groups. Diabetes technology & therapeutics. 2011;13(9):921–928. 10.1089/dia.2010.0247 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6. Danne T, Nimri R, Battelino T, Bergenstal RM, Close KL, DeVries JH, et al. International Consensus on Use of Continuous Glucose Monitoring. Diabetes care. 2017;40(12):1631–1640. 10.2337/dc17-1600 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7. Kovatchev BP, Otto E, Cox D, Gonder-Frederick L, Clarke W. Evaluation of a New Measure of Blood Glucose Variability in Diabetes. Diabetes care. 2006;29(11):2433–2438. 10.2337/dc06-1085 [DOI] [PubMed] [Google Scholar]
  • 8. Leelarathna L, Thabit H, Wilinska ME, Bally L, Mader JK, Pieber TR, et al. Evaluating glucose control with a novel composite continuous glucose monitoring index. Journal of diabetes science and technology. 2020;14(2):277–283. 10.1177/1932296819838525 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9. McDonnell CM, Donath SM, Vidmar SI, Werther GA, Cameron FJ. A novel approach to continuous glucose analysis utilizing glycemic variation. Diabetes technology & therapeutics. 2005;7(2):253–263. 10.1089/dia.2005.7.253 [DOI] [PubMed] [Google Scholar]
  • 10. Umpierrez GE, Kovatchev BP. Glycemic Variability: How to Measure and Its Clinical Implication for Type 2 Diabetes. The American journal of the medical sciences. 2018;356(6):518–527. 10.1016/j.amjms.2018.09.010 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11. Nathan DM, Kuenen J, Borg R, Zheng H, Schoenfeld D, Heine RJ, et al. Translating the A1C assay into estimated average glucose values. Diabetes care. 2008;31(8):1473–1478. 10.2337/dc08-0545 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12. Bergenstal RM, Beck RW, Close KL, Grunberger G, Sacks DB, Kowalski A, et al. Glucose Management Indicator (GMI): A New Term for Estimating A1C From Continuous Glucose Monitoring. Diabetes care. 2018;41(11):2275–2280. 10.2337/dc18-1581 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13. Hill NR, Hindmarsh PC, Stevens RJ, Stratton IM, Levy JC, Matthews DR. A method for assessing quality of control from glucose profiles. Diabetic Medicine. 2007;24(7):753–758. 10.1111/j.1464-5491.2007.02119.x [DOI] [PubMed] [Google Scholar]
  • 14. Peyser TA, Balo AK, Buckingham BA, Hirsch IB, Garcia A. Glycemic Variability Percentage: A Novel Method for Assessing Glycemic Variability from Continuous Glucose Monitor Data. Diabetes technology & therapeutics. 2018;20(1):6–16. 10.1089/dia.2017.0187 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15. Wojcicki J. “J”-index. A new proposition of the assessment of current glucose control in diabetic patients. Hormone and metabolic research. 1995;27(01):41–42. 10.1055/s-2007-979906 [DOI] [PubMed] [Google Scholar]
  • 16. Hermanides J, Vriesendorp TM, Bosman RJ, Zandstra DF, Hoekstra JB, DeVries JH Glucose variability is associated with intensive care unit mortality. Critical care medicine. 2010; 38(3): 838–842. 10.1097/CCM.0b013e3181cc4be9 [DOI] [PubMed] [Google Scholar]
  • 17. Service FJ, Nelson RL. Characteristics of Glycemic Stability. Diabetes care. 1980;3(1):58–62. 10.2337/diacare.3.1.58 [DOI] [PubMed] [Google Scholar]
  • 18. Schlichtkrull J, Munck O, Jersild M. The M-Value, an Index of Blood-sugar Control in Diabetics. Acta Medica Scandinavica. 1965;177(1):95–102. 10.1111/j.0954-6820.1965.tb01810.x [DOI] [PubMed] [Google Scholar]
  • 19. Clarke W, Kovatchev B. Statistical Tools to Analyze Continuous Glucose Monitor Data. Diabetes technology & therapeutics. 2009;11(S1):S45–S54. 10.1089/dia.2008.0138 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20. Rodbard D. New and improved methods to characterize glycemic variability using continuous glucose monitoring. Diabetes technology & therapeutics. 2009;11(9):551–565. 10.1089/dia.2009.0015 [DOI] [PubMed] [Google Scholar]
  • 21. Swihart BJ, Caffo B, James BD, Strand M, Schwartz BS, Punjabi NM. Lasagna Plots. Epidemiology. 2010;21(5):621–625. 10.1097/EDE.0b013e3181e5b06a [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22. Gaynanova I, Punjabi N, Crainiceanu CM. Modeling continuous glucose monitoring (CGM) data during sleep. Biostatistics. 2020. 10.1093/biostatistics/kxaa023 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Müller K, Wickham H. tibble: Simple Data Frames; 2020. Available from: https://CRAN.R-project.org/package=tibble.
  • 24. Suh S, Kim JH. Glycemic Variability: How Do We Measure It and Why Is It Important? Diabetes & Metabolism Journal. 2015;39(4):273–10. 10.4093/dmj.2015.39.4.273 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25. Riddlesworth TD, Beck RW, Gal RL, Connor CG, Bergenstal RM, Lee S, et al. Optimal sampling duration for continuous glucose monitoring to determine long-term glycemic control. Diabetes technology & therapeutics. 2018;20(4):314–316. 10.1089/dia.2017.0455 [DOI] [PubMed] [Google Scholar]
  • 26. Rodbard D A semilogarithmic scale for glucose provides a balanced view of hyperglycemia and hypoglycemia. J Diabetes Sci Technol. 2009;3(6):1395–401. 10.1177/193229680900300620 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27. Battelino T, Danne T, Bergenstal RM, Amiel SA, Beck R, Biester T, et al. Clinical targets for continuous glucose monitoring data interpretation: recommendations from the international consensus on time in range Diabetes Care. 2019. August;42(8):1593–1603 10.2337/dci19-0028 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28. Rodbard D Display of glucose distributions by date, time of day, and day of week: new and improved methods. Journal of diabetes science and technology. 2009;3(6):1388–94. 10.1177/193229680900300619 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29. Johnson ML, Martens TW, Criego AB, Carlson AL, Simonson GD, Bergenstal RM. Utilizing the ambulatory glucose profile to standardize and implement continuous glucose monitoring in clinical practice. Diabetes technology & therapeutics. 2019; 21(S2), S2–S17. [DOI] [PubMed] [Google Scholar]
  • 30.Kolde R. pheatmap: Pretty Heatmaps; 2019. Available from: https://CRAN.R-project.org/package=pheatmap.
  • 31. Fabris C, Facchinetti A, Sparacino G, Zanon M, Guerra S, Maran A, et al. Glucose variability indices in type 1 diabetes: parsimonious set of indices revealed by sparse principal component analysis. Diabetes technology & therapeutics. 2014;16(10):644–652. 10.1089/dia.2013.0252 [DOI] [PubMed] [Google Scholar]
  • 32. Fabris C, Facchinetti A, Fico G, Sambo F, Arredondo MT, Cobelli C, MOSAIC EU Project Consortium. Parsimonious description of glucose variability in type 2 diabetes by sparse principal component analysis. Journal of diabetes science and technology. 2016; 10(1):119–124. 10.1177/1932296815596173 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 33.Chang W, Cheng J, Allaire J, Xie Y, McPherson J. shiny: Web Application Framework for R; 2020. Available from: https://CRAN.R-project.org/package=shiny.

Decision Letter 0

Laura Pyle

20 Nov 2020

PONE-D-20-30578

Interpreting blood GLUcose data with R package iglu

PLOS ONE

Dear Dr. Gaynanova,

Thank you for submitting your manuscript to PLOS ONE. After careful consideration, we feel that it has merit but does not fully meet PLOS ONE’s publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.  Please note that Reviewer 2 made a number of suggestions for modification of the software which should be viewed as optional recommendations.  

I have a few comments to add to those of the reviewers:

1) Please perform a careful copy edit as there are typos and missing references.

2) In fig 2c, if these are 24 hour averages how can the x-axis unit be hours?

3) The Shiny interface is an extremely useful step, reducing the need for the user to have programming experience.  However, the user still needs to get the data into 3 column format, which is not the format exported by the CGM software.  Therefore, this step may require programming or manual editing of the data, which could introduce error.

Please submit your revised manuscript by Jan 04 2021 11:59PM. If you will need more time than this to complete your revisions, please reply to this message or contact the journal office at plosone@plos.org. When you're ready to submit your revision, log on to https://www.editorialmanager.com/pone/ and select the 'Submissions Needing Revision' folder to locate your manuscript file.

Please include the following items when submitting your revised manuscript:

  • A rebuttal letter that responds to each point raised by the academic editor and reviewer(s). You should upload this letter as a separate file labeled 'Response to Reviewers'.

  • A marked-up copy of your manuscript that highlights changes made to the original version. You should upload this as a separate file labeled 'Revised Manuscript with Track Changes'.

  • An unmarked version of your revised paper without tracked changes. You should upload this as a separate file labeled 'Manuscript'.

If you would like to make changes to your financial disclosure, please include your updated statement in your cover letter. Guidelines for resubmitting your figure files are available below the reviewer comments at the end of this letter.

If applicable, we recommend that you deposit your laboratory protocols in protocols.io to enhance the reproducibility of your results. Protocols.io assigns your protocol its own identifier (DOI) so that it can be cited independently in the future. For instructions see: http://journals.plos.org/plosone/s/submission-guidelines#loc-laboratory-protocols

We look forward to receiving your revised manuscript.

Kind regards,

Laura Pyle

Academic Editor

PLOS ONE

Journal Requirements:

When submitting your revision, we need you to address these additional requirements.

1. Please ensure that your manuscript meets PLOS ONE's style requirements, including those for file naming. The PLOS ONE style templates can be found at

https://journals.plos.org/plosone/s/file?id=wjVg/PLOSOne_formatting_sample_main_body.pdf and

https://journals.plos.org/plosone/s/file?id=ba62/PLOSOne_formatting_sample_title_authors_affiliations.pdf

2. In your ethics statement in the manuscript and in the online submission form, please provide additional information about the dataset used in your study. Specifically, please ensure that you have discussed whether all data were fully anonymized before you accessed them.

3.We suggest you thoroughly copyedit your manuscript for language usage, spelling, and grammar. If you do not know anyone who can help you do this, you may wish to consider employing a professional scientific editing service.  

Whilst you may use any professional scientific editing service of your choice, PLOS has partnered with both American Journal Experts (AJE) and Editage to provide discounted services to PLOS authors. Both organizations have experience helping authors meet PLOS guidelines and can provide language editing, translation, manuscript formatting, and figure formatting to ensure your manuscript meets our submission guidelines. To take advantage of our partnership with AJE, visit the AJE website (http://learn.aje.com/plos/) for a 15% discount off AJE services. To take advantage of our partnership with Editage, visit the Editage website (www.editage.com) and enter referral code PLOSEDIT for a 15% discount off Editage services.  If the PLOS editorial team finds any language issues in text that either AJE or Editage has edited, the service provider will re-edit the text for free.

Upon resubmission, please provide the following:

  • The name of the colleague or the details of the professional service that edited your manuscript

  • A copy of your manuscript showing your changes by either highlighting them or using track changes (uploaded as a *supporting information* file)

  • A clean copy of the edited manuscript (uploaded as the new *manuscript* file)

4. In your Data Availability statement, you have not specified where the minimal data set underlying the results described in your manuscript can be found. PLOS defines a study's minimal data set as the underlying data used to reach the conclusions drawn in the manuscript and any additional data required to replicate the reported study findings in their entirety. All PLOS journals require that the minimal data set be made fully available. For more information about our data policy, please see http://journals.plos.org/plosone/s/data-availability.

Upon re-submitting your revised manuscript, please upload your study’s minimal underlying data set as either Supporting Information files or to a stable, public repository and include the relevant URLs, DOIs, or accession numbers within your revised cover letter. For a list of acceptable repositories, please see http://journals.plos.org/plosone/s/data-availability#loc-recommended-repositories. Any potentially identifying patient information must be fully anonymized.

Important: If there are ethical or legal restrictions to sharing your data publicly, please explain these restrictions in detail. Please see our guidelines for more information on what we consider unacceptable restrictions to publicly sharing data: http://journals.plos.org/plosone/s/data-availability#loc-unacceptable-data-access-restrictions. Note that it is not acceptable for the authors to be the sole named individuals responsible for ensuring data access.

We will update your Data Availability statement to reflect the information you provide in your cover letter.

[Note: HTML markup is below. Please do not edit.]

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Author

1. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer #1: Yes

Reviewer #2: Yes

**********

2. Has the statistical analysis been performed appropriately and rigorously?

Reviewer #1: No

Reviewer #2: Yes

**********

3. Have the authors made all data underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data—e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

Reviewer #2: Yes

**********

4. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer #1: Yes

Reviewer #2: Yes

**********

5. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer #1: The authors present the R package “iglu” and accompanying Shiny app for visualization and analysis of continuous glucose monitor (CGM) data. The software calculates CGM metrics and generates figures not available in other packages, and is accessible to users with little programming experience. It is an excellent piece of software that will significantly ease the burden of analysis for many researchers.

Minor revisions for the paper:

1) There are a couple of small typos, so the paper could do with one more round of copy editing

2) In the interest of fairness, it would be worth including in Table 2 metrics calculated by CGManalyzer and cgmanalysis that are not included in iglu.

3) Please add a little bit more detail on how the package handles missing values. Does the CGMS2DayByDay() function automatically fill in missing data using linear interpolation? Or does it fill in with NA values? Also, the caption of Figure 1 claims that metric calculations are not affected by missing glucose values, but this cannot be true for all metrics so clarification is needed.

4) Figure 4 and the section on “relationship between metrics,” while interesting, seem beyond the scope of this manuscript. The hierarchical-clustering tool does not appear to be available in the Shiny app (although adding it could be extremely useful), which makes the inclusion of this clustered heatmap slightly confusing.

5) Please add some brief comparisons to demonstrate how closely this software agrees with other packages. This does not need to be an in-depth statistical analysis, as that would also be beyond the scope of the paper. However, the primary concern for many readers will be the accuracy of the calculations, so brief side-by-side comparisons between packages would be reassuring.

6) Please add some limitations to the conclusion section.

Minor suggestions for the software:

1) Although the graphing artifact (Figure 1, subject 2) is obvious in this example data, smaller artifacts may be less obvious in real-life data. Missing values should be blank space in the plots to avoid confusion.

2) After loading the 5 subject example data in R, writing to .csv, and loading into the Shiny app, the active_percent() function produces Error: unused arguments (180, 200, 250).

3) The visualizations are generally excellent as they are, but one suggestion would be to look into making the plots interactive using the plotly graphing library in R. This is not necessary for publication, but perhaps a recommendation for future updates.

4) Many researchers use packages like this to generate metrics for further analysis, so it might be nice to have the option to download all the metrics at once rather than manually combining results from multiple functions. Again, this is not a necessary change for publication, but simply a recommendation for the future.

Reviewer #2: Comments to the authors:

1. The paper is well written. This work goes beyond previous methods/software for analysis of CGM data. There is a need for such open source software. This software includes several metrics that were not included in previous software. The work is done well technically.

2. The introduction of Lasagna plots is new and novel. That approach is closely related to the use of stacked bar charts as introduced by Rodbard in 2009, and now included in nearly all outputs for CGM data.It remains to be see to what extent the Lasagna plot is superior to use of the stacked bar chart.

3. The authors note that they might add additional metrics in the future.

New metrics continue to be developed. See for instance Leelarathna et al, re COGI, published in 2020 in Diabetes Technology and Therapeutics.

4. The authors do not include an AGP in their outputs. This is perhaps the most popular component of nearly all displays of CGM data at the present time – along with the stacked bar chart. See Mazze et al, Diabetes Care 1987 and also 2008 2009 and multiple other papers, and subsequent papers from Bergenstal et al. See a recent review from Rodbard in press and online at DTT.

5. Most endocrinologists and other diabetes specialists use 70 and 180 as the cutoffs for in range. The present authors use 70 and 140. The graphs will look more familiar and appropriate to many readers if you use 70 and 180, or even 54 70 180 and 250. See Battelino et al, 2019, Diabetes Care. (63 and 140 are used or proposed for pregnancy).

6. It is reasonable for the authors to use their own nomenclature for their own variables in their program. However, for clarity, the authors might use the nomenclature as established in the literature for a number of variables, e.g. the subclassification of SD, i.e. SDT SDw SDb SDhh:mm SDdm SDb//dm and some others. e.g., bottom of page 4/9

7. Several of the metrics have ‘parameters’, i.e. TIR, TBR TAR MR CONGAn IGC (with a,b,c,d, LLTR ULTR). Please specify what default parameters you are using, and whether or not the end user can adjust those parameters. Cf top of page 4/9. Also SDwsh – what are the parameters for h? and is this for the entire series with all possible starting points, or for particular starting points?

8. Throughout - this reviewer prefers use of ‘allows one to map’ rather than ‘allow to map’ (several other instances for the word allows)

9. Page 5/9: under visualizations, line 5: reference to Section ___ (the number of the section is not currently specified)

10. The color scheme used by the authors is perfectly acceptable – but most of the commercial software for CGM data analysis uses a different color scheme. Authors might to well to build in flexibility and allow the end user to select their own color scheme.

11. Consider the possible option to include a logarithmic scale for glucose (Rodbard 2009 .. separate article than the ones cited).

12. Page 6/9: Authors discuss “worse glucose control” at at least two locations in the paper. But worse has several dimensions – can be in terms of TIR TBR TAR SD CV etc. So authors should be careful in using the term “worse” – it is “worse” in only 1 dimension.

13. Authors seem unaware of two articles by Fabris C et al (with Breton or Cobelli or Kovatchev) using principal components analysis and the high degree of correlation of many of the metrics. These probably should be cited, vis a vis the hierarchical analysis used by the present authors.

14. What algorithm are the authors using for MAGE (please use MAGE in all caps – all uppercase). Peter Baghurst has an algorithm (DTT) written in R. Are you using that one? That has been ‘validated’ or at least tested – see Sechterberger et al.

15. CVsd is an entirely new metric—what does it mean> What is it correlated with? Any place where the authors believe it might be helpful?

16. In your function CGMS2DaybyDay, what is the nature of your smoothing function? Any particular reason why it was selected or what its advantages might be relative to some alternatives? Any indication that it performs better than others.

17. You do not seem to include MAG (DeVries, Hermanides ?) also also see distance traveled (DT from Marling). A recent study from Moscada (?) and Nick Oliver indicates that MAG has the highest value for Discriminant Ratio, a criterion they propose as a basis to select among alternative metrics for various aspects of CGM.

18. Various consensus papers (Bergenstal, Danne, Maahs, Battelino) have discussed the statistics that the consensus groups believed should be presented together with the AGP (and other analyses of the CGM data). Please be sure that you have computed and provide the ones that are currently or recently in vogue.

19. Several authors have investigated how much data must be available to obtain reliable estimates of the parameters. These include Xing et al, Riddlesworth et al, and Nick Oliver or others from his group (may be in press or online at the present time, in DTT).

20. There are two major sets of applications for CGM data: The first is for the care of the individual patient. For this, one does not need or want all possible parameters… there is now a consensus that TIR TAR TBR Mean or median, %CV, and perhaps a very few other parameters are sufficient – in any event they are usually more than either the physician, health care practitioner, patient or patient’s family can digest. So, there is very little demand for new metrics – most unfamiliar, and most highly redundant or at least highly correlated with the few mentioned here.

21. The other major application of CGM data is in the context of clinical trials. Here one is interested in significance testing for superiority or non-inferiority for one or the other treatment, using randomized parallel studies or crossover studies. These often involve multivariate corrections e.g. for baseline A1C, or baseline mean glucose, and for clinical sites, and other subsets of the data. This is what a pharmaceutical laboratory would need. The present article, and program, despite all of its strengths, does not really fulfil the needs to these two major potential groups of users (in my opinion). The current study and paper is still valuable, and publishable, but this reviewer would suggest that the authors try to address or at least acknowledge these two major use-cases, and either try to address them in the present paper, or address them in future studies and manuscripts. Perhaps the lack of the ability of the present study and code to address these important use-cases should be included as a limitation of the study. However, the present code should be useful to others trying to address those cases.

22. Hill and Oliver et al have recently published (or have online) a new version of their EZ GV method (still in Excel, I believe) that might be helpful.

Some of the references cited in my comments above: Some of these might be helpful to the authors in the context of the present paper; others may be helpful in the future, to enable them to better coordinate with the “clinical diabetes” side of the relevant literature.

1. Updated Software for Automated Assessment of Glucose Variability and Quality of Glycemic Control in Diabetes.

Moscardó V, Giménez M, Oliver N, Hill NR.Diabetes Technol Ther. 2020 Oct;22(10):701-708. doi: 10.1089/dia.2019.0416. Epub 2020 Apr 22.PMID: 32195607

2. Assessment of Glucose Control Metrics by Discriminant Ratio.

Moscardó V, Herrero P, Reddy M, Hill NR, Georgiou P, Oliver N.Diabetes Technol Ther. 2020 Oct;22(10):719-726. doi: 10.1089/dia.2019.0415.PMID: 32163723

3. Calculating the mean amplitude of glycemic excursion from continuous glucose monitoring data: an automated algorithm.

Baghurst PA.Diabetes Technol Ther. 2011 Mar;13(3):296-302. doi: 10.1089/dia.2010.0090. Epub 2011 Feb 3.PMID: 21291334

4. Ambulatory glucose profile: representation of verified self-monitored blood glucose data

R S Mazze, D Lucido, O Langer, K Hartmann, D Rodbard PMID: 3552508 DOI: 10.2337/diacare.10.1.111

5. Recommendations for standardizing glucose reporting and analysis to optimize clinical decision making in diabetes: the Ambulatory Glucose Profile (AGP).

Bergenstal RM, Ahmann AJ, Bailey T, Beck RW, Bissen J, Buckingham B, Deeb L, Dolin RH, Garg SK, Goland R, Hirsch IB, Klonoff DC, Kruger DF, Matfin G, Mazze RS, Olson BA, Parkin C, Peters A, Powers MA, Rodriguez H, Southerland P, Strock ES, Tamborlane W, Wesley DM.Diabetes Technol Ther. 2013 Mar;15(3):198-211. doi: 10.1089/dia.2013.0051. Epub 2013 Feb 28.PMID: 23448694

6. J Diabetes Sci Technol . 2009 Nov 1;3(6):1395-401.

doi: 10.1177/193229680900300620. A semilogarithmic scale for glucose provides a balanced view of hyperglycemia and hypoglycemia David Rodbard 1 PMID: 20144394 PMCID: PMC2787040 DOI: 10.1177/193229680900300620

7. Clinical Targets for Continuous Glucose Monitoring Data Interpretation: Recommendations From the International Consensus on Time in Range.

Battelino T, Danne T, Bergenstal RM, Amiel SA, Beck R, Biester T, Bosi E, Buckingham BA, Cefalu WT, Close KL, Cobelli C, Dassau E, DeVries JH, Donaghue KC, Dovc K, Doyle FJ 3rd, Garg S, Grunberger G, Heller S, Heinemann L, Hirsch IB, Hovorka R, Jia W, Kordonouri O, Kovatchev B, Kowalski A, Laffel L, Levine B, Mayorov A, Mathieu C, Murphy HR, Nimri R, Nørgaard K, Parkin CG, Renard E, Rodbard D, Saboo B, Schatz D, Stoner K, Urakami T, Weinzimer SA, Phillip M.Diabetes Care. 2019 Aug;42(8):1593-1603. doi: 10.2337/dci19-0028. Epub 2019 Jun 8.PMID: 31177185 Free

8. International Consensus on Use of Continuous Glucose Monitoring. Danne T, Nimri R, Battelino T, Bergenstal RM, Close KL, DeVries JH, Garg S, Heinemann L, Hirsch I, Amiel SA, Beck R, Bosi E, Buckingham B, Cobelli C, Dassau E, Doyle FJ 3rd, Heller S, Hovorka R, Jia W, Jones T, Kordonouri O, Kovatchev B, Kowalski A, Laffel L, Maahs D, Murphy HR, Nørgaard K, Parkin CG, Renard E, Saboo B, Scharf M, Tamborlane WV, Weinzimer SA, Phillip M.Diabetes Care. 2017 Dec;40(12):1631-1640. doi: 10.2337/dc17-1600.PMID: 29162583 Free PMC article. Review

9. Outcome Measures for Artificial Pancreas Clinical Trials: A Consensus Report. Maahs DM, Buckingham BA, Castle JR, Cinar A, Damiano ER, Dassau E, DeVries JH, Doyle FJ 3rd, Griffen SC, Haidar A, Heinemann L, Hovorka R, Jones TW, Kollman C, Kovatchev B, Levy BL, Nimri R, O'Neal DN, Philip M, Renard E, Russell SJ, Weinzimer SA, Zisser H, Lum JW.Diabetes Care. 2016 Jul;39(7):1175-9. doi: 10.2337/dc15-2716.PMID: 27330126 Free PMC article. Review

10. Evaluating Glucose Control With a Novel Composite Continuous Glucose Monitoring Index. Leelarathna L, Thabit H, Wilinska ME, Bally L, Mader JK, Pieber TR, Benesch C, Arnolds S, Johnson T, Heinemann L, Hermanns N, Evans ML, Hovorka R.J Diabetes Sci Technol. 2020 Mar;14(2):277-283. doi: 10.1177/1932296819838525. Epub 2019 Mar 31.PMID: 30931606 Free PMC article.

11. A Review of Continuous Glucose Monitoring-Based Composite Metrics for Glycemic Control. Nguyen M, Han J, Spanakis EK, Kovatchev BP, Klonoff DC.Diabetes Technol Ther. 2020 Aug;22(8):613-622. doi: 10.1089/dia.2019.0434. Epub 2020 Mar 4.PMID: 32069094

**********

6. PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: Yes: Tim Vigers

Reviewer #2: No

[NOTE: If reviewer comments were submitted as an attachment file, they will be attached to this email and accessible via the submission site. Please log into your account, locate the manuscript record, and check for the action link "View Attachments". If this link does not appear, there are no attachment files.]

While revising your submission, please upload your figure files to the Preflight Analysis and Conversion Engine (PACE) digital diagnostic tool, https://pacev2.apexcovantage.com/. PACE helps ensure that figures meet PLOS requirements. To use PACE, you must first register as a user. Registration is free. Then, login and navigate to the UPLOAD tab, where you will find detailed instructions on how to use the tool. If you encounter any issues or have any questions when using PACE, please email PLOS at figures@plos.org. Please note that Supporting Information files do not need this step.

Decision Letter 1

Laura Pyle

2 Mar 2021

Interpreting blood GLUcose data with R package iglu

PONE-D-20-30578R1

Dear Dr. Gaynanova,

We’re pleased to inform you that your manuscript has been judged scientifically suitable for publication and will be formally accepted for publication once it meets all outstanding technical requirements.

Within one week, you’ll receive an e-mail detailing the required amendments. When these have been addressed, you’ll receive a formal acceptance letter and your manuscript will be scheduled for publication.

An invoice for payment will follow shortly after the formal acceptance. To ensure an efficient process, please log into Editorial Manager at http://www.editorialmanager.com/pone/, click the 'Update My Information' link at the top of the page, and double check that your user information is up-to-date. If you have any billing related questions, please contact our Author Billing department directly at authorbilling@plos.org.

If your institution or institutions have a press office, please notify them about your upcoming paper to help maximize its impact. If they’ll be preparing press materials, please inform our press team as soon as possible -- no later than 48 hours after receiving the formal acceptance. Your manuscript will remain under strict press embargo until 2 pm Eastern Time on the date of publication. For more information, please contact onepress@plos.org.

Kind regards,

Laura Pyle

Academic Editor

PLOS ONE

Additional Editor Comments (optional):

The second reviewer notified the Editor by email that all comments had been addressed.

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Author

1. If the authors have adequately addressed your comments raised in a previous round of review and you feel that this manuscript is now acceptable for publication, you may indicate that here to bypass the “Comments to the Author” section, enter your conflict of interest statement in the “Confidential to Editor” section, and submit your "Accept" recommendation.

Reviewer #1: All comments have been addressed

**********

2. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer #1: Yes

**********

3. Has the statistical analysis been performed appropriately and rigorously?

Reviewer #1: Yes

**********

4. Have the authors made all data underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data—e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

**********

5. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer #1: Yes

**********

6. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer #1: (No Response)

**********

7. PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: Yes: Tim Vigers

Acceptance letter

Laura Pyle

5 Mar 2021

PONE-D-20-30578R1

Interpreting blood GLUcose data with R package iglu 

Dear Dr. Gaynanova:

I'm pleased to inform you that your manuscript has been deemed suitable for publication in PLOS ONE. Congratulations! Your manuscript is now with our production department.

If your institution or institutions have a press office, please let them know about your upcoming paper now to help maximize its impact. If they'll be preparing press materials, please inform our press team within the next 48 hours. Your manuscript will remain under strict press embargo until 2 pm Eastern Time on the date of publication. For more information please contact onepress@plos.org.

If we can help with anything else, please email us at plosone@plos.org.

Thank you for submitting your work to PLOS ONE and supporting open access.

Kind regards,

PLOS ONE Editorial Office Staff

on behalf of

Dr. Laura Pyle

Academic Editor

PLOS ONE

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Supplementary Materials

    Attachment

    Submitted filename: ResponseReviews.pdf

    Data Availability Statement

    The data underlying the results presented in the study are available as part of the iglu package. The package can be accessed from https://CRAN.R-project.org/package=iglu.


    Articles from PLoS ONE are provided here courtesy of PLOS

    RESOURCES