Literature DB >> 26150993

Sleep scoring made easy-Semi-automated sleep analysis software and manual rescoring tools for basic sleep research in mice.

M Kreuzer1, S Polta2, J Gapp3, C Schuler3, E F Kochs1, T Fenzl3.   

Abstract

Studying sleep behavior in animal models demands clear separation of vigilance states. Pure manual scoring is time-consuming and commercial scoring software is costly. We present a LabVIEW-based, semi-automated scoring routine using recorded EEG and EMG signals. This scoring routine is •designed to reliably assign the vigilance/sleep states wakefulness (WAKE), non-rapid eye movement sleep (NREMS) and rapid eye movement sleep (REMS) to defined EEG/EMG episodes.•straightforward to use even for beginners in the field of sleep research.•freely available upon request. Chronic recordings from mice were used to design and evaluate the scoring routine consisting of an artifact-removal, a scoring- and a rescoring routine. The scoring routine processes EMG and different EEG frequency bands. Amplitude-based thresholds for EEG and EMG parameters trigger a decision tree assigning each EEG episode to a defined vigilance/sleep state automatically. Using the rescoring routine individual episodes or particular state transitions can be re-evaluated manually. High agreements between auto-scored and manual sleep scoring could be shown for experienced scorers and for beginners quickly and reliably. With small modifications to the software, it can be easily adapted for sleep analysis in other animal models.

Entities:  

Keywords:  EEG; EMG; Semi-automated sleep scoring; Sleep scoring; Vigilance states

Year:  2015        PMID: 26150993      PMCID: PMC4487923          DOI: 10.1016/j.mex.2015.04.005

Source DB:  PubMed          Journal:  MethodsX        ISSN: 2215-0161


Method details

The presented sleep scoring routine enables fast and easy semi-automated definitions of the vigilance/sleep states wakefulness (WAKE), non-REM sleep (NREMS) and REM sleep (REMS), especially for beginners in this field. The underlying algorithms applied in the present program are based on the vigilance/sleep state classification algorithm introduced by Louis et al. for rats, modified for mice by Fenzl and co-workers [6], [3]. The program was written in LabVIEW 8.5 (National Instruments, Austin, TX, USA). Starting the sleep scoring software a graphical user interface GUI will be opened and the user can choose between three executable programs: A manual ARTIFACT DETECTION routine, the SLEEP SCORING routine for semi-automated sleep scoring and a RESCORING routine to enable manual re-evaluation of distinct automatically scored EEG/EMG sequences. In total, 14 mice were used for this study. All mice where kept in their home cages (26 cm × 26 cm with wood chips and nesting material) during the whole experiment under constant light/dark cycles (12/12 h; 220 lx in the light period) and constant temperature (24 °C ± 1 °C) within noise reduced recording chambers. Water and food was supplied ad libitum. All mice were allowed to recover from surgery for 14 days. Within that period all mice were also adapted to the laboratory light/dark cycles. After recovery, EEG and EMG recordings started 23 h a day for at least 3 consecutive days. The one hour gap (at the end of the dark period) after 23 h of recording and the beginning of the next 23 h recording was used for animal maintenance, if needed. The animals were surgically prepared under isoflurane anesthesia (Univentor 410 anesthesia unit, agnthós, Sweden) within a stereotactic frame (Angle Two Leica Biosystems, USA). After surgical tolerance was reached, the animals’ eyes were covered with eye ointment to prevent desiccating and each animal received Meloxicam (0.5 mg/kg) to reduce postoperative pain. The analgesic was additionally given into the water bottle (0.5 mg/kg) for 8 days following surgery. EEG and EMG electrodes were composed of gold wire with ball shaped endings of approximately 100 μm diameter and were surgically implanted in all animals. The electrodes were soldered on socked boards (Typ 861-87-008, preci-dip, Switzerland) that were used to connect the recording cable [7], [4]. The recording cable consisted of a headstage amplifier (1x amp., npi electronics, Germany), connected to a commutator (SL-10, slip-ring commutator, Dragonfly, USA). The commutator was balanced on a swivel equipped with a counter weight (custom made, Streicher, Austria). This design facilitated weight-neutral, free movements of the animals in all three dimensions within the home cage. Signals of two EEG electrodes, a ground electrode and a differential electrode together with two EMG signals were fed into individual amplifiers (type DPA-2FL, npi electronics, Germany). The amplification factor of the EEG and EMG recording was set to 1000. Before analog to digital conversion, EEG signals and EMG signals were band pass filtered to the 0.1–100 Hz range. Digital sampling rate was 250 Hz (Power 1401-3 AD-board and SPIKE2, Cambridge Electronic Design, UK). The EMG signals were additionally band pass-filtered online (40–90 Hz). All signals were stored for offline analysis. All experiments were conducted under the guidelines of national and international animal welfare protocols and were approved by the Bundesministerium für Wissenschaft, Forschung und Wirtschaft, Austria (BMWF-66.008/0011-II/3b/2013 and BMWFW-66.008/0011-WF/V/3b/2014).

