Skip to main content

A comprehensive toolbox to analyse and model raw physical activity data

Project description

Tests Coverage Documentation Status Python Versions License 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

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:

Authors and Contributers

paat was mainly developed by Marc Weitz and Shaheen Syed. For the full list of contributors have a look at Github’s Contributor summary.

Currently, it is maintained by Marc Weitz. In case you want to contact the project maintainers, please send an email to marc [dot] weitz [at] uit [dot] no

Acknowledgments

This work was supported by the High North Population Studies at UiT The Arctic University of Norway.

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

paat-1.0.0b10.tar.gz (10.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paat-1.0.0b10-py3-none-any.whl (10.6 MB view details)

Uploaded Python 3

File details

Details for the file paat-1.0.0b10.tar.gz.

File metadata

  • Download URL: paat-1.0.0b10.tar.gz
  • Upload date:
  • Size: 10.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for paat-1.0.0b10.tar.gz
Algorithm Hash digest
SHA256 e67902ae542c274e8fd22f4b481dc96dde1baea5052a5db3007226990e6e3f1c
MD5 306ba8dbf518f51eff03f7058d940fe2
BLAKE2b-256 ffe1fd89a88878b4cb5dc72d87544baa2206a89c77db6b822b777613367c1d31

See more details on using hashes here.

File details

Details for the file paat-1.0.0b10-py3-none-any.whl.

File metadata

  • Download URL: paat-1.0.0b10-py3-none-any.whl
  • Upload date:
  • Size: 10.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for paat-1.0.0b10-py3-none-any.whl
Algorithm Hash digest
SHA256 2850b7559272a4d9b0c545a476665bb25385420aa55c394c0ce62d9baddd4cbb
MD5 b81a46db388c9a0f19469c58ffdd66b9
BLAKE2b-256 c2eb18974e85b1cd64df4698c93db07816cf6ed561ae06ef10a61e0f04da7813

See more details on using hashes here.

Supported by

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