The mean amplitude of glycemic excursions (MAGE) is an essential index for glycemic variability assessment, which is treated as a key reference for blood glucose controlling at clinic. However, the traditional “ruler and pencil” manual method for the calculation of MAGE is time-consuming and prone to error due to the huge data size, making the development of robust computer-aided program an urgent requirement. Although several software products are available instead of manual calculation, poor agreement among them is reported. Therefore, more studies are required in this field. In this paper, we developed a mathematical algorithm based on integer nonlinear programming. Following the proposed mathematical method, an open-code computer program named MAGECAA v1.0 was developed and validated. The results of the statistical analysis indicated that the developed program was robust compared to the manual method. The agreement among the developed program and currently available popular software is satisfied, indicating that the worry about the disagreement among different software products is not necessary. The open-code programmable algorithm is an extra resource for those peers who are interested in the related study on methodology in the future.
Clinical researches have suggested that high glycemic variability may cause more serious damage to the body than high level stable blood glucose [
MAGE is an arithmetic average of either the upward or downward of all glycemic excursions exceeding the threshold (standard deviation of blood glucose (SDBG) obtained from all blood glucose concentrations within 24-hour period); the direction of the calculation is determined by the first countable excursion [
To address the urgent need above, several automatic programs have been developed [
Therefore, in this report, we developed a mathematical algorithm based on integer nonlinear programming method. Following the proposed mathematical method, a computer-aided program named MAGECAA v1.0 was developed. The code of our program is open; if peers are interested in it, please contact xuefeiyu@smu.edu.cn for downloading. To validate the developed program, comparison study was implemented using blood glucose CGM datasets obtained from T1D, T2D, and gestational diabetes patients against the manual method (MAGEo) and other currently popular software products.
Let
Amplitude is the difference of functional values in a peak and a nadir of the function graph. A valid amplitude is labeled and counted when it is bigger than SDBG. To compute MAGE, these valid amplitudes of function
Suppose that
Thus, the above MAGE computation problem can be transformed to an integer nonlinear programming (INLP) problem.
According to the principle of INLP problem, function (
Suppose that
If the extreme point
If the extreme point
Now, our object is to get the optimal solution
It is difficult to directly solve function (
Set
The new unconstrained integer optimization problem becomes
When the optimum value
Differential evolution (DE) algorithm, a faster optimization algorithm proposed by Storn and Price [
DE searches for a global optimal point in an
The details of the employment of the DE algorithm to solve the above INLP problem are as follows from (a) to (d).
The above (b) to (d) steps are repeated till the evolution times arrived to certain number (general
Flow of the algorithm of the program of MAGECAA v1.0.
Based on the proposed mathematical method, a computer automated program named MAGECAA v1.0 was developed. The MAGE calculation program can be described as a process that selects valid extreme points from a time-ordered set of glucose concentrations whose adjacent differences are all greater than the threshold (typically 1 SDBG obtained from 24-hour period blood glucose concentrations). It can be summarized as finding the optimum vector combination solution of the valid extreme points and using INLP to establish the mathematic method, which can be solved by differential evolution (DE) algorithm. Once all valid extreme points of countable excursions have been identified, the MAGE is determined by MAGE+ or by MAGE−, depending on the direction of the first countable excursion. For more in-depth understanding, it depends on the first valid extreme point of the vector combination, because that point indicates the direction. In addition, the average of both MAGE+ and MAGE−, designated as MAGEa, is also calculated. MAGECAA v1.0 is based on INLP and has several different outputs: SDBG, MAGE+, MAGE−, MAGE, MAGEa, and so forth. Besides it also needs plot to show all valid extreme points joined by straight lines; MATLAB (MathWorks®, USA) is chosen as the programming environment accordingly. Generally, some data points could not be extreme point according to the mathematical definition, like points shown in Figure
(a) shows turning points
MAGECAA v1.0 consists of the following major modules: (1) import CGM data and calculate the SDBG as the threshold; (2) identify all extreme points; (3) find the optimum vector combination solution of valid extreme points; and (4) display the calculated parameters and plots.
The CGM datasets obtained by using CGMS® Gold™ (Medtronic®, USA), collected from clinical treatment, are used to evaluate the proposed program. All CGM datasets were provided by the Third Affiliated Hospital of Southern Medical University. Only complete 24-hour CGM data were selected for comparison study. All patients have provided their written informed consent. 5 CGM recordings from 3 T1D patients, 116 CGM measurements contributed by 58 T2D patients, and 127 CGM measurements based on gestational diabetes patients have been collected. Outpatients had been treated with either diet, oral hypoglycemic agents, oral hypoglycemic agents plus insulin, or insulin alone, depending on their glycemic control.
The validation of MAGECAA v1.0 was implemented by comparison against MAGEo and MAGEc. A doctor who has been well trained in using the original manual method to analyze CGM data was invited from Department of Endocrinology of the Third Affiliated Hospital of Southern Medical University, and he did not know the effect of MAGECAA v1.0. Our research team analyzed the complete patient population
Spearman’s correlation analysis was applied in evaluating the relationship between the MAGE values obtained by different methods with respect to the same patients. Bland-Altman plots were used to represent the agreement of the methods [
Figure
Screenshot of the graphical user interface of the MAGECAA v1.0 based on the MATLAB® programming environment for the mean amplitude of glycemic excursions (MAGE) calculation. After computation, 24-hour continuous glucose monitoring profiles are shown in the plots with all valid extreme points joined by straight lines. Besides the calculation of MAGE, it also calculates the standard deviation of blood glucose (SDBG), the average of all upward valid excursions (MAGE+), the average of all downward valid excursions (MAGE−), and the average of all valid excursions (MAGEa). The CGM data were collected from patients with type 1 diabetes. After calculation, the results are as follows: SDBG = 1.63 mmoles/L, MAGE+ = 4.43 mmoles/L, MAGE− = 4.63 mmoles/L, MAGEc = 4.43 mmoles/L (the first account excursion is from nadir to peak), and MAGEa = 4.53 mmoles/L.
As shown in Figure
(a) Correlation of the mean amplitude of glycemic excursions values (MAGE) obtained from the proposed program (MAGEc) and the original manual methods (MAGEo). The data of 60 continuous glucose monitoring (CGM) measurements were randomly chosen from all collected CGM data. (b) Bland-Altman plot shows the difference between MAGEc and MAGEo on
To evaluate the agreement of MAGECAA v1.0 with two currently available popular software products, that is, Fritzsche and EasyGV, we did pairwise comparison of MAGE among them. Table
The correlation coefficient and difference of the results separately calculated using MAGEc, Fritzsche, and EasyGV software.
MAGEc | Fritzsche | |||
---|---|---|---|---|
| mean ± SD | | mean ± SD | |
(mmoles/L−1) | (mmoles/L−1) | |||
MAGEc | — | — | — | — |
Fritzsche | 0.987 | 0.14 ± 0.55 | — | — |
EasyGV | 0.926 | 0.52 ± 1.17 | 0.926 | 0.38 ± 1.12 |
Bland-Altman plots showing the mean difference between MAGEc, EasyGV, and Fritzsche when applied to the same continuous glucose monitoring datasets.
In the original definition of MAGE, its direction of the calculation is determined by the first countable excursion. So MAGEc = MAGE+ or MAGEc = MAGE−; it is somewhat arbitrary and ignores half of the valid excursions. However, MAGEa represents the average of MAGE+ and MAGE−; it does not consider the direction, thus involving all the valid excursions.
To explore whether MAGEa may be a more useful index than MAGEc which depends on MAGE+ or MAGE−, the relationship between MAGEc and MAGEa was tested by using all the 248 CGM measurements via Spearman’s correlation analysis and Bland-Altman analysis. As shown in Figure
(a) Correlation between the mean amplitudes of glycemic excursions computerized (MAGEc) and the average of all valid glycemic excursions (MAGEa) for the total collected 248 continuous glucose monitoring measurements. (b) Bland-Altman plot shows the mean difference between MAGEc and MAGEa.
We developed a computer-aided open-code program named MAGECAA v1.0 based on INLP algorithm for automatic calculation of MAGE. Compared with the existing methods, the proposed novel method turns to search the optimal solution of the combination of extreme points from overall CGM measurements instead of searching adjacent extreme points from the beginning to the end step by step. As for the computational time, if used for one person, the proposed method is comparable with currently available methods; if used for batch calculation, the proposed method is more powerful. The programmable open codes are useful for the study of methodology for automatic calculation of MAGE. The comparison study using MAGECAA v1.0 against manual method indicated that the agreement is satisfied. The pairwise comparison study between MAGECAA v1.0 and two other available software products, Fritzsche and EasyGV, based on Spearman’s correlation analysis and Bland-Altman plots, demonstrated that the agreements between them met the requirement. Our study showed that the worry about the disagreement among the currently available popular software products is not necessary, which is different from the proposal by Sechterberger et al. [
The MAGE value depends on MAGE+ or MAGE−, following the direction of the first accountable glucose excursion. Considering the fact that only one direction of glucose excursion is adopted in current popular software, unavoidably resulting in the omission of the other directions of valid excursions, we implemented an extra experiment in which data from both directions of the valid glycemic excursions are utilized. MAGEa was used to represent the mean of MAGE+ and MAGE− for the calculation of MAGE. As shown by our data, a close linear correlation between MAGEa and MAGEc was observed, indicating that the difference between MAGE+ and MAGE− is significantly small. Therefore, we proposed that MAGEa might be another suitable parameter to quantify glycemic variability.
To conclude, an open-code software program named MAGECAA v1.0 for automatic calculation of MAGE based on a mathematical algorithm has been proposed and evaluated. The programmable open codes are useful for further methodology study in the future. The comparison study indicated that the agreement among the proposed software and existing software is satisfied, and the worry about the disagreement among currently available different popular software products is not necessary.
Mean amplitude of glycemic excursions
Standard deviation of blood glucose
Continuous glucose monitoring
Fritzsche et al.’s software
Integer nonlinear programming
Calculated values obtained from the original manual method
Calculated values obtained from MAGECAA v1.0
The average of all upward valid glycemic excursions
The average of all downward valid glycemic excursions
The average of all downward validated glycemic excursions
Differential evolution.
The authors declare that there are no conflicts of interest regarding the publication of this paper.
This study was partially supported by the National Key Research and Development Program of China (nos. 2016YFC0100800 and 2016YFC0100801), the National Natural Science Foundation of China (Grants nos. 61671229 and 61528102), Science and Technology Program of Guangdong, China (nos. 2015B020214006 and 2016A050502026), Guangdong Natural Science Foundation (no. 2015A030313234), and Science and Technology Program of Guangzhou, China (no. 201704020091).