Skip to content

marsiwiec/spike-doctor

Repository files navigation

Spike Doctor

A Shiny web application for analyzing whole-cell current-clamp recordings. Spike Doctor detects action potentials and extracts electrophysiological features from Axon Instruments ABF files using pyABF and eFEL.

Features

  • Batch processing of multiple ABF files
  • Spike detection with configurable voltage and derivative thresholds
  • Electrophysiological feature detection via eFEL
  • Interactive plots: raw traces, F-I curves, and phase-plane plots
  • Exports: CSV, multi-sheet Excel, and PDF summary plots
  • Analysis Logs tab for real-time troubleshooting
  • Debug plots with on-demand sweep selector, detection threshold overlay, and marked spike peaks

Installation

Docker (recommended)

git clone https://github.com/marsiwiec/spike-doctor.git
cd spike-doctor
docker compose up

Then open http://localhost:8000.

Standalone executables

Pre-built binaries for all platforms are available:

Platform Architecture Artifact Run
Windows x64 SpikeDoctor-windows-x64.exe Download and run directly
macOS x64 (Intel) SpikeDoctor-macos-x64 chmod +x then run
macOS arm64 (Apple Silicon) SpikeDoctor-macos-arm64 chmod +x then run
Linux x64 SpikeDoctor-linux-x64 chmod +x then run

The console window must stay open while the app is running.

Windows security warning

Because the executable is not code-signed, Windows Defender / SmartScreen may show a warning like "Windows protected your PC" or "Microsoft Defender SmartScreen prevented an unrecognized app from starting."

To proceed:

  1. Click "More info" on the warning dialog.
  2. Click "Run anyway".

To build from source:

uv pip install pyinstaller
pyinstaller SpikeDoctor.spec

Manual (uv)

git clone https://github.com/marsiwiec/spike-doctor.git
cd spike-doctor
uv sync
uv run shiny run app.py

Then open http://127.0.0.1:8000.

Nix + uv

For Nix users, a flake-parts dev shell is included:

git clone https://github.com/marsiwiec/spike-doctor.git
cd spike-doctor
nix develop   # or `direnv allow` if using nix-direnv
uv sync
uv run shiny run app.py

Quick Start

  1. Upload one or more .abf files.
  2. Adjust parameters if your protocol uses a non-standard stimulus epoch or spike thresholds.
  3. Select features from the Basic tab or search/filter the Advanced tab.
  4. View results in the Summary Plots, Results Table, Debug Plots, and Analysis Logs tabs.
  5. Export as CSV, Excel, or PDF.

File Support

  • Format: Axon Binary Format (ABF)
  • Recording mode: Current clamp only so far

Known limitation: ABF v1 with float data

Some older ABF v1 files (e.g., recorded with legacy Axon software or exported from other programs) store data as 32-bit float rather than 16-bit integer. pyABF does not support float-encoded ABF v1 files and will raise:

ValueError: Support for float data is not implemented

Workaround: Open the file in Clampfit, then re-save it as an ABF v2 file:

  1. Open the file in Clampfit.
  2. Go to File → Save As...
  3. Choose ABF 2.0 as the file format.
  4. Save the file and load it into Spike Doctor.

Alternatively, use the Data File Index feature in Clampfit to batch-convert files to ABF v2.

Parameters

Parameter Description Default
Channel ADC channel to analyze (0-based). 0
Stimulus Epoch Index Epoch containing the current step (0-based). Most protocols use epoch 2. 2
Detection Threshold Voltage threshold for spike detection (mV). -20 mV
Derivative Threshold Minimum dV/dt to qualify as a spike (mV/ms). 10 mV/ms

Basic Features

The Basic tab exposes commonly used eFEL features with readable names (some of them are simply needed for further calculations):

Feature Description
Spike Count Number of action potentials generated during the stimulus period
Resting Voltage Mean membrane potential before stimulus onset (mV)
Steady-State Voltage Mean membrane potential at the end of the stimulus (mV)
Voltage Deflection Steady-state minus resting voltage (mV)
Input Resistance From voltage deflection (MOhm)
Mean Firing Frequency Average spiking rate during the stimulus (Hz)
Latency to First Spike Time from stimulus onset to first AP (ms)
Membrane Time Constant Tau fitted to voltage response to a hyperpolarizing current step (ms)

The Advanced tab exposes the full eFEL feature library. See the eFEL documentation for details.

Output Formats

  • CSV -- Flat table: one row per sweep per file.
  • Excel -- One sheet per feature. Rows are sweeps/current steps; columns are files.
  • PDF -- Summary plots (2 files per A4 landscape page): raw traces, F-I curve, and phase-plane plot at ~2x rheobase. Perfect for printing out/displaying for overview.

Calculated Metrics

  • Capacitance (pF): Cm = tau / Rin x 1000. Only calculated for hyperpolarizing sweeps without spikes.

License

See LICENSE.

Acknowledgments

About

Shiny Python app for the analysis of whole-cell current clamp recordings

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages