paper-behavior
This repository contains code to reproduce all figures of the behavior paper by the International Brain Laboratory. If reusing any part of this code please cite the bioRxiv paper in which these figures appear.
Installation
These instructions require anaconda (https://www.anaconda.com/distribution/#download-section) for Python 3 and git (https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
In an Anaconda prompt window:
- Create a folder for this repository and go to that directory:
cd <directory-you-want-this-in> - Clone the repo:
git clone https://github.com/int-brain-lab/paper-behavior.gitand go into itcd paper-behavior - Create a new conda environment:
conda env create -f dj_env.yml - Activate this environment:
conda activate dj_env - Install requirements:
pip install -r requirements.txt - Clone this in the same parent folder as this repo (only for figure 1; can do
cd ..to come back to parent folder):git clone https://github.com/int-brain-lab/IBL-pipeline
Obtain a DataJoint account through IBL JupyterHub
IBL Jupyterhub provides an online environment to explore the IBL behavior data pipeline.
- Use your GitHub account to log in and go to the resource folder.
- Notebook
04-Access the database locallyprovides the instruction to obtain the credentials to access the database. Copy the value ofdj.config - In your local python IDE, do the following:
a.
import datajoint as djb. set your local config variabledj.configwith the value copied from JupyterHub c.dj.config.save_local()
You'll be able to run the code after the settings above.
How to run the code
All the scripts start with the name of the figure they produce. To run a script you need to add the local path of the repository to your Python environment so that the functions in paper_behavior_functions and dj_tools can be found. Either change the working directory of your Python IDE to the path where you cloned the repository or run the commands import_sys and sys.path.insert('~/path/to/repository').
All figure panels will appear in the exported_figs folder.
Questions?
If you have any problems running this code, please open an issue or get in touch with the code's authors (written at the top of each script).