This repository contains the code and datasets used to generate the figures in the preprint Millisecond-scale, single-neuron credit assignment in a songbird.
This code is intended to run on MATLAB release R2025a or later (on any compatible operating system). It has been tested in MATLAB R2025a on Ubuntu 24.04 LTS. No non-standard hardware is required.
The following MATLAB toolboxes are required:
- Curve Fitting Toolbox
- Image Processing Toolbox
- Parallel Computing Toolbox
- Signal Processing Toolbox
- Statistics and Machine Learning Toolbox
No installation is required; this repository can be cloned and each script run in MATLAB.
Warning
This repository relies on Git LFS to store preprocessed data. Make sure Git LFS is installed using:
git lfs installAs this repository relies on submodules, cloning should be performed using the following command:
git clone --recurse-submodules https://github.com/FeeLab/ncaf_paper_code.gitIf you already cloned the repo without submodules, initialize them using:
git submodule update --init --recursiveNote that as the repository contains the preprocessed data, this cloning process may take a few minutes.
The scripts to generate the figures are found in the figure_generation directory. There is a corresponding script for each main and extended data figure. Quantative results quoted in the manuscript are printed to the terminal by the script for the associated figure. Note that although most scripts run quickly, the simulations in fig3.m are computationally intensive and may take >24 hours to perform on a typical machine.
This project uses the following external repositories as submodules:
- SpikeGLX_Datafile_Tools - Used for interacting with SpikeGLX files.
- npy-matlab - Used for loading numpy files in MATLAB.
This project also uses the following external files, stored in the external directory:
- colorcet - Used for perceptually uniform colormaps.
- MATLAB SMOTE - Used for balancing classes in the LMAN localizer classifier.
- ndSparse - Used for creating >2-dimensional sparse arrays.