Skip to content

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 API sanpy/detectionParams.

Note: To update this table use sanpy/bDetection.py

Parameter Default Value Units Human Readable Description
detectionName default Detection Preset Name The name of detection preset
userSaveName Saved Detection Params The name of saved user detection params
detectionType dvdt Detection Type Detect using derivative (dvdt) or membrane potential (mV)
dvdtThreshold 20 dVdt dV/dt Threshold "dV/dt threshold for a spike, will be backed up to dvdt_percentOfMax and have xxx error when this fails"
mvThreshold -20 mV mV Threshold mV threshold for spike AND minimum spike mV when detecting with dV/dt
startSeconds s Start(s) Start seconds of analysis
stopSeconds s Stop(s) Stop seconds of analysis
cellType Cell Type Cell Type
sex Sex Sex
condition Condition Condition
dvdt_percentOfMax 0.1 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 mV Accept Peaks Above (mV) Only accept APs with peaks above this value (mV)
onlyPeaksBelow_mV mV Accept Peaks Below (mV) Only accept APs below this value (mV)
doBackupSpikeVm False Boolean Backup Vm Spikes "If true, APs detected with just mV will be backed up until Vm falls to xxx"
refractory_ms 170 ms Minimum AP interval (ms) APs with interval (wrt previous AP) less than this will be removed
peakWindow_ms 100 ms Peak Window (ms) Window after TOP (ms) to seach for AP peak (mV)
dvdtPreWindow_ms 10 ms dV/dt Pre Window (ms) Window (ms) to search before each TOP for real threshold crossing
dvdtPostWindow_ms 20 ms dV/dt Post Window (ms) Window (ms) to search after each AP peak for minimum in dv/dt
mdp_ms 250 ms Pre AP MDP window (ms) Window (ms) before an AP to look for MDP
avgWindow_ms 5 ms MDP averaging window (ms) Window (ms) to calculate MDP (mV) as a mean rather than mV at single point for MDP
lowEddRate_warning 8 EDD slope EDD slope warning Generate warning when EED slope is lower than this value.
halfHeights "[10, 20, 50, 80, 90]" AP Durations (%) AP Durations as percent of AP height (AP Peak (mV) - TOP (mV))
halfWidthWindow_ms 200 ms Half Width Window (ms) Window (ms) after TOP to look for AP Durations
preSpikeClipWidth_ms 200 ms Pre AP Clip Width (ms) The pre duration of generated AP clips (Before AP)
postSpikeClipWidth_ms 500 ms Post AP Clip Width (ms) The post duration of generated AP clips (After AP)
fastAhpWindow_ms 8 ms Fast AHP Window (ms) Window (ms) after peak to look for a fast AHP
medianFilter 0 points Median Filter Points "Number of points in median filter, must be odd, 0 for no filter"
SavitzkyGolay_pnts 5 points SavitzkyGolay Points "Number of points in SavitzkyGolay filter, must be odd, 0 for no filter"
SavitzkyGolay_poly 2 SavitzkyGolay Poly Deg The degree of the polynomial for Savitzky-Golay filter
verbose False 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 dvdt max. When this occurs, the TOP (mV) of a spike will be more depolarized than it should be.
  • preMin: Error searching for spike pre min, 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 slope of EDD.
  • preSpikeDvDt: Error while searching for peak in max ap upstroke (dV/dt) between spike threshold (TOP) and the peak in the first derivative of Vm (dV/dt).
  • cycleLength: Usually occurs on last spike when looking for next MDP.
  • spikeWidth: Error finding a particular spike with (AP_Dur). Usually occurs when spikes are too broad, can increase detection parameter hwWindow_ms.

Analysis results¤

Once spikes are detected, SanPy has the following analysis results. The Stat column is a human readable version. The name column is the variable name used in the code and is saved as a column when analysis results are saved to a csv file.

Note: To generate this use bAnalysisUtil._print()

