This repository contains the analysis code used for the publication investigating how propofol induces divergent transitions in brain-state dynamics, ranging from direct neural suppression to transient paradoxical excitation. The project uses resting-state EEG and complexity-based metrics to characterize how neural activity changes across sedation depth and how baseline brain dynamics relate to individual susceptibility to propofol.
The workflow centers on distinguishing Type I and Type II complexity measures and mapping their joint dynamics on the Complexity–Entropy Causal Plane (CECP). In particular, the codebase extracts Lempel–Ziv Complexity (LZC) as a Type I complexity measure and Statistical Complexity (SC) as a Type II complexity measure, allowing the analysis of divergent neural trajectories during propofol-induced state transitions.
Authorship note: This repository was written and maintained by Derek Newman and accompanies a manuscript by Derek Newman, Charlotte Maschke, George A. Mashour, and Stefanie Blain-Moraes. Derek Newman and Charlotte Maschke contributed as co-first authors.
The repository supports analyses from two independent cohorts of healthy adults exposed to propofol:
CHENNUdata underDATA/CHENNU: data is publically available at https://www.repository.cam.ac.uk/items/b7817912-50b5-423b-882e-978fb39a49dfRECCOGNITIONdata underDATA/MDFA
The Chennu dataset includes baseline, mild sedation, moderate sedation, and recovery recordings, while the RecCognition dataset captures escalating propofol infusion from baseline to deep sedation. Across both cohorts, the repository is used to quantify complexity changes, compare responsive and unresponsive trajectories, examine baseline predictors of sedation response, and generate the figures and summaries used in the manuscript.
This repo is used to:
- preprocess raw EEG recordings into cleaned epoch datasets
- estimate delay and embedding parameters for complexity analysis
- extract Type I and Type II complexity features from resting-state EEG
- compare neural responses across sedation levels and behavioral responsiveness groups
- assess whether baseline complexity predicts susceptibility to propofol
- map subject- and group-level trajectories onto the Complexity–Entropy Causal Plane
- generate figures, summaries, and visualizations for manuscript work
PREPROCESSING/: notebooks for filtering, segmenting, and fixing EEG epoch filesDATA/: raw and processed dataset assets, including.fifepoch files (not included here)scripts/: Python modules for parameter selection, complexity extraction, CLI entrypoints, and group topomap plottingANALYSIS/: figure-generation and exploratory notebookssource/: supporting lookup tables and serialized intermediate files used by the notebooksfeature_results/: saved outputs and log files from feature runs (not included here)
TYPE2
├── ANALYSIS
│ ├── Manuscript_figures
│ │ ├── supp. mat.
│ │ ├── Figure_1.tif
│ │ ├── Figure_2.tif
│ │ ├── Figure_3.tif
│ │ └── Figure_4.tif
│ ├── supplementary
│ │ ├── LZC-check
│ │ ├── fig4_subgroups.ipynb
│ │ ├── Parameter_Mean_Inspection.ipynb
│ │ ├── Time_resolved.ipynb
│ │ └── Topomap_Inspection.ipynb
│ ├── F1_GroupComparison_Types_Complexity.ipynb
│ ├── F2_Neural_Bx_Group_Correlation.ipynb
│ ├── F3_Simulations_CECP.ipynb
│ ├── F4_CECP_both_datasets.ipynb
│ ├── Get_parameters.ipynb
│ └── Inspect_data.ipynb
├── PREPROCESSING
│ ├── channel_fix_MDFA.ipynb
│ ├── preprocess_MDFA.ipynb
│ └── segment_MDFA.ipynb
├── scripts
│ ├── group_average_topomaps.py
│ ├── parameter_selection.py
│ ├── type2_features.py
│ └── type_complexity.py
├── source
├── .gitignore
├── README.md
└── requirements.txt
Create and activate a virtual environment, then install dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Run the notebooks in
PREPROCESSING/to clean and segment EEG recordings into epochs. - Use the scripts in
scripts/or the analysis notebooks to extract complexity features from epoch files. - Open the notebooks in
ANALYSIS/to reproduce comparisons, figures, and exploratory analyses.
The main command-line entrypoint is [scripts/type_complexity.py]. It wraps the feature extraction pipeline in [scripts/type2_features.py].
Example:
cd scripts
python type_complexity.py ../DATA/MDFA/epochs/fixed/MDFA05-base_eeg_epochs.fif --out_dir ../feature_resultsThere is also a plotting helper in [scripts/group_average_topomaps.py] for group-averaged EEG topomaps across datasets.