Methods
Detection Parameters¤
To detect action potentials, SanPy uses a number of parameters. These can all be configured using the detection parameter plugin or programmatically with the bDetection API.
Generated on 20261026 with SanPy version 0.3.0.post76.
| Parameter | Category | Default | Type | Units | Human name | Description |
|---|---|---|---|---|---|---|
| detectionName | presets | default | str | Detection Preset | The name of detection preset | |
| userSaveName | presets | str | Save User Name | The name of saved user detection params | ||
| detectionType | detection | dvdt | detection type | Detection Type | Detect using derivative (dvdt) or membrane potential (mV) | |
| dvdtThreshold | detection | 20 | float | None | mV/ms | dV/dt Threshold | Minimum dV/dt used to detect a spike threshold |
| mvThreshold | detection | -20 | float | mV | mV Threshold | mV threshold for spike AND minimum spike mV when detecting with dV/dt |
| startSeconds | windows | None | float | None | s | Start(s) | Start seconds of analysis, set from the visible x-range when detecting |
| stopSeconds | windows | None | float | None | s | Stop(s) | Stop seconds of analysis, set from the visible x-range when detecting |
| dvdt_percentOfMax | detection | 0.1 | float | Percent | dV/dt Percent of max | For dV/dt detection, the final TOP is when dV/dt drops to this percent from dV/dt AP peak |
| onlyPeaksAbove_mV | waveform | None | float | None | mV | Accept Peaks Above (mV) | Only accept APs with peaks above this value (mV) |
| onlyPeaksBelow_mV | waveform | None | float | None | mV | Accept Peaks Below (mV) | Only accept APs below this value (mV) |
| doBackupSpikeVm | advanced | False | bool | Boolean | Backup Vm Spikes | If true, APs detected with just mV will be backed up until Vm falls to xxx |
| refractory_ms | windows | 170 | float | ms | Minimum AP interval (ms) | APs with interval (wrt previous AP) less than this will be removed |
| peakWindow_ms | windows | 100 | float | ms | Peak Window (ms) | Window after TOP (ms) to seach for AP peak (mV) |
| dvdtPreWindow_ms | windows | 10 | float | ms | dV/dt Pre Window (ms) | Window (ms) to search before each TOP for real threshold crossing |
| dvdtPostWindow_ms | windows | 20 | float | ms | dV/dt Post Window (ms) | Window (ms) to search after each AP peak for minimum in dv/dt |
| mdp_ms | windows | 250 | float | ms | Pre AP MDP window (ms) | Window (ms) before an AP to look for MDP |
| avgWindow_ms | windows | 5 | float | ms | MDP averaging window (ms) | Window (ms) to calculate MDP (mV) as a mean rather than mV at single point for MDP |
| lowEddRate_warning | advanced | 8 | float | EDD slope | EDD slope warning | Generate warning when EED slope is lower than this value. |
| halfWidthWindow_ms | windows | 200 | float | ms | Half Width Window (ms) | Window (ms) after TOP to look for AP widths |
| preSpikeClipWidth_ms | spike clips | 4 | float | ms | Pre AP Clip Width (ms) | The pre duration of generated AP clips (Before AP) |
| postSpikeClipWidth_ms | spike clips | 8 | float | ms | Post AP Clip Width (ms) | The post duration of generated AP clips (After AP) |
| fastAhpWindow_ms | windows | 8 | float | ms | Fast AHP Window (ms) | Window (ms) after peak to look for a fast AHP |
| medianFilter | filtering | 0 | int | None | points | Median Filter Points | Number of points in median filter, must be odd, 0 for no filter |
| SavitzkyGolay_pnts | filtering | 5 | int | None | points | SavitzkyGolay Points | Number of points in SavitzkyGolay filter, must be odd, 0 for no filter |
| SavitzkyGolay_poly | filtering | 2 | int | SavitzkyGolay Poly Deg | The degree of the polynomial for Savitzky-Golay filter | |
| verbose | advanced | False | bool | Boolean | Verbose | Verbose Detection Reporting |
Detection Errors¤
When SanPy encounters errors during spike detection, they are stored for each spike in errors. Each error has a name like dvdtPercent, as follows:
- dvdtPercent: Error searching for percent (10%) of dV/dt max. When this occurs, the TOP (mV) of a spike will be more depolarized than it should be.
- preMin: Error searching for spike pre-minimum, the MDP before a spike. This can occur on the first spike if it is close to the beginning of the recording.
- postMin:
- fitEDD: Error while fitting the slope of EDD.
- preSpikeDvDt: Error while searching for peak AP upstroke (dV/dt) between spike threshold (TOP) and the peak in the first derivative of Vm (dV/dt).
- cycleLength: Usually occurs on the last spike when looking for the next MDP.
- spikeWidth: Error finding a particular spike width (AP duration). This usually occurs when spikes are too broad; increase the
halfWidthWindow_msdetection parameter.
Analysis results¤
Once spikes are detected, SanPy exposes the following analysis results in its plotting interfaces. Name is the internal variable name and CSV column name, while Axis label is the human-readable label.
Generated on 20261026 with SanPy version 0.3.0.post76.
| Name | Category | Axis label | Type | Default | Units | Plot menu | Categorical | Detection dependency | Error | Description |
|---|---|---|---|---|---|---|---|---|---|---|
| sweep | acquisition | Sweep | int | None | True | True | Zero-based analyzed sweep number. | |||
| epoch | acquisition | Epoch | int | None | None | True | True | Zero-based stimulus epoch containing the spike. | |||
| epochLevel | acquisition | Epoch level (pA) | float | None | None | pA | True | True | DAC stimulus level during the spike. | ||
| spike_include | metadata | Spike included | str | yes | True | True | Whether this spike is included. | |||
| file_number | metadata | File Number | int | 0 | True | True | File number used when pooling analyses. | |||
| sweepCondition | identity | Sweep condition | str | True | True | User-assigned sweep condition. | ||||
| spikeNumber | identity | Spike number | int | None | True | False | Zero-based spike number across all sweeps. | |||
| sweepSpikeNumber | identity | Sweep spike number | int | None | True | False | Zero-based spike number within the sweep. | |||
| userType | identity | User type | int | 0 | True | True | User-assigned integer spike type. | |||
| spike_condition | identity | Spike condition | str | True | True | User-assigned condition for this spike. | ||||
| thresholdSec | peak detection | Threshold time (s) | float | None | None | sec | True | False | Action-potential threshold time. | ||
| thresholdVal | peak detection | Threshold voltage (mV) | float | None | None | mV | True | False | Voltage at threshold. | ||
| peakVal | peak detection | Peak voltage (mV) | float | None | None | mV | True | False | Voltage at the peak. | ||
| peakHeight | peak detection | Spike height (mV) | float | None | None | mV | True | False | Peak voltage minus threshold voltage. | ||
| timeToPeak_ms | peak detection | Time to peak (ms) | float | None | None | ms | True | False | Time from threshold to peak. | ||
| fastAhpValue | peak detection | Fast AHP voltage (mV) | float | None | None | mV | True | False | Voltage at the fast AHP. | ||
| preMinVal | peak detection | Pre-spike minimum voltage (mV) | float | None | None | mV | True | False | Minimum voltage before the spike. | ||
| earlyDiastolicDuration_ms | peak detection | Early diastolic duration (ms) | float | None | None | ms | True | False | Duration of the early-diastolic fit. | ||
| earlyDiastolicDurationRate | peak detection | Early diastolic rate (mV/s) | float | None | None | mV/s | True | False | Slope of the early-diastolic fit. | ||
| preSpike_dvdt_max_val | peak detection | Voltage at pre-spike maximum dV/dt (mV) | float | None | None | mV | True | False | Voltage at maximum pre-spike dV/dt. | ||
| preSpike_dvdt_max_val2 | peak detection | Pre-spike maximum dV/dt (mV/ms) | float | None | None | dV/dt | True | False | Maximum pre-spike dV/dt. | ||
| postSpike_dvdt_min_val | peak detection | Voltage at post-spike minimum dV/dt (mV) | float | None | None | mV | True | False | Voltage at minimum post-spike dV/dt. | ||
| isi_ms | timing | Interspike interval (ms) | float | None | None | ms | True | False | Time since the previous threshold. | ||
| spikeFreq_hz | timing | Spike frequency (Hz) | float | None | None | Hz | True | False | Instantaneous frequency from the previous spike. | ||
| cycleLength_ms | timing | Cycle length (ms) | float | None | None | ms | True | False | Time between successive pre-spike minima. | ||
| diastolicDuration_ms | timing | Diastolic duration (ms) | float | None | None | ms | True | False | Time from pre-spike minimum to threshold. | ||
| width_10_ms | widths | Spike width at 10% (ms) | float | None | None | ms | True | False | halfWidthWindow_ms | Width at 10 percent of spike height. | |
| width_20_ms | widths | Spike width at 20% (ms) | float | None | None | ms | True | False | halfWidthWindow_ms | Width at 20 percent of spike height. | |
| width_50_ms | widths | Spike width at 50% (ms) | float | None | None | ms | True | False | halfWidthWindow_ms | Width at 50 percent of spike height. | |
| width_80_ms | widths | Spike width at 80% (ms) | float | None | None | ms | True | False | halfWidthWindow_ms | Width at 80 percent of spike height. | |
| width_90_ms | widths | Spike width at 90% (ms) | float | None | None | ms | True | False | halfWidthWindow_ms | Width at 90 percent of spike height. |
Analysis results (full)¤
The complete analysis-result registry includes stored results that are not offered by plotting menus.
Generated on 20261026 with SanPy version 0.3.0.post76.
| Name | Category | Axis label | Type | Default | Units | Plot menu | Categorical | Detection dependency | Error | Description |
|---|---|---|---|---|---|---|---|---|---|---|
| file | acquisition | File | str | False | False | Name of the analyzed raw-data file. | ||||
| sweep | acquisition | Sweep | int | None | True | True | Zero-based analyzed sweep number. | |||
| epoch | acquisition | Epoch | int | None | None | True | True | Zero-based stimulus epoch containing the spike. | |||
| epochLevel | acquisition | Epoch level (pA) | float | None | None | pA | True | True | DAC stimulus level during the spike. | ||
| detectionType | detection | Detection type | detectionTypes_ | None | False | False | Spike-detection algorithm. | |||
| dvdtThreshold | detection | dV/dt threshold (mV/ms) | float | None | None | dvdt | False | False | dvdtThreshold | Derivative threshold used for detection. | |
| mvThreshold | detection | Voltage threshold (mV) | float | None | None | mV | False | False | mvThreshold | Membrane-potential detection threshold. | |
| medianFilter | detection | Median filter | int | None | 0 | False | False | medianFilter | Median-filter width in points. | ||
| analysisDate | detection | Analysis date | str | False | False | Analysis date in YYYYMMDD format. | ||||
| analysisTime | detection | Analysis time | str | False | False | Analysis time in 24-hour HH:MM:SS format. | ||||
| modDate | detection | Modification date | str | False | False | Date of a post-detection edit. | ||||
| modTime | detection | Modification time | str | False | False | Time of a post-detection edit. | ||||
| sanpy_version | detection | Sanpy Version | str | False | False | SanPy version used for analysis. | ||||
| sanpy_git_commit | detection | Sanpy Git Commit | str | False | False | SanPy Git commit used for analysis. | ||||
| sanpy_git_dirty | detection | Sanpy Git Dirty | bool | str | False | False | Whether the checkout had changes. | ||||
| spike_include | metadata | Spike included | str | yes | True | True | Whether this spike is included. | |||
| file_number | metadata | File Number | int | 0 | True | True | File number used when pooling analyses. | |||
| sweepCondition | identity | Sweep condition | str | True | True | User-assigned sweep condition. | ||||
| spikeNumber | identity | Spike number | int | None | True | False | Zero-based spike number across all sweeps. | |||
| sweepSpikeNumber | identity | Sweep spike number | int | None | True | False | Zero-based spike number within the sweep. | |||
| userType | identity | User type | int | 0 | True | True | User-assigned integer spike type. | |||
| spike_condition | identity | Spike condition | str | True | True | User-assigned condition for this spike. | ||||
| errors | identity | Errors | list | [] | False | False | Detection errors for this spike. | |||
| thresholdPnt | peak detection | Threshold point | int | None | point | False | False | Action-potential threshold point. | ||
| thresholdSec | peak detection | Threshold time (s) | float | None | None | sec | True | False | Action-potential threshold time. | ||
| thresholdVal | peak detection | Threshold voltage (mV) | float | None | None | mV | True | False | Voltage at threshold. | ||
| thresholdVal_dvdt | peak detection | Threshold dV/dt (mV/ms) | float | None | None | dvdt | False | False | dV/dt at threshold. | ||
| peakPnt | peak detection | Peak point | int | None | point | False | False | (onlyPeaksAbove_mV, peakWindow_ms) | Action-potential peak point. | |
| peakSec | peak detection | Peak time (s) | float | None | None | sec | False | False | Action-potential peak time. | ||
| peakVal | peak detection | Peak voltage (mV) | float | None | None | mV | True | False | Voltage at the peak. | ||
| peakHeight | peak detection | Spike height (mV) | float | None | None | mV | True | False | Peak voltage minus threshold voltage. | ||
| timeToPeak_ms | peak detection | Time to peak (ms) | float | None | None | ms | True | False | Time from threshold to peak. | ||
| fastAhpPnt | peak detection | Fast AHP point | int | None | None | point | False | False | fastAhpWindow_ms | Fast afterhyperpolarization point. | |
| fastAhpSec | peak detection | Fast AHP time (s) | float | None | None | sec | False | False | Fast AHP time. | ||
| fastAhpValue | peak detection | Fast AHP voltage (mV) | float | None | None | mV | True | False | Voltage at the fast AHP. | ||
| preMinPnt | peak detection | Pre-spike minimum point | int | None | None | point | False | False | mdp_ms | Minimum point before the spike. | |
| preMinVal | peak detection | Pre-spike minimum voltage (mV) | float | None | None | mV | True | False | Minimum voltage before the spike. | ||
| preLinearFitPnt0 | peak detection | Early diastolic fit start point | int | None | point | False | False | Start point for the early-diastolic fit. | ||
| preLinearFitPnt1 | peak detection | Early diastolic fit end point | int | None | point | False | False | End point for the early-diastolic fit. | ||
| earlyDiastolicDuration_ms | peak detection | Early diastolic duration (ms) | float | None | None | ms | True | False | Duration of the early-diastolic fit. | ||
| preLinearFitVal0 | peak detection | Early diastolic fit start voltage (mV) | float | None | None | mV | False | False | Voltage at the fit start. | ||
| preLinearFitVal1 | peak detection | Early diastolic fit end voltage (mV) | float | None | None | mV | False | False | Voltage at the fit end. | ||
| earlyDiastolicDurationRate | peak detection | Early diastolic rate (mV/s) | float | None | None | mV/s | True | False | Slope of the early-diastolic fit. | ||
| lateDiastolicDuration | peak detection | Late diastolic duration | float | None | None | False | False | Deprecated late-diastolic duration. | |||
| preSpike_dvdt_max_pnt | peak detection | Pre-spike maximum dV/dt point | int | None | None | point | False | False | Point of maximum dV/dt before the peak. | ||
| preSpike_dvdt_max_val | peak detection | Voltage at pre-spike maximum dV/dt (mV) | float | None | None | mV | True | False | Voltage at maximum pre-spike dV/dt. | ||
| preSpike_dvdt_max_val2 | peak detection | Pre-spike maximum dV/dt (mV/ms) | float | None | None | dV/dt | True | False | Maximum pre-spike dV/dt. | ||
| postSpike_dvdt_min_pnt | peak detection | Post-spike minimum dV/dt point | int | None | point | False | False | dvdtPostWindow_ms | Point of minimum dV/dt after the peak. | |
| postSpike_dvdt_min_val | peak detection | Voltage at post-spike minimum dV/dt (mV) | float | None | None | mV | True | False | Voltage at minimum post-spike dV/dt. | ||
| postSpike_dvdt_min_val2 | peak detection | Post-spike minimum dV/dt (mV/ms) | float | None | None | dV/dt | False | False | Minimum post-spike dV/dt. | ||
| isi_pnts | timing | Interspike interval (points) | int | None | None | point | False | False | refractory_ms | Points since the previous threshold. | |
| isi_ms | timing | Interspike interval (ms) | float | None | None | ms | True | False | Time since the previous threshold. | ||
| spikeFreq_hz | timing | Spike frequency (Hz) | float | None | None | Hz | True | False | Instantaneous frequency from the previous spike. | ||
| cycleLength_pnts | timing | Cycle length (points) | int | None | None | point | False | False | Points between successive pre-spike minima. | ||
| cycleLength_ms | timing | Cycle length (ms) | float | None | None | ms | True | False | Time between successive pre-spike minima. | ||
| diastolicDuration_ms | timing | Diastolic duration (ms) | float | None | None | ms | True | False | Time from pre-spike minimum to threshold. | ||
| width_10_ms | widths | Spike width at 10% (ms) | float | None | None | ms | True | False | halfWidthWindow_ms | Width at 10 percent of spike height. | |
| width_10_rising_pnt | widths | Spike width 10% rising point | int | None | None | point | False | False | halfWidthWindow_ms | Rising-phase crossing point at 10 percent of spike height. | |
| width_10_falling_pnt | widths | Spike width 10% falling point | int | None | None | point | False | False | halfWidthWindow_ms | Falling-phase crossing point at 10 percent of spike height. | |
| width_20_ms | widths | Spike width at 20% (ms) | float | None | None | ms | True | False | halfWidthWindow_ms | Width at 20 percent of spike height. | |
| width_20_rising_pnt | widths | Spike width 20% rising point | int | None | None | point | False | False | halfWidthWindow_ms | Rising-phase crossing point at 20 percent of spike height. | |
| width_20_falling_pnt | widths | Spike width 20% falling point | int | None | None | point | False | False | halfWidthWindow_ms | Falling-phase crossing point at 20 percent of spike height. | |
| width_50_ms | widths | Spike width at 50% (ms) | float | None | None | ms | True | False | halfWidthWindow_ms | Width at 50 percent of spike height. | |
| width_50_rising_pnt | widths | Spike width 50% rising point | int | None | None | point | False | False | halfWidthWindow_ms | Rising-phase crossing point at 50 percent of spike height. | |
| width_50_falling_pnt | widths | Spike width 50% falling point | int | None | None | point | False | False | halfWidthWindow_ms | Falling-phase crossing point at 50 percent of spike height. | |
| width_80_ms | widths | Spike width at 80% (ms) | float | None | None | ms | True | False | halfWidthWindow_ms | Width at 80 percent of spike height. | |
| width_80_rising_pnt | widths | Spike width 80% rising point | int | None | None | point | False | False | halfWidthWindow_ms | Rising-phase crossing point at 80 percent of spike height. | |
| width_80_falling_pnt | widths | Spike width 80% falling point | int | None | None | point | False | False | halfWidthWindow_ms | Falling-phase crossing point at 80 percent of spike height. | |
| width_90_ms | widths | Spike width at 90% (ms) | float | None | None | ms | True | False | halfWidthWindow_ms | Width at 90 percent of spike height. | |
| width_90_rising_pnt | widths | Spike width 90% rising point | int | None | None | point | False | False | halfWidthWindow_ms | Rising-phase crossing point at 90 percent of spike height. | |
| width_90_falling_pnt | widths | Spike width 90% falling point | int | None | None | point | False | False | halfWidthWindow_ms | Falling-phase crossing point at 90 percent of spike height. |
What spike parameters are detected?¤
For cardiac myocyte analysis, SanPy follows the nomenclature from this paper:
- MDP and Vmax were defined as the most negative and positive membrane potentials, respectively.
- Take-off potential (TOP) was defined as the membrane potential when the first derivative of voltage with respect to time (dV/dt) reached 10% of its maximum value.
- Cycle length was defined as the interval between MDPs in successive APs.
- The maximum rates of the AP upstroke and repolarization were taken as the maximum and minimum values of the first derivative (dV/dtmax and dV/dtmin, respectively).
- Action potential duration (APD) was formerly defined as the interval between the TOP and the subsequent MDP; this definition was removed in 2021.
- APD_50 and APD_90 were defined as the interval between the TOP and 50% and 90% repolarization, respectively.
- The diastolic duration was defined as the interval between MDP and TOP.
- The early diastolic depolarization rate was estimated as the slope of a linear fit between 10% and 50% of the diastolic duration, and the early diastolic duration was the corresponding time interval.
- The nonlinear late diastolic depolarization phase was estimated as the duration between 1% and 10% dV/dt.