Abstract
Sinoatrial node myocytes act as cardiac pacemaker cells by generating spontaneous action potentials (APs). Much information is encoded in sinoatrial AP waveforms, but both the analysis and the comparison of AP parameters between studies is hindered by the lack of standardized parameter definitions and the absence of automated analysis tools. Here we introduce ParamAP, a standalone cross-platform computational tool that uses a template-free detection algorithm to automatically identify and parameterize APs from text input files. ParamAP employs a graphic user interface with automatic and user-customizable input modes, and it outputs data files in text and PDF formats. ParamAP returns a total of 16 AP waveform parameters including time intervals such as the AP duration, membrane potentials such as the maximum diastolic potential, and rates of change of the membrane potential such as the diastolic depolarization rate. ParamAP provides a robust AP detection algorithm in combination with a standardized AP parameter analysis over a wide range of AP waveforms and firing rates, owing in part to the use of an iterative algorithm for the determination of the threshold potential and the diastolic depolarization rate that is independent of the maximum upstroke velocity, a parameter that can vary significantly among sinoatrial APs. Because ParamAP is implemented in Python 3, it is also highly customizable and extensible. In conclusion, ParamAP is a powerful computational tool that facilitates quantitative analysis and enables comparison of sinoatrial APs by standardizing parameter definitions and providing an automated work flow.
Introduction
Sinoatrial node myocytes (SAMs) perform their function as cardiac pacemaker cells by generating spontaneous action potentials (APs). Sinoatrial APs are characterized by a spontaneous depolarization of the membrane potential during diastole and by a slow upstroke velocity. Despite widespread recognition of these characteristics, limited quantitative information is available about the averages and variability of sinoatrial AP waveform parameters, or about the relationship between specific attributes of the sinoatrial AP and the underlying ionic currents. The collection and standardized analysis of SAM AP waveform parameters is therefore crucial for the development of improved mathematical models of the sinoatrial AP and is an important step toward ultimately gaining insight into the molecular processes that drive pacemaking. However, the analysis and comparison of AP parameters between studies is currently hindered by the lack of standardized parameter definitions and the absence of automated analysis tools.
To address these issues, we have developed a standalone computational tool, ParamAP, which automates sinoatrial AP analysis, and standardizes parameter definitions. ParamAP can be run on Windows, Mac OS X, or Linux operating systems. It accepts data input in the form of standard text files that can be generated by any data acquisition platform and it computes a total of 16 AP waveform parameters, which are output as text and graphical files.
ParamAP is available under the GNU General Public License 2.0 and archived on Zenodo to make it uniquely citable (1). File archives containing bundled installations of ParamAP, the executable source code, a user manual, and an example file are available at https://github.com/crickert1234/ParamAp/.
Materials and Methods
ParamAP implementation
The implementation of ParamAP is based on recent installations of Python 3 (2), NumPy (3), SciPy (4), and Matplotlib (5). ParamAP runs its code from the command line (Windows) or the terminal (Linux, Mac OS X). However, a graphical user-interface has been implemented for the visualization of the data and for documentation of the results.
The parameterization is performed in 10 consecutive steps:
-
1)
Experimental data is imported from standard text files using NumPy’s loadtxt (np.loadtxt) function and displayed with Matplotlib’s plot function.
-
2)
The user is given the option to provide numerical input to customize the analysis of a given dataset by providing parameters like the time interval, limiting values for the data, the filter strength, and peak detection scopes.
-
3)
The imported data is filtered using the Savitzky-Golay (SG) filter (6) from SciPy’s signal processing modules (sp_sig.savgol_filter).
-
4)
All maxima (peaks) in the filtered data are detected using sp_sig.argrelmax, and all minima (troughs) in the filtered data are detected using sp_sig.argrelmin, respectively.
-
5)
All detected extrema are examined for validity and excluded from analysis, if they do not comply with user-defined criteria.
-
6)
The time intervals between maxima and minima are calculated using a k-dimensional tree (7) for nearest-neighbor lookup (sp_spat.KDTree) from SciPy’s spatial algorithms and data structures modules to assign minima to their corresponding maxima. The result of this analysis is displayed with Matplotlib’s plot function.
-
7)
Raw unfiltered data segments consisting of time intervals with a central maximum and two adjacent minima are averaged.
-
8)
The resulting average AP and its first derivative are then SG-filtered to improve the robustness of the peak/trough detection.
-
9)
The AP waveform parameters are determined from the filtered averaged data and the filtered first derivative of the averaged data. The result of this analysis is displayed with Matplotlib’s plot function.
-
10)
After the analysis of the input data, three files are saved (the input parameters, the previously displayed output data, and a summary of output parameters) using the functions np.savetxt and matplotlib.backends.backend_pdf.PdfPages.
Details of the implementation can be found in the in-line comments of the source code. Instructions for the installation and use of ParamAP are described in the accompanying User Manual in the Supporting Material.
Savitzky-Golay filtering and AP detection
SG filtering in ParamAP is used to primarily used to improve the robustness of the maxima/minima detection by reducing high-frequency noise in the raw traces. It secondarily improves the alignment of data segments containing individual APs for averaging, thus improving the signal-to-noise ratio (SNR) of the averaged trace and the parameterization accuracy. The filter settings can be customized by adjusting the running average window size with the manual user input options for a given run (see the User Manual in the Supporting Material for more details).
For the identification of APs, which are comprised of a central maximum and two adjacent minima, individual distances from each of the minima to each of the maxima could be calculated. However, such a calculation would become computationally demanding as the number of APs increased. Instead, ParamAP employs the nearest-neighbor lookup using a k-dimensional tree search algorithm for one dimension, where the dataset is iteratively split into an arbitrary number of half-datasets using the median maxima as delimiters. This approach significantly reduces the number of calculated distances required to assign two neighboring minima to their corresponding maxima.
Results and Discussion
SAM AP parameter definitions
The sinoatrial AP waveform parameter definitions implemented in ParamAP are based on previously published definitions (8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) with some refinements made to allow automated analysis and to accommodate a wide range of AP waveforms and firing rates. ParamAP computes a total of 16 parameters in three categories: membrane potentials, rates of change of the membrane potential, and time intervals (Fig. 1; Table 1).
Figure 1.
Schematic illustration of AP parameters reported by ParamAP. Shown here are the representative AP waveform (top) and first derivative of AP (bottom). PP (top, black dot), and MDP1 and MDP2 (top, blue dots), mark the extrema of the AP waveform. DDR (top, orange dots, and line) is determined from the best linear fit segment from a search within a predefined time interval. EDD, LDD, DD, APD, APD50, and APD90 are indicated with horizontal gray lines (top). APA is indicated by a vertical black line (top). MUV and MRR (bottom, green dots) mark the extrema of the first derivative of the AP waveform. THR (top and bottom, red dots, and dashed red line) is determined from the best linear fit (bottom, red dots, and red line) within a predefined time interval in the first derivative trace (DDD; bottom, dashed red line) plus 0.5 mV/ms. To see this figure in color, go online.
Table 1.
List of AP Parameters Reported by ParamAP
Abbreviation | Parameter | Unit | Definition |
---|---|---|---|
APs | action potentials | — | number of averaged APs in a given run |
FR | AP firing rate | AP/min | AP firing rate |
CL | cycle length | ms | time interval MDP1-MDP2 |
DD | diastolic duration | ms | EDD plus LDD |
EDD | early DD | ms | time from MDP1 to end of linear fit for DDR |
LDD | late DD | ms | time from end of linear fit for DDR to THR |
APD | AP duration | ms | time from THR to MDP2 |
APD50 | AP duration 50 | ms | time interval at 50% of maximum repolarization |
APD90 | AP duration 90 | ms | time interval at 90% of maximum repolarization |
MDP1 | maximum diastolic potential 1 | mV | minimum potential preceding PP |
MDP2 | maximum diastolic potential 2 | mV | minimum potential after PP |
THR | threshold potential | mV | potential separating DD and APD |
PP | peak potential | mV | maximum potential of AP |
APA | AP amplitude | mV | potential difference of PP minus MDP2 |
DDR | diastolic depolarization rate | mV/ms | potential change rate at end of EDD |
MUV | maximum upstroke velocity | mV/ms | maximum of derivative between MDP1 and PP |
MRR | maximum repolarization rate | mV/ms | minimum of derivative between PP and MDP2 |
TRR | transient repolarization rate | mV/ms | maximum negative potential rate change after PP, if distinct from MRR |
Please refer to the text for detailed explanations of the parameter definitions.
Membrane potentials
The peak potential (PP) is defined as the maximum membrane potential during an AP. PP is used to localize individual APs in continuous recordings. Detection of PP relies on the use of the SG filter in the initial data preparation to reduce the number of potential maxima caused by noise artifacts. Further elimination of potential maxima is achieved by limiting candidate maxima to a user-defined range of acceptable PP values. The AP firing rate (FR) is determined from the number of identified APs divided by the time interval from the first to the last AP maximum.
The maximum diastolic potentials (MDP1, MDP2) are the minimum membrane potentials that precede and follow each PP, respectively. Detection of MDP is challenging because the comparatively slow change in membrane potential during diastole means that noise artifacts could introduce multiple local minima. SG filtering and averaging are used to reduce the number of local membrane potential minima considered in the determination of MDP. The minima ultimately accepted as MDP1 and MDP2 meet the criteria of being the closest minima to a given maximum while falling within a window of expected maximum half-cycle length (user-definable, with a default value of 250 ms). A half-cycle length criterion is used to exclude subthreshold membrane potential oscillations from the AP averages.
The action potential amplitude (APA) is the difference in the membrane potential between PP and MDP2.
Threshold potential (THR) is defined as the potential at a time point occurring after MDP1 but before PP at which the first derivative of the AP waveform deviates from linearity by the empirically determined value of 0.5 mV/ms. The linearity is determined from an iterative linear regression fit of a segment consisting of 40–80% of the first derivative trace between MDP1 and the beginning of APD90. The determination of THR combines and extends previous approaches (8, 9, 10, 11, 12, 13, 14) to provide robust analysis of a wide range of AP waveforms.
Rates of change of membrane potential
The maximum upstroke velocity (MUV) is defined as the maximum value of the first derivative in the epoch between MDP1 and PP. The maximum and transient repolarization rates (MRR and TRR) are determined as minimum values of the derivative between PP and the time point at 90% repolarization. MRR is defined as the minimum closest to the time of 90% repolarization. If a second minimum is detected between PP and the time of 90% repolarization, the minimum closer to PP is defined as TRR. This transient repolarization phase is present in APs from transitional and atrial-like myocytes, but is absent from classical SAM APs, such as the one depicted in Fig. 1.
The diastolic depolarization rate (DDR) is determined iteratively from a linear regression fit of a segment consisting of at least half of the interval corresponding to the initial 10–50% of MDP1-THR. Interestingly, the best linear fit usually occurs at the end of this interval, matching the definition of DDR used by Bucchi et al. (12) for rabbit sinoatrial myocyte APs. However, the iterative fit approach allows determination of DDR across a wide range of AP firing rates and waveforms.
AP epoch durations
The cycle length (CL) is defined as the time interval between MDP1 and MDP2. The diastolic duration (DD) is defined as the time interval between MDP1 and THR (9, 12, 14). The early diastolic duration (EDD) consists of the time interval from MDP1 to the end of the segment used for the best linear fit from the determination of DDR. The late diastolic duration (LDD) is defined as the time interval from the end of EDD to THR. The action potential duration (APD) is the time interval between THR and MDP2. The action potential durations at 50 and 90% repolarization (APD50 and APD90) are defined as the time intervals spanning across the AP at potentials corresponding to 50 and 90% repolarization.
Validation
ParamAP was validated by comparing manually determined AP parameters from a previous study (see Table S2 in (15)) with parameters automatically obtained by ParamAP for the same dataset. As shown in Table 2, ParamAP returned results that are very similar to the previous analysis for most parameters. Significant differences were observed only for LDD and APD90 owing to differences in parameter definitions. LDD was previously defined as the duration between 1 and 10% of the maximum dV/dt (15), whereas in ParamAP, LDD is defined as the interval from EDD to THR, so that it is independent of the upstroke velocity. Similarly, APD90 was previously defined as the interval between THR and 90% repolarization, whereas ParamAP defines APD90 as the interval spanning across the AP at 90% repolarization, so that it is independent of THR. The parameterization results for parameters with identical definitions are therefore validated by the comparison with the previous study, whereas the results for most parameters with modified definitions are insignificantly different. ParamAP’s robust analysis of a wide range of AP waveforms is illustrated in Fig. 2.
Table 2.
Validation of ParamAP
Parameter | Parameterization Method |
|||
---|---|---|---|---|
Larson et al., 2013 (15) | ParamAP | |||
MDPa (mV) | −59.2 | ±2.0 (12) | −59.3 | ±2.0 (12) |
THR (mV) | −45.9 | ±1.3 (13) | −50.1 | ±2.1 (13) |
DD (ms) | 51.1 | ±5.6 (14) | 66.7 | ±13.0 (14) |
EDD (ms) | 22.7 | ±2.9 (14) | 29.2 | ±6.3 (14) |
LDD (ms) | 17.7 | ±2.6 (14) | 37.5 | ±7.1 (14)∗ |
DDR (mV/s) | 133.7 | ±15.4 (13) | 115.9 | ±17.9 (13) |
MRRa (mV/ms) | −2.3 | ±0.2 (14) | −2.3 | ±0.2 (14) |
MUVa (mV/ms) | 24.3 | ±4.4 (13) | 23.2 | ±4.8 (13) |
PPa (mV) | 11.1 | ±1.6 (13) | 11.0 | ±1.7 (13) |
APAa (mV) | 70.1 | ±2.9 (11) | 70.1 | ±2.9 (11) |
APDa (ms) | 81.9 | ±7.3 (14) | 87.5 | ±8.0 (14) |
APD50 (ms) | 35.6 | ±3.3 (14) | 30.9 | ±1.9 (14) |
APD90 (ms) | 50.8 | ±2.8 (14) | 69.4 | ±6.8 (14)∗ |
Parameterization results are from manual analysis in a previous study (see Table S2 in (15)) compared to the results of automated analysis of the same dataset by ParamAP. Definitions, except as indicated in the footnote, are slightly modified in ParamAP. Asterisks mark significant differences (p > 0.05; t-test/U-test) between the two analyses. Numbers of cells analyzed for each parameter are shown in parentheses.
Parameters with identical definitions.
Figure 2.
Robust analysis of a wide range of AP waveforms. Given here are representative results returned by ParamAP for four distinct AP waveforms. Shown are membrane potentials (green and blue circles), rates of change of membrane potential (open circles), THR (red circle), DDR (dashed line), and APDs (horizontal lines and black circles). See User Manual in the Supporting Material for complete details of ParamAP output. To see this figure in color, go online.
Capabilities
As an open-source software tool, ParamAP is highly extensible and customizable. For example, the SG filter could be extended with an optimized filter algorithm to reject specific artifacts, such as stimulation artifacts in atrial or ventricular AP recordings. In a similar manner, the performance-optimized averaging algorithm could be applied for time intervals that are defined differently from our current implementation using extrema, for example, with an external Schmitt trigger signal as reference. A possible application is the analysis of neuronal APs synchronized with an external signal.
Limitations
ParamAP’s overall run-time is mainly determined by the time required for the file input from the hard drive to the main memory. An immediate reduction in run-time can therefore be achieved by processing the input files from a solid-state drive. In addition to file input/output, the memory allocation of the NumPy arrays can be a performance-limiting step. In our experiments, we commonly observed an ∼10-fold increase in peak memory requirement compared to the file size on the hard drive. However, because main memory modules are available at relatively low cost, we have refrained from implementing our own memory-optimized data structure competing with NumPy’s readily available array objects and functions.
The detection of a significant number of false-positive extrema can also be computationally demanding. In the case of a low SNR, the SG filter can be applied taking into account a larger number of data points for filtering, effectively increasing the SNR. Similarly, the reliability of the extrema detection will be less prone to noise artifacts by increasing the number of data points considered for the detection.
The performance of ParamAP could also benefit from a parallelized implementation that would avoid the global interpreter lock active in CPython. However, both NumPy and SciPy are currently incompatible with global interpreter lock-free implementations of Python, i.e., Jython or IronPython. Instead of parallelizing the analysis of a single file, large datasets with multiple files should therefore be analyzed in parallel using separate copies of ParamAP.
Conclusions
ParamAP is a powerful computation tool that automates and standardizes the analysis and of SAM APs. In particular, it streamlines the analysis of large data sets in a reproducible manner. The iterative algorithm for the determination of DDR and THR is robust, allowing the analysis of a wide range of different AP waveforms with the same algorithms. Furthermore, the open-source implementation allows users to extend and customize ParamAP to their individual applications.
Author Contributions
C.R. and C.P. designed the study. C.R. implemented and validated ParamAP. C.R. and C.P. wrote the manuscript.
Acknowledgments
We thank Drs. Stefano Morotti, Emily J. Sharpe, Hicham Bichraoui, and Daniel C. Bartos for constructive criticism during the development of ParamAP and for feedback on the manuscript and the User Manual.
This work was supported by National Institutes of Health (NIH) R01-HL088427 to C.P.
Editor: Eric Sobie.
Footnotes
ParamAP User Manual and four figures are available at http://www.biophysj.org/biophysj/supplemental/S0006-3495(17)30750-6.
Supporting Material
References
- 1.Rickert, C., and C. Proenza. ParamAP: Standarized parameterization of sinoatrial node myocyte action potentials. Zenodo, http://dx.doi.org/10.5281/zenodo.823742. [DOI] [PMC free article] [PubMed]
- 2.Dubois P.F. Guest editor’s introduction. Python: batteries included. Comput. Sci. Eng. 2007;9:7–9. [Google Scholar]
- 3.van der Walt S., Colbert S.C., Varoquaux G. The NumPy array: a structure for efficient numerical computation. Comput. Sci. Eng. 2011;13:22–30. [Google Scholar]
- 4.Jones, E., T. Oliphant, …, P. Peterson. 2001. SciPy: open source scientific tools for Python. https://www.python.org/.
- 5.Hunter J.D. Matplotlib: a 2D graphics environment. Comput. Sci. Eng. 2007;9:90–95. [Google Scholar]
- 6.Savitzky A., Golay M.J.E. Smoothing and differentiation of data by simplified least squares procedures. Anal. Chem. 1964;36:1627–1639. [Google Scholar]
- 7.Bentley J.L. Multidimensional binary search trees used for associative searching. Commun. ACM. 1975;18:509–517. [Google Scholar]
- 8.Opthof T., de Jonge B., Bouman L.N. Functional and morphological organization of the guinea-pig sinoatrial node compared with the rabbit sinoatrial node. J. Mol. Cell. Cardiol. 1985;17:549–564. doi: 10.1016/s0022-2828(85)80024-9. [DOI] [PubMed] [Google Scholar]
- 9.Kodama I., Nikmaram M.R., Owen J.M. Regional differences in the role of the Ca2+ and Na+ currents in pacemaker activity in the sinoatrial node. Am. J. Physiol. 1997;272:H2793–H2806. doi: 10.1152/ajpheart.1997.272.6.H2793. [DOI] [PubMed] [Google Scholar]
- 10.Verheijck E.E., Wessels A., Bouman L.N. Distribution of atrial and nodal cells within the rabbit sinoatrial node: models of sinoatrial transition. Circulation. 1998;97:1623–1631. doi: 10.1161/01.cir.97.16.1623. [DOI] [PubMed] [Google Scholar]
- 11.Verheijck E.E., van Ginneken A.C., Bouman L.N. Contribution of L-type Ca2+ current to electrical activity in sinoatrial nodal myocytes of rabbits. Am. J. Physiol. 1999;276:H1064–H1077. doi: 10.1152/ajpheart.1999.276.3.H1064. [DOI] [PubMed] [Google Scholar]
- 12.Bucchi A., Baruscotti M., DiFrancesco D. Modulation of rate by autonomic agonists in SAN cells involves changes in diastolic depolarization and the pacemaker current. J. Mol. Cell. Cardiol. 2007;43:39–48. doi: 10.1016/j.yjmcc.2007.04.017. [DOI] [PubMed] [Google Scholar]
- 13.Bogdanov K.Y., Maltsev V.A., Lakatta E.G. Membrane potential fluctuations resulting from submembrane Ca2+ releases in rabbit sinoatrial nodal cells impart an exponential phase to the late diastolic depolarization that controls their chronotropic state. Circ. Res. 2006;99:979–987. doi: 10.1161/01.RES.0000247933.66532.0b. [DOI] [PubMed] [Google Scholar]
- 14.Zaza A., Robinson R.B., DiFrancesco D. Basal responses of the L-type Ca2+ and hyperpolarization-activated currents to autonomic agonists in the rabbit sino-atrial node. J. Physiol. 1996;491:347–355. doi: 10.1113/jphysiol.1996.sp021220. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Larson E.D., St Clair J.R., Proenza C. Depressed pacemaker activity of sinoatrial node myocytes contributes to the age-dependent decline in maximum heart rate. Proc. Natl. Acad. Sci. USA. 2013;110:18011–18016. doi: 10.1073/pnas.1308477110. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Severi S., Fantini M., DiFrancesco D. An updated computational model of rabbit sinoatrial action potential to investigate the mechanisms of heart rate modulation. J. Physiol. 2012;590:4483–4499. doi: 10.1113/jphysiol.2012.229435. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Verkerk A.O., Geuzebroek G.S.C., Wilders R. Effects of acetylcholine and noradrenalin on action potentials of isolated rabbit sinoatrial and atrial myocytes. Front. Physiol. 2012;3:174. doi: 10.3389/fphys.2012.00174. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.St Clair J.R., Sharpe E.J., Proenza C. Culture and adenoviral infection of sinoatrial node myocytes from adult mice. Am. J. Physiol. Heart Circ. Physiol. 2015;309:H490–H498. doi: 10.1152/ajpheart.00068.2015. [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.