Data from: Thalamocortical bursts encode reward contingencies and drive associative learning
Data files
Jul 20, 2026 version files 83.87 GB
Abstract
Learning requires adaptive changes in neuronal circuits, but how neurons encode learning content in their activity patterns to construct memories remains poorly understood. Using longitudinal multi-site recordings in freely moving male mice performing a sensory discrimination task, we discover the emergence of burst-coding neurons (BCNs) across cortical, thalamic, and extrathalamic regions. BCNs encoded task rules through the presence or absence of bursts, with their proportion increasing as learning progressed. Decoding analyses reveal that BCNs act as the principal carriers of rule information within the thalamocortical system. BCN burst rates scaled with stimulus valence, collapsed when contingencies were degraded, and inverted after repeated rule reversals, demonstrating that bursts dynamically track associative context during learning. Indeed, pharmacological and focal genetic suppression of thalamocortical bursting disrupted learning and task performance, establishing neuronal bursts as context-sensitive drivers of associative learning. These findings identify a previously unknown burst-based neural code for stimulus–outcome associations in the thalamocortical system and provide causal evidence linking cellular firing dynamics to reward contingency learning.
Supplementary data for Heimburg et al. (2026), Thalamocortical bursts encode reward contingencies and drive associative learning.
Overview
This archive: Thalamocortical-bursts-encode-reward-contingencies-and-drive-associative-learning.7z contains processed behavioral, electrophysiological, decoding, and reconstruction data, and corresponding scripts for reconstruction of the results associated with a tactile discrimination learning task in freely moving mice. Session-level spike and event data are also available in Neurodata Without Borders (NWB) format for broader use.
The archive contains six animals (#33 to #38), with 306 session folders (306 NWB files) and 306 behavioral event tables.
A comprehensive description of the paradigm, including setup details and technical drawings of the recording devices, is available in Heimburg, Saluti, Timm et al. A tactile discrimination task to study neuronal dynamics in freely-moving mice. Nat Commun 16, 6421 (2025). https://doi.org/10.1038/s41467-025-61792-0. Additional resources, including technical documentation, can be accessed via the corresponding GitHub repository (https://github.com/GrohLab/A-tactile-discrimination-task-to-study-neuronal-dynamics-in-freely-moving-mice) or through Zenodo (DOI: https://zenodo.org/doi/10.5281/zenodo.13369685).
Experimental context
Mice were trained in a tactile discrimination task with multiple behavioral phases. Sessions in this archive span different training phases named in the folder structure:
P3.2_50pctReward= Initial learning (50% reward/wide, 50% punishment/narrow)P3.3_all_states= Establishing of the neutral apertureP3.4_ruleswitch_two_textures= Rule reversal (50% reward/narrow, 50% punishment/wide)P3.6_extinction_two_textures= Degradation phaseP3.7_initial_rules= Restored rules (50% reward/wide, 50% punishment/narrow)
The dataset combines:
- behavioral event logs
- derived high-speed video trial tables
- processed electrophysiology trigger files
- curated spike sorting outputs
- burst-analysis outputs
- precomputed figure data
- precomputed neural decoding outputs
- tetrode reconstruction files
Brain-area abbreviations used throughout the archive include:
BC= barrel cortexVPM= ventral posteromedial thalamic nucleusPOm= posterior medial thalamic nucleusZIv= ventral zona incerta
Cluster-quality labels used throughout the MATLAB files and TSV tables include:
goodmua(multi-unit activity)noise
Top-level directory structure
The root of the archive contains:
Data/= all data files used by the MATLAB analysis scripts, including per-animal session folders, shared metadata files, figure-source data, decoding outputs, and reconstructionsScripts/= MATLAB scripts and helper functions used to reproduce analyses and figuresREADME.md= brief repository-level README supplied with the package
Data directory structure
Data/ contains:
#33/,#34/,#35/,#36/,#37/,#38/= animal-specific processed session dataallFiles.mat= file inventory metadata from the source projectanimalData.mat= animal-level behavioral and learning metadataAnalysis-Figures/= precomputed figure data, figure output directoryDecoding-with-increasing-cellNum/= precomputed decoding results across stages, cell counts, and bootstrap resamplesReconstructions/= Amira.amfiles for tetrode reconstructions and anatomical reference objectsREADME.md= brief data-folder README supplied with the package
Animal/session organization
Within each animal folder, sessions are organized as:
Data/<animalID>/<YYYY-MM-DD>/<session_name>/
Example:
Data/#33/2021-11-06/P3.2_50pctReward_session01/
Each session folder contains:
events/intan-signals/videos/nwbFile.nwb
Common session contents
events/
Contains the behavioral event log for the session.
Files typically present:
table.csvmanifest.toml
table.csv is a semicolon-delimited event table with three columns:
Time= event timestampTag= machine-readable event labelDescription= human-readable event description
Examples of Tag/Description values include reward-state changes, drum position changes, high-speed camera start/stop markers, and trial outcomes.
intan-signals/
Contains processed electrophysiology trigger data and curated spike sorting outputs.
Files typically present:
<recordingID>analysis.matmanifest.tomlautomatedCuration/= Contains curated spike sorting and downstream analysis outputs.
videos/
Contains processed trial-level high-speed video alignment/annotation data.
Files typically present:
HispeedTrials.matmanifest.toml
nwbFile.nwb
Contains a standardized NWB export of the session.
Important note on what is and is not included
This archive contains processed derivatives and curated outputs, not the full original acquisition tree. In particular:
- raw video files such as
.mkv,.avi, or.mp4are not included - raw continuous electrophysiology files are not included
- some MATLAB tables retain original lab-storage paths, which must be updated to reflect the corresponding paths in the new computing environment.
Shared metadata files
Data/allFiles.mat
This file functions as a file inventory from the original project environment. It is not a perfect manifest of only the files physically present in this archive. In the inspected copy, it references 441 source-session event files, whereas the archive contains 306 session folders.
Data/animalData.mat
This file stores animal-level behavioral progression and learning-performance metadata used to group sessions by stage and discrimination performance.
The file stores the struct animalData, which contains different cohort fields. Of those, only the cohort, relevant for the publication, was included. Each cohort contains the following fields:
- Lick_Events = Cell array containing the outcome/event labels associated with lick-related trials for each session.
- session_names = Cell array of session identifiers/paths, one entry per session.
- bodyweight = Two-column numeric array with one row per session; the first column is body weight in grams, and the second column is expressed as percent of baseline weight
. animalName = Animal identifier, e.g. #33.
- gogo_suc = Session-level success rate for Go trials.
- nogo_suc = Session-level success rate for No-Go trials.
- overall_suc = Session-level overall success rate across trial types.
- medium_lick = Session-level lick rate for intermediate/neutral-type trials.
- trial_num = Number of trials per session.
- dvalues_sessions = Session-level d-prime (d') values summarizing discrimination performance.
- cvalues_sessions = Session-level decision criterion (c) values summarizing response bias.
- dvalues_trials = Trial-wise d-prime trajectory across concatenated trials.
- dprime_logfit = Fitted d-prime trajectory across trials, used to describe learning progress with a smooth/log-like fit.
- stage2_trialcount = Stage-wise trial indexing used for learning-curve fitting.
- stage_sessionCount = Numeric stage label assigned to each session.
- cvalues_trials = Trial-wise decision criterion (c) trajectory across concatenated trials.
- slope_initial = Slope of the fitted learning curve from the initial learning phase.
- intersec_initial = Intercept of the fitted learning curve from the initial learning phase.
- slope_second= Slope of the fitted learning curve from the rule reversal phase.
- intersec_second = Intercept of the fitted learning curve from the rule reversal phase.
Animal and session-level metadata files
Each animal folder contains additional metadata files.
targetHit.mat
The analysis scripts use this file as a list of recording channels whose tetrodes were inside the target recording area. It is used to restrict analyses to units from tetrodes judged to be in-area.
<recordingID>analysis.mat
Contains:
Conditions= A struct array that stores named trigger/event groupings used downstream for peri-event analysesTriggers= A struct containing raw digital trigger vectors forReward,Punishment, andLick.
<recordingID>_all_channels.mat
Contains:
sortedData= A cell array with 3 columns: cluster/unit ID, spike times, automatic class code (class code mapping is as follows:1=good;2=mua;3=noise)fs= Sampling rate
<recordingID>_waveforms_all.mat
Contains the variable clWaveforms, which contains per-unit waveform information. The variable's columns correspond to unit IDs, waveform matrices, and waveform-associated metadata arrays.
cluster_info.tsv
This is a Phy/Kilosort cluster-metrics table. The file stores spike-sorting quality and cluster-location metrics used to determine whether a unit should be included in downstream analyses.
BurstinessData.mat
This file stores burst timing and burst-summary statistics for each retained unit. Contained variables:
- BurstDurations = Burst duration for each detected burst, stored per unit.
- BurstEnds = End timestamps of detected bursts, stored per unit.
- BurstFrequencies = Within-burst spike frequencies, stored per unit.
- BurstStarts = Start timestamps of detected bursts, stored per unit.
- NumSpikesInBursts = Number of spikes contained in each burst, stored per unit.
- TypeOfSpike = Per-spike classification vector for each unit; burst spikes are marked as 1 and non-burst spikes as 0.
- burstRatio = Summary measure of how much of a unit’s firing occurred in bursts.
- numberBursts = Total number of detected bursts for each unit.
- unitIDs = Unit identifiers corresponding to the entries in the burst-related variables.
SingleCellReactivity_...mat
This table stores per-unit response inclusion flags, area assignments, cluster quality labels, and burst/reactivity metrics under different aperture conditions. Contained variable: SingleCellResponse = MATLAB table with columns:
- cluster_id = Numeric cluster/unit identifier.
- ch = Recording channel associated with the unit.
- area = Anatomical area assigned to the unit, e.g., BC, VPM, POm, or ZIv.
- group = Cluster quality label: good, mua, or noise.
- include = Logical inclusion flag used for downstream analyses; units are included only if they pass quality thresholds and come from target-hit tetrodes.
- respWide = Logical flag indicating significant responsiveness on wide-aperture trials.
- respNarrow = Logical flag indicating significant responsiveness on narrow-aperture trials.
- respInterm = Logical flag indicating significant responsiveness on intermediate-aperture trials.
- wideBurstiness = Logical flag indicating significant burst-related responsiveness when comparing spontaneous vs evoked activity in wide trials.
- narrowBurstiness = Logical flag indicating significant burst-related responsiveness when comparing spontaneous vs evoked activity in narrow trials.
- wideVSnarrow_Bursts = Logical flag indicating a significant difference in burst-related response magnitude between wide and narrow trials.
- allBurstiness = Logical flag indicating significant burst-related responsiveness when all selected trials are pooled.
- allVSwide_Bursts = Logical flag indicating a significant difference in burst-related response magnitude between pooled all trials and wide trials.
StimulusResponse_...mat
Contained variables:
- Go_NoGo_Neutral = trial-type vector (1 = Go/reward, 2 = No-Go/punishment, 3 = Neutral/diagonal/medium)
- Lick = lick/no-lick vector
- Wide_Narrow_Intermediate = aperture-class vector (1 = wide, 2 = narrow, 3 = intermediate)
- StimulusResponse = table with area-specific firing-rate summaries
HispeedTrials.mat
Contains the variable HispeedTrials, with columns:
- VideoPath = stores the original path to the source movie file
- Hispeed = identifies high-speed camera number
- Section = identifies the section/trial number
- Go_NoGo_Neutral = stores outcome-based trial class
- Go_NoGo_Neutral_settingBased = stores aperture setting class and can differ from outcome-based class during degradation
- Lick = stores lick/no-lick outcome
- Timestamps = stores frame timestamps
- Event_Index = stores the frame index nearest the behavioral event
- PreviousMP = stores the timestamp of the previous middle-point event
- ContactLeft = Detected timestamps of left-whisker contacts with the aperture, stored as a vector per trial.
- ContactRight = Detected timestamps of right-whisker contacts with the aperture, stored as a vector per trial.
- HeadAngle = Per-frame head-angle trace for that trial.
- Dist2Middle = Per-frame head distance to the midline for that trial.
- WhiskerAngle = Per-frame whisker-angle measurements; stored as a multi-column array, one column per tracked whisker.
- WhiskerCurv = Per-trial whisker-curvature table.
- HeadVel = Per-frame head-velocity trace for that trial.
- TurningPoint = Derived turning-point annotation for the trial.
NWB files
Each session contains nwbFile.nwb. NWB is the standardized cross-platform session representation for spike times and event timestamps.
Each NWB file contains unit data:
- units/id
- units/electrodes
- units/spike_times
- units/spike_times_index
and event timestamp series:
- stimulus/presentation/Lick
- stimulus/presentation/Middlepoint
- stimulus/presentation/Punishment
- stimulus/presentation/Random
- stimulus/presentation/Reward
- stimulus/presentation/WhiskerContact_left
- stimulus/presentation/WhiskerContact_onlyLeftFirst
- stimulus/presentation/WhiskerContact_onlyRightFirst
- stimulus/presentation/WhiskerContact_right
- stimulus/presentation/onlyFirstLick
Figure-source data
Contains precomputed data and MATLAB figure files for burst-related summary figures grouped by learning stages.
Relevant summary-table variables in a representative file:
avgCellResponse= Per-unit summary table of average pre-vs-post response metrics for the selected condition and trial subset. Each row is one unit. The columns store average response measures such as tonic spikes, spikes belonging to bursts, burst-to-tonic ratio, burst count, average spikes per burst, and average burst frequency, separated into pre-stimulus and post-stimulus values.burstAPs_Info= Per-unit summary table for burst-related responses. Each row is one unit. CellResponses is a trial-by-2 matrix, with one row per trial and two columns representing pre-window and post-window burst-related values. Significance is a logical flag indicating whether that unit showed a significant burst-related spontaneous-vs-evoked difference for the selected condition.tonicAPs_Info= Per-unit summary table for tonic-spike responses. Each row is one unit. CellResponses is a trial-by-2 matrix, with one row per trial and two columns representing pre-window and post-window tonic-spike values. Significance is a logical flag indicating whether that unit showed a significant tonic spontaneous-vs-evoked difference for the selected condition.
Decoding results
Data/Decoding-with-increasing-cellNum/
Contains a large collection of precomputed neural decoding outputs for the expert learning stage (stage2-dprime1.65_Inf)
Within each population folder, subfolders are grouped by number of cells (e.g., 001cells, 005cells, 030cells)
Within each cell-count folder, files are bootstrap runs such as: Binned_data_results_WhiskerContact_left_allSpikes_burstUnits_allAreas_allTrials_libsvm_CL_10splits_bootstrap001.mat
These files contain the DECODING_RESULTS with decoding outputs.
Reconstructions
Data/Reconstructions/
These files describe tetrode reconstructions and anatomical reference objects for visualization in Amira-compatible software. Contains one folder per animal, each with Amira .am files:
- Brain.am
- PO.am
- Tetrodes.am
- VPM.am
- Zona_Incerta.am
Scripts
The Scripts/ folder contains the MATLAB analysis code used to generate the figure-source files in Data/.
Before executing the scripts, include the folder path in the MATLAB environment by using the command: addpath(genpath('.\Scripts')).
Required MATLAB toolboxes are:
Signal Processing Toolbox
- Deep Learning Toolbox
- Statistics and Machine Learning Toolbox
- Communications Toolbox
- Image Processing Toolbox
Main scripts include:
- userDataPath.m = Sets the root cohortPath for the downloaded dataset, saves that path to userDataPath.mat, and rewrites the animalData.mat session paths so the archived local Data/ folder is used instead of the original lab paths. In practice, this is the initialization script that should be run before the other MATLAB scripts.
- singleUnitBurstinessAnalysis.m = Interactively selects sessions, stage/performance groups, condition, trial types, and cell subsets, then computes per-unit burst and tonic response measures around selected events from the session-level processed data. It can generate single-unit rasters and response plots, updates SingleCellResponse with burst/tonic bias flags, saves per-session SingleCellFiringRates_...mat files, and builds the pooled ResponsePattern_...mat summary files used by the later figure scripts.
- ApertureResponseTypes.m = Loads two ResponsePattern_...mat files, typically for two trial types such as wide vs narrow, and compares each unit’s burst and tonic preference between them. It generates scatter/contour-style summary figures by area and waveform class, computes significance of burst and tonic bias, marks touch-modulated cells, and saves figure-ready outputs plus a responseTypes_...mat summary file.
- ApertureResponseTypes_Comparison.m = Compares multiple previously generated stage-level burst/tonic bias figure sets from Analysis-Figures/Burstiness-Scatter. It extracts the plotted bias values from saved .fig files, summarizes them across stages with stacked bars and violin plots, performs sign-rank tests against zero, and saves the comparison figures to Analysis-Figures/Burstiness-Bias.
- ApertureResponseTypes_StageProgression.m = Loads two ResponsePattern_...mat files from a single stage and tracks how burst bias and the fraction of burst-responsive cells evolve across sessions and animals within that stage. It aligns these trajectories with behavioral performance (d'), supports filtering by area/waveform/cell class, and saves progression figures to Analysis-Figures/Burstiness-StageProgression.
- DecodingWithIncreasingUnitNum_Plotting.m = Reads the precomputed bootstrap decoding results stored in Decoding-with-increasing-cellNum, groups them by stage, trial type, response class, and area, and plots decoding accuracy as a function of the number of input cells. It averages across selected bootstraps, optionally compares two conditions statistically, and saves the resulting decoding-accuracy figures as .fig files.
- ApertureBurstCodingMotifs.m = Loads two burst-response summary files, identifies significant burst-coding neurons, and subdivides them into explicit coding motifs based on whether wide and/or narrow apertures are represented through burst enhancement or suppression.
The Scripts/HelperFunctions/ tree includes helper code and bundled external dependencies, including utilities related to spike sorting and the Neural Decoding Toolbox.
Software, toolboxes, and external dependencies
The analysis, spike-sorting import, video tracking, NWB export, decoding, and reconstruction workflow associated with this dataset relies on MATLAB and several external software packages.
- MATLAB: All analysis presented in this study was analyzed using custom MATLAB code (version MATLAB R2022b+).
- Signal Processing Toolbox: A proprietary add-on toolbox for MATLAB provided by MathWorks, used for signal-processing operations, such as Kilosort2 software.
- Statistics and Machine Learning Toolbox: A proprietary add-on toolbox for MATLAB provided by MathWorks, used for classification, model fitting, or clustering (e.g., decoding classifiers).
- Deep Learning Toolbox: A proprietary add-on toolbox for MATLAB provided by MathWorks.
- Communications Toolbox: A proprietary add-on toolbox for MATLAB provided by MathWorks.
- Image Processing Toolbox: A proprietary add-on toolbox for MATLAB provided by MathWorks, required by some image-analysis scripts.
- Kilosort2: Primary spike-sorting software (https://github.com/MouseLand/Kilosort release v2.0). For more recent releases, see also Pachitariu, M., Sridhar, S., Pennington, J., & Stringer, C. (2024). Spike sorting with Kilosort4. Nature Methods, 21, pages 914–921.
- Phy: Manual curation/inspection software for Kilosort outputs (https://github.com/cortex-lab/phy).
- npy-matlab: MATLAB helper library used to read NumPy .npy files generated by Kilosort/Phy (https://github.com/kwikteam/npy-matlab)
- Neural Decoding Toolbox (NDT): Used for population decoding analyses of neural activity (https://readout.info/). See also: Meyers, E. M. (2013). The neural decoding toolbox. Front. Neuroinform. 7:8. https://doi.org/10.3389/fninf.2013.00008
- DeepLabCut: Used for markerless behavioral tracking and whisker-contact extraction from video (https://github.com/DeepLabCut/DeepLabCut, version 2.0.5). See also: Mathis, A., Mamidanna, P., Cury, K.M. et al. DeepLabCut: markerless pose estimation of user-defined body parts with deep learning. Nat Neurosci 21, 1281–1289 (2018). https://doi.org/10.1038/s41593-018-0209-y
- matnwb: MATLAB API used to create NWB files (https://github.com/NeurodataWithoutBorders/matnwb, version 2.7.0). See also: Oliver Rübel, Andrew Tritt, Ryan Ly, Benjamin K Dichter, Satrajit Ghosh, Lawrence Niu, Pamela Baker, Ivan Soltesz, Lydia Ng, Karel Svoboda, Loren Frank, Kristofer E Bouchard. (2022). The Neurodata Without Borders ecosystem for neurophysiological data science. eLife, 11:e78362. doi: https://doi.org/10.7554/eLife.78362
- ecephys_spike_sorting: Allen Institute spike-sorting pipeline for automated quality assessment of sorted units (https://github.com/AllenInstitute/ecephys_spike_sorting, version 0.2)
- Amira: Used for anatomical and tetrode reconstruction files stored as .am objects (https://www.thermofisher.com/de/de/home/electron-microscopy/products/software-em-3d-vis/amira-software.html, version 6.5).
- Custom GrohLab MATLAB scripts for Kilosort/Phy import: In-house helper functions were used to convert curated Kilosort/Phy outputs into MATLAB-friendly data structures for downstream analysis, credited in particular to Emilio Isaias-Camacho.
