Calculate CGM-derived measures
Project description
CGMac (CGM Metrics Calculator)
Overview
This code calculates key metrics from Continuous Glucose Monitoring (CGM) data for multiple individuals. It processes time series glucose data and calculates various statistical measures including mean glucose levels, standard deviation and temporal autocorrelation properties.
Function description
The main function cgmac processes CGM data and returns the following measures for each individual
- Mean glucose level
- Standard deviation of the glucose levels
- Mean of autocorrelation values
- Variance of autocorrelation values
These measures are particularly useful for
- Predicting glucose control abilities including insulin sensitivity, insulin secretion, and insulin clearance
- Prediction of diabetic complications
Lag Parameter Selection
Default Recommendations
For a typical CGM analysis, we recommend the following lag settings based on sampling interval:
- 5-minute sampling interval: lag = 30 (covers 150 minutes)
- 15-minute sampling interval: lag = 10 (covers 150 minutes)
These recommendations are based on capturing temporal correlations over a 150-minute window, which often provides meaningful insights into glucose dynamics. The lag parameter is fully customisable as optimal lag values may vary depending on your research objectives.
Examples of use with different sampling intervals:
import cgmac
# For 5-minute interval data
results_5min = cgmac.cgmac(data=cgm_data_5min, lag=30)
# For 15-minute interval data
results_15min = cgmac.cgmac(data=cgm_data_15min, lag=10)
# Custom lag for specific research needs
results_custom = cgmac.cgmac(data=cgm_data, lag=your_custom_lag)
Prerequisites
Required Python libraries:
- pandas
- statsmodels
- numpy
Input data format
The input DataFrame should be structured as follows
- First column: Individuals IDs
- Second column onwards: Glucose readings (time series data)
- Each row represents a different individual's CGM readings.
Example input data structure:
ID Reading1 Reading2 Reading3 ...
0 1 120 125 118 ...
1 2 115 118 121 ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cgmac-0.1.0.tar.gz.
File metadata
- Download URL: cgmac-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02d627677d5eebc2405acbaa19440fc34e470e6333e2472cabbd320093746b48
|
|
| MD5 |
c14c346b898db22117cee9ce00d3ed7c
|
|
| BLAKE2b-256 |
dd5a2787720cd2478cfaf1ed7c95f7dffdc65c10e4b6a696acecbfcd8cf42091
|
File details
Details for the file cgmac-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cgmac-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61fc1aad692cc319ccac039a79feb83f11d3e7a847a8649bc7c30e324dcc1c8a
|
|
| MD5 |
f8eed9053e2e5a2267b35ca7a0ab9ce9
|
|
| BLAKE2b-256 |
4882c67e4e0c5682eb81675371c2d2a3d1099c99db052776d0a68d7f431c4137
|