Skip to content

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 20261014 with SanPy version 0.3.0.post42.

Parameter Category Default Type Units Human name Description
detectionName general default string Detection Preset Name The name of detection preset
userSaveName general string Saved Detection Params The name of saved user detection params
detectionType detection dvdt sanpy.bDetection.detectionTypes Detection Type Detect using derivative (dvdt) or membrane potential (mV)
dvdtThreshold detection 20 float 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 s Start(s) Start seconds of analysis
stopSeconds windows None float s Stop(s) Stop seconds of analysis
userType general 0 int User Type User Type
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 mV Accept Peaks Above (mV) Only accept APs with peaks above this value (mV)
onlyPeaksBelow_mV waveform None float mV Accept Peaks Below (mV) Only accept APs below this value (mV)
doBackupSpikeVm advanced False boolean 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 detection 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.
halfHeights waveform [10, 20, 50, 80, 90] list AP Durations (%) AP Durations as percent of AP height (AP Peak (mV) - TOP (mV))
halfWidthWindow_ms windows 200 float ms Half Width Window (ms) Window (ms) after TOP to look for AP Durations
preSpikeClipWidth_ms windows 200 float ms Pre AP Clip Width (ms) The pre duration of generated AP clips (Before AP)
postSpikeClipWidth_ms windows 500 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 points Median Filter Points Number of points in median filter, must be odd, 0 for no filter
SavitzkyGolay_pnts filtering 5 int 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 boolean 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_ms detection 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 20261014 with SanPy version 0.3.0.post42.

Name Category Axis label Type Default Units Plot menu Categorical Detection dependency Error Description
sweep acquisition Sweep int 0 True True Sweep number of analyzed sweep. Zero based.
epoch acquisition Epoch int NaN True True Stimulus epoch number the spike occured in. Zero based.
epochLevel acquisition Epoch level float NaN True True Epoch level (DAC) stimulus during the spike.
dacCommand acquisition DAC command (mV) float NaN mV True True Value of DAC command at AP threshold point.
spike_include metadata Spike included str yes True True Whether an individual spike is included (yes or no).
file_number metadata File Number int 0 True True Number of the file - used in pooling
sweepCondition identity Sweep condition str True True User-assigned sweep condition.
spikeNumber identity Spike number int None True False Spike number across all sweeps. Zero based.
sweepSpikeNumber identity Sweep spike number int None True False Spike number within the sweep. Zero based.
userType identity User type int 0 True True User-assigned user type for an individual spike.
spike_condition identity Spike condition str True True User-assigned condition for an individual spike.
thresholdSec peak detection Threshold time (s) float NaN sec True False AP threshold seconds
thresholdVal peak detection Threshold voltage (mV) float NaN mV True False Value of Vm at AP threshold point.
peakVal peak detection Peak voltage (mV) float NaN mV True False Value of Vm at AP peak point.
peakHeight peak detection Spike height (mV) float NaN mV True False Difference between peakVal minus thresholdVal.
timeToPeak_ms peak detection Time to peak (ms) float NaN ms True False Time to peak (ms) after TOP.
fastAhpValue peak detection Fast AHP voltage (mV) float NaN mV True False Value of Vm at fast AHP point.
preMinVal peak detection Pre-spike minimum voltage (mV) float NaN mV True False Minimum before an AP taken from predefined window.
earlyDiastolicDuration_ms peak detection Early diastolic duration (ms) float NaN ms True False Time (ms) between start/stop of EDD.
earlyDiastolicDurationRate peak detection Early diastolic rate (mV/s) float NaN mv/S True False Early diastolic duration rate, the slope of the linear fit between start/stop of EDD.
preSpike_dvdt_max_val peak detection Voltage at pre-spike maximum dV/dt (mV) float NaN mV True False Value of Vm at peak of dv/dt before an AP.
preSpike_dvdt_max_val2 peak detection Pre-spike maximum dV/dt (mV/ms) float NaN dv/dt True False Value of dv/dt at peak of dv/dt before an AP.
postSpike_dvdt_min_val peak detection Voltage at post-spike minimum dV/dt (mV) float NaN mV True False Value of Vm at minimum of dv/dt after an AP.
isi_ms timing Interspike interval (ms) float NaN ms True False Inter-Spike-Interval (ms) with respect to previous AP.
spikeFreq_hz timing Spike frequency (Hz) float NaN Hz True False AP frequency with respect to previous AP.
cycleLength_ms timing Cycle length (ms) int NaN point True False Time (ms) between APs with respect to previous AP.
diastolicDuration_ms timing Diastolic duration (ms) float NaN ms True False Time (ms) between minimum before AP (preMinPnt) and AP time (thresholdPnt).
widths_10 widths Spike width at 10% (ms) int NaN percent True False halfWidthWindow_ms Width (ms) at half-height 10 %.
widths_20 widths Spike width at 20% (ms) int NaN percent True False halfWidthWindow_ms Width (ms) at half-height 20 %.
widths_50 widths Spike width at 50% (ms) int NaN percent True False halfWidthWindow_ms Width (ms) at half-height 50 %.
widths_80 widths Spike width at 80% (ms) int NaN percent True False halfWidthWindow_ms Width (ms) at half-height 80 %.
widths_90 widths Spike width at 90% (ms) int NaN percent True False halfWidthWindow_ms Width (ms) at half-height 90 %.