Signal processing and data analysis

The scoring routines require individual data vectors (text file) for the EEG and EMG recordings. The scoring routine itself consists of three individual, although complementary parts, the ARTIFACT DETECTION, the semi-automated SLEEP SCORING and the manual RESCORING that can be selected via the graphical user interface (GUI). Within the user interface, the following parameters can be set: Sampling rate: The sampling rate of the EEG and EMG signals in Hz. Filter order: Filter order of the Butterworth band pass applied to the EEG. Filter settings: high and low cutoff frequencies are preset to 0.5–31.75 Hz [3] but can be adjusted if necessary. Block length: Length of the EEG episodes to be processed in seconds (see below for root mean square calculation) File tag: Individual markers to individualize the generated artifact, autoscoring and rescoring vectors.

Scoring process

A complete scoring procedure starts with the ARTIFACT DETECTION and continues with the semi-automated SLEEP SCORING, followed by the manual RESCORING routine. Data inputs and outputs for each routine are specified in Table 1
Table 1

Required inputs and created outputs for the scoring routines.

RoutineInputOutput
ARTIFACTDETECTION(1) EMG data vector (raw data file)(2) EEG data vector (raw data file)Artifact vectorfile annex: _artifact



SLEEPSCORING(1) EMG data vector (_rms/ RMS- filtered EMG data vector)(2) Artifact vector(3) EEG data vector (raw data file)Autoscored matrixfile annex: _autoscored



RESCORING(1) EMG data vector (raw data file)(2) EEG data vector (raw data file)(3) Autoscored matrixRescored vectorfile annex: _rescored
In order to start a scoring process, the user opens the “Scoring-Routine” GUI. There, the user can set sampling rate, block length and alter filter settings if necessary. The artifact detection, sleep scoring and rescoring routine can be started from the GUI by clicking the corresponding button. Fig. 1 shows a screenshot of the “Scoring-Routine”.
Fig. 1

Screenshot of the Scoring-Routine GUI. The user can adjust the general settings and start the artifact, scoring or rescoring programs.

ARTIFACT DETECTION (semi-automated)

To eliminate EEG/EMG artifacts, first the EMG data vector and then the EEG data vector must be selected and fed into the ARTIFACT DETECTION routine. This routine eliminates short artifacts as well as extended artifacts, frequently caused by heavy movements of the animal. Short artifacts can be eliminated by manually setting individual maximum and minimum graphical thresholds in the EMG and EEG vector plots. All amplitudes above the maximum threshold and all amplitudes below the minimum threshold will automatically be defined as an artifact. For the elimination of extended artifacts the user can select the affected segment of the EEG data vector. By clicking the “Long-term” artifact button the entire EEG segment displayed is defined as artifact. All “artifact” episodes are excluded from the data vectors for further analysis, labeled with NaN. A visualized scheme of the artifact detection process is shown in Fig. 2. Fig. 3 shows a screenshot of the artifact detection GUI.
Fig. 2

The user can define short (top) and long-term artifacts (bottom) with the ARTIFACT DETECTION routine. (1) For the removal of spike-like (short) artifacts, the user can set upper and lower amplitude threshold cursors. All data points outside these cursors are set to NaN and hence excluded from the sleep scoring analysis. (2) In order to remove long term artifacts, the user defines the onset and end of such an artifact by zooming into the EEG or EMG trace. In line with step a, all visible data points are set to NaN.

Fig. 3

Screenshot of the ARTIFACT DETECTION GUI. For spike removal, the user can set the orange horizontal cursors as upper and lower threshold for artifact detection. A click on “Spike Artefact” removes all spikes defined by the threshold as shown in Fig. 2. The user can further zoom into the EEG or EMG trace. A click on “Long time artifact” sets all visible data points to NaN.

SLEEP SCORING (semi-automated)

