-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathREADME.Rmd
More file actions
129 lines (80 loc) · 5.96 KB
/
README.Rmd
File metadata and controls
129 lines (80 loc) · 5.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# iglu
<!-- badges: start -->
[](https://cran.r-project.org/package=iglu)[](https://CRAN.R-project.org/package=iglu)
[](https://github.com/irinagain/iglu/actions)
[](https://github.com/irinagain/iglu/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/irinagain/iglu?branch=master)
<!-- badges: end -->
iglu: Interpreting data from Continuous Glucose Monitors (CGMs)
====================================================================
The R package 'iglu' provides functions for outputting relevant metrics for data collected from Continuous Glucose Monitors (CGM). For reference, see ["Interpretation of continuous glucose monitoring data: glycemic variability and quality of glycemic control." Rodbard (2009)](https://doi.org/10.1089/dia.2008.0132). For more information on the package, see [package website](https://irinagain.github.io/iglu/). We also have a [GUI that requires no programming experience](https://irinagain.shinyapps.io/shiny_iglu/) and mirrored [Python version of iglu](https://github.com/IrinaStatsLab/iglu-py).
For short **tutorial on how to use the package**, see [Video tutorial on working with CGM data in iglu](https://www.birs.ca/events/2025/5-day-workshops/25w5474/videos/watch/202502260906-Gaynanova.html) and corresponding [slides](https://irinagain.github.io/Resources/SlidesWorkshop.pdf).
iglu comes with two example datasets: example_data_1_subject and example_data_5_subject. These data are collected using Dexcom G4 CGM on subjects with Type II diabetes. Each dataset follows the structure iglu's functions are designed around. Note that the 1 subject data is a subset of the 5 subject data. See the examples below for loading and using the data.
Attribution
------------
We are glad you found iglu useful. If you use it for computing CGM metrics or visualizing CGM data, please cite the package appropriately, depending on the features used.
**Original package paper**: most of the CGM metrics, time series and lasagna plots, AGP
* Broll S, Urbanek J, Buchanan D, Chun E, Muschelli J, Punjabi N and Gaynanova I (2021). [Interpreting blood glucose data with R package iglu.](https://doi.org/10.1371/journal.pone.0248560) *PLoS One*, Vol. 16, No. 4, e0248560.
**Updated package paper**: for episode (event) detection, postprandial metrics, built-in clustering and heatmap tools, new MAGE, and Python version
* Chun E, Fernandes JN and Gaynanova I (2024) [An Update on the iglu Software for Interpreting Continuous Glucose Monitoring Data.](https://doi.org/10.1089/dia.2024.0154) *Diabetes Technology and Therapeutics,* Vol. 26, No. 12, 939-950.
**MAGE algorithm**: if you use MAGE, which is uniquely implemented and validated against manual computation, we ask that you additionally cite
* Fernandes N, Nguyen N, Chun E, Punjabi N and Gaynanova I (2022) [Open-Source Algorithm to Calculate Mean Amplitude of Glycemic Excursions Using Short and Long Moving Averages.](https://doi.org/10.1177/19322968211061165) *Journal of Diabetes Science and Technology*, Vol. 16, No. 2, 576-577.
**Reuse or modification in another software:**
iglu is free and released under the GNU General Public License v2 (GPL-2). This permits use, modification, and distribution (including translations), under the following conditions:
- Any redistributed or modified version must also be licensed under GPL-2, even if iglu is used in only parts of the work.
- You must provide clear attribution to iglu for the appropriate parts of the code, describe your changes (if applicable), and identify yourself as the source of modifications.
We recommend referencing the specific version of iglu that was used/modified to help track divergence from future updates.
**Copyright and warranty:**
© 2020 Texas A&M University
© 2023 The Regents of the University of Michigan
Gaynanova Lab - <https://irinagain.github.io/>
iglu is free software released under GPL 2.0. Use and modification are subject to the same license terms. It is distributed in the hope that it will be useful, but without any warranty. See the **LICENSE** file for full terms.
Installation
------------
The R package 'iglu' is available from CRAN, use the commands below to install the most recent Github version.
```{r, eval = FALSE}
# Plain installation
devtools::install_github("irinagain/iglu") # iglu package
# For installation with vignette
devtools::install_github("irinagain/iglu", build_vignettes = TRUE)
```
Example
-------
```{r}
library(iglu)
data(example_data_1_subject) # Load single subject data
## Plot data
# Use plot on dataframe with time and glucose values for time series plot
plot_glu(example_data_1_subject)
# Summary statistics and some metrics
summary_glu(example_data_1_subject)
in_range_percent(example_data_1_subject)
above_percent(example_data_1_subject, targets = c(80,140,200,250))
j_index(example_data_1_subject)
conga(example_data_1_subject)
# Load multiple subject data
data(example_data_5_subject)
plot_glu(example_data_5_subject, plottype = 'lasagna', datatype = 'average')
below_percent(example_data_5_subject, targets = c(80,170,260))
mage(example_data_5_subject)
```
Shiny App
------------
Shiny App can be accessed locally via
```{r, eval = FALSE}
library(iglu)
iglu_shiny()
```
or globally at [https://irinagain.shinyapps.io/shiny_iglu/](https://irinagain.shinyapps.io/shiny_iglu/). As new functionality gets added, local version will be slightly ahead of the global one.