Sleep Cycles Delimiter
Module name: SleepCyclesDelimiter
Package: CEAMSModules 7.4.0
Version: 2.4.0
Overview
Compute the sleep cycles. Creates and appends events with group: “cycles” and name: “cycle number” ex.1.
Cycle definition: The cycle starts with a nrem period. The nrem period ends with a rem stage. The rem period ends when there is 15 mins without a rem stage. The end of the rem period is updated to the last rem stage or the start of the following nrem period.
Inputs
Input |
Format |
Default |
Description |
|---|---|---|---|
|
pandas DataFrame |
— |
List of events, including sleep stages (columns=[‘group’,’name’,’start_sec’,’duration_sec’,’channels’]).
|
|
dict |
None |
Dictionary of options to define the cycles.
{‘defined_option’: ‘Minimum Criteria’
‘Include_SOREMP’ : ‘1’
‘Include_last_incompl’ : ‘1’
‘Include_all_incompl’ : ‘1’
‘dur_ends_REMP’ : ‘15’
‘NREM_min_len_first’: ‘0’
‘NREM_min_len_mid_last’: ‘15’
‘NREM_min_len_val_last’: ‘0’
‘REM_min_len_first’: ‘0’
‘REM_min_len_mid’: ‘0’
‘REM_min_len_last’: ‘0’
‘mv_end_REMP’: ‘0’
‘sleep_stages’: ‘N1, N2, N3, R’
‘details’: ‘Adjust options based on minimum criteria.’}
|
|
string |
None |
Label to identify the current recording |
Outputs
Output |
Format |
Description |
|---|---|---|
|
pandas DataFrame |
List of events (columns=[‘group’,’name’,’start_sec’,’duration_sec’,’channels’]) |
|
Dict |
Options used to define the cycles
{‘defined_option’:’Minimum Criteria’
‘defined_option’:’Minimum Criteria’
‘Include_SOREMP’ : ‘1’
‘Include_last_incompl’ : ‘1’
‘Include_all_incompl: : ‘1’
‘dur_ends_REMP’ : ‘15’
‘NREM_min_len_first’:’0’
‘NREM_min_len_mid_last’:’15’
‘NREM_min_len_val_last’:’0’
‘REM_min_len_first’:’0’
‘REM_min_len_mid’:’0’
‘REM_min_len_last’:’0’
‘mv_end_REMP’:’0’
‘sleep_stages’:’N1, N2, N3, R’
‘details’: ‘Adjust options based on minimum criteria.’}
|
|
list |
The list of sleep cycle in epoch (one cycle per row).
Epoch start and end are inclusive and start to 0.
[((NREM start, NREM stop),(REM start, REM stop))
((NREM start, NREM stop),(REM start, REM stop))
…]
|
|
list |
The list of REM period in epoch (one cycle per row).
Epoch start and end are inclusive and start to 0.
[(REM start, REM stop))
((REM start, REM stop))
…]
|
|
pandas DataFrame |
List of NREM and REM periods (columns=[‘group’,’name’,’start_sec’,’duration_sec’,’channels’])
where the group is the input label.
|
Usage in a process
Open Dev Tools -> New process in Snooz.
In the Module Library, find Sleep Cycles Delimiter under the Hypnogram Analysis category.
Drag the module onto the process canvas.
Connect the required inputs from upstream modules (or set values in the Settings tab).
Connect outputs to downstream modules as needed.
Double-click the module to configure parameters in the Settings tab.
Run the process and inspect results in the Results tab.
Note
For general guidance on building processes with modules, see Explore examples.