Computational Approach for the Reliable Inference of Task States Encoded by Neurons Using Calcium Imaging.
Huixin Huang, Hita Adwanikar, Shreesh P Mysore
Department of Psychological and Brain Sciences, Johns Hopkins University, Baltimore, MD, USA.
Key points
From the paper's conclusion- Thus, our protocol provides a reusable, extensible approach to identify optimal parameter settings for reliably characterizing neural encoding of two discrete task states.
Abstract
Calcium imaging has become a widely used technique for measuring the activity of identified neurons during behavior. A key goal in such investigations is to determine whether, and to what extent, neurons preferentially encode one task-relevant state over another-a property referred to as neuronal selectivity. Despite the widespread use of calcium imaging for this purpose, no consensus exists on the parameter choices required to assess neuronal selectivity reliably: choices regarding neural data representation, behavioral position tracking, temporal binning, data balancing, and statistical shuffling all vary substantially across published studies. We recently developed a systematic computational approach to address this gap. Here, we describe the step-by-step protocol for implementing this computational pipeline. Starting from preprocessed calcium imaging data, the protocol guides users through all stages of the analysis: loading and aligning neural and behavioral data, deriving four metrics of neural activity, computing a selectivity index (SI), generating null distributions using four shuffling strategies, and assigning selectivity labels to individual neurons. The protocol introduces a principled, data-driven framework for evaluating the quality of any combination of parameter choices using quantitative metrics of accuracy and robustness and for identifying the optimal combination. The framework is validated using bootstrap resampling and hold-out cross-validation, and its generality is demonstrated by application to a different, regression-based approach for assessing selectivity of individual neurons. Finally, we describe the natural extension of this framework to inferences about task states encoded by populations of neurons. Thus, our protocol provides a reusable, extensible approach to identify optimal parameter settings for reliably characterizing neural encoding of two discrete task states. Key features • Provides a step-by-step computational pipeline for assessing the selectivity of neurons to task states from calcium imaging data. • Introduces quantitative accuracy and robustness metrics for objectively evaluating and comparing the quality of any combination of analysis parameter choices. • Validates the optimal parameter choices in terms of reliability, generalizability, and generality using bootstrap resampling, hold-out cross-validation, and a regression-based (GLM) approach, respectively. • Provides modular, well-documented MATLAB code covering all pipeline stages, enabling adaptation to different cell types, brain areas, calcium indicators, two-state task designs, and ensembles.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Deep learning classifies calcium imaging dynamics using time-series representationsScientific Reports · 2026
- Granger sensori-behavioral functional taxonomy of neuronal ensemble activity from two-photon calcium imaging dataPLoS Computational Biology · 2026
- Protocol for correlating in vivo calcium imaging with spatial transcriptomics in the mouse brain.STAR protocols · 2026
- A shared multi-feature population code for sensory reliability across mouse visual cortex.Cell reports · 2026
- Spike inference from calcium imaging data acquired with GCaMP8 indicatorsNature Methods · 2026
- Patterns of neural activity in prelimbic cortex neurons correlate with attentional behavior in the rodent continuous performance testTranslational Psychiatry · 2025