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
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 if 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 a summary of movement from a raw Axivity accelerometer file (.cwa):
$ accProcess 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)": 32.78149,
"wearTime-overall(days)": 5.8,
"nonWearTime-overall(days)": 0.04,
"quality-goodWearTime": 1
}
To visualise the time series and activity classification output:
$ accPlot data/sample-timeSeries.csv.gz
<output plot written to data/sample-timeSeries-plot.png>
See the documentation for more.
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.
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:
-
[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
-
[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
-
[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
-
[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
This project is released under a BSD 2-Clause Licence (see LICENCE file)
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
File details
Details for the file accelerometer-5.1.0.tar.gz
.
File metadata
- Download URL: accelerometer-5.1.0.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4a017816019c9ec0541e01b32b603a16b6c5c99f7c23aa2d0c972aba1363a7f |
|
MD5 | 50bbbec23a8771498417d6d43d159cfa |
|
BLAKE2b-256 | 4721f38603e2451ee70196a53767c1080370bc57b790fb8e7a2ca223e0d40855 |
File details
Details for the file accelerometer-5.1.0-py3-none-any.whl
.
File metadata
- Download URL: accelerometer-5.1.0-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20c1c2bca9b808d34db41a51bcdb875c01c4e87d6354075ee23c6690b615da4a |
|
MD5 | e821b1c798b33ddf4cb2e83e067f5ea3 |
|
BLAKE2b-256 | 27841aada8c9818a6c873326685fa5c06ea7b149ef6a10bd87a826912cf2485b |