Independent Component Analysis (ICA)
ICA15a.s2s & ICAutils.s2s (01/19)
ICA refers to a group of mathematical methods for separating sampled waveforms into statistically independent components. It is very useful for extracting the underlying signals from a group of recordings where each individual channel is an unknown mixture of signals from several underlying generators. For example, ICA offers a solution to the classical "Cocktail party problem": Can one disentangle individual voices from a conversational hubbub? ICA can do this provided that the sound was recorded from several different positions using multiple microphones.
ICA is also applicable in physiological recording situations where multiple electrodes are used to record underlying signals, for example, scalp EEG electrodes, intra-cranial multi-electrode EEG recordings, surface EMG recordings or electrode arrays in a tissue culture. Importantly, the method can also separate mains hum and sources of electrical interference from signals of physiological origin.
The price that you pay for excellent signal source separation is loss of amplitude information, - the results are normalised. However, if you can accept this limitation, ICA may be a very powerful form of analysis and well worth investigating.
The package includes:
|ICA15a.s2s and ICAutils.s2s
|The main script and library of script functions
|User guide to the script
|An introduction to the the maths underlying ICA
|Sampled Sounds.smrx / .s2rx
|Example data containing a number of entangled musical tracks
|icEEG example.smrx /s2rx
|Example data from 3 intra cranial EEG electrode arrays heavily polluted with mains hum
This script requires Spike2 version 9.
Rectify and Integrate waveforms
Integrate 01.s2s (06/16)
Extra-cellular multi-unit activity from peripheral nerves can be difficult to quantify. Individual units may not be identifiable because the signal to noise ratio is too low or too many units are activated simultaneously. In these circumstances, it can be helpful to rectify and integrate the signal over a short time range to convert the activity of an ensemble of units to a level that can indicate changing responses to stimuli. This script works on- or off-line on up to 4 source channels sampled at the same rate. You can increase the number of channels processed on-line by minor edits to the script.
This script has been tested with Spike2 v7.17 or higher.
This script calculates 'median' value of a selected waveform between two cursors and tabulates results in the log view. The median is the mid-point of the data range, that is, half of the data points are lower and half are higher values. This measurement is not currently available from the Cursor Regions dialog.
Note that calculating the median could take a noticeable amount of time when the number of data points in the chosen range is large.
There is a user guide on page 1 of the script file.
The script requires Spike2 v7.20 or higher.
GrandAv 02a.s2s (12/18)
Use this script to build average views from multiple result views, i.e. PSTH's, interval histograms, waveform averages, and power spectra. Both source and destination views may contain multiple channels. There are manual and batch processing options:
- Batch processing allows you to create a grand average from all of the result views in a folder. You can add each channel in the source files to the corresponding channel number in the grand average. Alternatively, you can add all channels in the source files to a nominated single channel in the grand average.
- Manual mode: Here, you can choose which channel in the source to add to which channel in the destination grand average step by step.
Each channel in a multi-channel grand average view has its own sweep count held in the channel comment.
The user guide is on pages 1 -3 of the script file.
The script requires Spike2 v 7.11 or higher
Multiple cross-channel correlations
This script generates multiple spike correlation histograms for all combinations of templated spikes in a channel. Currently it allows for up to 8 spike templates per channel (including code 0) for correlating between channels in the file.
The script is controlled from a toolbar where the user can open a data file for analysis and control the parameters for the correlation as well as the number of correlation results views to display at any one time. A suitable example data file, Extracellular spikes.smr, is included in the Data folder of your Spike2 directory.
This script requires Spike2 v7.20 or higher.
Interactive feature detection
This script allows the user to interactively import peaks, troughs or threshold crossings based on an amplitude value defined with a pair of horizontal cursors, or a single horizontal cursor used as a threshold crossing.
The script utilises an idle routine that automatically updates the memory channel holding the event markers if the user adjusts the amplitudes or threshold levels. A suitable example data file, Blood pressure waveform.smr, is included in the Data folder of your Spike2 directory.
This script requires Spike2 v4.24 or higher.
Automate Cursor Regions Measurements
This script automates the process of taking multiple Cursor Regions type measurements. You simply specify the source channel, the type of measurement to take and the time range over which to make it. For example one could specify the mean of a waveform to be measured in 30s bins. The results can be plotted as a RealMark or tabulated in the log. As a further refinement you can specify a State channel and marker codes to gate the analysis to time ranges of interest.
This script requires Spike2 v6.06 or higher.
Fit a Gabor Function
The Gabor function is a sine wave damped by a Gaussian function.
This script allows you to fit a Gabor function to physiological data. An example application might be to detect oscillatory neural activity in auto-correlograms, e.g., Young et al (1992). The script also generates test data that you can use to familiarise yourself with the curve-fitting procedure.
You could also use this script as a template for fitting other functions by non-linear regression using the FitNLUser() script function.
This script requires Spike2 v6.06 or higher.
Young MP, Tanaka K, Yamane S (1992) On Oscillating Neuronal Responses in the Visual Cortex of the Monkey J NeuroPhysiol 67:1464 - 1474
Record and analyse respiratory data
Resp 80t.s2s (01/21)
This archive contains scripts that enable you to:
- Calibrate a pneumotachograph, the type of flow meter commonly used to record breathing
- Convert the pneumotach. output to BTPS flow and BTPS volume online
- Analyse respiratory data
The respiration analysis script enables you to:
- Subtract drift from volume and flow traces
- Measure inspired capacity (IC) and forced vital capacity (FVC) manoeuvres
- Perform breath by breath analysis of many respiratory parameters
- Plot Flow-Volume loops
- Plot a composite maximal flow-volume loop using the script: Loop Env.s2s
- Plot and tabulate slope ratio of Maximal Expired Flow-Volume loops
- Investigate flow limitation during exercise by making comparative measurements of F-V loops
- Plot Volume-Pressure loops
- Measure elastic and resistive components of Work of Breathing
The archive also includes user guides, example data files and sampling configurations that should help you to get started. These scripts require Spike2 version 8.09 or higher.
They are beta versions. Send your bug reports and ideas for further development to email@example.com
LVP Analysis Resp Phases
LVP_Analysis_Resp Phases.s2s (06/21)
In this Spike2 script, we use physiological left ventricle and tracheal pressure signals, obtained simultaneously by catheterization, to determine the interactions between cardiac hemodynamics and respiratory function. Metrics of systolic and diastolic function are calculated and separated into inspiratory, early expiratory, and late expiratory phases of respiration to characterize the effect of each respiratory phase on parameters of left ventricle function.
This script requires Spike2 v10.01 or higher.
On/Offline Measurement from a Blood Pressure Trace
This family of Spike2 v7 scripts and sampling configurations allows you to perform long-term recordings of blood pressure, heart rate and sympathetic activity and to analyse baroreceptor reflexes and heart rate variability. The scripts are suitable for use with a range of laboratory animals and can record data from up to 8 animals simultaneously when used together with telemetry systems.
HRBP8b.s2s derives systolic, diastolic and mean blood pressure, heart rate and respiratory rate from each blood pressure trace. Data from up to 8 animals can be analysed on- or off-line. Results are recorded continuously or according to a user-defined schedule, e.g. 10 minutes per hour. Data can be auto-saved to a new file at regular intervals (e.g. every 24 hr.) in order to achieve virtually continuous recording over days or weeks.
MergeFiles.s2s /SplitFiles.s2s These utility scripts allow you to splice auto-saved data files end to end before further analysis and to split data related to different animals into separate data files.
sBRG.s2s This offline script calculates baroreceptor reflex sensitivity based on spontaneous fluctuations in blood pressure.
SigFit.s2s Fits sigmoid curves (4 and 5 parameters) to heart rate and blood pressure data derived from steady-state experiments.
HRV1.s2s Performs frequency domain analysis of heart rate variability.
Poincaré s2s Performs non-linear analysis of heart rate variability.
HRBPtable.s2s Generates tables of results suitable for further analysis with spreadsheet software.
Baro5.s2s This is a library of script functions required by the SigFit script.
This family of Spike 2 scripts require v7.12 or higher.
Plot heart rate and RR interval based on ECG
HR_RRecg.s2s (08/23) New!
This offline script generates a heart rate channel (bpm) and an RR interval channel (ms) based on an ECG channel in the current time view. There is also an option to create a table of heart rate and RR intervals beat by beat, along with keyboard markers and TextMarks (often used to indicate the timing and details of experimental treatments). The script includes a brief user guide that displays when you click on a toolbar button.
The script requires the latest Spike2 version 8, v.9 or v.10.
Blood pressure analysis
HR_BP.s2s (07/23) Improved!
This script allows you to:
Create additional channels in your data file derived from a blood pressure trace. The extra channels available are: Heart rate, inter-beat interval, diastolic bp, systolic bp, and pulse bp.
Process a single bp trace online or multiple bp traces offline.
Simulate online recording by replaying an existing time view using the REPLAY button.
Display a table of "current" blood pressure statistics that updates every second online or during REPLAY.
Generate a table of beat times and amplitudes for each derived channel in a grid view. There is also an option to include experimenter's notes and stimulus timing information stored in the Keyboard marker and TextMark channels. This table can be saved or pasted into spreadsheet software for further analysis.
This script requires v8.20 or higher.
Analysis of heart rate and blood pressure variability
The HRV_10 script performs frequency domain analysis of pulse interval (PI) and also variability of systolic and diastolic blood pressure.
Long-term recordings are subdivided into user-defined epochs with separate power spectra for each time range.
HRV waveforms can be edited to exclude artifacts prior to the generation of multi-channel power spectrum views.
Spectra are subdivided into user-defined VLF, LF and HF bands and the levels are plotted to the source data file and tabulated in a spreadsheet.
A second script HRV10 revu.s2s provides a convenient method for reviewing existing data files.
Both scripts require Spike2 v9.17 or higher.
This script generates an amplitude distribution histogram from a Waveform, RealWave or WaveMark channel. You can select the required channel, time range, amplitude range and bin size using a combination of cursor dragging and dialog entries. The results can be displayed in various forms including number of points, Time and percent time in each amplitude bin. A user guide is included in the comments at the head of the script.
This script requires Spike2 version 6,04 or higher. It also makes use of functions in the script file GHutils.s2s (included in the download). This file must be located in a folder called include located inside the directory holding your copy of Spike2.
Separate traces from stereotrode and tetrode channels
This script will take a selected channel of multiple trace WaveMark data and create additional memory channels in the data file, each holding a single trace from the source channel. The user selectes the channel and type (stereotrode or tetrode) from a dialog when the script is run. A suitable example data file, Tetrode data.smr, is included in the .zip file.
This script requires Spike2 v5.21 or higher.
Detecting event bursts using Poisson Surprise
This script detects bursts of events against a background of more random events.
Improved burst analysis
Create level channels in a data file that mark groups of Events, Markers or Wavemarks. Plot burst duration, inter-burst interval, burst period or events /burst vs time.
Create additional channels showing burst rate, burst onset times, and events within bursts and events not in bursts.
Generate a table of burst statistics that can be easily copied to a spreadsheet for further analysis.