This respository hosts the code (jupyter notebooks) to recreate the figures presented in Tanaka & Portugues (2025) Algorithmic dissection of optic flow memory in larval zebrafish (preprint).
- Jupyter notebooks (
fig<number>_<descriptive names>.ipynb): Each notebook generates figure panels indicated by its name. homr_utils.py: This file contains utility functions used in the notebooks.data/: Please put data downloaded from Zenodo to this directory.svgs/: The figure panels generated by the notebooks will be saved here as SVG files.environment.yml: This file specifies the anaconda environment needed to run the notebooks.
The dataset to be analyzed by this repository is hosted on Zenodo (doi: 10.5281/zenodo.16085585).
The dataset containts raw behavioral as well as preprocessed imaging data.
Data are arranged in directories corresponding to each notebook file. Put unpacked data directories under the data folder in the repository.
We used anaconda to manage the environment to run the notebooks. The notebooks on this repository depends on following packages:
python=3.10.6bouter=0.2.0colorcet=3.0.1flammkuchen=1.0.2ipykernelmatplotlib=3.6.0pipscipy=1.9.1tqdm=4.64.1
Please create an anaconda environment using the yml file provided conda env create -f environment.yml (named ofmemory). Solving dependency could take 10+ minutes. Alternatively, you might simply install packages one by one manually, which could be faster.
Enter the newly created conda environment, and run python -m ipykernel install --user --name=ofmemory to register it to the jupyter lab.
The notebooks save the figures as SVG (in the svgs folder), as they appear in paper figures (with the exact sizes), which is why they appear small on the screen.