Code repository for processing and analysing behaviour and photometry data from trial-based choice task
This code repository is tailored for the dataset "Behaviour and dorsal striatum photometry recordings of mice during choice task with non-stationary probabilistic reward outcomes", but can be adapted for use on datasets from other trial-based choice tasks, especially those generated with pyControl and pyPhotometry. This repository is also hosted and maintained at https://github.com/Bogacz-Group/DLS_APE, the DOI of this dataset relates to the 1.0.0 release.
“qualitative_analysis.ipynb” contains code for loading the behavioural data and performing qualitative (model-free) analysis. “behaviour_model_fitting.ipynb” performs maximum-likelihood parameter optimisation with a stochastic algorithm and Bayesian model selection to compare the goodness of fit of different generative models on the same behavioural data. This notebook also generates latent variables from the best fitting model for use in analysis of photometry data.
“pre_processing.py”, “make_dataframe.py” and “simplify_data.py” are code for pre-processing and filtering the raw photometry data, aligning photometry signals with behavioural events on each trial, and formatting the processed data for efficient regression analysis. “mixed_effects.py” performs regression analysis with mixed-effects models on the processed photometry data to find correlation between neural activity and behavioural variables.
The “README.md” file within the repository provides further details on the functionality of the code, and more details on analysis methods will be published in a future research article.
We welcome researchers wishing to reuse our data to contact the creators of datasets. If you are unfamiliar with analysing the type of data we are sharing, have questions about the acquisition methodology, need additional help understanding a file format, or are interested in collaborating with us, please get in touch via email. Our current members have email addresses on our main site. The corresponding author of an associated publication, or the first or last creator of the dataset are likely to be able to assist, but in case of uncertainty on who to contact, email Ben Micklem, Research Support Manager at the MRC BNDU.
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
This is a human-readable summary of (and not a substitute for) the licence.
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
This licence is acceptable for Free Cultural Works. The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same licence as the original.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the licence permits.

