Skip to main content
medRxiv
  • Home
  • About
  • Submit
  • ALERTS / RSS
Advanced Search

SleePyPhases: A Workflow Framework for Sleep Data Harmonization, Analysis and Machine Learning

View ORCID ProfileFranz Ehrlich, Sara Bäcker, View ORCID ProfileMartin Schmidt, Hagen Malberg, Martin Sedlmayr, Miriam Goldammer
doi: https://doi.org/10.64898/2026.01.14.26344163
Franz Ehrlich
1Institute for Medical Informatics and Biometry, Faculty of Medicine and University Hospital Carl Gustav Carus, TUD Dresden University of Technology
2Institute of Biomedical Engineering, TUD Dresden University of Technology
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Franz Ehrlich
  • For correspondence: franz.ehrlich{at}tu-dresden.de
Sara Bäcker
1Institute for Medical Informatics and Biometry, Faculty of Medicine and University Hospital Carl Gustav Carus, TUD Dresden University of Technology
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Martin Schmidt
2Institute of Biomedical Engineering, TUD Dresden University of Technology
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Martin Schmidt
Hagen Malberg
2Institute of Biomedical Engineering, TUD Dresden University of Technology
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Martin Sedlmayr
1Institute for Medical Informatics and Biometry, Faculty of Medicine and University Hospital Carl Gustav Carus, TUD Dresden University of Technology
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Miriam Goldammer
1Institute for Medical Informatics and Biometry, Faculty of Medicine and University Hospital Carl Gustav Carus, TUD Dresden University of Technology
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • Abstract
  • Full Text
  • Info/History
  • Metrics
  • Data/Code
  • Preview PDF
Loading

Abstract

Data-driven sleep research relies on polysomnography data from various public repositories and vendor systems. Yet the lack of standardized access methods creates substantial barriers to multi-dataset research, method reuse, and reproducibility. We present SleePyPhases, an open-source Python framework providing unified access to multiple sleep data repositories. It offers integrated data harmonization, configuration-based preprocessing, and the development of machine learning pipelines. The framework unifies channel naming, annotation semantics, and data formats across several public repositories (including SHHS, MESA, MrOS, PhysioNet, and SleepEDF) and commercial vendor formats (Philips Alice and Somnomedics Domino). We validated the framework by reproducing five published sleep analysis studies covering diverse datasets, sleep scoring tasks (sleep staging, arousal, leg movement, respiratory event detection), preprocessing methods (signal preprocessing and spectrograms), machine learning methods (supervised and unsupervised learning), and model architectures (convolutional, recurrent, and transformer networks). Four reproductions achieved near-identical results, confirming data fidelity and methodological flexibility. SleePyPhases is open-source and provides a foundation for reproducible sleep research, enabling researchers to focus on scientific questions rather than data infrastructure.

Competing Interest Statement

The authors have declared no competing interest.

Funding Statement

Yes

Author Declarations

I confirm all relevant ethical guidelines have been followed, and any necessary IRB and/or ethics committee approvals have been obtained.

Yes

The details of the IRB/oversight body that provided approval or exemption for the research described are given below:

This study did not require Institutional Review Board approval because it involved secondary analysis of publicly available, de-identified data.

I confirm that all necessary patient/participant consent has been obtained and the appropriate institutional forms have been archived, and that any patient/participant/sample identifiers included were not known to anyone (e.g., hospital staff, patients or participants themselves) outside the research group so cannot be used to identify individuals.

Yes

I understand that all clinical trials and any other prospective interventional studies must be registered with an ICMJE-approved registry, such as ClinicalTrials.gov. I confirm that any such study reported in the manuscript has been registered and the trial registration ID is provided (note: if posting a prospective study registered retrospectively, please provide a statement in the trial ID field explaining why the study was not registered in advance).

Yes

I have followed all appropriate research reporting guidelines, such as any relevant EQUATOR Network research reporting checklist(s) and other pertinent material, if applicable.

Yes

Data Availability

