This dataset belongs to: Alejandre-García T, Kim S, Pérez-Ortega J, and Yuste R. (2022) Intrinsic excitability mechanisms of neuronal ensemble formation. eLife Goal: The project goal was investigated the synaptic and cellular mechanisms that underlying the formation of neuronal ensembles, which is defined as coactive groups of neurons in spontaneous and evoked activity. Using in vitro electrophysiology and optogenetic in slices of mouse neocortex we replicated a protocol that generates ensembles in vivo (Carrillo-Reid, Science, 2016). After optogenetic and electrical stimulation, we observed biphasic synaptic plasticity change and, unexpectedly, major increases in cellular excitability, due to increase in membrane resistance, and reductions in firing threshold. Contact information regarding analyses: Tzitzitlini Alejandre-García, at3415@columbia.edu or tzitzitlini9@gmail.com Files are MATLAB data files (*.mat), so you need MATLAB to open them. We used Matlab 2020, but they likely can be opened with previous and new versions. Recordings were analyzed with custom routines in MATLAB. All the data consist of electrophysiological recordings of electrical membrane properties, using perforated patch-clamp in voltage-clamp or current-clamp before and after optogenetic or electrical stimulation. For optogenetic stimulation, action potentials were generated by trains of 10 Hz, 5ms light pulses for 4 s followed by a 10 s rest. For electrical stimulation protocol, action potentials were generated with 10 Hz trains, 5–10ms depolarizing currents pulses 400–600 pA for 4 s followed by a 10 s rest. These recordings were not included in the analysis. Electrophysiological recordings were performed at 30 degrees Celsius. Stimulation and acquisition data were sampled at 10 kHz using a Multiclamp 700B amplifier and Patch© open-access software http://impatch.ifc.unam.mx. • Spontaneous activity was recorded in cero current injection during 1 min, in 1-second steps. • Spontaneous activity was used to measure the correlation between the spontaneous activity of pairs. • Also, Spontaneous activity was used to extract spontaneous EPSPs parameters. • Current/Voltage curve (I/V curve) consists of 16 to 20 seconds recording in 1 second steps, as follows: 50 ms delay, 500 ms alternately positive and negative 20 pA current steps from -160 to 160 pA (also -200 to 200pA). Each follow tittle can be found individually in their corresponding folder: • Dryad_Data: please find the data set folder. • Dryad_Scripts: please find the scripts related to the data set. • Dryad_Supplemental Information: please find the supplemental information, figures, and tables, related to the data set and the scripts. 1. The correlation coefficient of connected and no connected pairs. Spontaneous activity of pairs of neurons was recorded in '*.csv' files (cell 1 and cell 2), these files were read with the script 'Read_EPSPs.m', this script read the data and saved it as a '*.mat' files. The same script was also used to save the data before and after spontaneous EPSPs per cell (cell 1_before and cell 1_after). Once the data that came from pairs was in '*.mat' files was read, characterized, and saved using the script 'EPSPsPairs.m'. For calculating the correlation coefficient, the row signals 'cell_signal1 and cell_signal2' were used in the script 'correlation_connectivity.m' to get the correlation of pair of connected and no connected neurons. Database: Correlation coefficient of the first min recording of pair of neurons simultaneously recorded. File Pair 0 in the 1_Correlation_connectivity folder includes the relation connected (1) and no connected pairs (0). Files the Pair 1 ...Pain n in 1_Correlation_connectivity folder includes the data of every pair (Cell 1 and cell2). 2. Correlation coefficient before and after optogenetic, and electrical stimulation or control condition. The files with before and after optogenetic and electrical stimulation and control conditions were processed with the script 'Correlation_stim.m'. Spontaneous activity in all conditions was collected during min 1, 3, 5, 10 15, 20, 25, and 30. This timing can be different for every pair but always 1 - 14 was considered as before and 15 - 30 as after. All collected data from the same neuron were average to get before and after activity and then compared. Files can be found in 2_Correlation_stim folder as follow: • Control Pair_beforeC1_1, ..., Pair_beforeCn_n. This means this is a pair in control condition (C) of the pair 1 minute 1 (1_1). • Photostimulation Pair_beforeP1_1, ..., Pair_beforePn_n. • Electrical stimulation Pair_beforeE1_1, ..., Pair_beforeEn_n. 3. Evoked EPSCs and EPSPs The data correspond to simultaneous recording of IV curve applied in the presynaptic neuron (current-clamp) and the recording in voltage-clamp of the postsynaptic neurons. In the presynaptic signal, the time of the first action potential was detected with the help of a spike detector function 'findpv2', then the time of the first spike was set with the function 'Get_EPSP_time.m', spike time. This spike time was later detected in the smoothed version of the postsynaptic signal. The function 'Get_negative_amplitude.m' obtained the minimum value in a range of 50 frames after the spike time, this is evoked EPSC amplitude. When the function detected a second presynaptic spike, in frequencies ±50 Hz, the function calculates the PPR by dividing 'amplitude 2'/ 'amplitude 1'. All this sequence of functions is organized in the script 'First_EPSC.m'. This data was saved in MATLAB data files as 'EPSC_Amp_PPR_1.mat' To get the amplitude of the first evoked EPSP, the sequence of the data process was similar to the one used to get the measurement of evoked EPSC. With the difference that the recording of the postsynaptic neuron was in current-clamp. To get the evoked EPSP amplitude we used the function 'Get_positive_amplitude.m' to obtain the maximum value in a range of 50 frames after the spike time. This sequence of functions is organized in the script 'First_EPSP.m'. This data was saved in MATLAB data files as 'Amp_PPR_1.mat'. The collected data was finally organized in the MATLAB data files as 'evoked_EPSP&EPSC.mat' and processed in the script 'EvokedEPSP_EPSC_PPR.m'. The data file 'evoked_EPSP&EPSC.mat' also contain the summary of the data collected from Samuel Kim, that was previously processed in 'sk_Coplot_Npcs.m', sk_MiniPlot_2.m, 'sk_psc_analysis3.m', 'sk_TrainPsc_Analysis7.m', 'sk_Wholecell_LTPplot.m', and sk_WHolecell_PPRplot.m. This last data includes most of the data of evoked EPSC and PPR from optogenetic stimulated neurons and control conditions, the analysis of this data extracts the same data under similar principles. 4. Evoked EPSCs and EPSPs by LED in non-expressing neurons The amplitude of the Evoked EPSC and EPSP was obtained by reading the data for every experiment with its respective before, after, and rest. The data correspond to 1 minute of simultaneous recording of postsynaptic neuron and the LED stimulation (optogenetic stimulation protocol of the opsin expressing neurons). The time of every LED pulse was detected with the help of a spike detector function 'findpv2'. The time of the LED pulses was considered as spike time. This spike time was later detected in the smoothed version of the postsynaptic signal, and then, the minimum or maximum value (evoked EPSC or EPSP amplitude respectively) in a range of 100 frames after the spike time was measured and averaged for every condition (before, after, and rest). Amplitude values were saved in 'evoked_EPSP&EPSC.mat' and organized and plotted using 'EPSP_EPSC_LEDevoked_graphs.m'. 5. Spontaneous EPSPs Every file in 5_SpontaneousEPSPs includes the spontaneous activity of the same neuron, before and after optogenetic ('photoEPSPs_1.mat'), electrical stimulation ('electEPSPs_1.mat') or control condition ('crt_crtEPSPs_1.mat'). Spontaneous EPSPs of optogenetic stimulated non-expressing neurons were separated in 'unStimulated neurons' carpet. Every pair of data was read, characterized, and saved using the script 'EPSPs.m'. Where the signal was filtered with a low pass and larger oscillations were removed using the function 'Filter signal_60.m'. This filtered signal was used to detect spontaneous EPSPs with a spike detector with a set threshold of 0.3 for all signals. The function 'Get_frequency.m' detects the spike time, spike time variable was used to measure spike amplitude in 'Get_EPSPs_Amplitude.m' by getting the maximum value of the 50 frames after the spike time. These data were filed and used to get statistic values, compared, and plotted in the scripts 'EPSPs_Statistic.m', and 'Ind_sEPSPs.m' for unstimulated neurons. The script 'EPSPs.m' also contains the variable 'escale1' to before and 'escale2' to the after condition. This variable obtained the average of the whole current-clamp signal that calculates the membrane voltage value. The value was used later to compare the voltage membrane before and after experimental protocols in the script 'membrane_potential'. 6. Intrinsic values The intrinsic values such as firing frequency, resistance, and firing threshold were measured with current injection steps that allow obtaining such parameters, IV curve. The compared data was obtained applying the same IV curve, before and after optogenetic, electrical stimulation, or control condition. Records were saved in '*.csv' files (cell 1_before and cell 1_after), and then read with the script 'Read_IV.m', this script read the data and saved it as a '*.mat' files. Every '.mat' file (IV1_1.mat) was processed in the script 'IV4two.m', in this script, firing frequency current injection dependency was quantified by the detection of the spikes in every positive current injection step, with the function 'Get_frequency_Analysis'. Here, the number of spikes, average frequency, and frequency of the two first spikes were calculated. 7. Resistance and Threshold The same data was used to obtain membrane resistance by calculating the difference between adjacent elements in the voltage signal (diff(step1_volatage step2_voltage)), using the injected current steps from 20 to -120 pA (diff(step1_current step2_current)) the resistance value was calculated for all conditions (resistance = diff voltage/diff current). I/V curve was also used to compare the firing threshold before and after experimental protocols. Because 60 pA was the current step where neurons usually started to fire in both, before and after conditions, the first spike generated by the current step 60 pA was taken. However, the function 'Get_frequency_Analysis' also calculated the threshold for all the first action potential generated by positive current steps. When the function found a spike, it set the spike time and back 550 frames, 550 frames before the spike. The function 'Get_frequency_Analysis' calculated the first derivative with a threshold >0.00015. That is how the function finds the time and the voltage the spike start (voltage threshold) All these data were saved as individual files (one per cell, before and after together) in files like 'PhotoStim_1.mat'. Then, statistics compared were performed with the script 'IntriscParam.m' for firing rate; 'Resistance.m' to compare membrane resistance; and 'Threshold' to firing threshold.