Skip to content

zero-noise-lab/AttentionSpotlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analysis code for:

Sharing the Spotlight: Uncovering common attentional dynamics across species


Requirements

1. Clone the repo

git clone https://github.com/zero-noise-lab/AttentionSpotlight.git
cd AttentionSpotlight

2. Set up the environment

conda env create -f spotlight_env.yml
conda activate spotlight_env

3. Install SSM

SSM 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-isolation

4. Get the data

Download 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

Running the analysis

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.

Computationally heavy cells

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.


Repository structure

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

About

These are raw data and analysis scripts for the manuscript Glukhova et al. (2025) 'Sharing the Spotlight: Uncovering common attentional dynamics across species'

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors