Graphical abstract
Method name: The matrix exponential method for ion channel parameterization
Keywords: Cardiac action potential, Ion channels, Computer modeling
Abstract
Continuous time Markov models have been widely used to describe ion channel kinetics, providing explicit representation of channel states and transitions. Fitting models to experimental data remains a computationally demanding task largely due to the high cost of model evaluation. Here, we propose a method to efficiently optimize model parameters and structure. Voltage clamp channel protocols can be decomposed into a series of fixed steps of constant voltage resulting in a set of linear systems of differential equations. Given the linear systems, ODE integration can be swapped for the faster matrix exponential routine. With our parallelized implementation, optimized models are able to reproduce a wide range of experimentally collected data within one minute, a 50 times speedup over ODE integration.
-
•
The cost of the objective function is reduced by employing the matrix exponential
-
•
The likelihood of convergence is improved by applying synchronous start simulated annealing
-
•
The approach was tested by optimizing parameters for a model of the cardiac voltage-gated Na+ channel, NaV1.5, and the KCNQ1 K+ channel.
Method
Following the seminal work of Hodgkin and Huxley in 1952 [1], mechanistic ordinary differential equation (ODE) models have been used to simulate dynamics of excitable systems including neurons, myocytes and pancreatic beta cells [2], [3]. A persistent challenge in creating these models is the identification of optimal parameters. This difficulty arises from the multi-dimensionality of the search, the exponential form of the rate equations, and the existence of many local minima. Global search methods such as simulated annealing and genetic algorithms have been applied to identify optimal sets of parameters [4], [5], [6]. However, these approaches require significant computational resources.
The primary bottleneck for optimization is the numerical solution of ODEs needed to simulate experimentally observed dynamics. When evaluating a large set of models with global searches, this step becomes rate-limiting, and is particularly difficult when the equations become stiff, requiring very small time-steps or complicated implicit schemes [7].
We propose to overcome the ODE barrier by solving these differential equations with the matrix exponential, an approach that has been used to analyze channel kinetics and improve the efficiency of action potential simulations [8], [9]. We tested this approach on experimental voltage pulse protocols, optimizing a two discrete-state Markov models of the cardiac Na+ channel and the KCNQ1 K+ channel. Optimization was performed using multiple chain simulated annealing [10]. Code has been made publically available at, where demos and https://github.com/silvalab/MMOptimizer instructions on model fitting can be found. Example model graphs and fits to Na+ experimental data are shown in Fig. 1; K+ fits are shown in Fig. 2.
We used the following voltage pulse protocols for Na+ model fitting:
Voltage Dependent Activation (Fig. 1B): A series of depolarizing pulses were applied from −120 mV to 20 mV in 10 mV increments from a resting potential of −100 mV. The voltage-dependence of channel conductance was found from this protocol by finding the peak current during the pulse and dividing by the driving force (), where is the membrane potential and is the reversal potential for Na+.
Steady State Inactivation (Fig. 1B): Cells were held at −120 mV before being exposed to conditioning pulses ranging from −120 mV to 20 mV in 10 mV increments for 200 ms. Voltage was then stepped to −20 mV and peak current was recorded and normalized by dividing by the maximum current.
Recovery from Inactivation (Fig. 1C): Cells were held at −120 mV before being exposed to a −20 mV depolarizing pulse for 200 ms. Cells were then allowed to recover at −120 mV for durations ranging from 1 ms to 1000 ms before a final depolarizing pulse at −20 mV where peak current was recorded and normalized across samples.
Rise/Fall Time (Fig. 1D): This protocol replicated Voltage Dependent Activation. Rise (10%-90%) measured the amount of time it took for current to rise from 10% to 90% of the maximum recorded current. Fall (90%-20%) characterized fast inactivation kinetics by measuring the time it took for current to fall from 90% to 20% peak current.
Conductance Trace (Fig. 1E): In the final protocol we exposed the cell to a single depolarizing pulse and recorded normalized conductance over 5 ms.
Similarly, we used the following voltage pulse protocols for K+ model fitting:
Voltage dependent activation (Fig. 2B): A series of depolarizing pulses were applied from −100 mV to 60 mV in 20 mV increments from a resting potential of −100 mV. The voltage-dependent channel conductance was calculated by dividing the peak current by the driving force (), where is the membrane potential and is the reversal potential for K+.
Deactivation (Fig. 2C): Cells were held at −80 mV before exposure to a depolarizing pulse at 60 mV for 2 ms. Voltage was then stepped to conditioning pulses ranging from −120 mV to 0 mV for 4 ms. Voltage dependent-channel conductance was calculated by dividing the minimum absolute current by the driving force.
Rise Time (Fig. 2D): This protocol replicated Voltage Dependent Activation. Rise (10%-90%) measured the amount of time it took for the current to rise from 10% to 90% of the peak.
Conductance Traces (Fig. 2E): Cells were exposed to −20 mV, 0 mV, and 40 mV depolarizing pulses and normalized conductance was recorded over a 4 ms interval.
Model structure
Models are implemented as a connected graph, a sequence of rate parameters, and a boolean conductivity vector. Each node in the graph represents a discrete model state, with transitions between model states denoted by graph edges. The conductivity vector gives the relative conductance for each state. Models are initialized from the space of random connected graphs using an approach described by Wilson et al. [11]. We begin by constructing a minimum spanning tree by performing a random walk over the graph until all nodes have been visited. Every time an unvisited node is encountered, the edge connecting this node to the previous node is added to the graph. Afterwards, new edges are added with constant probability. Initial rate parameters are drawn from independent normal distributions.
If we let denote the set of edges and the set of rates, the transition matrix can be generated as follows:
(1) |
(2) |
Note that each edge is bidirectional, so . With the transition matrix, the model kinetics can be defined by a single differential equation
(3) |
where is the vector of state occupancies. The solution to this ODE can be approximated by using standard solvers such as Runge-Kutta methods [12].
If we limit ourselves to the unconstrained case, we can optimize over all rate parameters. However, most ion channels are observed to obey microscopic reversibility, or the reversibility of flow in closed loops [13], [14], so we instead limit the search space to the set of models that satisfy this principle. Rather than attempting to solve the constrained optimization problem, we follow the approach outlined by Menon et al. [4], where we optimize over a set of independent rate parameters which can be used to generate models that observe microscopic reversibility.
Microscopic reversibility requires that in equilibrium, the transition rates between any two connected states must balance each other [15]. Thus, if , the following must hold:
(4) |
where and are the steady state occupancies for states and respectively. Taking the log of both sides, Eq. (4) can be written in matrix form
(5) |
(6) |
where is the transpose of the even columns of the graph’s incidence and is a E × 2E difference matrix with
(7) |
This forms a system of equations with 2E unknowns and E equations. To solve for , we need an additional E independent equations. A simple choice is to define a new variable to be the product of forward and backward rates
(8) |
(9) |
or again written in matrix form
(10) |
Combining Eq. (9) with Eq. (6) gives an independent linear systems of equations with 2E variables and 2E equations.
(11) |
(12) |
Of course, we expect the elements of the rate vector to be voltage-dependent, but microscopic reversibility must also hold for all values of voltage. Eq. (12) shows that is linear in terms of and . Thus, we can define and to the exponent of a linear operation
(13) |
(14) |
where is a vector valued function of voltage, and are vectors of rate parameters which are subject to optimization. Substituting Eqs. (13) and (14) into Eq. (12)
(15) |
Substituting the voltage constant part of Eq. (15) for
(16) |
(17) |
The results obtained in Eq. (17) can be used to generate the transition matrix as shown in Eq. (2). Because the rate vector is the result of linear operations on s and k it is of the same form as s and k.
Voltage dependence
In the model, transition rates are given as the exponent of the inner product of a vector valued voltage function and the model parameters.
(18) |
Any rate function that can be written in this form can be made to satisfy microscopic reversibility by the method previously described. The simplest voltage function is a linear model motivated by the constant temperature Eyring rate theory [16], with . The transition rate then becomes
(19) |
In practice, the linear model worked well. We were able to obtain good fits for all provided voltage clamp protocols. Nonetheless, the linear model is prone to stiff differential equations. As membrane voltage becomes increasingly large (for ) or increasingly small (for ), the becomes exponentially larger, often resulting in physically implausible transition rate. A simple solution would be to bound ; however, in models where the rates are not linearly independent microscopic reversibility could be violated.
Another proposed voltage function extends the linear model by adding higher order polynomial terms [17], with and . We test both second order expansions of this form. The higher order terms gave the model more expressive power and resulted in significantly reduced fitting error. Regardless, the polynomial model showed signs of severe overfitting. Even slight modifications of the protocol parameters resulted in very different behavior, making models ill-suited for larger scale simulations.
Finally, we attempted a third voltage dependence function in attempt to circumvent some of the limitations of the linear model by bounding transitions rates while not violating microscopic reversibility. The proposed function is in the form
(20) |
where sig is the sigmoid function and and are fixed parameters shared across all rates. In regions where , the sigmoid model closely approximates the linear model; however, at large or small voltages, the sigmoid function becomes bounded limiting the maximum rate and reducing ODE stiffness. Additionally, this function provided better fits than the linear model.
Cost function evaluation
Each of the fitted voltage clamp protocols consist of a sequence of discrete voltage steps. The cost function is computed by simulating each of the protocols, recording the results, and using squared error as a metric to evaluate model performance. In this paper, we look at two different ways to simulate the model: traditional ODE solvers and the matrix exponential. A flow chart illustrating the cost function evaluation for both approaches is show in Fig. 3.
As the execution time profiling results in Fig. 4A show, ODE integration is the clear bottleneck, accounting for as much as 99% of execution time. ODE solvers were designed to solve a broad class of problems
(21) |
Yet, voltage clamp protocols commonly consist of a series of discrete voltage steps, reducing the system from to where is constant over the time to . We expect that standard ODE solvers are not able to take full advantage of the linear nature of the constant voltage steps. In contrast, using the matrix exponential, the solution is given as [23]. The matrix exponential can further be used to sample state occupancy over a series of fixed time steps
(22) |
showing that it can effectively replace ODE solvers in our cost function evaluation routine. In our implementation we used ExpoKit’s Padé approximation routine [19], [23]
The resulting speedup is substantial—using a single thread on an Intel Xeon E5-2630 processor, the matrix exponential (EXPM) implementation converges in significantly less time than ode integration (ODE) as shown in Fig. 4B. With a single thread, the EXPM implementation was able fit models in the order of five minutes compared to five hours, a speed-up of more than 50×. Synchronous chain simulated annealing can easily be modified to use more than a single thread. Using 12 threads, model fitting shown in Fig. 1 can be performed in under a minute.
Finally, we evaluated a stiffness penalty on the models proportional to the model’s largest eigenvalue over a range of voltages (–120 mV to +20 mV). This penalty constrains the search space and resulting models have slightly higher cost (Fig. 5A). Nonetheless, adding a small penalty proved to be important. Following optimization, we reran the fitted models over the protocols, using ODE solvers rather than the matrix exponential (Fig. 5B). Models with no added penalty took over 50 x longer due to their stiff differential equations. In whole cell simulations, membrane voltage is no longer a series of discrete steps, but rather a continuous variable requiring ODE integration. This penalty ensures that fitted models can be efficiently used in larger scale simulations, while constraining transition rates to physically plausible values.
Optimization
Similar to Menon et al., we optimize over model architecture as well rate parameters, maintaining microscopic reversibility by encoding rates as a set of independent parameters. Instead of a genetic algorithm, we use simulated annealing to explore the combinatorial search space. Genetic algorithms involve a recombination step, where individuals are selected to form offspring for the next generation [22]. With like structured models, new model rates can simply be drawn from a random distribution parametrized by the parents’ rates. When models have different structures (i.e. different numbers of nodes and connectivity), recombination is less obvious. One option is to only perform recombination over models with the same structure. However, we observed this leads to a collapsed structural search space, and leads to unsatisfactory local optima. We obtained better convergence results in much less time using simulated annealing.
Specifically, we used synchronous chain simulated annealing for model optimization, considering the tradeoff between execution time and model error. Simulated annealing is an iterative stochastic search algorithm which combines local Monte Carlo search with an annealing schedule [10]. It probabilistically guarantees a globally optimal solution provided an infinitely long cooling schedule [20]; however, in practice, we wish to fit good suboptimal models quickly.
At each iteration we generate a new model proposal by perturbing the current model .
Perturbations are reversible and can alter both model structure and rate parameters taking one or more of the following forms:
-
1.
State Addition: A new state is added to the model. A random edge is formed connecting the new state to a random state drawn from the existing model. The new rate parameters governing the edge and state are drawn from a normal distribution.
-
2.
State Removal: A state is randomly chosen from the existing model and removed; all edges connecting this state are also removed. If removal results in a disconnected graph, the graph is reconnected by forming a random minimum spanning tree over the disconnected components.
-
3.
Edge Addition: Two model states are randomly selected, if these states are not already connected a new edge is formed. Rate parameters are drawn from a normal distribution.
-
4.
Edge Removal: A random model edge is selected and removed. If removal results in a disconnected graph, the graph is reconnected similar to (2).
-
5.
Rate Perturbation: Each rate parameter has probability of being updated. Updates are performed by adding a random variable drawn from a zero mean normal distribution to the current parameter. Thus, for rate parameter
(23) |
The locality of the perturbation can be modified by adjusting hyper-parameters and . Every perturbation performs a rate update—other structural modifications are performed with a predefined probability.
Following perturbation, the cost function for the new model is computed. The new model is accepted with probability
(24) |
where is the previous model error, is the perturbed model error, and the annealing temperature [21]. As the temperature decreases, , the probability of making an uphill transition, , becomes increasingly small. In our implementation, we adopt the simple exponential annealing schedule [21] with or equivalently , where governs the rate of annealing and initial temperature .
To avoid getting trapped in local optima and increase the probability of convergence, we run multiple synchronous chains [10]. Rather than a single model, we maintain a set of models, each with their own search path. Model perturbation and acceptance are both performed individually for each chain.
The optimization procedure attempts to fit all the voltage clamp protocols while minimizing model complexity. We found that in many cases, several models of similar complexity were able to achieve approximately the same fitting error. Hence, different runs often converged to different model structures. Since model structure is an optimization variable, we make no attempt to distinguish the types of channel states, rather such states naturally emerge as a product of the optimization. Open states can easily be identified by examine the conductivity vector. Similarly, closed and inactivated states can be identified by exposing models to a depolarizing test pulse (Fig. 1F), and looking at the transition of state occupancy.
Conclusions
Identification of continuous Markov model parameters is a challenging problem due to a large search space and a high cost of function evaluation, often requiring significant computational resources. We propose to overcome these limitations by efficiently encoding the cost function as a sequence of discrete voltage steps, solvable using the matrix exponential. Our implementation successfully captures channel kinetics without requiring excess resources or time.
Overall, we observed a 50× speedup when using the matrix exponential implementation of the cost function. One a single processor, optimization could be performed in only 10 min—extended to 12 cores, convergence time dropped to under a 2 min. The encoding of the cost function can be generalized to other voltage clamp protocols, allowing our implementation to be easily adapted to fit other channels types and data.
Modern biophysics methods are beginning to reveal molecular details of channel function [24], [25], [26], [27], the nanoscale consequences of inherited mutations [27], [28], and the precise mechanisms of small-molecule drug regulation [29]. To rigorously describe these molecular details, the complexity of models and the burden of optimization will increase substantially, necessitating advanced optimization methods and computer hardware. As such we expect that much future work will be needed to develop the methods required to create these models.
The matrix exponential method for ion channel parameterization
Acknowledgments
The authors are thankful to Taylor Voelker and Angela Schubert for help with figure composition, and the laboratory of Prof. Jianmin Cui for providing K+ channel data. This work was supported by a James M. McKelvey Undergraduate Research Award in Engineering (Z.T.) and a Burroughs Wellcome Fund Career Award at the Scientific Interface 101029 and an American Heart Association grant 16GRNT31200025 (J.S.).
MethodsX thanks the reviewers of this article for taking the time to provide valuable feedback.
References
- 1.Hodgkin Alan L., Huxley Andrew F. A quantitative description of membrane current and its application to conduction and excitation in nerve. J. Physiol. 1952;4:500. doi: 10.1113/jphysiol.1952.sp004764. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Rudy Yoram, Silva Jonathan R. Computational biology in the study of cardiac ion channels and cell electrophysiology. Q. Rev. Biophys. 2006;39(01):57–116. doi: 10.1017/S0033583506004227. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Silva Jonathan R., Cooper Paige, Nichols Colin G. Modeling K, ATP-dependent excitability in pancreatic islets. Biophys. J. 2014;107(9):2016–2026. doi: 10.1016/j.bpj.2014.09.037. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Menon Vilas, Spruston Nelson, Kath William L. A state-mutating genetic algorithm to design ion-channel models. Proc. Natl. Acad. Sci. U. S. A. 2009;106(39):16829–16834. doi: 10.1073/pnas.0903766106. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Gurkiewicz Meron, Korngreen Alon. A numerical approach to ion channel modelling using whole-cell voltage-clamp recordings and a genetic algorithm. PLoS Comput. Biol. 2007;3(8):e169. doi: 10.1371/journal.pcbi.0030169. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Milescu Lorin S., Akk Gustav, Sachs Frederick. Maximum likelihood estimation of ion channel kinetics from macroscopic currents. Biophys. J. 2005;88(4):2494–2515. doi: 10.1529/biophysj.104.053256. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Garfinkel David, Marbach Carl B., Shapiro Norman Zalmon. Stiff differential equations. Annu. Rev. Biophys. Bioeng. 1977;6(1):525–542. doi: 10.1146/annurev.bb.06.060177.002521. [DOI] [PubMed] [Google Scholar]
- 8.Colquhoun David, Hawkes Alan G. Single-Channel Recording. Springer; US: 1995. A Q-matrix cookbook; pp. 589–633. [Google Scholar]
- 9.Starý Tomáš, Biktashev Vadim N. Exponential integrators for a Markov chain model of the fast sodium channel of cardiomyocytes. IEEE Trans. Biomed. Eng. 2015;62(4):1070–1076. doi: 10.1109/TBME.2014.2366466. [DOI] [PubMed] [Google Scholar]
- 10.Lee Soo-Young, Lee Kyung Geun. Synchronous and asynchronous parallel simulated annealing with multiple Markov chains. IEEE Trans. Parallel Distrib. Syst. 1996;7(10):993–1008. [Google Scholar]
- 11.Wilson David Bruce. Generating random spanning trees more quickly than the cover time. Proceedings of the Twenty-eighth Annual ACM Symposium on Theory of Computing; ACM; 1996. [Google Scholar]
- 12.Ascher Uri M., Petzold Linda R. vol. 61. Siam; 1998. (Computer Methods for Ordinary Differential Equations and Differential-algebraic Equations). [Google Scholar]
- 13.Colquhoun David. How to impose microscopic reversibility in complex reaction mechanisms. Biophys. J. 2004;86(6):3510–3518. doi: 10.1529/biophysj.103.038679. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14.Rothberg Brad S., Magleby Karl L. Testing for detailed balance (microscopic reversibility in ion channel gating. Biophys. J. 2001;80(6):3025. doi: 10.1016/S0006-3495(01)76268-6. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Boynton Frederick P. Detailed balance and microscopic reversibility. J. Chem. Phys. 1964;40(10):3124. [Google Scholar]
- 16.Hänggi Peter, Talkner Peter, Borkovec Michal. Reaction-rate theory: fifty years after Kramers. Rev. Mod. Phys. 1990;62(2):251. [Google Scholar]
- 17.Destexhe Alain, Huguenard John R. Nonlinear thermodynamic models of voltage-dependent currents. J. Comput. Neurosci. 2000;9(3):259–270. doi: 10.1023/a:1026535704537. [DOI] [PubMed] [Google Scholar]
- 19.Sidje Roger. Expokit: a software package for computing matrix exponentials. ACM Trans. Math. Softw. (TOMS) 1998;24(1):130–156. [Google Scholar]
- 20.Ingber Lester. Simulated annealing: practice versus theory. Math. Comput. Model. 1993;18(11):29–57. [Google Scholar]
- 21.Kirkpatrick Scott, Gelatt C. Daniel, Vecchi Mario P. Optimization by simulated annealing. Science. 1983;220(4598):671–680. doi: 10.1126/science.220.4598.671. [DOI] [PubMed] [Google Scholar]
- 22.Deb Kalyanmoy. A fast and elitist multiobjective genetic algorithm: NSGA-II. IEEE Trans. Evol. Comput. 2002;6(2):182–197. [Google Scholar]
- 23.Moler Cleve, Van Loan Charles. Nineteen dubious ways to compute the exponential of a matrix. SIAM Rev. 1978;20(4):801–836. [Google Scholar]
- 24.Zhu Wandi, Varga Zoltan, Silva Jonathan R. Molecular motions that shape the cardiac action potential: insights from voltage clamp fluorometry. Prog. Biophys. Mol. Biol. 2016;120(1):3–17. doi: 10.1016/j.pbiomolbio.2015.12.003. [DOI] [PubMed] [Google Scholar]
- 25.Brettmann Joshua B. Role of protein dynamics in ion selectivity and allosteric coupling in the NaK channel. Proc. Natl. Acad. Sci. U. S. A. 2015;112(50):15366–15371. doi: 10.1073/pnas.1515965112. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Rudokas Michael W. The Xenopus oocyte cut-open vaseline gap voltage-clamp technique with fluorometry. JoVE. 2013;85 doi: 10.3791/51040. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Varga Zoltan. Direct measurement of cardiac Na+ channel conformations reveals molecular pathologies of inherited mutations. Circ. Arrhythmia Electrophysiol. 2015;8(5):1228–1239. doi: 10.1161/CIRCEP.115.003155. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.Silva Jonathan R., Goldstein Steve A.N. Voltage-sensor movements describe slow inactivation of voltage-gated sodium channels II: a periodic paralysis mutation in NaV1. 4 (L689I) J. Gen. Physiol. 2013;141(3):323–334. doi: 10.1085/jgp.201210910. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Muroi Yukiko, Chanda Baron. Local anesthetics disrupt energetic coupling between the voltage-sensing segments of a sodium channel. J. Gen. Physiol. 2009;133(1):1–15. doi: 10.1085/jgp.200810103. [DOI] [PMC free article] [PubMed] [Google Scholar]