All source code is made available under the MIT License on GitLab: - **SleePyPhases Framework**: (https://gitlab.com/sleep-is-all-you-need/SleePyPhases) - Main framework implementation - **Sleep Harmonizer**: (https://gitlab.com/sleep-is-all-you-need/sleep-harmonizer) - PSG data harmonization plugin - **Reproduction Studies**: (https://gitlab.com/sleep-is-all-you-need/reproduce) - All reproduction experiments as sub-projects - **pyPhases Core**: (https://gitlab.com/sleep-is-all-you-need/pyphases) - Core pyPhases framework and all related projects including pyPhasesRecordLoader and dataset-specific record loaders (SHHS, MESA, MrOS, etc.) The SHHS, MESA and MrOS datasets for validating the framework are available from the National Sleep Research Resource website (https://sleepdata.org/datasets), while the PhysioNet 2018 and Sleep-EDF datasets are available from Physionet (https://physionet.org/).

https://physionet.org/

https://sleepdata.org/datasets

https://gitlab.com/sleep-is-all-you-need/SleePyPhases

https://gitlab.com/sleep-is-all-you-need/sleep-harmonizer

https://gitlab.com/sleep-is-all-you-need/reproduce

https://gitlab.com/sleep-is-all-you-need/pyphases

Copyright 
The copyright holder for this preprint is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. It is made available under a CC-BY 4.0 International license.
Back to top
PreviousNext
Posted January 16, 2026.
Download PDF
Data/Code
Email

Thank you for your interest in spreading the word about medRxiv.

NOTE: Your email address is requested solely to identify you as the sender of this article.

Enter multiple addresses on separate lines or separate them with commas.
SleePyPhases: A Workflow Framework for Sleep Data Harmonization, Analysis and Machine Learning
(Your Name) has forwarded a page to you from medRxiv
(Your Name) thought you would like to see this page from the medRxiv website.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Share
SleePyPhases: A Workflow Framework for Sleep Data Harmonization, Analysis and Machine Learning
Franz Ehrlich, Sara Bäcker, Martin Schmidt, Hagen Malberg, Martin Sedlmayr, Miriam Goldammer
medRxiv 2026.01.14.26344163; doi: https://doi.org/10.64898/2026.01.14.26344163
Twitter logo Facebook logo LinkedIn logo Mendeley logo
Citation Tools
SleePyPhases: A Workflow Framework for Sleep Data Harmonization, Analysis and Machine Learning
Franz Ehrlich, Sara Bäcker, Martin Schmidt, Hagen Malberg, Martin Sedlmayr, Miriam Goldammer
medRxiv 2026.01.14.26344163; doi: https://doi.org/10.64898/2026.01.14.26344163

Citation Manager Formats

  • BibTeX
  • Bookends
  • EasyBib
  • EndNote (tagged)
  • EndNote 8 (xml)
  • Medlars
  • Mendeley
  • Papers
  • RefWorks Tagged
  • Ref Manager
  • RIS
  • Zotero
  • Tweet Widget
  • Facebook Like
  • Google Plus One

Subject Area

  • Health Informatics
Subject Areas
All Articles
  • Addiction Medicine (576)
  • Allergy and Immunology (867)
  • Anesthesia (306)
  • Cardiovascular Medicine (4480)
  • Dentistry and Oral Medicine (449)
  • Dermatology (385)
  • Emergency Medicine (614)
  • Endocrinology (including Diabetes Mellitus and Metabolic Disease) (1528)
  • Epidemiology (15276)
  • Forensic Medicine (31)
  • Gastroenterology (1133)
  • Genetic and Genomic Medicine (6643)
  • Geriatric Medicine (671)
  • Health Economics (1006)
  • Health Informatics (4602)
  • Health Policy (1378)
  • Health Systems and Quality Improvement (1622)
  • Hematology (544)
  • HIV/AIDS (1275)
  • Infectious Diseases (except HIV/AIDS) (15959)
  • Intensive Care and Critical Care Medicine (1110)
  • Medical Education (626)
  • Medical Ethics (147)
  • Nephrology (674)
  • Neurology (6692)
  • Nursing (346)
  • Nutrition (1006)
  • Obstetrics and Gynecology (1152)
  • Occupational and Environmental Health (961)
  • Oncology (3369)
  • Ophthalmology (988)
  • Orthopedics (370)
  • Otolaryngology (421)
  • Pain Medicine (437)
  • Palliative Medicine (131)
  • Pathology (668)
  • Pediatrics (1703)
  • Pharmacology and Therapeutics (699)
  • Primary Care Research (717)
  • Psychiatry and Clinical Psychology (5494)
  • Public and Global Health (9284)
  • Radiology and Imaging (2223)
  • Rehabilitation Medicine and Physical Therapy (1375)
  • Respiratory Medicine (1201)
  • Rheumatology (598)
  • Sexual and Reproductive Health (720)
  • Sports Medicine (535)
  • Surgery (720)
  • Toxicology (100)
  • Transplantation (290)
  • Urology (266)