Data and code to reproduce the figures and tables of: Pala, A., and Stanley, G.B.(2022).Ipsilateral stimulus encoding in primary and secondary somatosensory cortex of awake mice. J.Neuroscience 3 items are part of the download: 1) Data folder: "Data" - .mat file containing the list of recordings included in the analysis and some metadata:"Expts_in_Analysis_PalaStanley2022" - Data from each recording are located in distinct folders labeled "AP0xx_n_S1/S2". - Each individual recording folder contains at most 6 subfolders containing preprocessed data regarding : a) Individual RS and FS neuron spike times for a 2 sec period centered on the whisker stimulus onset time (t=0): "SU_APtimes" b) Individual RS and FS neuron single-unit isolation quality metrics and classification criteria: "SU_Metrics" c) Individual RS and FS neuron stimulus responsiveness and response sign: "SU_StimResponsiveness" d) Individual RS and FS neuron average spike waveform: "SU_Waveforms" e) Classification of stimulus trials as occuring during Whisking, Quietness or Others: "WhiskQuiet" f) LFP CSD response to contralateral whisker stimulation: "CSD_ContraStim" 2) Main code to reproduce the figures: "PalaStanley2022_CodeFigures_Sharing.mat" 3) Folder containing auxillary functions called in the main code: "NeededAdditionalFunctions" This code was written and tested in Matlab R2017b Aurelie Pala, Stanley lab, 2022.