The semi-automated sleep scoring is based on individual thresholds to be set for processed EEG and EMG recordings after loading the EMG vector (_rms), the artifact vector (_artifact) and the EEG vector. After loading the vectors, the routine automatically performs the following processing steps: 1st step: EEG filtering to the 0.5–31.75 Hz frequency band by a 3rd order Butterworth filter before it is plotted in the active “EEG window” (parameter 1) of the SLEEP SCORING GUI. 2nd step: Additional EEG filtering to particular frequency bands according to the articles of Louis et al. and [6] Fenzl et al. [3]: (δ: 0.5–5 Hz; θ: 6–9 Hz; α: 10–15 Hz; μ: 16–22.75 Hz and β: 23–31.75 Hz). 3rd step: Calculation of the root mean squares (RMS) for each of the above mentioned filtered signals (RMS; δRMS, θRMS, αRMS, μRMS, and βRMS) and for the raw EMG vector (EMGRMS) from strictly non-overlapping episodes. The user can define the episode length with the “Block length in s” button of the SLEEP SCORING GUI. RMS calculation is according to following formula:N is the number of data points in any given episode and represents the discrete amplitude values in a given episode. 4th step: SLEEP SCORING creates additional “DELTA and THETA graphs” (parameter 2 and parameter 3), calculated on the following equations [6], [3]:The EMGRMS is the fourth parameter used for sleep analysis by plotting the function exp(EMGRMS) in the “EMG activity” window within the GUI, locked to the corresponding episodes of the EEG window. In each of these windows (DELTA, THETA and EMGRMS) the user can set a horizontal threshold cursor. These thresholds trigger a decision tree, published by Louis et al. [6], to define the sleep stage for the corresponding EEG episode. Fig. 4 shows the individual steps of EEG and EMG band pass filtering, RMS calculation and assignments of sleep stages based on the decision tree. Fig. 5 displays a screenshot of the GUI for semi-automated sleep scoring
Fig. 4

In the (semi-) automated SLEEP SCORING routine following steps are performed: (1) The EEG is filtered to different frequency bands. (2) For each frequency band and the EMG data vector the RMS for non-overlapping episodes of the block length defined in the GUI is calculated. (3) EEG parameters DELTA and THETA are calculated according to the corresponding equations. (4) Decision tree for sleep stage assignments including an example for the manually set thresholds.

Fig. 5

Screenshot of the semi-automated SLEEP SCORING GUI. The three graphs on the right side show the RMS parameters that are used for the decision algorithm. The user can manually set the (orange) thresholds. A click on “start scoring” starts the scoring algorithm. This procedure can be repeated and the scoring result is not saved until “Save Scored Data” is clicked. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

Decision 1(performed by the user): Vigilance state AWAKE vs. SLEEP (Decision is depending on the EMGRMS threshold). All episodes within the “EMG activity” window with exp(EMGRMS) values above the user-defined threshold are automatically indicated as AWAKE. All episodes with exp(EMGRMS) values below the user-defined threshold are automatically indicated as NOT AWAKE (low or no EMG activity equals sleep; quiet wakefulness, also indicated by low or no EMG activity may be evaluated within the RESCORING routine manually). For all sub-threshold exp(EMGRMS) episodes the sleep-state NREMS or REMS has to be defined as follows. Decision 2 (performed by the user): NREMS vs. REMS (Decision is depending on the DELTA and THETA thresholds). All episodes indicated as NOT AWAKE by decision 1 are subject to further evaluation by applying individual thresholds for DELTA and THETA assigning REMS or NREMS. Episodes are defined as REMS when the corresponding DELTA function is below its manually set threshold while the synchronized THETA function is above its manually set threshold. All other episodes, which have not been assigned to AWAKE or REMS are defined as NREMS automatically. The autoscored matrix consists of four columns: 1st column: (semi-) autoscored behavioral states, assigned to each individual epoch (AWAKE, NREMS, REMS) 2nd column: DELTA values 3rd column: THETA values 4th column: EMGRMS values

RESCORING (manually)

This routine provides the opportunity to manually select and rescore/correct each episode individually by loading the (semi-) autoscored matrix in the RESCORING routine together with the raw EMG and EEG files. From a “list box” menu all previously assigned vigilance states and/or all possible state transitions can be selected and plotted for re-evaluation. For the selected epochs, the EMG and EEG raw signal is displayed and the corresponding DELTA, THETA and EMGRMS are marked with a cursor. The user can change each (semi-) autoscored behavioral state (AWAKE, NREMS, REMS) in the GUI. Re-evaluated behavioral states are assigned to each individual epoch (AWAKE, NREMS, REMS). Fig. 6 presents the GUI of the rescoring routine.
Fig. 6