Stat name units yStat yStatUnits xStat xStatUnits
0 Spike Time (s) thresholdSec s thresholdVal mV thresholdSec s
1 Spike Number spikeNumber spikeNumber
2 Sweep Spike Number sweepSpikeNumber sweepSpikeNumber
3 Sweep Number sweep sweep
4 Epoch epoch epoch
5 Epoch DAC epochLevel epochLevel
6 Epoch Spike Number epoch epoch
7 Take Off Potential (mV) thresholdVal mV thresholdVal mV thresholdPnt Points
8 Spike Frequency (Hz) spikeFreq_hz Hz spikeFreq_hz Hz thresholdPnt Points
9 Inter-Spike-Interval (ms) isi_ms ms isi_ms ms thresholdPnt Points
10 Cycle Length (ms) cycleLength_ms ms cycleLength_ms ms thresholdPnt Points
11 AP Peak (mV) peakVal mV peakVal mV peakPnt Points
12 AP Height (mV) peakHeight mV peakHeight mV peakPnt Points
13 Time To Peak (ms) timeToPeak_ms ms peakVal mV peakPnt Points
14 Pre AP Min (mV) preMinVal mV preMinVal mV preMinPnt Points
15 Post AP Min (mV) postMinVal mV postMinVal mV postMinPnt Points
16 Fast AHP (mV) fastAhpValue mV fastAhpValue mV fastAhpPnt Points
17 Early Diastolic Depol Rate (dV/s) earlyDiastolicDurationRate dV/s earlyDiastolicDurationRate dV/s
18 Early Diastolic Duration (ms) earlyDiastolicDuration_ms ms earlyDiastolicDuration_ms dV/s thresholdPnt Points
19 Diastolic Duration (ms) diastolicDuration_ms ms diastolicDuration_ms dV/s thresholdPnt Points
20 Max AP Upstroke (mV) preSpike_dvdt_max_val mV preSpike_dvdt_max_val dV/s preSpike_dvdt_max_pnt Points
21 Max AP Upstroke (dV/dt) preSpike_dvdt_max_val2 dV/dt preSpike_dvdt_max_val2 dV/dt preSpike_dvdt_max_pnt Points
22 Max AP Repolarization (mV) postSpike_dvdt_min_val mV postSpike_dvdt_min_val mV postSpike_dvdt_min_pnt Points
23 AP Duration (ms) apDuration_ms ms apDuration_ms ms thresholdPnt Points
24 Half Width 10 (ms) widths_10 nan widths_10 ms
25 Half Width 20 (ms) widths_20 nan widths_20 ms
26 Half Width 50 (ms) widths_50 nan widths_50 ms
27 Half Width 80 (ms) widths_80 nan widths_80 ms
28 Half Width 90 (ms) widths_90 nan widths_90 ms
29 User Time To Peak (ms) user_timeToPeak_ms

Analysis results (full)¤

Note: To update this table, use sanpy/bAnalysisResults.py

