Giter Site home page Giter Site logo

jungguchoi / biobankaccelerometeranalysis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oxwearables/biobankaccelerometeranalysis

0.0 1.0 0.0 8.92 MB

Extracting meaningful health information from large accelerometer datasets

Home Page: http://biobankAccAnalysis.readthedocs.io

License: Other

Python 52.57% Java 46.82% Shell 0.61%

biobankaccelerometeranalysis's Introduction

Accelerometer data processing overview

A tool to extract meaningful health information from large accelerometer datasets. The software generates time-series and summary metrics useful for answering key questions such as how much time is spent in sleep, sedentary behaviour, or doing physical activity.

Installation

Dependancies include: unix, java 8 (Java 8 JDK) and python 3.7 (Anaconda's Python 3 or installation via Brew should do the trick).

$ git clone [email protected]:activityMonitoring/biobankAccelerometerAnalysis.git
$ bash utilities/downloadDataModels.sh
$ pip3 install --user .
$ javac -cp java/JTransforms-3.1-with-dependencies.jar java/*.java

Usage

To extract a summary of movement (average sample vector magnitude) and (non)wear time from raw Axivity .CWA (or gzipped .cwa.gz) accelerometer files:

$ python3 accProcess.py data/sample.cwa.gz
 <output written to data/sample-outputSummary.json>
 <time series output written to data/sample-timeSeries.csv.gz>

The main JSON output will look like:

{
    "file-name": "sample.cwa.gz", 
    "file-startTime": "2014-05-07 13:29:50", 
    "file-endTime": "2014-05-13 09:49:50", 
    "acc-overall-avg(mg)": 33.23, 
    "wearTime-overall(days)": 5.8, 
    "nonWearTime-overall(days)": 0.04,
    "quality-goodWearTime": 1
}

To visualise the time series and activity classification output:

$ python3 accPlot.py data/sample-timeSeries.csv.gz data/sample-plot.png
 <output plot written to data/sample-plot.png>

Time series plot

The underlying modules can also be called in custom python scripts:

    from accelerometer import summariseEpoch
    summary = {}
    epochData, labels = summariseEpoch.getActivitySummary("sample-epoch.csv.gz", 
            "sample-nonWear.csv.gz", summary)
    # <nonWear file written to "sample-nonWear.csv.gz" and dict "summary" updated
    # with outcomes>

Under the hood

Interpreted levels of physical activity can vary, as many approaches can be taken to extract summary physical activity information from raw accelerometer data. To minimise error and bias, our tool uses published methods to calibrate, resample, and summarise the accelerometer data. Click here for detailed information on the data processing methods on our wiki.

Accelerometer data processing overview Activity classification

Citing our work

When describing or using the UK Biobank accelerometer dataset, or using this tool to extract overall activity from your accelerometer data, please cite [Doherty2017].

When using this tool to extract sleep duration and physical activity behaviours from your accelerometer data, please cite [Willetts2018] and [Doherty2018].

[Doherty2017] Doherty A, Jackson D, Hammerla N, et al. (2017) 
Large scale population assessment of physical activity using wrist worn 
accelerometers: the UK Biobank study. PLOS ONE. 12(2):e0169649

[Willetts2018] Willetts M, Hollowell S, Aslett L, Holmes C, Doherty A. (2018) 
Statistical machine learning of sleep and physical activity phenotypes from 
sensor data in 96,220 UK Biobank participants. Scientific Reports. 8(1):7961

[Doherty2018] Doherty A, Smith-Bryne K, Ferreira T, et al. (2018) 
GWAS identifies 14 loci for device-measured physical activity and sleep 
duration. Nature Communications. 9(1):5257
Licence

This project is released under a BSD 2-Clause Licence (see LICENCE file)

Contributors

Aiden Doherty, Sven Hollowell, Matthew Willetts (University of Oxford) Dan Jackson, Nils Hammerla (Newcastle University)

biobankaccelerometeranalysis's People

Contributors

aidendoherty avatar chanshing avatar danielgjackson avatar supersational avatar

Watchers

 avatar

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.