This repository contains the code for analyzing the data from the Credit Assignment project, an Allen Institute for Brain Science OpenScope project.
The experiment details, analyses and results are published in Gillon et al., 2021, bioRxiv.
To run the code, you should install Anaconda or Miniconda.
Once these are installed, you can simply use the appropriate .yml
file to create a conda environment. For example, if using Ubuntu or Mac OS, open a terminal, go to the repository directory, and enter:
conda env create -f osca.yml
source activate osca
The code is written in Python 3
.
Once installed, when using the codebase, simply activate the environment:
source activate osca
All of the appropriate libraries should then be loaded, and the modules can be imported for use in ipython, python scripts, or jupyter notebooks, for example.
run_paper_figures.py
: run, analyse and plot paper figures (for example usage, see thepaper_figures
folder)analysis
: analysis scripts, including the Session and Stim objectssess_util
: session specific utilities moduleplot_fcts
: plotting scriptspaper_fig_util
: scripts to organize and generate the paper figuresexamples
: example notebook for using the Session and Stim objects
The full dataset for this project is hosted here in the DANDI archive in NWB format. The associated metadata can be found here. The subset of data used in the paper (33 sessions, ~15 GB total) can be downloaded by running, from the main directory of the repository:
python sess_util/sess_download_util.py --output path/to/save/
Code to generate the stimuli used in these experiments can be found here.
The following notebooks give examples of how to download the data, and run the paper analyses.
Run in Binder | View the notebook | Run the Google Colab notebook |
---|---|---|
The contents of the Binder and Google Colab notebooks differ somewhat, due to the resources available:
- Binder: conda env. is already installed (+), but only limited compute resources are available (-).
- Google Colab: conda env. must first be installed (-), but more substantial compute resources are available (+).
This code was written by:
- Colleen Gillon (colleen dot gillon at mail dot utoronto dot ca)
- Jay Pina, Joel Zylberberg, and Blake Richards
Please do not hesitate to contact the authors or open an issue/pull request, if you have trouble using the data or the codebase or improvements to propose.
Note: The module Dataset2p.py
under sess_util
contains code shared by authors at the Allen Institute for Brain Science. The authors of the code cannot guarantee support for its usage.