Screenshot of the RESCORING GUI. The (semi-) automated scoring vector can be manually corrected with this routine. Individual vigilance states and state transitions can be selected using the listbox on the left. The central section in the “filtered EEG” and “EMG” windows can be re-evaluated by clicking on the “WAKE”, “NREMS” or “REMS” button. A click on “Save Rescored” saves the changes applied.

Additional information

The sleep scoring routine represents a straight forward and fast approach to detect the behavioral states AWAKE, NREMS and REMS, based on EEG and EMG recordings from mice. The user can also score sleep behavior of rats and other laboratory animals after adaption of the selected frequency bands and its corresponding equations that underlie the DELTA and THETA calculation. The sleep scoring routines are especially designed for laboratories whose research focus is not mainly sleep research, although the tools can easily be adapted and extended to a more in-depth analysis as required for evaluation of state transitions, state durations or Fast Fourier analysis of particular frequency bands (e.g., slow wave activity). By keeping the presented tool straightforward, basic sleep analysis can now be included as an additional readout to complex behavioral, circadian dependent questions related to chronopharmacology, chronotoxicology, chronobiology, learning and memory etc. We performed a random sample test to evaluate the performance of our sleep scoring tool. Two very experienced scorers semi-automatically and independently analyzed recordings of 14 animals from our laboratory data pool and manually rescored five of these (semi-) automatically generated data files. The agreement between the two scorers’ semi-automatic scoring results was 90.8% in average (n = 14 min: 84.8%; max: 95.5%) and agreement after sample rescoring was 91.1% (n = 5; min: 85.9%; max: 95.4%). Cohen’s Kappa was 0.850 (CI: 0.847–0.851) for the autoscored data as well as 0.851 (0.847–0.854) for the rescored data. Results indicate excellent (independent) agreement between both scorers. The fraction of rescored episodes was 5.0% (min: 2.1%; max: 9.0%). The agreement of autoscoring versus manual rescoring was 95.0% (SEM: 0.67%) which is well in the range of other automated sleep scoring approaches described in literature as presented in Table 2.
Table 2

Rate of agreement between automated and manual sleep scoring represented in literature.

