ActiSleep Tracker
ActiSleep Tracker: a Python-based dashboard for adjusting automatic sleep predictions of actigraphy data - Published in JOSS (2025)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
○Academic email domains
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Scientific Fields
Repository
A webapp for annotating actigraphy data
Basic Info
Statistics
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 9
- Releases: 6
Topics
Metadata Files
README.md
ActiSleep Tracker
ActiSleep Tracker is an application designed to run after processing actigraphy data with the GGIR package and allows users to annotate sleep data. This repository contains the source code and related files for the application.
Getting Started
The application may be installed either through Docker (recommended for users) or Poetry (recommended for developers). Whichever method you use to launch the app, the app will be available at http://localhost:8051.
Running ActiSleep Tracker through Docker
- Install Docker: Ensure you have Docker installed on your system. Get Docker
- Pull the Docker image:
bash docker pull cmidair/actigraphy:main - Run the Docker image with your data:
bash docker run \ -p 127.0.0.1:8051:8051 \ --volume /local/path/to/data:/data \ cmidair/actigraphy:mainReplace/local/path/to/datawith the path to your input data directory (i.e., GGIR's output folder).
How to use ActiSleep Tracker?
All the steps below will consider that you cloned this GitHub repository inside your Documents folder.
There is an examplar raw data under paper/data/raw and a processed version using GGIR 3.2-6 under paper/data/ggir_outputs.
If you wish to use this data, be aware that it's stored via Git LFS, so you'll have to run the following commands to download it.
bash
git clone https://github.com/childmindresearch/actisleep-tracker.git
cd actisleep-tracker
git lfs install
git lfs pull
After cloning this repository or processing your actigraphy data with GGIR, you should have a folder structure similar to:
├── 📁 ggir_outputs
│ └── 📁 output_sub001
│ ├── 📄 config.csv
│ ├── 📁 meta
│ └── 📁 results
├── 📁 raw
│ └── 📄 sub001.gt3x
└── 📁 scripts
└── 📄 run_ggir.R
where outputs contains all files generated by GGIR; raw is the raw actigraphy data; and scripts contains all the scripts used in this project.
Run ActiSleep Tracker through Docker by typing:
bash
DATA_DIR="INSERT_PATH_TO_YOUR_DATA_DIRECTORY"
docker run \
-p 127.0.0.1:8051:8051 \
--volume $DATA_DIR:/data \
cmidair/actigraphy:main
If you want to try our sample dataset, navigate to the root of the repository and use DATA_DIR=./paper/data/ggir_outputs.
The application will the available at http://localhost:8051.
Select the output you would like to visualize; then, click on Load Files:
Note: the file may take some time to load for the first time.
Once the file is loaded, you will see the following screen:
The top slider is used to select the day to visualize. Next, you have three main questions to answer about that night: 1. Are there multiple sleep periods in these data? - Select this toggle button if you identify more than one sleep window on that day (i.e., multiple sleep windows at night or nap times during the day). 2. Do you need to review this night? - Select this toggle button if that day will need further review. 3. Are >2 hours of data missing between 8PM to 8AM? - Select this toggle button if there is insufficient data for sleep analysis. For the protocol we designed, we were considering sleep periods between 8PM to 8AM, but you can use this toggle and adapt to your own needs.
The graph represents the angle of sensor's z-axis (in blue) and arm movement (in grey). The slider below the graph is used to adjust the main sleep window. To change the window, just slide the slider to the desired onset and/or offset sleep times. In cases where your data has more than one sleep window (multiple sleep windows at night or nap times during the day), you can use the Add Slider button to create a new sleep window. Note that the main sleep episode should always use the slider below the graphs. The code will automatically save all changes you made and will create three files:
ggir_outputs/output_sub001/logs/data_cleaning_sub001.csv: a data cleaning file that contains nights that should be omitted from sleep analysis;ggir_outputs/output_sub001/logs/multiple_sleep_sub001.csv: file that documents cases with more than one sleep window per day, facilitating analyses of naps and nocturnal awakenings.ggir_outputs/output_sub001/logs/sleeplog_sub001.csv: initial sleep onset and offset predictions from GGIR.
Developer notes
The Actigraphy app is developed to annotate sleep data, and for this project, we've utilized the Dash framework. It's important to note that Dash apps usually aren't geared towards full-stack applications, but given the project requirements, adopting it was a pragmatic necessity. In this repository, we've implemented a custom Dash architecture to address some typical challenges associated with a full-stack Dash app, particularly through the introduction of a custom callback manager. The organization of the project is structured as follows:
app.pycontains the main Dash app, which is responsible for the layout of the app.components/houses the components utilized by the app. Each component is tasked with its specific layout and logic. Some of the components include file selection, day slider, and graph visualization.core/contains the core tools of the app, including configurations, utilities, command line interface and the callback manager.core/callback_manager.pyis responsible for registering callbacks for the app. It is also responsible for registering callbacks for the components. This file allows the callbacks to be placed across multiple files by defining a global manager.database/contains the tools for interacting with the database.io/contains the tools for loading and saving data.plottingcontains the tools for plotting data.
That being said, the callback architecture has grown complex, especially in the graph component where chains of callbacks can cause the app to slow down.
Running the App through uv
Installation via uv is intended for developers; end-users should use the Docker installation described earlier.
- Ensure you have uv installed.
- Clone the repository:
bash git clone https://github.com/childmindresearch/actisleep-tracker.git cd actisleep-tracker - Install dependencies:
bash uv sync - Run the app:
bash uv run actigraphy $DATA_DIR
Owner
- Name: Child Mind Institute — Research Teams
- Login: childmindresearch
- Kind: organization
- Email: gregory.kiar@childmind.org
- Repositories: 62
- Profile: https://github.com/childmindresearch
GitHub organization for the Child Mind Institute Research Teams
JOSS Publication
ActiSleep Tracker: a Python-based dashboard for adjusting automatic sleep predictions of actigraphy data
Authors
Child Mind Institute, New York City, New York, United States of America
Genetic Epidemiology Research Branch, Intramural Research Program, National Institute of Mental Health, Bethesda, Maryland, United States of America
Genetic Epidemiology Research Branch, Intramural Research Program, National Institute of Mental Health, Bethesda, Maryland, United States of America
Department of Biostatistics and Informatics, University of Colorado Anschutz Medical Campus, Aurora, Colorado, United States of America
Department of Biostatistics, Johns Hopkins Bloomberg School of Public Health, Baltimore, Maryland, United States of America
Child Mind Institute, New York City, New York, United States of America
Genetic Epidemiology Research Branch, Intramural Research Program, National Institute of Mental Health, Bethesda, Maryland, United States of America
Tags
actigraphyGitHub Events
Total
- Create event: 12
- Release event: 1
- Issues event: 2
- Watch event: 1
- Delete event: 3
- Issue comment event: 8
- Push event: 58
- Pull request review comment event: 8
- Pull request review event: 12
- Pull request event: 26
- Fork event: 1
Last Year
- Create event: 12
- Release event: 1
- Issues event: 2
- Watch event: 1
- Delete event: 3
- Issue comment event: 8
- Push event: 58
- Pull request review comment event: 8
- Pull request review event: 12
- Pull request event: 26
- Fork event: 1
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 1
- Total pull requests: 17
- Average time to close issues: 26 days
- Average time to close pull requests: 1 day
- Total issue authors: 1
- Total pull request authors: 4
- Average comments per issue: 0.0
- Average comments per pull request: 0.24
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 3
Past Year
- Issues: 1
- Pull requests: 16
- Average time to close issues: 26 days
- Average time to close pull requests: 1 day
- Issue authors: 1
- Pull request authors: 3
- Average comments per issue: 0.0
- Average comments per pull request: 0.25
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- nathaliaesper (1)
Pull Request Authors
- nathaliaesper (9)
- reindervdw-cmi (5)
- dependabot[bot] (2)
- pre-commit-ci[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- MishaKav/pytest-coverage-comment main composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- chartboost/ruff-action v1 composite
- codecov/codecov-action v3 composite
- python 3.11-buster build
- annotated-types 0.6.0
- ansi2html 1.9.1
- blinker 1.7.0
- certifi 2023.11.17
- cfgv 3.4.0
- charset-normalizer 3.3.2
- click 8.1.7
- colorama 0.4.6
- coverage 7.3.4
- dash 2.14.2
- dash-bootstrap-components 1.5.0
- dash-core-components 2.0.0
- dash-daq 0.5.0
- dash-html-components 2.0.0
- dash-table 5.0.0
- distlib 0.3.8
- filelock 3.13.1
- flask 3.0.0
- greenlet 3.0.2
- identify 2.5.33
- idna 3.6
- importlib-metadata 7.0.0
- iniconfig 2.0.0
- itsdangerous 2.1.2
- jinja2 3.1.2
- markupsafe 2.1.3
- mypy 1.7.1
- mypy-extensions 1.0.0
- nest-asyncio 1.5.8
- nodeenv 1.8.0
- numpy 1.26.2
- packaging 23.2
- pandas 2.1.4
- pdoc 14.2.0
- platformdirs 4.1.0
- plotly 5.18.0
- pluggy 1.3.0
- polars 0.19.19
- pre-commit 3.6.0
- pyarrow 14.0.2
- pydantic 2.5.2
- pydantic-core 2.14.5
- pydantic-settings 2.1.0
- pygments 2.17.2
- pytest 7.4.3
- pytest-cov 4.1.0
- pytest-mock 3.12.0
- python-dateutil 2.8.2
- python-dotenv 1.0.0
- pytz 2023.3.post1
- pyyaml 6.0.1
- rdata 0.9.1
- requests 2.31.0
- retrying 1.3.4
- ruff 0.1.8
- setuptools 69.0.2
- six 1.16.0
- sqlalchemy 2.0.23
- tenacity 8.2.3
- toml 0.10.2
- typing-extensions 4.9.0
- tzdata 2023.3
- urllib3 2.1.0
- virtualenv 20.25.0
- vulture 2.10
- werkzeug 3.0.1
- xarray 2023.12.0
- zipp 3.17.0
- dash ^2.13.0
- dash-bootstrap-components ^1.4.2
- dash-daq ^0.5.0
- numpy ^1.25.2
- pandas ^2.0.3
- plotly ^5.16.1
- polars ^0.19.19
- pyarrow ^14.0.1
- pydantic ^2.2.0
- pydantic-settings ^2.1.0
- python ~3.11
- rdata ^0.9
- sqlalchemy ^2.0.23
- JamesIves/github-pages-deploy-action v4 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- actions/checkout v4 composite
- docker/build-push-action v5.1.0 composite
- docker/login-action v3 composite
- docker/metadata-action v5.4.0 composite
- docker/setup-buildx-action v3 composite
- docker/setup-qemu-action v3 composite