Physical Activity Analysis Toolbox (PAAT)
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
The easiest way is to install paat directly from PyPI using pip:
pip install paat
For reproducible versions, see zenodo.
Usage
PAAT comprises several functions to work with raw data from ActiGraph devices. 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.
It is also possible to use other packages such as actipy or SciKit Digital Health (SKDH) to load the data. The only prerequisite is that a pandas DataFrame with a TimeStamp index and the sampling frequency is provided. The pandas DataFrame should have raw acceleration data of the vertical axis (“Y” column), the sagittal axis (“X” column), and the frontal axis (“Z” column).
# 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.
Metadata
Release files for paat 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| paat-1.0.0.tar.gz | 10.6 MB | Without provenance | Details for paat-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| paat-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for paat-1.0.0-py3-none-any.whl |
Total release size: 21.2 MB
Release files / paat-1.0.0.tar.gz
| Download URL | paat-1.0.0.tar.gz |
|---|---|
| Size | 10.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
526f4f31b8cc00e1bde35f73f5d3182b59baba53cb99d527898e69d1b541f1b8
|
|
BLAKE2b-256 checksum How to use checksums |
5ba30bb52b76671d2e3b4db0c8237e217cc74166eaed48746f3fdd5f6cabe68a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.13 Linux/6.11.0-1018-azure
|
Release files / paat-1.0.0-py3-none-any.whl
| Download URL | paat-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8535a9730363d15af533b4144baadb4d368c19f0870d38de1a57d666f67cb09c
|
|
BLAKE2b-256 checksum How to use checksums |
5b1fe5a2a8da0833deb8d6f85299fa5475f3da41adbf15d67753a695afc71559
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.13 Linux/6.11.0-1018-azure
|
Security for paat 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.