Skip to main content

ActiNet

GitHub all releases DOI

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.

Install

Minimum requirements: Python>=3.9, Java 8 (1.8)

The following instructions make use of Anaconda to meet the minimum requirements:

  1. Download & install Miniconda (light-weight version of Anaconda).

  2. (Windows) Once installed, launch the Anaconda Prompt.

  3. Create a virtual environment:

    conda create -n actinet python=3.9 openjdk pip
    

    This creates a virtual environment called actinet with Python version 3.9, OpenJDK, and Pip.

  4. Activate the environment:

    conda activate actinet
    

    You should now see (actinet) written in front of your prompt.

  5. Install actinet:

    pip install actinet
    

You are all set! The next time that you want to use actinet, open the Anaconda Prompt and activate the environment (step 4). If you see (actinet) in front of your prompt, you are ready to go!

Usage

# Process an AX3 file
$ actinet sample.cwa.gz

# Or an ActiGraph file
$ actinet sample.gt3x

# Or a GENEActiv file
$ actinet sample.bin

# Or a CSV file (see data format below)
$ actinet sample.csv

# Specify column names for CSV (default: time,x,y,z)
$ actinet sample.csv --csv-txyz 'timestamp,accel_x,accel_y,accel_z'

# Or specify columns by index (0-indexed)
$ actinet sample.csv --csv-txyz-idxs '0,1,2,3'

# Process an inclusive time interval from the recording
$ actinet sample.cwa --start '2024-01-01 10:00:00' --end '2024-01-08 09:59:59'

See the Usage page for further uses of the tool.

Troubleshooting

Some systems may face issues with Java when running the script. If this is your case, try fixing OpenJDK to version 8:

conda create -n actinet openjdk=8

Output files

By default, output files will be stored in a folder named after the input file, outputs/{filename}/, created in the current working directory. You can change the output path with the -o flag:

$ actinet sample.cwa -o /path/to/some/folder/

<Output summary written to: /path/to/some/folder/sample-outputSummary.json>
<Time series output written to: /path/to/some/folder/sample-timeSeries.csv.gz>

The following output files are created:

  • Info.json Summary info, as shown above.
  • timeSeries.csv Raw time-series of activity levels

See Data Dictionary for the list of output variables.

Plotting activity profiles

To plot the activity profiles, you can use the -p flag:

$ actinet sample.cwa -p
<Output plot written to: data/sample-timeSeries-plot.png>

Crude vs. Adjusted Estimates

Adjusted estimates are provided that account for missing data. Missing values in the time-series are imputed with the mean of the same timepoint of other available days. For adjusted totals and daily statistics, 24h multiples are needed and will be imputed if necessary. Estimates will be NaN where data is still missing after imputation.

Processing multiple files

Windows

To process multiple files you can create a text file in Notepad which includes one line for each file you wish to process, as shown below for file1.cwa, file2.cwa, and file2.cwa.

Example text file commands.txt:

actinet file1.cwa &
actinet file2.cwa &
actinet file3.cwa 
:END

Once this file is created, run cmd < commands.txt from the terminal.

Linux

Create a file command.sh with:

actinet file1.cwa
actinet file2.cwa
actinet file3.cwa

Then, run bash command.sh from the terminal.

Collating outputs

A utility script is provided to collate outputs from multiple runs:

actinet-collate-outputs outputs/

This will collate all *-Info.json files found in outputs/ and generate a CSV file.

Citing our work

When using this tool, please consider citing the works listed in CITATION.md.

Licence

See LICENSE.md.

Acknowledgements

We would like to thank all our code contributors, manuscript co-authors, and research participants for their help in making this work possible.

Metadata

Release files for actinet 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for actinet 0.8.0
File Size Uploaded
actinet-0.8.0.tar.gz 94.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for actinet 0.8.0
File Interpreter ABI Platform
actinet-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 155.0 kB

Release files / actinet-0.8.0.tar.gz

Download URL actinet-0.8.0.tar.gz
Size 94.4 kB
Tags Source
SHA-256 checksum
How to use checksums
06a1f47b47db395742ef1cc7a2ce0a5c2a19590ea8bd25947704da6440ddd7c8
BLAKE2b-256 checksum
How to use checksums
8bf01dd0ad023bc2a9ffe4e47e64e68cf3c1c4902da7f6b485d9d4f364c1559b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / actinet-0.8.0-py3-none-any.whl

Download URL actinet-0.8.0-py3-none-any.whl
Size 60.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
281cb87762082b964dfd054fc9c7fdafa5473d5f6d4f5da277a2b1329176bb21
BLAKE2b-256 checksum
How to use checksums
59db2de20a6618f2dcdb4b2578bf5b433a362722ae2b250e8dc2e8d709a6a582
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page