Name type default units depends on detection error description
0 spikeNumber int None Spike number across all sweeps. Zero based.
1 include bool True Boolean indication include or not. Can be set by user/programmatically after analysis.
2 detectionType None Type of detection, either vm or dvdt. See enum sanpy.bDetection.detectionTypes
3 sweep int 0 Sweep number of analyzed sweep. Zero based.
4 epoch int NaN Stimulus epoch number the spike occured in. Zero based.
5 epochLevel float NaN Epoch level (DAC) stimulus during the spike.
6 sweepSpikeNumber int None Spike number within the sweep. Zero based.
7 userType int 0 Integer indication user type. Can be set by user/programmatically after analysis.
8 errors list [] List of dictionary to hold detection errors for this spike
9 analysisDate str Date of analysis in yyyymmdd format.
10 analysisTime str Time of analysis in hh:mm:ss 24 hours format.
11 modDate str Modification date if AP is modified after detection.
12 modTime str Modification time if AP is modified after detection.
13 analysisVersion str Analysis version when analysis was run. See sanpy.analysisVersion
14 interfaceVersion str Interface version string when analysis was run. See sanpy.interfaceVersion
15 file str Name of raw data file analyzed
16 cellType str User specified cell type
17 sex str User specified sex
18 condition str User specified condition
19 dvdtThreshold float NaN dvdt dvdtThreshold AP Threshold in derivative dv/dt
20 mvThreshold float NaN mV mvThreshold AP Threshold in primary recording mV
21 medianFilter int 0 medianFilter Median filter to generate filtered vm and dvdt. Value 0 indicates no filter.
22 halfHeights list [] halfHeights List of int to specify half-heights like [10, 20, 50, 80, 90].
23 thresholdPnt int NaN point AP threshold point
24 thresholdSec float NaN sec AP threshold seconds
25 thresholdVal float NaN mV Value of Vm at AP threshold point.
26 thresholdVal_dvdt float NaN dvdt Value of dvdt at AP threshold point.
27 dacCommand float NaN mV Value of DAC command at AP threshold point.
28 peakPnt int NaN point (onlyPeaksAbove_mV, peakWindow_ms) AP peak point.
29 peakSec float NaN sec AP peak seconds.
30 peakVal float NaN mV Value of Vm at AP peak point.
31 peakHeight float NaN mV Difference between peakVal minus thresholdVal.
32 timeToPeak_ms float NaN ms Time to peak (ms) after TOP.
33 fastAhpPnt int NaN point fastAhpWindow_ms fast AHP point.
34 fastAhpSec float NaN sec fast AHP seconds.
35 fastAhpValue float NaN mV Value of Vm at fast AHP point.
36 preMinPnt int NaN point mdp_ms Minimum before an AP taken from predefined window.
37 preMinVal float NaN mV Minimum before an AP taken from predefined window.
38 preLinearFitPnt0 int NaN point Point where pre linear fit starts. Used for EDD Rate
39 preLinearFitPnt1 int NaN point Point where pre linear fit stops. Used for EDD Rate
40 earlyDiastolicDuration_ms float NaN ms Time (ms) between start/stop of EDD.
41 preLinearFitVal0 float NaN mv
42 preLinearFitVal1 float NaN mv
43 earlyDiastolicDurationRate float NaN mv/S Early diastolic duration rate, the slope of the linear fit between start/stop of EDD.
44 lateDiastolicDuration float NaN Depreciated
45 preSpike_dvdt_max_pnt int NaN point Point corresponding to peak in dv/dt before an AP.
46 preSpike_dvdt_max_val float NaN mV Value of Vm at peak of dv/dt before an AP.
47 preSpike_dvdt_max_val2 float NaN dv/dt Value of dv/dt at peak of dv/dt before an AP.
48 postSpike_dvdt_min_pnt int NaN point dvdtPostWindow_ms Point corresponding to min in dv/dt after an AP.
49 postSpike_dvdt_min_val float NaN mV Value of Vm at minimum of dv/dt after an AP.
50 postSpike_dvdt_min_val2 float NaN dvdt Value of dv/dt at minimum of dv/dt after an AP.
51 isi_pnts int NaN point refractory_ms Inter-Spike-Interval (points) with respect to previous AP.
52 isi_ms float NaN ms Inter-Spike-Interval (ms) with respect to previous AP.
53 spikeFreq_hz float NaN Hz AP frequency with respect to previous AP.
54 cycleLength_pnts int NaN point Points between APs with respect to previous AP.
55 cycleLength_ms int NaN point Time (ms) between APs with respect to previous AP.
56 diastolicDuration_ms float NaN ms Time (ms) between minimum before AP (preMinPnt) and AP time (thresholdPnt).
57 widths list [] A list of dict to hold half-height information for each half-height in detection halfHeights.
58 widths_10 int NaN percent halfWidthWindow_ms Width (ms) at half-height 10 %.
59 widths_20 int NaN percent halfWidthWindow_ms Width (ms) at half-height 20 %.
60 widths_50 int NaN percent halfWidthWindow_ms Width (ms) at half-height 50 %.
61 widths_80 int NaN percent halfWidthWindow_ms Width (ms) at half-height 80 %.
62 widths_90 int NaN percent 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)
  • [[[REMOVED 20210501]]] Action potential duration (APD) was defined as the interval between the TOP and the subsequent MDP
  • 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 2011-2023 Robert H. Cudmore