This repository contains notebooks for running xCEBRA-based analyses and figure generation for schizophrenia time-series experiments. See our manuscript: "An explainable AI latent space of brain dynamics reveals a cerebello-prefrontal signature of schizophrenia symptoms" Moritz Bonhoeffer, Paolo Muratore, Mackenzie Weygandt Mathis & Indrit Bègue.
xCEBRA_combined.ipynb— main xCEBRA workflow.Ensemble_xCEBRA_models.ipynb— ensemble modeling workflow.Decode_clinical_variables_different_decoders.ipynb— decoder comparison for clinical variables.Data_Pipeline_for_publishing/— preprocessing and atlas/time-course preparation notebooks.Plotting_for_figures/— plotting notebooks and generated figures.
- Create and activate a virtual environment:
python -m venv .venvsource .venv/bin/activate(Linux/macOS) or.venv\\Scripts\\activate(Windows)
- Install dependencies (see below):
pip install -r requirements.txt
- Start Jupyter:
jupyter notebook
- Open notebooks in this recommended order:
Data_Pipeline_for_publishing/*.ipynbxCEBRA_combined.ipynbEnsemble_xCEBRA_models.ipynbDecode_clinical_variables_different_decoders.ipynbPlotting_for_figures/*.ipynb
- Build:
docker build -t xcebra-schizophrenia .
- Run:
docker run --rm -p 8888:8888 -v "$PWD":/workspace xcebra-schizophrenia
- Open Jupyter in your browser at the URL shown in the container output.
Install all dependencies:
pip install -r requirements.txtPrimary runtime stack:
- Python 3.10
- PyTorch (
torch) - CEBRA (
cebra) - Scientific stack:
numpy,pandas,scipy,scikit-learn - Neuroimaging stack:
nibabel,nilearn,SUITPy - Plotting:
matplotlib,seaborn - Utilities used in notebooks:
joblib,pingouin,openpyxl - Notebook tools:
notebook,ipykernel
flowchart TD
NB[Notebooks in this repo] --> CORE[torch + cebra]
NB --> SCI[numpy + pandas + scipy + scikit-learn]
NB --> NEURO[nibabel + nilearn + SUITPy]
NB --> PLOT[matplotlib + seaborn]
NB --> UTIL[joblib + pingouin + openpyxl]
This repo includes Jupyter Book configuration files:
_config.yml_toc.yml
To build and serve the book locally:
- Install Jupyter Book:
pip install jupyter-book
- Build the site from the repository root:
jupyter-book build .
- Open:
_build/html/index.html