Giter Site home page Giter Site logo

glucopy's Introduction

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.

glucopy's People

Contributors

deigoodle avatar

Stargazers

 avatar

Watchers

 avatar

glucopy's Issues

metrics 4: Q-Score

  • assuming the range is the average of the differences between max and min

metrics 2: AGP

  • In the paper is described as a metric, but the correct interpretation is on a plot

ADRR, GRADE fix

  • Convertion of mg/dl to mmol/l and viceversa
  • GRADE now can return percentages of contribution to 'Hypoglycaemia', 'Euglycaemia' and 'Hyperglycaemia'

GRADE fix, wrong percentages

  • Previously I was checking if the GRADE values were in the ranges <3.9, >8.9, etc. Which was wrong, now check with the data values

trace MAGE: improve

  • Use a more precise method regarding manuscripts.
  • Add a smoothing method (is worst than scipy.signal.find_peaks alone)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.