########################## Required external libraries: SKLEARN MATPLOTLIB NUMPY SCIPY ########################## Bespoke libraries included with this code: DATACLASSES Simple objects for saving details of individual trials and average behaviour of neurons across all trials of an experiment ########################## Python scripts 1 PROCESS TRIAL DATA. This brings in raw data files, processes them and save them in .npy files. This must be run before any other scripts, as the other scripts use these .npy files as input. 2 PAIRS. This is used to determine whether response similarity between neurons is more clustered than might be expected at random. 3 SVM GONOGO ETC. This is used to analyse how well the dff data of each neuron can predict GO/NOGO or LICK/NOLICK status of trials. Performance is compared against 100 surrogates generated by shuffling trial labels. Neurons were deemed to support classification at a significant level of performance if they performed better than 95 of the surrogates. Before running this script, the required values for brain_area (S1, S1naive or PPC) and type_of_analysis (GO or LICK) should be set in the code. Since this script takes a longtime to run, output files are created, allowing analysis to be run separately without having to rerun these SVMs each time. 4 ANALYSE SVM. This uses files created by "SVM GONOGO ETC", which therefore must be run in advance for the brain area being investigated - once for GO/NOGO SVMs and once for LICK/NOLICK. The script plots: a) scatter plot of how well each neuron performs at predicting GO/NOGO and LICK/NOLICK from its dff data. Neurons which outperform 95% of surrogates are shown in red. b) 2d scatter plot of each neuron's GO/NOGO prediction performance vs. LICK/NOLICK. Different colours are used to indicate whether it outperforms 95% of surrogates on neither test, one of them or both of them.