sleep_study
sleep_study copied to clipboard
Starter code for using NCH Sleep DataBank
Sleep study data analysis
If you find this code useful, please cite:
Lee H, Li B, DeForte S, Splaingard M, Huang Y, Chi Y, & Lin S. "A large collection of real-world pediatric sleep studies ". Scientific Data 9, 421 (2022). PDF
The NCH Sleep DataBank can be accessed from https://sleepdata.org/datasets/nchsdb and https://physionet.org/content/nch-sleep/.
AHI (Apnea Hypopnea Index)
We have not calculated AHI from our side, but we think it should be straightforward to calculate it from the annotations file. The annotations (.tsv) files look like this example https://www.nature.com/articles/s41597-022-01545-6/tables/4. So calculating AHI for a given sleep study should be doable by:
- counting how many words containing 'hyponea' or 'apnea' appear in the 'Description' column.
- counting how many times 'Sleep stage R', 'Sleep stage N1', 'Sleep stage N2', 'Sleep stage N3' appear in the 'Description' column -> multiply this number by 30 seconds to get the Total Sleep Time.
- divide #1 by #2 to get the AHI for one patient in one sleep study.
- Originally, we incorrectly suggested counting occurences of 'Sleep stage W' into Total Sleep Time. We thank S. Haimov for bringing it to our attention. See https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4246141/ and https://www.sleep.pitt.edu/wp-content/uploads/2020/03/The-AASM-Manual-for-Scoring-of-Sleep-and-Associated-Events-2007-.pdf for more definitions.