YASA (Yet Another Spindle Algorithm): a Python package to analyze polysomnographic sleep recordings.
Minor release with one bugfix and several other improvements:
relative_prominence
parameters in :py:func:yasa.rem_detect
(#151)yasa.simulate_hypno
function to yasa.simulate_hypnogram
Hypnogram
class in public API. Hypnogram
will become the default method for manipulating hypnograms in YASA starting from v0.7.This is a minor release with one bugfix and one new function. Big shoutout to @remrama for his huge help on this new version!
Bugfix
Solved a bug in the spindles detection which resulted in no spindle being detected on some systems. See #107 and #115.
New functions
Added the yasa.simulate_hypno
function to generate a simulated hypnogram, primarily for testing purposes and tutorials. The hypnogram is simulated as a Markov sequence based on sleep stage transition probabilities. Transition probabilities can be user-defined or will default to those published in Metzner et al., 2021, Commun Biol (see Figure 5b). See #109 and #110
Improvements
ax
keyword-argument to yasa.plot_hypnogram
and removed figsize
. Now select figure aesthetics (e.g., size, dpi) by opening a matplotlib.axes.Axes
instance and passing to ax
. See PR #108yasa.plot_hypnogram
now draws the hypnogram withmatplotlib.pyplot.stairs
instead of matplotlib.pyplot.step
. See issue #106 and PR #108This releases implement several new functions. Please refer to the full changelog at: https://raphaelvallat.com/yasa/build/html/changelog.html#v0-6-2-august-2022
This release fixes a CRITICAL BUG with the spindles detection. Specifically, the yasa.spindles_detect() could return different results depending on the sampling rate of the data. For example, downsampling the data from 256 Hz to 128 Hz may have significantly reduced the number of detected spindles. As explained in issue 54, this bug was caused by a floating-point error in numpy.convolve() when calculating the soft spindle threshold. Tests seem to indicate that only certain sampling frequencies were impacted, such as 200 Hz, 256 Hz or 400 Hz. Other sampling frequencies such as 100 Hz and 500 Hz were seemingly not affected by this bug.
We recommend all users to upgrade to this new version ASAP and check any results obtained with the yasa.spindles_detect() function!
This is a MAJOR release with several API-breaking changes, new functions, bugfixes and a new section in the documentation.
IMPORTANT — The default behavior of coupling=True in yasa.sw_detect() has been changed: YASA now uses a ± 1 second window around the negative peak of the slow-waves (2 sec total) to calculate the coupling, instead of a ± 2 sec window. Overall, this tends to increase the ndPAC values because of the higher temporal specificity. To keep a 4-sec window, use coupling_params['time'] = 2
.
We’ve enabled the statistical thresholding in the ndPAC calculation. Practically, this means that events with a weak/unreliable coupling are assigned an ndPAC value of zero. Statistical thresholding can be disabled with coupling_params['p'] = None
.
Because of these changes, the coupling values are therefore not comparable with previous versions of YASA. Please make sure to re-run your analyses with the new default parameters.
This is a bugfix release. The latest pre-trained classifiers for yasa.SleepStaging were accidentally missing from the previous release. They have now been included in this release. We recommend all users to upgrade to this version with pip install –upgrade yasa
This is a major release with an important bugfix for the slow-waves detection as well as API-breaking changes in the automatic sleep staging module. Please read the full changelog here.
We recommend all users to upgrade to this version with pip install –upgrade yasa
.
New functions
Added yasa.topoplot(), a wrapper around mne.viz.plot_topomap(). See 15_topoplot.ipynb.
Enhancements
coupling=True
so make sure to homogenize your slow-waves detection pipeline across all nights in your dataset.This is a major release with several new functions, the biggest of which is the addition of an automatic sleep staging module (yasa.SleepStaging). This means that YASA can now automatically score the sleep stages of your raw EEG data. The classifier was trained and validated on more than 3000 nights from the National Sleep Research Resource (NSRR) website.
Briefly, the algorithm works by calculating a set of features for each 30-sec epochs from a central EEG channel (required), as well as an EOG channel (optional) and an EMG channel (optional). For best performance, users can also specify the age and the sex of the participants. Pre-trained classifiers are already included in YASA. The automatic sleep staging algorithm requires the LightGBM and entropy package.
For more details, please see: https://raphaelvallat.com/yasa/build/html/changelog.html
Major release with important changes in the output of the spindles, slow-waves and REMs detection. See full changelog at https://raphaelvallat.com/yasa/build/html/changelog.html