Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Open In Colab Open In Kaggle

Allen Institute Visual Behavior 2P dataset overview

This dataset consists of neural activity measured with 2-photon calcium imaging in the visual cortex of mice performing an image change detection task.

In this task, mice learn to report changes in stimulus identity by licking a spout to earn a water reward.

(Figure “CD Task.png” is omitted from this example to keep the repository small; see the original notebook.)

In some sessions, the mice perform the task with familiar images they have seen many times during training. In other sessions, mice perform the task with novel images.
During 2-photon imaging sessions, 5% of stimulus presentations are randomly omitted, allowing us to examine the effect of unexpected events on neural activity.
The same population of cells is imaged over multiple days with varying sensory and behavioral conditions.

(Figure “experimental_design_matched.png” is omitted from this example to keep the repository small; see the original notebook.)

Multiple cortical areas and depths were measured concurrently in each session, at a sample rate of 11Hz.
Data was collected from excitatory and inhibitory neural populations.

(Figure “optical_physiology.png” is omitted from this example to keep the repository small; see the original notebook.)

You can learn more about this dataset, behavioral task, and find other useful tools here:
Overview page and Allen Brain Atlas
This example will focus on the activity of the two inhibitory types - VIP and SST neurons.

Loading the data

Source

For this example, we have pre-computed event triggered responses and saved them to figshare.

###This cell will download the responses.

Source

Then we open it using the pandas read_parquet method

(parquet is just another file format)

The data is organized as a pandas dataframe.
Each row contains all data for a given cell on a given trial
Available data includes:
Cell and session level metadata includes:

Let’s check what is available

How are VIP and SST cells affected by stimulus novelty?

Plot the population average change response for familiar and novel images for each cre line

Get trials where the image identity changed, for SST and VIP cells

Plot the population average change response of SST cells for familiar and novel images

Plot the population average change response of VIP cells for familiar and novel images

Can you find cells that were imaged across multiple sessions? How do single cells change depending on the image set?

What about trial to trial variability? How does the response of a single cell vary across a session?

How do SST and VIP cells respond when stimuli are omitted?¶

Plot the population average response to stimulus omission

Get trials where the stimulus was omitted, for SST and VIP cells

Plot the population average omission response of SST cells for familiar and novel images

Plot population average omission response of VIP cells for familiar and novel images

Does the omission response correlate with behavior?

How do the dynamics of image and omission evoked activity change over time during the novel image session?

To learn how to use the AllenSDK to access the full dataset, and see more in depth examples of how to interact with the data, check out the additional tutorials here:

https://colab.research.google.com/drive/163dPehppRK6JeHypgfB3gyaGQqKshNQc?usp=sharing

and in the ‘Getting Started’ section here:

https://allensdk.readthedocs.io/en/latest/visual_behavior_optical_physiology.html