This is a collection of Spike2 scripts written in the years since 2002, mostly by Dirk Bucher. This means that they were written in Spike2 versions 3-8. Most of the older scripts have been tested to work in newer versions, and usually CED makes sure there are no problems. However, scripts are not necessarily backward compatible. Feel free to contact Dirk Bucher if there are problems. The quality of the scripts ranges from “fast hack” to well designed and user-friendly. In addition, some are designed for broad use, while others are fairly specific for tasks that came up in the Marder and Bucher (and other) labs over the years. In general, apart from things like view manipulations that could be useful for anyone, there is a heavy bias toward analysis of rhythmic patterns and spike timing. General use scripts are listed in bold below. Scripts written by Dirk Bucher are in most cases designed to be run from the script bar and close automatically. If you prefer running them from the file view and keeping them open, “out code” the FrontView/FileClose lines at the end. Most scripts accessing time view files automatically operate in the time range between Cursor (1) and Cursor (2). If those are missing or in the wrong order, you’ll be asked if you want to analyze the entire time range instead. With most scripts that output numerical values, results are written into the log window and can then be saved as text files. Annotations are spotty. All scripts have a header with instructions/descriptions. However, the code itself is only annotated in some cases.
Descriptions of the scripts are shown below. You can either download them one by one or you can get all scripts in a fairly small zip file here (version 1604). Also includes a word file with script descriptions.
Spike2 Script Library
Dirk Bucher, May 2016, version 1605
Introduction
This is a collection of Spike2 scripts written in the years since 2002, mostly by Dirk Bucher. This means that they were written in Spike2 versions 3-8. Most of the older scripts have been tested to work in newer versions, and usually CED makes sure there are no problems. However, scripts are not necessarily backward compatible. Feel free to contact Dirk Bucher if there are problems.
The quality of the scripts ranges from “fast hack” to well designed and user-friendly. In addition, some are designed for broad use, while others are fairly specific for tasks that came up in the Marder and Bucher (and other) labs over the years. In general, apart from things like view manipulations that could be useful for anyone, there is a heavy bias toward analysis of rhythmic patterns and spike timing. General use scripts are listed in bold below.
Scripts written by Dirk Bucher are in most cases designed to be run from the script bar and close automatically. If you prefer running them from the file view and keeping them open, “out code” the FrontView/FileClose lines at the end.
Most scripts accessing time view files automatically operate in the time range between Cursor (1) and Cursor (2). If those are missing or in the wrong order, you’ll be asked if you want to analyze the entire time range instead.
With most scripts that output numerical values, results are written into the log window and can then be saved as text files.
Annotations are spotty. All scripts have a header with instructions/descriptions. However, the code itself is only annotated in some cases.
Burst Analysis
1spkMkburst - Creates burst markers at single events, allows using burst and phase analysis scripts when one of the neurons only spikes once per cycle. Dirk Bucher (2007). General Use
batchbfast - Does fast burst analysis for one channel in a sequence of files. Only returns means and SDs for burst duration and cycle periods. Intended for analysis of long-term recordings. Dirk Bucher (2002). General Use
batchburst - Does full burst analysis for one channel in a sequence of files. Intended for analysis of long-term recordings. Dirk Bucher (2002). General Use
burststat - Does single channel analysis of discrete bursts. Dirk Bucher (2003). General Use
gastBin - Analyzes burst parameters of a pyloric neuron over the normalized gastric mill cycle (in gastric cycle bins). Written for the Nusbaum lab to analyze gastro-pyloric interactions in the STG. Dirk Bucher (2015). Specialized
gastropyloric - Does burst analysis of a fast rhythmic signal with respect to a slow rhythmic signal, written for STG data to analyze when each pyloric burst happens in the gastric phase. Dirk Bucher (2005). Specialized
gpPhase - Does burst and phase analysis of a pyloric reference neuron and an additional pyloric (follower) neuron with respect to the phase of a gastric reference neuron. Written for the Blitz lab to analyze gastro-pyloric interactions in the STG. Dirk Bucher (2013). Specialized
missburst - Checks the regularity of alternation of two bursting neurons. Returns normal burst statistics for a reference channel and number of bursts of a second channel in each reference cycle. Quick way to check how much cycle skipping occurs. Dirk Bucher (2012). Fast Hack
mkbursts - Does burst detection from spike events. Creates a marker channel that holds burst starts and ends. Dirk Bucher (2002). General Use
nSpks - Plots the number of spikes per burst into a RealMark channel. Can be used as fast check for burst variability. Dirk Bucher (2012). General Use
periodcount - Counts the number of pyloric cycles (with fraction) within each gastric cycle. Dirk Bucher (2005). Specialized
phaseburst - Analyzes rhythmic bursting in 2-3 neurons fairly completely (in phase and time, and with optional spike analysis). Dirk Bucher (2002). General Use
PRC - Does phase response curve analysis. Dirk Bucher (2003). Fast Hack
pyloricBmk - Detects PD, LP and PY spikes and bursts if good enough for simple thresholding (faster than doing it one by one). Dirk Bucher (2005). Specialized
pyloricPhase - Customized version of "phaseburst" for analysis of pyloric rhythms from extracellular recordings. Dirk Bucher (2003). Specialized
pylPhConsec - Pyloric phase analysis from consecutive files toanalyze long-term recordings. Dirk Bucher (2005). Specialized
The_Crab_Analyzer - Does Spike detection , burst detection, and phase analysis to quantify pyloric and gastric rhythms all in one go. Wolfgang Stein (2009). Specialized
trigBurst - Does analysis of repetitive episodes of bursting. Dirk Bucher (2005). General Use
Channel Editing
AddChan - Generates an event channel that holds events of two input event channels. Dirk Bucher (2002). General Use
artiCut - Cuts out stimulus artifacts from a waveform channel and replaces them with a linear interpolation. Useful for removing short artifacts where data loss in that time window is not important, or where artifacts are inconsistent. Dirk Bucher (2012). General Use
artiSubtr - Removes stimulus artifacts from recording traces by subtracting a template average artifact waveform. Useful for removing artifacts with minimal data loss in traces with consistent artifact waveforms. Dirk Bucher (2012). General Use
chunkreplace - Copies a chunk of waveform from one channel and place it into another channel. Dirk Bucher (2012). Fast Hack
ClearProc - Clears all Channel Processes (like "smooth" or "rectify") from all channels. Dirk Bucher (2012). General Use
EditEvt - Allows to delete or add events or markers from event or marker channels "by hand". Dirk Bucher (2007). General Use
setBursts - Generates an event channel with "artificial bursts". Useful for generating test data sets. Dirk Bucher (2002). General Use
subtrSpikes - Subtracts events of one channel from another. Dirk Bucher (2002). General Use
WinSubtr - Deletes events in an event channel in time windows defined by markers in a marker channel. Dirk Bucher (2004). General Use
File Manipulation
batchImp - Converts a batch of files in foreign format (e.g., Axon) into spike2 files. Dirk Bucher (2002). General Use
ConcatFiles - Concatenates consecutive time view files (waveform channels only). Dirk Bucher (2007). General Use
RepFileMerge - Creates a new file that holds event and waveform channels from two source files that were recorded with matching stimulus patterns. Channels aligned at reference stimulus patterns can then be used for virtual channel calculations. Dirk Bucher (2013). General Use
Plot
EMFseq - Outputs a sequence of metafiles from time views. Useful for making movies or images of longer time stretches at decent resolution. CAN NOW EASILY BE EXTENDED TO ALLOW TIFF OR JPG, JUST HAVEN’T DONE THAT YET. Dirk Bucher (2005). Fast Hack
floatingBar - Creates an XY view floating bar chart with error bars. Values are entered manually.Fast way to create phase plots for CPG patterns. Wolfgang Stein & Dirk Bucher (2009). Fast Hack
mSweepAve - Plots multiple sweeps of AVERAGED waveform data with fixed delay and duration from a trigger (XY plot). Dirk Bucher (2014). General Use
multiSweep - Plots multiple sweeps of waveform data with fixed delay and duration from a trigger (XY plot). Dirk Bucher (2002). General Use
PhSweepAve - Creates both a multiple sweeps window and an average of waveform data in phase, i.e. normalized to the sweep duration. Dirk Bucher (2016). General Use
PoissCreate - Makes a file with an event channel in Poisson distribution. Dirk Bucher (2016). General Use
respMk - Creates artificial unitary passive responses from spike train event channel input using a te-at function. Useful to create artificial EPSP or contraction responses to a spike pattern. Ralph DiCaprio & Dirk Bucher (2002). General Use
SquareWave - Creates a waveform channel with square signals, at time points taken from an event channel. Dirk Bucher (2013). Fast Hack
SweepAve - Plots average from multiple sweeps in XY file. Only uses visible channels. Dirk Bucher (2016). General Use
SweepDiff - Plots the difference between two multisweep plots, as generated with "MultiSweeps". Useful for leak subtraction and difference currents from VC protocols. Dirk Bucher (2004). General Use
TrigEMF - Outputs a sequence of metafiles from time views triggered by events. Useful for making movies or images of longer time stretches at decent resolution. CAN NOW EASILY BE EXTENDED TO ALLOW TIFF OR JPG, JUST HAVEN’T DONE THAT YET. Dirk Bucher (2005). Fast Hack
WolfieSweep - Version of "multisweep" for more than 2 channels. Wolfgang Stein (2005). General Use
XYIhleak -Subtract leak from Ih measurements by scaling the response to the smallest command and subtracting it from all step responses. Alternative to subtracting leak from backward fits (script”Ih_fit”) under waveform analysis. Dirk Bucher (2016). Fast Hack
Spike Analysis
burstDelay - Analyzes delays and spike waveforms from burst stimulations of axons. Dirk Bucher (2012). Specialized
delFilter - Sorts spikes according to 2 different delay times between 2 recording sites. Dirk Bucher (2002). General Use
delFix - Plots delays between stimuli and spike responses, lets you edit for spike failures and ectopic spikes. Dirk Bucher (2016). Specialized
delPlot - Plots delays between stimuli and spike responses into a RealMark channel. Dirk Bucher (2012). Fast Hack
delTest - Plots delays between stimuli and spike responses into a RealMark channel, even if number of events are not matching. Useful for identifying spike failure times.Dirk Bucher (2012). Fast Hack
FailEctZoom - Checks for spike failures or ectopic spikes in burst stimulations, and zooms in on the next occurence of a mismatch between stim and response event channels. Dirk Bucher (2011).Specialized
IF_ISI - Returns intervals and instantaneous frequencies for an event channel.Dirk Bucher (2002). Fast Hack
PoissDel - Analyzes delays and spike waveforms from poisson stimulations of axons. Dirk Bucher (2012). Specialized
pPulse - Analyzes spike delays and waveform parameter changes from paired pulse recovery cycle protocols. Dirk Bucher (2010). Specialized
rate_meanfreq - Returns spike numbers and mean frequency in defined bins from an event channel.Dirk Bucher (2002). Fast Hack
tPulse - Analyzes spike delays and waveform parameter changes from recovery cycle protocols with conditioning trains. Dirk Bucher (2010). Specialized
View Manipulation
ChanWeight - Sets the relative vertical space taken up by a channel. Dirk Bucher (2007). General Use
CurLabelSwitch - Switches cursor label mode between "no label", "position only", "number only", and "position (number)". Dirk Bucher (2012). General Use
DelCur - Deletes all cursors (vertical and horizontal). Dirk Bucher (2002). General Use
displSwitch - Switches between default font and font sizes and larger fonts. Dirk Bucher (2003). General Use
optimise - Optimizes y-range for all channels. Similar to Ctrl+Q, but optimizes all channels, even unselected ones. Dirk Bucher (2002). General Use
TimeMax - Maximizes x-axis.Dirk Bucher (2002). General Use
Waveform Analysis
aab - Measures area above baseline (voltage integral) for single or compound EPSPs or EJPs.Dirk Bucher (2002). General Use
ClearFit - Removes all fits from all channels in result view or waveform channels or XY plots.Dirk Bucher (2009). General Use
decayfit - Returns time constants from dual exponential fits for PSPs or spikes as marked with event channel.Dirk Bucher (2010). Fast Hack
Ih_fit - Measures IV values, time constants and tail currents from multisweeps of non-leak subtracted Ih Vclamp data. Dirk Bucher (2008). Specialized
IMI_XYcursors - Drops cursors into an XY view IV plot of IMI for fast measurements, returns values to log window. Dirk Bucher (2013). Fast Hack
IMIcont - Creates IV plots of the modulator activated inward current from continuous (repeated) voltage clamp ramps during peptide application. Dirk Bucher (2012). Specialized
instCorr - Creates fast scatterplots of EPSP or EJP amplitudes from 2 waveform channels to see if they are correlated. Dirk Bucher (2005). Fast Hack
IVcurve - Returns IV values from time views of step protocols. Dirk Bucher (2004). Fast Hack
P5protocol - Creates a multisweep xy view of the summed step sequence from P/5 protocol data. For leak subtraction using the "SweepDiff" script. Dirk Bucher (2009). Specialized
PPsubtr - Subtracts conditioning pulse waveform from paired pulse responses and does paired pulse analysis.Dirk Bucher (2014). General Use
PSPparamAv - Returns PSP parameters from a waveform average. Dirk Bucher (2002). Fast Hack
RampIV - Creates difference current and IV plot from result files averaged from voltage ramps run to measure IMI in STG neurons. Dirk Bucher (2012). Specialized
SpkShapeSingle - Returns spike shape or EPSP shape parameters like peak voltage, time to peak and 2 time constants of exponential decay. Dirk Bucher (2014). Fast Hack
SynVC - Modification of "XI_IVcurve", specifically for synaptic currents from VC expts. Useful for analysis of slow graded synaptic currents in STG neurons. Ayanna Bryan & Dirk Bucher (2010).Specialized
trainPSPamp - Measures the amplitudes of PSPs in trains or bursts.Dirk Bucher (2002). General Use
TrigPSP - Returns PSP parameters for separate events.Dirk Bucher (2002). General Use
WaveToEv - Does event detection from waveform channel (peak, trough, threshold) and writes results into real event channel. Dirk Bucher (2002). General Use
winDiscr - Window Discriminator for event detection based on horizontal cursors. Dirk Bucher (2002). General Use
XY_IV - IV measurements from VC or CC step protocol data in XY views created with “multiSweeps”. Dirk Bucher (2013). General Use
XY_TabOut - Outputs xy view data as a text file with tab separated columns. Dirk Bucher (2009). Specialized