Tutorial Contents

Spike shape analysis

Mark features

Average

Noise reduction

Derivative calculation

Sample rate upscaling

Contents

Spike Shape Analysis

A fairly common task in some fields in neuroscience is to characterise intracellular spike shape with specific numerical values representing features such as threshold voltage, width at half-height etc. The Analyse: Spike shape facility helps with this.

You have to start this with a data trace containing the spikes (obviously) and an event channel containing events that locate spikes, where each event encompasses the peak of a single spike. The exact timing does not matter, so long as the peak is within the eventThe simplest way to detect intracellular spikes is usually with the Event edit: Threshold facility, with high-pass pre-filtering if necessary to remove any big DC shifts..

raw spikes
Raw spikes ready for shape analysis
Analyse spike shape dialog
The Spike shape analysis dialog.

Within the dialog, the graph on the left shows the waveform profile of the spike from the event specified by the Spike ID, over the specified region of interest (RoI) on either side of the spike peak. So in this case we are looking at the waveform 8 ms on either side of the peak of the first spike in the recording. The graph on the right shows the phase plane of the spike (voltage on the X axis, rate of change of voltage (1st derivative) on the Y axis).

You can scan through each spike in the recording by clicking the up spin button of the Spike ID. You can also, of course, edit the ID value directly.

Mark features

The controls in the Mark panel specify what spike characteristics are marked and measured.

If you check the Write events box then events will be written into the selected channels so as to mark the timing of the features in main view when you exit the dialog box by clicking OK (no events are written if you exit with Cancel). Note that the time and amplitude resolution of data values marked as events is limited to the sample values and intervals of the original recording. Data values shown with the List facility may be more accurate since intermediate values are calculated where appropriate by linear interpolation between samples.

The following features can be marked. If the feature cannot be detected, then no mark is made and -999 displays with the List command.

Peak

This marks the peak of the spike – the maximum voltage within the event specifying the spike.

Threshold

This estimates the spike threshold. For each threshold type, the time from the point at which the rising voltage crosses threshold to the time at which the falling voltage re-crosses the same threshold is marked.

Conceptually, threshold voltage is the “point of no return” at which the membrane potential takes off towards the spike peak, and although it can be defined absolutely in terms of membrane currents (Platkiewicz & Brette, 2010), it can only be estimated subjectively from the waveform profile. However, there are objective criteria which can be used to aid that estimation, although none of them are completely satisfactory for all types of spike profiles (Sekerli et al., 2004).

Voltage (User mV): The simple voltage threshold is the latest time before the spike peak at which the voltage crosses the user-specified value. You can specify the value either by directly editing the User level, or by clicking at an appropriate point in either graph. For this recording, a value of -26 mV gives a reasonable by-eye estimate of the threshold which works quite well for each spike in the recording.

Rate of rise (User dV/dt): The rate-of-rise threshold is the latest time before the maximum rate of rise at which the specified rate of rise is achieved. You can specify the value either by directly editing the User level, or by clicking at an appropriate point in either graph (in the Spike graph the rate of rise is set to the value at the time location clicked, rather than the voltage location). Note that clicking on the Spike graph may give unexpected results because there may be several locations on the spike waveform that have the same rate of rise. It is the latest before the maximum rate that will actually be marked.

Specifying the rate of rise is one of the standard ways of specifying threshold objectively. The default value of 10mV/ms works well for some spikes, but fails dismally for the 3rd and 5th in this recording.

Maximum 2nd Derivative (Max d2V/dt2): Working back from the spike peak, the local maxima for the first, second and third derivative are successively identified, and that of the second derivative is taken as the threshold. If you use this you may need to smooth the waveform or derivative (see below), since higher derivatives are very susceptible to noise.

Maximum 3rd Derivative (Max d3V/dt3): Working back from the spike peak, the local maxima for the first, second and third derivative are successively identified, and that of the third derivative is taken as the threshold. If you use this you may need to smooth the waveform or derivative (see below), since higher derivatives are very susceptible to noise.

The 3rd derivative method provides a good “by eye” fit to what appears to be threshold for the spikes in this recording.

