Skip to main content

A package to extract meaningful health information from large accelerometer datasets e.g. how much time individuals spend in sleep, sedentary behaviour, walking and moderate intensity physical activity

Project description

Accelerometer data processing overview

Github all releases install flake8 junit gt3x cwa

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

pip install accelerometer

You also need Java 8 (1.8.0) or greater. Check with the following:

java -version

You can try the following to check that everything works properly:

# Create an isolated environment
$ mkdir test_baa/ ; cd test_baa/
$ python -m venv baa
$ source baa/bin/activate

# Install and test
$ pip install accelerometer
$ wget -P data/ http://gas.ndph.ox.ac.uk/aidend/accModels/sample.cwa.gz  # download a sample file
$ accProcess data/sample.cwa.gz
$ accPlot data/sample-timeSeries.csv.gz

Usage

To extract summary movement statistics from an Axivity file (.cwa):

$ accProcess data/sample.cwa.gz

 <output written to data/sample-outputSummary.json>
 <time series output written to data/sample-timeSeries.csv.gz>

Movement statistics will be stored in a JSON file:

{
    "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)": 32.78149,
    "wearTime-overall(days)": 5.8,
    "nonWearTime-overall(days)": 0.04,
    "quality-goodWearTime": 1
}

See here for the list of output variables.

Actigraph and GENEActiv files are also supported, as well as custom CSV files. See the documentation for more details.

To visualise the activity profile:

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

Time series plot

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.

Accelerometer data processing overview Activity classification

Citing our work

When describing or using the UK Biobank accelerometer dataset, please cite [Doherty2017]. When using this tool to extract sleep duration and physical activity behaviours from your accelerometer data, please cite:

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

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

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

  4. [Walmsley2021] Walmsley R, Chan S, Smith-Byrne K, et al. (2021) Reallocation of time between device-measured movement behaviours and risk of incident cardiovascular disease. British Journal of Sports Medicine. Published Online First. DOI: 10.1136/bjsports-2021-104050

Licence

See license before using this software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

accelerometer-5.1.3.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

accelerometer-5.1.3-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file accelerometer-5.1.3.tar.gz.

File metadata

  • Download URL: accelerometer-5.1.3.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.13

File hashes

Hashes for accelerometer-5.1.3.tar.gz
Algorithm Hash digest
SHA256 0afc8cdc24113ac2eaa60774355038970833536a3b20bd51fcad7ecd168f8cda
MD5 613b4b5543d6f553357c49ce6e471bd4
BLAKE2b-256 289eba094efedb4ecf2a07884f4d627eb75f56ed4f64ef8f2918ef17294d906d

See more details on using hashes here.

File details

Details for the file accelerometer-5.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for accelerometer-5.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a37015c080490a51b29f066b9b42fad09f76ab4595315d0ca233b1332b52de38
MD5 8b781b3bf8a00da302d76c6ce7f77712
BLAKE2b-256 76cdafc74d7ac95df17ae3f3329b65b09ab11ac520c4814264620f9b1d54bd44

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page