A Python Shiny web application for analyzing whole-cell current clamp electrophysiology recordings. Spike Doctor focuses on spike detection and extraction of subthreshold and suprathreshold features from Axon Instruments ABF files.
- Batch Processing: Analyze multiple ABF files simultaneously
- Automatic Spike Detection: Configurable voltage and derivative thresholds
- Comprehensive Feature Extraction: 200+ electrophysiological features via eFEL
- Interactive Visualizations: Raw traces, spike count vs current (F-I curves), and phase-plane plots
- Multiple Export Formats: CSV, Excel (with per-feature sheets), and PDF summary plots
- Debug Mode: Detailed plots showing stimulus windows and analysis parameters
The repository includes a devenv configuration that automatically sets up a Python 3.12 virtual environment with all dependencies:
git clone https://github.com/marsiwiec/spike-doctor.git
cd spike-doctor
# If you have devenv installed, the environment activates automatically via direnvgit clone https://github.com/marsiwiec/spike-doctor.git
cd spike-doctor
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txtStart the application:
shiny run app.pyThen open http://127.0.0.1:8000 in your web browser.
- Upload Files: Click "Select ABF File(s)" and choose one or more
.abffiles - Configure Parameters: Adjust stimulus epoch index and spike detection thresholds if needed
- Select Features: Use the Basic tab for common features or Advanced tab for the full eFEL feature set
- View Results: Browse Summary Plots, Detailed Results Table, and Debug Plots tabs
- Export: Download results as CSV, Excel, or PDF
- Stimulus Epoch Index: The epoch containing the current injection step (0-based). Most protocols use index 2, but this depends on your ABF protocol structure.
- Detection Threshold (mV): Voltage threshold for spike detection. Default: -20 mV
- Derivative Threshold (mV/ms): Minimum dV/dt to qualify as a spike. Default: 10 mV/ms
The Basic tab provides commonly used features with friendly names:
| Feature | Description |
|---|---|
| Spike Count | Number of action potentials detected during the stimulus period |
| Resting Voltage | Mean membrane voltage before stimulus onset (mV) |
| Steady-State Voltage | Mean voltage at the end of the stimulus period (mV) |
| Voltage Deflection | Difference between steady-state and resting voltage (mV) |
| Input Resistance | Membrane input resistance calculated from voltage deflection (MΩ) |
| Mean Firing Frequency | Average firing rate during the stimulus period (Hz) |
| Latency to First Spike | Time from stimulus onset to first action potential (ms) |
| Membrane Time Constant | Tau from exponential fit of voltage response to hyperpolarizing current (ms) |
The Advanced tab provides access to the complete eFEL feature library (200+ features). See the eFEL documentation for detailed descriptions.
A flat table with all sweeps and selected features. Each row represents one sweep from one file.
Multi-sheet workbook where each sheet contains one feature:
- Rows: Sweep number and current step
- Columns: Individual files
- Useful for comparing the same feature across multiple recordings
Summary plots (2 files per page, A4 landscape):
- Raw voltage traces
- Spike count vs injected current (F-I curve)
- Phase-plane plot (dV/dt vs V) at ~2x rheobase
In addition to eFEL features, Spike Doctor calculates:
- Capacitance (pF): Derived from time constant and input resistance:
Cm = τ / Rin × 1000- Only calculated for hyperpolarizing sweeps without spikes
Currently supports:
- Format: Axon Binary Format (ABF) via pyABF
- Recording Mode: Current clamp (voltage recorded, current commanded)
- Shiny for Python - Web framework
- pyABF - ABF file reading
- eFEL - Electrophysiological feature extraction
- pandas - Data manipulation
- matplotlib - Plotting
- numpy - Numerical computing
- openpyxl - Excel file writing
# Type checking
pyright
# Code formatting
black .See LICENSE file for details.
