raphaelvallat / yasa

YASA (Yet Another Spindle Algorithm): a Python package to analyze polysomnographic sleep recordings.
https://raphaelvallat.com/yasa/
BSD 3-Clause "New" or "Revised" License
417 stars 113 forks source link

Invalid REM latency #149

Closed raphaelvallat closed 8 months ago

raphaelvallat commented 1 year ago

From https://github.com/raphaelvallat/yasa/discussions/148

Latencies: latencies of sleep stages from the beginning of the record --> my question is: REM latency should be the time from sleep onset to first epoch of REM according to the AASM guidelines. Is REM latency calculated like this, or as time from the beginning of the record?

As of now, "Lat_REM" returned by YASA is the latency from the beginning of the record to first epoch of sleep, which is consistent with other sleep stages. One can easily calculate the AASM REM latency by subtracting the SOL. However, this should be made more explicit in the documentation of the function.

raphaelvallat commented 8 months ago

Done in https://github.com/raphaelvallat/yasa/commit/58369f95751724101af8330337277e4ae0795d9d