Updated 23 Aug 2016
Common analysis of action potentials includes calculating amplitudes, their timing, frequency of firing, threshold voltage, and half-widths. This scripts helps to automatize this process.
Original code had some parameters hard-coded for a specific project. Version 1.1 should be usable for any project. If you find bugs, please let me know: email@example.com.
1) abfload.m was upgraded to 2.0 that allows to load .abf files from more recent versions of pClamp.
2) Updated frequency calculation: Now code checks the whole duration of each sweep (used to just use 2 seconds)
3) Threshold identification is now manual for better precision at a cost of slower analysis (used to be detected automatically, but was highly unreliable). Just use a cross-hair pointer to choose thresholds for each spike. Code puts a black circle on the point where you clicked. The figure with trace is forced to open in full screen mode to aid choosing the exact point of threshold.
4) Half-widths are now calculated more precisely. They are not exact due to inability to choose the time point where voltage was exactly 50% of amplitude. Instead, the closest sample is chosen. The error is measured in voltage offset of sample chosen to true 50% amplitude value, it is normalized to amplitude and exported to the Excel file.
5) Excel export includes: amplitude value in mV, the times of amplitudes in msec, action potential frequency in Hz, thresholds for each action potential in mV, the times when thresholds were breached in msec, half-widths in msec, relative errors for both sides when estimating half-width in %
6) batch_process.m is added which scans local directory for .abf files and executes APanalysis.m on all of them.
* Re-worked spike_times.m, which was identifying multiple spikes on the same action potential.
Roman Popov (2023). APanalysis (https://www.mathworks.com/matlabcentral/fileexchange/45667-apanalysis), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Inspired by: fcollman/abfload, spike_times(trace,threshold1)
Inspired: Current Clamp Analysis from WinWCP
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
1) abfload.m was upgraded to v2.0