yasa.SWResults.find_cooccurring_spindles#

SWResults.find_cooccurring_spindles(spindles, lookaround=1.2)[source]#

Given a spindles detection summary dataframe, find slow-waves that co-occur with sleep spindles.

Added in version 0.6.0.

Parameters:
spindlespandas.DataFrame

Output dataframe of yasa.SpindlesResults.summary.

lookaroundfloat

Lookaround window, in seconds. The default is +/- 1.2 seconds around the negative peak of the slow-wave, as in [1]. This means that YASA will look for a spindle in a 2.4 seconds window centered around the downstate of the slow-wave.

Returns:
_eventspandas.DataFrame

The slow-wave detection is modified IN-PLACE (see Notes). To see the updated dataframe, call the yasa.SWResults.summary method.

Notes

From [1]:

“SO–spindle co-occurrence was first determined by the number of spindle centers occurring within a ±1.2-sec window around the downstate peak of a SO, expressed as the ratio of all detected SO events in an individual channel.”

This function adds three columns to the output detection dataframe:

  • CooccurringSpindle: a boolean column (True / False) that indicates whether the given slow-wave co-occur with a sleep spindle.

  • CooccurringSpindlePeak: the timestamp of the peak of the co-occurring, in seconds from beginning of recording. Values are set to np.nan when no co-occurring spindles were found.

  • DistanceSpindleToSW: The distance in seconds from the center peak of the spindles and the negative peak of the slow-waves. Negative values indicate that the spindles occured before the negative peak of the slow-waves. Values are set to np.nan when no co-occurring spindles were found.

References

[1] (1,2)

Kurz, E. M., Conzelmann, A., Barth, G. M., Renner, T. J., Zinke, K., & Born, J. (2021). How do children with autism spectrum disorder form gist memory during sleep? A study of slow oscillation–spindle coupling. Sleep, 44(6), zsaa290.