AllenInstitute / licking_behavior_NP

Analysis of mouse licking behavior during visually guided behavior
0 stars 1 forks source link

licking_behavior

Analysis of mouse licking behavior during visually guided behavior. Primarily, this repo develops a time-varying logistic regression model that learns the probability of licking on a flash by flash basis, using weights that vary over time by following random walk priors.

This repository is specific to the Visual Behavior Neuropixels dataset. If you want to look at the Visual Behavior Optical Physiology dataset use github.com/alexpiet/licking_behavior. The model works the same but the data is loaded and processed slightly differently due to the VBN sessions being structured differently.

Installation

git clone https://github.com/AllenInstitute/licking_behavior_NP
pip install -e . #run in directory with setup.py

Time varying regression model

The model predicts the probability of the mouse starting a licking bout on each image presentation. Its described as the sum of several time-varying strategies.

Fitting the time varying regression model

import licking_behavior_NP.psy_tools as ps
for bsid in behavior_session_ids:
ps.process_session(bsid)

Model outputs

The key output dataframes are:

Diagram of information flow

code_diagram

summary_df

import licking_behavior_NP.psy_output_tools as po
summary_df = po.get_np_summary_table(BEHAVIOR_VERSION)

The columns of summary_df are:

Additionally, there are columns that are split by whether the mouse was engaged or disengaged. These should be self-explanatory based on the corresponding column that isn't split by engagement.

Finally, there are columns that are lists of length 4800 that correspond to each image presented during the active behavior period:

change_df

import licking_behavior_NP.psy_output_tools as po
change_df = po.get_change_table(BEHAVIOR_VERSION)

licks_df

import licking_behavior_NP.psy_output_tools as po
licks_df = po.get_licks_table(BEHAVIOR_VERSION)

The columns of licks_df are:

bouts_df

import licking_behavior_NP.psy_output_tools as po
licks_df = po.get_licks_table(BEHAVIOR_VERSION)
bouts_df = po.build_bout_table(licks_df)

The columns of bouts_df are:

figure script

import licking_behavior_NP.figure_script as f
f.make_figure_1_supplement_behavior()
f.make_figure_1_timing_end_of_lick_bout()
f.make_figure_1_supplement_task()
f.make_figure_1_supplement_licking()
f.make_figure_2()
f.make_figure_2_supplement_model_validation()
f.make_figure_2_supplement_strategy_characterization()
f.make_figure_2_supplement_strategy_characterization_rates()
f.make_figure_2_supplment_pca()
f.make_figure_2_novelty()
f.make_figure_3()