This repository contains Python code to reproduce the results and figures of:
- Vallat, Shah and Walker(2023). Coordinated human sleeping brainwaves map peripheral body glucose homeostasis. Cell Reports Medicine.
Data and Code Availability: The CFS dataset can be obtained, with the appropriate permissions, and for non-commercial use, at https://sleepdata.org/datasets/cfs. The MESA dataset can be obtained, with the appropriate permissions, through the BioLINCC repository at: https://biolincc.nhlbi.nih.gov/studies/mesa/. In addition to the public access repository, interested investigators may also access the data through the MESA Coordinating Center at the University of Washington. Use of the data via this mechanism is overseen by standard MESA policies and procedures, which assure that participant consent is honored. Additional information can be found at: https://www.mesa-nhlbi.org/.
Lead Contact: Further information and requests for resources should be directed to the lead contact, Dr. Raphael Vallat ([email protected])
Calculate the SO-spindles (sigma) coupling from the PSG recording.
Calculate overnight HRV metrics from the PSG recording.
Calculates the sleep statistics from the hypnogram.
Calculates the EEG spectral power from the PSG recording.
These notebooks combine the different data streams into a single dataframe. Specifically, the following steps are applied:
- Concatenate the demographics & health, coupling, spectral power and HRV data
- Remove participants <15 yrs old (not applicable in MESA)
- Preprocessing: outlier removal and data transformation
- Calculate the HOMA variables
- Calculate and plot the correlation between coupling and glucose, adjusted for age (partial correlation)
- Export
df_concat_R_1sec_[CFS/MESA].csv
, the main spreadsheet that will be used for subsequent analyses
Main statistical analysis pipeline, written in R.
Generate tables for CFS and MESA datasets with descriptive statistics.
The Python/R code to generate the figures of the paper can be found in:
- Figure 1A:
Fig_ERGCPAC.ipynb
- Figure 1B:
02_data_correlation_CFS.ipynb
- Figure 1C-D:
Fig_SO-coupling.ipynb
- Figure 2:
02_data_correlation_CFS.ipynb
- Figure 3:
03_regression_MESA.R
- Figure 4:
02_data_correlation_CFS.ipynb
- Figure 5:
Fig_TopSleepAdjusted.ipynb