SleepEEGpy: a Python-based software “wrapper” package to organize preprocessing, analysis, and visualization of sleep EEG data

G. Belonosov,R Falach,J.F. Schmidig,M. Aderka,V. Zhelezniakov,R. Shani-Hershkovich,E. Bar,Y Nir
DOI: https://doi.org/10.1101/2023.12.17.572046
2024-03-06
Abstract:Sleep research uses electroencephalography (EEG) to infer brain activity in health and disease. Beyond standard sleep scoring, there is increased interest in advanced EEG analysis that require extensive preprocessing to improve the signal-to-noise ratio, and dedicated analysis algorithms. While many EEG software packages exist, sleep research has specific needs that require dedicated tools (e.g. particular artifacts, event detection). Currently, sleep investigators use different libraries for specific tasks in a ‘fragmented’ configuration that is inefficient, prone to errors, and requires the learning of multiple software environments. This leads to a high initial complexity, creating a crucial barrier for beginners in sleep research. Here, we present SleepEEGpy, an open-source Python software “wrapper” package to facilitate sleep EEG data preprocessing and analysis. SleepEEGpy builds upon MNE-Python, YASA, and SpecParam tools to provide an all-in-one, beginner-friendly package for comprehensive yet straightforward sleep EEG research including (i) cleaning, (ii) independent component analysis, (iii) detection of sleep events, (iv) analysis of spectral features, and associated visualization tools. A dashboard visualization tool provides an overview to evaluate data and its preprocessing, which can be useful as an initial step prior to detailed analysis. We demonstrate the SleepEEGpy pipeline and its functionalities by applying it to overnight high-density EEG data in healthy participants, revealing multiple characteristic activity signatures typical of each vigilance state. These include alpha oscillations in wakefulness, sleep spindle and slow wave activities in NREM sleep, and theta activity in REM sleep. We hope that this software will be embraced and further developed by the sleep research community, and constitute a useful entry point tool for beginners in sleep EEG research.
Neuroscience
What problem does this paper attempt to address?