Analysis results (full)¤

The complete analysis-result registry includes stored results that are not offered by plotting menus.

Generated on 20261014 with SanPy version 0.3.0.post42.

Name Category Axis label Type Default Units Plot menu Categorical Detection dependency Error Description
file acquisition File str False False Name of raw data file analyzed
sweep acquisition Sweep int 0 True True Sweep number of analyzed sweep. Zero based.
epoch acquisition Epoch int NaN True True Stimulus epoch number the spike occured in. Zero based.
epochLevel acquisition Epoch level float NaN True True Epoch level (DAC) stimulus during the spike.
dacCommand acquisition DAC command (mV) float NaN mV True True Value of DAC command at AP threshold point.
detectionType detection Detection type None False False Type of detection, either vm or dvdt. See enum sanpy.bDetection.detectionTypes
dvdtThreshold detection dV/dt threshold (mV/ms) float NaN dvdt False False dvdtThreshold AP Threshold in derivative dv/dt
mvThreshold detection Voltage threshold (mV) float NaN mV False False mvThreshold AP Threshold in primary recording mV
medianFilter detection Median filter int 0 False False medianFilter Median filter to generate filtered vm and dvdt. Value 0 indicates no filter.
halfHeights detection Half-height levels list [] False False halfHeights List of int to specify half-heights like [10, 20, 50, 80, 90].
analysisDate detection Analysis date str False False Date of analysis in yyyymmdd format.
analysisTime detection Analysis time str False False Time of analysis in hh🇲🇲ss 24 hours format.
modDate detection Modification date str False False Modification date if AP is modified after detection.
modTime detection Modification time str False False Modification time if AP is modified after detection.
sanpy_version detection Sanpy Version str False False SanPy version when analysis was run.
sanpy_git_commit detection Sanpy Git Commit str False False SanPy git commit hash when analysis was run.
sanpy_git_dirty detection Sanpy Git Dirty str False False SanPy git dirty flag when analysis was run.
spike_include metadata Spike included str yes True True Whether an individual spike is included (yes or no).
file_number metadata File Number int 0 True True Number of the file - used in pooling
sweepCondition identity Sweep condition str True True User-assigned sweep condition.
spikeNumber identity Spike number int None True False Spike number across all sweeps. Zero based.
sweepSpikeNumber identity Sweep spike number int None True False Spike number within the sweep. Zero based.
userType identity User type int 0 True True User-assigned user type for an individual spike.
spike_condition identity Spike condition str True True User-assigned condition for an individual spike.
errors identity Errors list [] False False List of dictionary to hold detection errors for this spike
thresholdPnt peak detection Threshold point int NaN point False False AP threshold point
thresholdSec peak detection Threshold time (s) float NaN sec True False AP threshold seconds
thresholdVal peak detection Threshold voltage (mV) float NaN mV True False Value of Vm at AP threshold point.
thresholdVal_dvdt peak detection Threshold dV/dt (mV/ms) float NaN dvdt False False Value of dvdt at AP threshold point.
peakPnt peak detection Peak point int NaN point False False (onlyPeaksAbove_mV, peakWindow_ms) AP peak point.
peakSec peak detection Peak time (s) float NaN sec False False AP peak seconds.
peakVal peak detection Peak voltage (mV) float NaN mV True False Value of Vm at AP peak point.
peakHeight peak detection Spike height (mV) float NaN mV True False Difference between peakVal minus thresholdVal.
timeToPeak_ms peak detection Time to peak (ms) float NaN ms True False Time to peak (ms) after TOP.
fastAhpPnt peak detection Fast AHP point int NaN point False False fastAhpWindow_ms fast AHP point.
fastAhpSec peak detection Fast AHP time (s) float NaN sec False False fast AHP seconds.
fastAhpValue peak detection Fast AHP voltage (mV) float NaN mV True False Value of Vm at fast AHP point.
preMinPnt peak detection Pre-spike minimum point int NaN point False False mdp_ms Minimum before an AP taken from predefined window.
preMinVal peak detection Pre-spike minimum voltage (mV) float NaN mV True False Minimum before an AP taken from predefined window.
preLinearFitPnt0 peak detection Early diastolic fit start point int NaN point False False Point where pre linear fit starts. Used for EDD Rate
preLinearFitPnt1 peak detection Early diastolic fit end point int NaN point False False Point where pre linear fit stops. Used for EDD Rate
earlyDiastolicDuration_ms peak detection Early diastolic duration (ms) float NaN ms True False Time (ms) between start/stop of EDD.
preLinearFitVal0 peak detection Early diastolic fit start voltage (mV) float NaN mv False False
preLinearFitVal1 peak detection Early diastolic fit end voltage (mV) float NaN mv False False
earlyDiastolicDurationRate peak detection Early diastolic rate (mV/s) float NaN mv/S True False Early diastolic duration rate, the slope of the linear fit between start/stop of EDD.
lateDiastolicDuration peak detection Late diastolic duration float NaN False False Depreciated
preSpike_dvdt_max_pnt peak detection Pre-spike maximum dV/dt point int NaN point False False Point corresponding to peak in dv/dt before an AP.
preSpike_dvdt_max_val peak detection Voltage at pre-spike maximum dV/dt (mV) float NaN mV True False Value of Vm at peak of dv/dt before an AP.
preSpike_dvdt_max_val2 peak detection Pre-spike maximum dV/dt (mV/ms) float NaN dv/dt True False Value of dv/dt at peak of dv/dt before an AP.
postSpike_dvdt_min_pnt peak detection Post-spike minimum dV/dt point int NaN point False False dvdtPostWindow_ms Point corresponding to min in dv/dt after an AP.
postSpike_dvdt_min_val peak detection Voltage at post-spike minimum dV/dt (mV) float NaN mV True False Value of Vm at minimum of dv/dt after an AP.
postSpike_dvdt_min_val2 peak detection Post-spike minimum dV/dt (mV/ms) float NaN dvdt False False Value of dv/dt at minimum of dv/dt after an AP.
isi_pnts timing Interspike interval (points) int NaN point False False refractory_ms Inter-Spike-Interval (points) with respect to previous AP.
isi_ms timing Interspike interval (ms) float NaN ms True False Inter-Spike-Interval (ms) with respect to previous AP.
spikeFreq_hz timing Spike frequency (Hz) float NaN Hz True False AP frequency with respect to previous AP.
cycleLength_pnts timing Cycle length (points) int NaN point False False Points between APs with respect to previous AP.
cycleLength_ms timing Cycle length (ms) int NaN point True False Time (ms) between APs with respect to previous AP.
diastolicDuration_ms timing Diastolic duration (ms) float NaN ms True False Time (ms) between minimum before AP (preMinPnt) and AP time (thresholdPnt).
widths widths Spike widths list [] False False A list of dict to hold half-height information for each half-height in detection halfHeights.
widths_10 widths Spike width at 10% (ms) int NaN percent True False halfWidthWindow_ms Width (ms) at half-height 10 %.
widths_20 widths Spike width at 20% (ms) int NaN percent True False halfWidthWindow_ms Width (ms) at half-height 20 %.
widths_50 widths Spike width at 50% (ms) int NaN percent True False halfWidthWindow_ms Width (ms) at half-height 50 %.
widths_80 widths Spike width at 80% (ms) int NaN percent True False halfWidthWindow_ms Width (ms) at half-height 80 %.
widths_90 widths Spike width at 90% (ms) int NaN percent True False halfWidthWindow_ms Width (ms) at half-height 90 %.

What spike parameters are detected?¤

For cardiac myocyte analysis, SanPy follows the nomenclature from this paper:

Larson, et al. (2013), “Depressed pacemaker activity of sinoatrial node myocytes contributes to the age-dependent decline in maximum heart rate,” PNAS 110(44):18011–18016.

  • 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.
All material is Copyright 2019-2026 Robert H. Cudmore