Additional file 1 - analysis code and outputs
Can eye movements flag sleep apnea? Single-channel electrooculography with external validation (S. Jain)

Data (public, not redistributed): UCD Sleep Apnea Database (PhysioNet, doi:10.13026/C26C7D);
2018 PhysioNet/CinC Challenge training set (random 100 of 994 records, seed 2018).

Order of use:
1. build_features.py      - UCD: 30-s epoch EOG features, labels, AHI (needs edf.py and the raw UCD files)
2. colab_cinc_eog_v2.py   - CinC: download, extract E1-M2 in microvolts (header units), resample to 64 Hz (Google Colab)
3. colab_cinc_features_v2.py - CinC: epoch features, labels, arousal flags, AHI
4. pipeline_v2.py internal|external - all models, validation settings, bootstrap statistics, importance
5. make_tables.py         - builds Additional file 2 (validation tables)
6. fig_example.py         - Figure 1
results_v2/               - JSON summaries and epoch-level predictions for every setting
Python 3.13, numpy, scipy, pandas, scikit-learn 1.9.1.
