Skip to content

Deigoodle/GlucoPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GlucoPy

Python Toolbox for glycaemic signal processing

Table of Contents

Main Features

  • Importing and exporting CGM signals in formats: .csv, .xslx, .xls
  • Glycaemic signal in units: mg/dL (default), mmol/L
  • Calculation of metrics like Mean, MODD, TIR, MAGE, BGI, Q-Score, etc.
  • Automatic summary of the metrics.
  • Generate Plots for analysis and visualization of the entire data or separated by day, some examples are Box Plot, Frequency Histogram, Trace Plot, Ambulatory Glucose Profile (AGP), etc.
  • Very easy to use all metrics are calculated calling a method of the class Gframe, and the plots are generated using that same class.

Dependencies

Installation from source

In the GlucoPy directory (same one where you found this file after cloning the repository), run:

pip install .

Documentation

The official documentation is hosted on github.io/GlucoPy/

Examples

All the Metrics are implemented as methods in the glucopy.Gframe class

Create a Gframe object from a .csv file

import glucopy as gp

# Read the file
gf = gp.read_csv('path/to/file.csv')

Create a Gframe object from a .xslx file

# Read the file
gf = gp.read_xlsx('path/to/file.xlsx')

Create a Gframe object from a pandas DataFrame

import pandas as pd

# Create a DataFrame
df = pd.read_csv('path/to/file.csv')

gf = gp.Gframe(df)

Create a Gframe object from GlucoPy's datasets

# Import the dataset
gf = gp.data("prueba_1")

Calculate some metrics

Check the documentation of Gframe for a complete list of metrics

# Mean
mean = gf.mean()

# MODD
modd = gf.modd()

# TIR
tir = gf.tir()

# MAGE
mage = gf.mage()

# BGI
lbgi = gf.lbgi()
hbgi = gf.hbgi()

Plots

All the plots use a Gframe object as first parameter. Check the documentation of glucopy.plot for a complete list of plots

Ambulatory Glucose Profile (AGP)

gp.plot.agp(gf)

AGP Plot

Frequency Histogram

gp.plot.freq(gf)

Frequency Histogram

MAGE Plot

gp.plot.mage(gf)

MAGE Plot

Collection of Python Signal Processing Library Repositories

Public Datasets

  • Awesome-CGM

    This is a collection of links to publicly available continuous glucose monitoring (CGM) data.

  • OhioT1DM

    The OhioT1DM dataset is available to researchers interested in improving the health and wellbeing of people with type 1 diabetes. It contains 8 weeks worth of data for each of 12 people with type 1 diabetes. a Data Use Agreement (DUA) is required.

  • ShanghaiT1DM and ShanghaiT2DM

    ShanghaiT1DM and ShanghaiT2DM are publicly available Datasets for research purposes, they contain Type 1 (n = 12) and Type 2 (n = 100) diabetic patients in Shanghai, China.

  • CG Map

    A reference resource for characterization of CGM data collected from more than 7,000 non-diabetic individuals, aged 40-70 years.

Releases

No releases published

Packages

No packages published

Languages