AuthorAgreementAnimal
auto- vs. manual scoringInter-rater
Rytkönen[8]93%88–92%Ratmouse
Stephenson[9]87-92%Rat
Gross[5]80%83%Rat
Louis[6]88%88%Rat
Costa-Miserachs[2]94%96%Rat
Benington[1]88–91%95%Rat
The LabVIEW routine as well as a “quick start” manual can be obtained from the authors. The LabVIEW Runtime engine is freely available from the provider (National Instruments, Austin, TX, USA, http://www.ni.com/support/).
  8 in total

1.  Sleep homeostasis and the function of sleep.

Authors:  J H Benington
Journal:  Sleep       Date:  2000-11-01       Impact factor: 5.849

2.  Design and validation of a computer-based sleep-scoring algorithm.

Authors:  Rhain P Louis; James Lee; Richard Stephenson
Journal:  J Neurosci Methods       Date:  2004-02-15       Impact factor: 2.390

3.  Automated sleep staging in rat with a standard spreadsheet.

Authors:  David Costa-Miserachs; Isabel Portell-Cortés; Meritxell Torras-Garcia; Ignacio Morgado-Bernal
Journal:  J Neurosci Methods       Date:  2003-11-30       Impact factor: 2.390

4.  Fully automated sleep deprivation in mice as a tool in sleep research.

Authors:  Thomas Fenzl; Christoph P N Romanowski; Cornelia Flachskamm; Karlheinz Honsberg; Erwin Boll; Arnold Hoehne; Mayumi Kimura
Journal:  J Neurosci Methods       Date:  2007-07-24       Impact factor: 2.390

5.  Automated analysis of sleep-wake state in rats.

Authors:  Richard Stephenson; Aimee M Caron; Daniel B Cassel; Jennifer C Kostela
Journal:  J Neurosci Methods       Date:  2009-08-22       Impact factor: 2.390

6.  Automated sleep scoring in rats and mice using the naive Bayes classifier.

Authors:  Kirsi-Marja Rytkönen; Jukka Zitting; Tarja Porkka-Heiskanen
Journal:  J Neurosci Methods       Date:  2011-08-22       Impact factor: 2.390

7.  Open-source logic-based automated sleep scoring software using electrophysiological recordings in rats.

Authors:  Brooks A Gross; Christine M Walsh; Apurva A Turakhia; Victoria Booth; George A Mashour; Gina R Poe
Journal:  J Neurosci Methods       Date:  2009-07-15       Impact factor: 2.390

8.  Sleep disturbances in highly stress reactive mice: modeling endophenotypes of major depression.

Authors:  Thomas Fenzl; Chadi Touma; Christoph Pn Romanowski; Jörg Ruschel; Florian Holsboer; Rainer Landgraf; Mayumi Kimura; Alexander Yassouridis
Journal:  BMC Neurosci       Date:  2011-03-24       Impact factor: 3.288

  8 in total
  10 in total

1.  Supervised and unsupervised machine learning for automated scoring of sleep-wake and cataplexy in a mouse model of narcolepsy.

Authors:  Ioannis Exarchos; Anna A Rogers; Lauren M Aiani; Robert E Gross; Gari D Clifford; Nigel P Pedersen; Jon T Willie
Journal:  Sleep       Date:  2020-05-12       Impact factor: 5.849

2.  Breathing control center neurons that promote arousal in mice.

Authors:  Kevin Yackle; Lindsay A Schwarz; Kaiwen Kam; Jordan M Sorokin; John R Huguenard; Jack L Feldman; Liqun Luo; Mark A Krasnow
Journal:  Science       Date:  2017-03-30       Impact factor: 47.728

3.  Automatic Driver Drowsiness Detection Using Artificial Neural Network Based on Visual Facial Descriptors: Pilot Study.

Authors:  Papangkorn Inkeaw; Pimwarat Srikummoon; Jeerayut Chaijaruwanich; Patrinee Traisathit; Suphakit Awiphan; Juthamas Inchai; Ratirat Worasuthaneewan; Theerakorn Theerakittikul
Journal:  Nat Sci Sleep       Date:  2022-09-14

4.  Distinct Parameters in the EEG of the PLP α-SYN Mouse Model for Multiple System Atrophy Reinforce Face Validity.

Authors:  Lorenz Härtner; Tobias W M Keil; Matthias Kreuzer; Eva Maria Fritz; Gregor K Wenning; Nadia Stefanova; Thomas Fenzl
Journal:  Front Behav Neurosci       Date:  2017-01-10       Impact factor: 3.558

5.  Accurate discrimination of the wake-sleep states of mice using non-invasive whole-body plethysmography.

Authors:  Stefano Bastianini; Sara Alvente; Chiara Berteotti; Viviana Lo Martire; Alessandro Silvani; Steven J Swoap; Alice Valli; Giovanna Zoccoli; Gary Cohen
Journal:  Sci Rep       Date:  2017-01-31       Impact factor: 4.379

6.  A novel unsupervised analysis of electrophysiological signals reveals new sleep substages in mice.

Authors:  Vasiliki-Maria Katsageorgiou; Diego Sona; Matteo Zanotto; Glenda Lassi; Celina Garcia-Garcia; Valter Tucci; Vittorio Murino
Journal:  PLoS Biol       Date:  2018-05-29       Impact factor: 8.029

7.  Sleep/Wake Behavior and EEG Signatures of the TgF344-AD Rat Model at the Prodromal Stage.

Authors:  Matthias Kreuzer; Glenda L Keating; Thomas Fenzl; Lorenz Härtner; Christopher G Sinon; Ihab Hajjar; Vincent Ciavatta; David B Rye; Paul S García
Journal:  Int J Mol Sci       Date:  2020-12-05       Impact factor: 5.923

8.  Altered sleep behavior in a genetic mouse model of impaired fear extinction.

Authors:  Eva Maria Fritz; Matthias Kreuzer; Alp Altunkaya; Nicolas Singewald; Thomas Fenzl
Journal:  Sci Rep       Date:  2021-04-26       Impact factor: 4.379

9.  Optimization of real-time analysis of sleep-wake cycle in mice.

Authors:  Stephen Thankachan; Andrei Gerashchenko; Ksenia V Kastanenka; Brian J Bacskai; Dmitry Gerashchenko
Journal:  MethodsX       Date:  2022-08-08

10.  Robust, automated sleep scoring by a compact neural network with distributional shift correction.

Authors:  Zeke Barger; Charles G Frye; Danqian Liu; Yang Dan; Kristofer E Bouchard
Journal:  PLoS One       Date:  2019-12-13       Impact factor: 3.240

  10 in total

北京卡尤迪生物科技股份有限公司 © 2022-2023.