A comprehensive toolbox to analyse and model raw physical activity data
Project description
Note: This package is currently under development and the API might change anytime! For reproducible versions, see zenodo.
The physical activity analysis toolbox (PAAT) is a comprehensive toolbox to analyze raw acceleration data. We developed all code mainly for analyzing ActiGraph data (GT3X files) in large sample study settings where manual annotation and analysis is not feasible. Most functions come along with scientific papers describing the methodology in detail. Even though, the package was and is primarily develop for analyzing ActiGraph data, we warmly welcome contributions for other clinical sensors as well!
Installation
At the moment, the easiest way to install paat directly from GitHub by running:
pip install paat
Usage
For now, several functions to work with raw data from ActiGraph devices are implemented while others are still work in progress. The following code snippet should give you a brief overview and idea on how to use this package. Further examples and more information on the functions can be found in the documentation.
# Load data from file
data, sample_freq = paat.read_gt3x('path/to/gt3x/file')
# Detect non-wear time
data.loc[:, "Non Wear Time"] = paat.detect_non_wear_time_hees2011(data, sample_freq)
# Detect sleep episodes
data.loc[:, "Time in Bed"] = paat.detect_time_in_bed_weitz2024(data, sample_freq)
# Classify moderate-to-vigorous and sedentary behavior
data.loc[:, ["MVPA", "SB"]] = paat.calculate_pa_levels(
data,
sample_freq,
mvpa_cutpoint=.069,
sb_cutpoint=.015
)
# Merge the activity columns into one labelled column. columns indicates the
# importance of the columns, later names are more important and will be kept
data.loc[:, "Activity"] = paat.create_activity_column(
data,
columns=["SB", "MVPA", "Time in Bed", "Non Wear Time"]
)
# Remove the other columns after merging
data = data[["X", "Y", "Z", "Activity"]]
Getting involved
The paat project welcomes help in the following ways:
Making Pull Requests for code, tests or documentation.
Commenting on open issues and pull requests.
Helping to answer questions in the issue section.
Creating feature requests or adding bug reports in the issue section.
Acknowledgments
This work was supported by the High North Population Studies at UiT The Arctic University of Norway.
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 paat-1.0.0b7.tar.gz
.
File metadata
- Download URL: paat-1.0.0b7.tar.gz
- Upload date:
- Size: 29.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b65991f4c22ef3dda76ac7cb0a1f1f118e7ae5f7b728fcf33e8f08dd5abecfd |
|
MD5 | 3cf158a20deea1ef94c434a5c3d2b6c6 |
|
BLAKE2b-256 | 05b64809539e90e1549b05c21a503fd6a3bedcb8d8ff1979d2d812806e65351d |
File details
Details for the file paat-1.0.0b7-py3-none-any.whl
.
File metadata
- Download URL: paat-1.0.0b7-py3-none-any.whl
- Upload date:
- Size: 29.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 229beacdff4b9f691bf5a99e325f6a382b96c74d7ebf040c60ea144abd30e339 |
|
MD5 | aeec3d0a86ba6c635df02e424ba0897b |
|
BLAKE2b-256 | d55d463a982318f32a2be26e955688c02864da76c5e61943bfb5c0a43d54e17f |