This repository contains code for analyzing behavioral data from the Allen Institute BrainTV Visual Behavior Project.
This code is an important part of the internal Allen Institute code base and we are actively using and maintaining it. Issues are encouraged, but because this tool is so central to our mission pull requests might not be accepted if they conflict with our existing plans.
For example, using Conda:
conda create -n visual_behavior_analysis python=3.7
Then activate the environment:
conda activate visual_behavior_analysis
and install with pip (Allen Institute internal users only):
pip install git+http://stash.corp.alleninstitute.org/scm/vb/visual_behavior_analysis.git
This package is designed to be installed using standard Python packaging tools. For example,
python setup.py install
If you are using pip to manage packages and versions (recommended), you can also install using pip:
pip install ./
If you are plan to contribute to the development of the package, I recommend installing in "editable" mode:
pip install -e ./
This ensures that Python uses the current, active files in the folder (even while switching between branches).
To install from with in the AIBS local network from a whl using pip:
pip install -i http://aibs-artifactory/artifactory/api/pypi/pypi-local/simple --trusted-host aibs-artifactory --extra-index-url https://pypi.org/simple visual_behavior==0.5.0.dev5
Activate the environment:
conda activate visual_behavior_analysis
Install ipykernel:
pip install ipykernel
Register the environment with Jupyter:
python -m ipykernel install --user --name visual_behavior_analysis
First, load up a Foraging2 output
import pandas as pd
data = pd.read_pickle(PATH_TO_FORAGING2_OUTPUT_PKL)Then, we create the "core" data structure: a dictionary with licks, rewards, trials, running, visual stimuli, and metadata.
from visual_behavior.translator.foraging2 import data_to_change_detection_core
core_data = foraging2.data_to_change_detection_core(data)Finally, we create an "extended" dataframe for use in generating trial-level plots and analysis.
from visual_behavior.translator.core import create_extended_dataframe
extended_trials = create_extended_dataframe(
trials=core_data['trials'],
metadata=core_data['metadata'],
licks=core_data['licks'],
time=core_data['time'],
)Pull requests are welcome.
- Fork the repo
- Create a feature branch
- Commit your changes
- Create a pull request
- Tag
@dougollerenshaw,@matchingsto review
- Nicholas Cain - @nicain
- Marina Garrett - marinag@alleninstitute.org, @matchings
- Nile Graddis - nileg@alleninstitute.org, @nilegraddis
- Justin Kiggins - @neuromusic
- Jerome Lecoq - jeromel@alleninstitute.org, @jeromelecoq
- Sahar Manavi - saharm@alleninstitute.org, @saharmanavi
- Nicholas Mei - nicholas.mei@alleninstitute.org, @njmei
- Christopher Mochizuki - chrism@alleninstitute.org, @mochic
- Doug Ollerenshaw - dougo@alleninstitute.org, @dougollerenshaw
- Natalia Orlova - nataliao@alleninstitute.org, @nataliaorlova
- Jed Perkins - @jfperkins
- Alex Piet - alex.piet@alleninstitute.org, @alexpiet
- Nick Ponvert - @nickponvert
- Kate Roll - kater@alleninstitute.org, @downtoncrabby
- Ryan Valenza - @ryval