DOI: 10.5061/dryad.w3r2280w7
title: Stimulus encoding by specific inactivation of cortical neurons

description: Neuronal ensembles are groups of neurons with correlated activity
 associated with sensory, motor, and behavioral functions. To explore how
 ensembles encode information, we investigated responses of visual cortical
 neurons in awake mice using volumetric two-photon calcium imaging during
 visual stimulation. We identified neuronal ensembles employing an
 unsupervised model-free algorithm and, besides neurons activated by the
 visual stimulus (termed “onsemble”), we also found neurons that are
 specifically inactivated (termed “offsemble”). Offsemble neurons showed
 faster calcium decay during stimuli, suggesting selective inhibition. In
 response to visual stimuli, each ensemble (onsemble+offsemble) exhibited
 small trial-to-trial variability, high orientation selectivity, and
 superior predictive accuracy for visual stimulus orientation, surpassing
 the sum of individual neuron activity. Thus, the combined selective
 activation and inactivation of cortical neurons enhance visual encoding as
 an emergent and distributed neural code.
description: Animals and surgery
 All experimental procedures were
 conducted in accordance with the US National Institutes of Health and
 Columbia University Institutional Animal Care and Use Committee and were
 similar to our previous study14. Mice were housed in a controlled
 environment under a 12 h dark-light cycle at room temperature of ~23 °C
 and ~50% of humidity. Mice had ad libitum access to food and water.
 Experiments were performed in 12 adult transgenic mice (Slc17a7-IRES2-Cre,
 JAX stock # 023527) crossed with TIGRE2.0 Ai162 (TIT2L-GC6s-ICL-tTA2, JAX
 stock # 031562) maintained in C57BL/6 J congenic background. Mice were
 anesthetized with isoflurane (1.5–2%) while maintaining body temperature
 at 37 °C. Dexamethasone sodium phosphate (0.6 mg/kg) and Enrofloxacin (5
 mg/kg) were administered subcutaneously and Carprofen (5 mg/kg)
 intraperitoneally. A titanium head-plate was attached to the skull, a 4 mm
 diameter craniotomy opened (center at 2.1 mm lateral and 3.4 mm posterior
 from bregma), and a round coverslip was implanted and sealed. Animals
 received postoperative Carprofen for two days. Mice were allowed to
 recover for five days with food and water ad libitum, and their health was
 checked daily. Visual stimulation A custom-made MATLAB application
 (MouSee,
 2023; doi:10.5281/zenodo.7765050) was used to display visual drifting gratings on
 an LCD monitor positioned 15 cm from the right eye at 45° to the long axis
 of the animal. In 10 out of 12 mice, only the blue channel of the monitor
 was used (red and green channels were disabled) to avoid light
 contamination in the photomultiplier (PMT). No discernible difference was observed
 between blue and black/white drifting gratings across experiments when the
 imaging objective was shielded. Visual stimulation started with a blue
 screen (mean of grating luminescence) followed by full sinusoidal gratings
 (100% contrast, 0.13 cycles/deg, 5 cycles/s) drifting in 8 directions
 selected randomly (0º, 45º, 90º, 135º, 180º, 225º, 270º, and 315º)
 presented for 2 s, and a blue screen inter-gratings lasting between 1 to 5
 s. Drifting gratings were presented at least 6 times for each direction
 during a 5-min session (at least 48 trials per
 experiment). Mouse facial recording
 The mouse face was recorded using an infrared
 monochrome camera (DMK 21BU04.H, The Imaging Source) with a zoom lens
 (MVL7000, Navitar) and an infrared illuminator (AI4, Tendelux). Images
 were acquired at 30 frames per second and stored using IC Capture software
 (The Imaging Source). Whisking, blinking, and sniffing behaviors were
 measured using a custom-made MATLAB code (MoussionEnergy, 2023;
 doi:10.5281/zenodo.8422691). Volumetric two-photon calcium
 imaging  Imaging experiments were performed 5 days after
 head-plate implantation. Each mouse was head-fixed on a wheel under a
 two-photon microscope (a custom-modified Ultima IV, Bruker). Animals were
 acclimated to the head restraint for periods of 5 to 15 minutes for at
 least 2 days and exposed to visual stimulation sessions before recordings.
 The imaging setup was enclosed with a blackout screen to avoid light
 contamination into the PMT. An imaging laser (Ti:sapphire, λ = 920 nm,
 Chameleon Ultra II, Coherent) was used to excite GCaMP6s. The laser beam
 at the sample (30–60mW) was controlled by a high-speed resonant
 galvanometer scanning an XY plane (256 × 256 pixels) at 17.7 ms (frame
 period) covering a field of view of 452 × 452 μm using a 25X objective (NA
 1.05, XLPlan N, Olympus). An electrically tunable lens (ETL) was used to
 change focus (z-axis) during the recording. Imaging was performed in three
 planes (30-50 μm apart) recorded consecutively at a depth of 150 μm to 250
 μm from the pia, pausing ~10ms between planes for ETL focus to stabilize.
 Thus, we collected three frames, one per depth, every ~80ms for 5 min.
 Imaging and ETL were controlled by Prairie View
 software. Ensemble activity
 detection To
 identify ensembles, we used a custom MATLAB program(Xsembles2P, 2023;
 doi:10.5281/zenodo.8423311), built upon our previous
 work. First, we extracted
 the functional neuronal network from the raster
 matrix. Subsequently, we
 filtered the raster by removing spikes from neurons that are
 nonfunctionally connected in each column vector. Following this
 preprocessing step, hierarchical clustering was applied to all column
 vectors using Jaccard similarity and Ward linkage (as illustrated in
 Figure 1d). The optimal number of clusters is determined by identifying
 the maximum local contrast index. Each cluster was considered an ensemble if the
 similarity between their vectors was statistically significant (p &lt;
 0.05), determined through a z-test. This significance was assessed by
 comparing the average similarity within the cluster vectors being tested
 to the mean and standard deviation average similarity among the same
 number of the cluster vectors selected randomly over 1,000 iterations.
 Once significant ensembles were identified, their timestamps were
 located.
description: # **Stimulus encoding by specific inactivation of cortical neurons** ##
 Description of the data and file structure This dataset was generated by
 Jesús Pérez-Ortega, Alejandro Akrouh, and Rafael Yuste for the paper
 entitled "**Stimulus encoding by specific inactivation of cortical
 neurons**" published in Nature Communications
 [https://doi.org/10.1038/s41467-024-47515-x](https://doi.org/10.1038/s41467-024-47515-x). This folder has MATLAB data files of all mice, and each file contains the information of a single mouse session. The name of the file indicates the number of the mouse and the type of session. The letter "S" stands for spontaneous activity (blue screen), and the letter "V" stands for visual stimulation (8 directions of drifting gratings). For example, the file "M3_V" refers to the mouse number 3 during the visual stimulation session. Every file is a MATLAB structure variable containing the information of the session (number of frames, sampling period, neuronal ROIs, raw signals, filtered signal, raster, ensembles (onsembles and offsembles) found, voltage recording of locomotion and visual stimulation, etc.) The variable structure of each experiment contains the main following fields (for the full list of variables, please refer to the GitHub repository Xsembles2P [https://github.com/PerezOrtegaJ/Xsembles2P](https://github.com/PerezOrtegaJ/Xsembles2P): * data.Movie **(information of the two-photon imaging movie recorded)** * data.Movie.Width **(width of the movie)** * data.Movie.Height **(height of the movie)** * data.Movie.Frames **(number of frames recorded)** * data.Movie.FPS **(recording rate in frames per second)** * data.ROIs **(information of neuronal regions of interest)** * data.ROIs.CellRadius **(neuronal radius parameter, in pixels)** * data.ROIs.AuraRadius **(local neuropil radius parameter, in pixels)** * data.VoltageRecording **(external voltage recording)** * data.VoltageRecording.Stimuli **(visual stimulation signal, values from 1 to 8 mean the direction of drifting gratings from 0° to 315°, respectively)** * data.VoltageRecording.Locomotion **(mouse running speed, in cm/s)** * data.XY.All **(spatial coordinates of ROIs identified as neurons)** * data.Neurons **(location and shape for each ROI identified as a neuron)** * data.Transients **(neuronal signals)** * data.Transients.Raw **(raw calcium signals)** * data.Transients.Filtered **(filtered calcium signals)** * data.Transients.F0 **(local neuropil signals)** * data.Transients.PSNRdB **(peak signal-to-noise ratio for each neuron, in dB)** * data.Transients.Inference **(spike inference signals)** * data.Transients.Raster **(binary spiking activity signals)** * data.Analysis **(ensemble analysis results)** * data.Analysis.Raster **(binary spiking activity signals, same as in data.Transients.Raster)** * data.Analysis.Neurons **(number of neurons recorded)** * data.Analysis.Frames **(number of frames recorded)** * data.Analysis.Network **(functional neuronal network)** * data.Analysis.Filter **(raster information after filtering by functional connectivity)** * data.Analysis.Ensembles **(information of ensembles found)** * data.Analysis.Ensembles.Count **(number of ensembles detected)** * data.Analysis.Ensembles.Activity **(binary signals representing ensemble occurrences)** * data.Analysis.Ensembles.OnsembleActivity **(fraction of onsemble neurons for each ensemble)** * data.Analysis.Ensembles.OffsembleActivity **(fraction of offsemble neurons for each ensemble)** * data.Analysis.Ensembles.EPI **(ensemble participation index for each neuron for each ensemble)** * data.Analysis.Ensembles.OnsembleNeurons **(indices of onsembles neurons for each ensemble)** * data.Analysis.Ensembles.OffsembleNeurons **(indices of offsembles neurons for each ensemble)** * data.Analysis.Ensembles.Durations **(duration of continuous ensemble occurrences)** * data.Analysis.Ensembles.ContinuousActivationCount **(number of total ensemble occurrences)** * data.Analysis.Ensembles.FrameActivationCount **(total number of frames of ensemble occurrences)** * data.Analysis.Ensembles.Probability **(ensemble probability of being a significant pattern of activity)** * data.Face **(information from the mouse facial recording)** * data.Face.Movie **(information of the facial movie recording)** * data.Face.Movie.Height **(height of the movie)** * data.Face.Movie.Width **(width of the movie)** * data.Face.Movie.Frames **(number of frames recorded)** * data.Face.Movie.FPS **(frame rate, in frames per second)** * data.Face.Whiskers **(whisker motion information)** * data.Face.Whiskers.Energy **(signal of whisker motion energy)** * data.Face.Whiskers.ROI **(whisker ROI information)** * data.Face.Whiskers.ROI.Position **(ROI location of whiskers)** * data.Face.Blinking **(binary signal of blinking detected)** * data.Face.Sniffing **(binary signal of sniffing detected)** * data.Analysis.FaceBored **(same fields as in data.Analysis.Face during a fatigued mouse session)** ## Code This database was generated by using a custom-made MATLAB programs: 1. "Xsembles2P" for extraction of neuronal ensembles from calcium imaging ([https://doi.org/10.5281/zenodo.8423311](https://doi.org/10.5281/zenodo.8423311)) 2. "MouSee" for visual stimulation ([https://doi.org/10.5281/zenodo.7765050](https://doi.org/10.5281/zenodo.7765050)) 3. "MoussionEnergy" for face motion energy ([https://doi.org/10.5281/zenodo.8422691](https://doi.org/10.5281/zenodo.8422691))