Rise inflection: When a spike is triggered by an EPSP or current injection, the waveform initially rises with a rate of rise that decreases with time (a classic RC charging curve). However, if the stimulus leads to a spike, the rate of rise starts to increase again, as the voltage dependent channels are activated. The time of this inflection, if it exists, is automatically detected. This method tends to work well for spikes elicited by current injection, but less well for spontaneous spikes or spikes generated by multiple EPSPs (as is the case in the sample recording).

Phase-plane inflection: This attempts to identify the point where the phase-plane graph starts to curve strongly upwards from the rest position, which presumably indicates an overall increase in inward current. It is Method II described by Sekerli et al. (2004), and reports the voltage at the peak of the second derivative with respect to voltage in the phase-plane, at a voltage below that of the maximum rising slope. It works well for some spike shapes, but, like all the other methods, less well for others!

The half-height width, which is the width at the voltage which is half way between the threshold and the peak, can be marked. Similarly, the 10%-90% rise time, which is the time delay from 10% above threshold to 90% above threshold (where the spike peak is 100%), can be marked.

Peak-trough

This marks from the peak to the first trough after the peak, if any trough is detected. In the sample file, only Spike 5 has a trough within the RoI (and this is caused by a following EPSP rather than a post-spike hyperpolarization).

Max rise

This marks the point at which the maximum rate of rise of the voltage (i.e. the peak of the first derivative) before the spike peak is achieved.

Max fall

This marks the point at which the maximum rate of fall of the voltage after the peak is achieved. In this case the time measurement is backwards to the same voltage on the rising phase.

A particular set of analysis parameters can be Saved to a configuration file and re-Loaded for subsequent analysis of other files if desired.

Average

Check the Average box to display the average of all spikes marked by events in the trace, rather than the individual spikes. By default, the registration point for averaging is the time of the Peak of each spike, but if you wish you can set this to be the time at which Threshold is crossed (see below for how to define threshold).

Noise reduction

If you have a lot of noise in the recording you can apply a Savitzky-Golay filter. Membrane noise can have a big effect on the derivative of the waveform, and since several analysis routines depend on this, noise reduction may be crucial.

Smoothing the waveform does reduce noise, but it is also effectively low-pass filtering and so can distort the spike shape, so smoothing should be kept to the minimum necessary The S-G filter has 2 user-specified parameters: the polynomial degree, and the number of samples in the window over which the polynomial is fitted. For a spike, a relatively high-order polynomial (degree 6) is probably best.

Derivative calculation

The voltage derivatives can be calculated either using a fourth-order finite difference method (the default), or using a Savitzky-Golay filter. The latter automatically applies smoothing to the derivatives.

Note that you can apply smoothing to both the waveform and the derivatives if you wish – the waveform smoothing is done first, and then the smoothed derivatives are calculated from the smoothed waveform.

Sample rate upscaling

If a data file is recorded at a relatively low sample rate, the waveform in the “join the dots” standard display may not show the shape of the spikes accurately.

The ADC sample rate for this file was 10 KHz, which definitely meets the Nyquist criterion for the data, but does not provide a good "join the dots" display - the first spike apparently has a lower peak amplitude than the second spike.

The peak of the spike is clearly truncated, and the jagged phase-plane graph reflects the paucity of data points within the spike itself.

So long as the Nyquist criterion has been met, the apparent data sample rate can be increased by interpolation using the FFT technique.

The spike now has a more realistic shape, and its peak amplitude is now 30.8 mV. The interpolated waveform (black trace) is slightly delayed relative to the raw data (red trace), but its width and general shape appears undistorted. The phase-plane graph is now smooth.

The measured peak amplitude of the second spike is slightly increased (to 31.6 mV), but now the two spikes have peak amplitudes that are very similar. The apparent difference in amplitude in the raw data is due to the A-D converter not acquiring a sample at the exact time of the peak of the first spike, but nearly doing so for the second spike.

Frequency upscaling should be used with care since it can introduce spurious oscillations in the flatter portions of the waveform (the Gibbs effect), although this has been minimized by applying a window which tapers to zero on either side of the region of interest. Better results may be obtained by using the Transform: Increase frequency option on the whole file. This works purely in the time domain, and artefactual oscillations are limited to the start and end of the data file as a whole (rather than just the spike window as is the case here). However, this obviously produces a proportionally larger file.