Data Analysis Scripts
The general organization of the included software is as follows:
The raw data files start as Plexon '.plx' files. These files contain raw spike timestamps or local field potential (continuous) voltage values. They also contain event codes that signify various aspects of the task. Knowing what the event codes signify is key to organizing the data. The first step is to use Plexon's offline sorter program to convert the plx file to an nex file. The offline sorter is also the program you will use to cluster sort your neuron's action potentials. Plexon store all of the waveforms that pass the horizontal threshold. You will need to choose the sorting algorithm (principal component, valley, peak, etc.) to cluster your data into the waveforms that represent the neuron and not noise. Click export to nex and it will generate a .nex file with your data.
To process the nex data files, they are first loaded into Matlab, click here for the Plexon-Matlab functions. I use the 'readnexfile' function. This function converts the nex file into a structure, for instance: matdata = readnexfile('nexdatafile.nex'). Thist structure contains your continuous variables (LFP, eye, photo diode, etc), your markers (event codes and timestamps of event codes), and timestamps of action potentials.
The next step is to reorganize the data from 'nex' format into a generic matlab structure. This makes later matlab functions for plotting or statisics much easier since you'll be able to reuse code. My data structures go something like this: MatlabData.Condition.Trialnumber.Trial_information. Each dot signifies a subfield. The Trial_information can be, spike rate for that neuron on that trial, time when the trial started, time when stimulus was on or off, etc.
With the raw data now converted to matlab structures, your ready to analyze/plot away.
5-16-2014, I've added a section (BiModal Gaussian Distribution) that contains a program to estimate and plot a bi-modal distribution of spike widths. I used this function to estimate inhibitory/excitatory neuron groups.