Analysis code for:
git clone https://github.com/zero-noise-lab/AttentionSpotlight.git
cd AttentionSpotlightconda env create -f spotlight_env.yml
conda activate spotlight_envSSM requires numpy and cython at build time and must be installed with build isolation disabled:
pip install cython
pip install git+https://github.com/lindermanlab/ssm --no-build-isolationDownload the data from the repository and place all .pkl files flat into data/.
The link contains multiple data files. The 5 original data files from which the results can be recreated are listed below. The data deopsit also contains multiple intermediate output files that require heavy computation to produce. Those files start with a prefix 'data_shuffled' and are used for the permutation analysis.
The raw data files:
data_raw_sessions_human.pkl
data_raw_sessions_monkey.pkl
data_raw_sessions_mouse.pkl
monkey_pupil.pkl
mouse_pupil.npy
Open code/analysis_pipeline.ipynb in Jupyter and run cells from top to bottom.
The notebook is organised by figure — each section corresponds to a main or supplementary
figure in the paper. Figures are saved to figures/ as PNG files.
Three cells use ACME for parallel jobs and may take several hours to complete.
Set n_iter = 10 at the top of Section 2 for a quick test run.
Set n_iter = 1000 for full analysis as reported in the paper.
If pre-computed null .pkl files are available (from the data deposit), these cells
can be skipped — all figure cells load results from disk.
code/
analysis_pipeline.ipynb — main analysis notebook
analysis_tools.py — helper functions
data/ — input data and the intermediate steps (download separately, see above)
figures/ — output figures (generated by notebook)
spotlight_env.yml — conda environment