Introduction

The discovery of human induced pluripotent stem cells (hiPSCs) has started a new era in biological science and medicine. These reprogrammed somatic cells can be differentiated into a wide variety of cell lineages, and allow in vitro examination of cellular properties at the level of the human individual. In particular, this technology has large implications in drug development, moving us away from well studied but often unrepresentative animal models towards direct testing of compounds in specific human phenotypes and genotypes. This new access offers the potential for creating more cost effective, better, safer drug treatments; both from the ability to target precision, patient specific approaches, and to reveal possible side effects of drugs in the broader human population. However, despite its promise, the technology needed to fully utilize hiPSCs for drug testing is still under development and currently faces many difficulties limiting practical applicability.

In particular, the problem of maturation is a major challenge to the successful use of hiPSCs in drug discovery and development. Although hiPSCs can be used to create specialized human cells and tissues, these rapidly grown cells and tissues may have significant proteomic and structural differences to, and are often more fetal-like than, their adult in vivo counterparts. This is especially true in hiPSC derived cardiomyocytes (hiPSC-CMs), where the adult cells they are intended to represent have undergone decades of growth and development under cyclical physiological loading and stimulation. However, despite this limitation, hiPSC-CMs have already been successfully used to assess unwanted side effects of drugs (see e.g.1,2), and new technologies such as microphysiological systems (MPS)3, are emerging to improve maturation and better capture drug effects. Still, the overall applicability of hiPSC-CMs to find unwanted side effects of drugs for adult cardiomyocytes remains limited by the fact that only relatively immature cells are available for analysis (see e.g.4,5,6,7.). And, as pointed out in numerous papers (e.g.8,9,10,11,12.), the electrophysiological characteristics of hiPSC-CMs and adult cardiomyocytes differ significantly and, for determining potential dangerous drug side-effects, these differences may lead to both false positives and false negatives (see e.g.3,13.).

Meanwhile, in silico methods for investigating the properties of the action potential (AP) of excitable cells is a well-developed field (see e.g.14,15,16.) and includes models of human cardiomyocytes (see e.g.17,18,19,20.), and models where the effect of drugs are taken into account (see e.g.21,22,23.). Also, mathematical models of the action potential of hiPSC-CMs have been developed (see e.g.9,24.) based on measurements reported in8,25,26,27. This field has progressed to the point where computational models are now an active part of cardiotoxicity research28, and are being integrated into guidelines for comprehensive drug arrhythmia analysis.

In this work, we discuss how computational models of immature (IM) and mature (M) cardiomycytes can contribute to the improvement of the applicability of exploiting hiPSCs in the drug development pipeline. Despite remarkable progress in handling hiPSC-CMs under lab conditions (see, e.g.29), the ability to create fully mature hiPSC-CMs for drug screening is likely to remain a significant challenge. In the present report, we therefore address how in silico computational modeling can be used to deduce properties of mature (adult) cardiomyocytes based on two real time measurements of their immature counterparts.

A key idea in our approach is that individual proteins are functionally invariant under maturation. Therefore, maturation is multiplication in the sense that, for every type of protein, the number of proteins multiply during maturation, but the function of every protein remains unaltered. In addition, the surface area of the cell and the cell volume also increase significantly during maturation, leading to large changes in current densities between the IM and M cells. The invariance of the functional properties of the IM and M versions of every protein suggests a proportionality between the associated individual currents of the IM and M cells which may explain the results obtained in12. We use the proportionality between the individual currents to define a maturation matrix that maps the parameterization of a model of the IM cell to a parameterization of a model of the M cell.

Our approach to estimate effects of drugs on M cells based on measurements of IM cells can be summarized as follows and is shown in Fig. 1:

  1. 1.

    A MPS system is used to collect time averaged voltage and intracellular (cystolic) calcium waveforms, both under control conditions and in the presence of drug.

  2. 2.

    These voltage and calcium traces are inverted in order to define a mathematical model of the membrane and calcium dynamics of the tested IM cells. The effect of the drug is reflected in terms of changes in the maximum conducances of ion channels in the model.

  3. 3.

    The IM models are multiplied by a maturation matrix in order to obtain models for the M cells. The effect of the drug for adult cells is estimated by comparing the AP models of the M cells.

Figure 1
figure 1

Depiction of in silico modeling and analysis of an MPS system. Optical measurements of calcium and voltage are taken at baseline and in the presence of drug. These waveforms are inverted using a mathematical model of cell dynamics, into a set of parameters that define key ion channel conductances. Changes in this parameter set give information about specific changes in conductances under drug, and this parameter set can then be mapped to a model of mature cell behavior using the assumption of functional invariance of individual channels.

To demonstrate this process, we start by showing that a cost function, measuring the difference between data and model, is sensitive with respect to changes in the maximum conductance of major currents. Next, we show that this sensitivity is sufficient to invert simulated data and obtain a mathematical model of a drug effect. This model can be mapped from the IM case to the M case simply by multiplying a parameter vector by a diagonal maturation matrix. Finally, we apply the method of inversion to obtain an IM model based on experimental data obtained using voltage- and calcium sensitive dyes in an MPS. Again, the IM model is mapped to an M model. The effects of drugs are identified by inverting MPS data (voltage and cytosolic calcium concentration) and then mapping the resulting model from IM to M giving a mathematical model of the mature cardiomyocytes under the influence of a drug.

Results

Model inversion is sensitive to perturbations in major ion channel currents

The inversion of data through the minimization of a cost function requires that this cost function is sensitive to changes in model parameters. In Fig. 2, we illustrate the sensitivity of three cost functions utilizing voltage, calcium, or both, to perturbations in the conductances of major cellular currents or fluxes. Here the base model (see Methods) is defined by a modified version of the Paci et al. model9 (the details of the modification are given in the supplementary information).

Figure 2
figure 2

Sensitivity of maximum conductances of the immature base model assessed by the three cost functions defined in (3)–(4) with ε = 0.2. The color intensities correspond to the sum of the cost function upon perturbing the maximum conductance of the given current (or flux) by ±10%.

The results indicate that the cost function using voltage alone, HV, is sensitive to only some of the currents and fluxes, and in particular, it is largely insensitive to changes in Ito and IKs. Similar trends are seen in the calcium mismatch, HCa, and this cost function is, in general, less sensitive than the HV version. Finally, we consider the cost function combining both the voltage and calcium data, HV + Ca, and observe that it is more sensitive to perturbations than both HV and HCa alone, although some currents are still largely invisible.

Of note the maximum upstroke velocity of the action potential is not added as a part of the HV cost function. Adding this component would likely improve sensitivity, especially for the sodium current, but our measurements (see Methods) do not at present provide sufficient accuracy of the upstroke velocity. However, the upstroke velocity of the calcium transient can be accurately estimated from the MPS measurements and is therefore a part of the cost function describing the calcium mismatch.

Simulated channel block identification

Although Fig. 2 shows the sensitivity of the computed cost functions with respect to individual currents, we need to establish that the cost functions are adequately sensitive when multiple currents are allowed to vary. In Fig. 3, we show the values of HV + Ca as a function of pairwise perturbations in the maximum conductances of four major channels. The traces are theoretically computed using known effects of two chosen drugs; Verapamil which blocks ICaL and IKr, and Cisapride which blocks IKr, see28.

Figure 3
figure 3

The cost function (4) with ε = 0.2 for simulated drug data, evaluated with pairwise perturbations of maximum conductances to examine if a unique minimum can be found corresponding to chosen drug effects. Left panels: The effect of Verapamil is simulated by blocking the ICaL and IKr by 50% and 25%, respectively. Right panels: The effect of Cisapride is simulated by blocking the IKr by 50%. For both drugs, clear minimums are observed at the specified channel blockages.

Our results indicate that the cost functional using both voltage and calcium can theoretically identify the simulated channel block of the chosen drugs. The left panels show the value of HV + Ca as a function of the perturbation of the maximum conductances when the drug data are computed using the specified blocking due to the application of Verapamil. Six different configurations of pairwise blocking perturbations were tested and a minimum is clearly obtained close to the correct blocking of ICaL and IKr. Meanwhile, in the right panel, we show the values of HV + Ca when IKr is blocked by 50%, simulating the effect of Cisapride. The pairwise perturbations clearly identify that IKr is blocked by around 50%. These results indicate that an optimization algorithm of the cost function could find unique minima corresponding to specific channel blocks.

Simulated drug effect identification using the inversion procedure

Our methodology for inversion and mapping from the IM to the M state is first illustrated in Fig. 4 using simulated data. This process is used to identify the theoretical effect of the two drugs of Verapamil and Cisapride on mature cells from waveforms that would be obtained from known channel blocking. From the left panel, we observe that the inversion algorithm is able to identify the specified effect of both Verapamil and Cisapride very accurately, reproducing chosen blocks nearly exactly. This is consistent with the results of Fig. 3. The figure also shows the IM (middle panel) and M (right panel) action potentials and calcium transients. The M models are computed using the maturation map introduced in the Methods section showing how these detected blocks would appear in mature cells.

Figure 4
figure 4

Identification of drug effects on M cells based on simulated data of IM cells. Left panel: Results of inversion by minimizing the cost function (4) with ε = 0.2. Middle panel: Action potential (blue) and calcium transient (red) before and after (dotted) the drug is applied. Right panel: Model results after application of the maturation matrix.

Identification of simulated channel block of major and minor currents

Figure 3 demonstrates using simulated data that the cost function HV + Ca is able to theoretically identify induced changes to the IKr and ICaL currents. In Fig. 5, we extend this analysis to consider 50% single channel block of each of the major currents INa, ICaL, IKr and IK1. Again, we show the values of HV + Ca for pairwise perturbations of the maximum conductance of these four currents. In the supplementary information, similar plots are given for the cost functions HV and HCa.

Figure 5
figure 5

The cost function (4) with ε = 0.2 evaluated for pairwise perturbations of the maximum conductances of four major currents for simulated single-channel block of each of the currents. In the upper panel, INa is blocked by 50%, and in the next panels, ICaL, IKr and IK1 are similarly blocked by 50%. Like in Fig. 3, clear minimums are observed at the correct blockages in all four cases.

Figure 5 indicates that the cost function HV + Ca is theoretically able to identify each of the simulated single channel blocks. On the other hand, we expect that the cost function might fail to identify channel block of some of the minor, less sensitive membrane currents, for example Ito and IKs, which both have low sensitivity values in Fig. 2. In Table 1, we rank the currents by their total inward and outward contributions to the action potential, and report how well the inversion algorithm is able to identify simulated 10%, 30%, 50%, and 70% single-channel block of these currents. We observe that the inversion algorithm is not able to correctly identify the block of the smaller contributing currents Ito and IKs, but identifies the block of IK1, ICaL, IKr, and INa quite accurately for the investigated channel blockings.

Table 1 Identification of simulated single-channel block of six currents and four levels of block.

Channel block identification using a combined in vitro/in silico system

After demonstrating the theoretical sensitivity of inversion and drug effect prediction, we turn to the application of inverting actual cardiac MPS data. Average voltage and calcium traces (υ, Ca) = (υ(t), Ca(t)) from an MPS3 were inverted to yield parameterized mathematical models of the IM cells. This was done first for control data, denoted by (υC, CaC) to yield a control model. We then show the sensitivity of the cost function HV + Ca comparing this model with obtained voltage and calcium waveforms under the effect of actual doses of Verapamil and Cisparide, (υD, CaD). In Fig. 6, we present pairwise perturbations of maximum conductances and we observe again that the cost function HV + Ca is sensitive to these perturbations. For Verapamil, we see that the cost function clearly indicates that ICaL is blocked by around 50%. Furthermore, IKr seems to be blocked significantly, but it is not clear from the figure the extent of the block. In the right panel, we also consider the effect of Cisapride. Here, the cost function indicates that IKr is blocked to a large extent.

Figure 6
figure 6

The cost function (4) with ε = 0.2 evaluated for pairwise perturbations of maximum conductances using measured data from the MPS. Left panels: The effect of a dose of 100 nM of Verapamil is shown; it clearly blocks ICaL and it also blocks IKr. Right panels: The effect of a dose of 10 nM of Cisapride is shown; it clearly blocks IKr. The results of the inversion is given in Fig. 7.

The full inversion procedure (see the Methods section) is then applied, and it finds that ICaL is blocked by 71% and IKr is blocked by 19% (see Fig. 7) for Verpamil, in rough agreement with known properties of Verapamil at this dose. For Cisapride, the inversion predicts that IKr is blocked by 52%, and it predicts that the other currents are nearly unaffected by the drug.

Figure 7
figure 7

Results obtained by applying the inversion procedure to measured MPS data. First column: Results of inversion by minimizing the cost function (4) with ε = 0.2. Second column: Average voltage and calcium traces from MPS measurements. Third column: The AP model of the IM cells. Fourth column: The AP model of the M cells.

Mature AP change prediction using MPS data

In Panel 1 (leftmost) of Fig. 7, we show the numeric results of inversion using measured data. The next three panels show action potentials and calcium transients for measured data (Panel 2), simulation of IM cells (Panel 3) and simulation of M cells (Panel 4). The simulations presented in Panel 3 are based on inversion of the MPS data giving the block values shown in Panel 1. The parameter vector (see the Methods section) representing the IM cells is multiplied by the maturation matrix in order to define the parameter vector representing the M cells. The figure illustrates how MPS measurements of IM cells can be used to estimate the effect of an unknown compound for M cells.

Discussion

In this paper, we present a mathematical analysis framework to define the electrophysiologic mechanisms of drug action in mature human cardiomyocytes using only optical recordings of membrane potential and calcium in hiPSC-CMs. This procedure overcomes a number of major existing challenges in hiPSC-CM-based screening: (1) data inversion of measured drug effects can be successfully applied to all-optical experimental data, thus allowing detailed pharmacologic characterization without the need for intracellular electrodes, (2) the mathematical approach to mapping between hiPSC-CM and adult myocyte electrophysiology is straightforward and generalizable, and (3) the MPS-based optical recordings are averaged over relatively large populations of hiPSC-CMs, thus reducing errors associated with the well-known phenotypic heterogeneity of hiPSC-CM preparations.

Inversion of voltage and calcium traces into action potential models

Modern cardiac AP models have been developed more or less continually since the celebrated sinoatrial node model of Noble30. As a result, a range of cardiac cellular models have evolved to represent the accumulated knowledge of nearly six decades of multidisciplinary research, and the models are detailed and complex. Conventional approaches to developing these models have relied heavily upon voltage-clamp microelectrode data. These techniques provide exquisite resolution of single-channel31,32,33,34, through to whole-cell currents35,36,37, and has thereby allowed the models to provide remarkably accurate reconstructions of cardiac cellular APs and calcium dynamics. However, while generalized cell models built using such data are widely used, especially to mechanistically understand how drug compounds alter electrophysiology, the experimental methods used to build them are technically challenging, have intrinsically low-throughput and cannot be used on tissue models like MPS.

In the present paper, we have developed an alternative approach that attempts to exploit the decades of information stored in modern cardiac AP models to rapidly parameterize base models for hiPSC-CMs. Rather than the data traditionally used to develop AP models, we used metrics that can readily be measured in a MPS, namely the optically assessed transmembrane potential and cytosolic calcium concentration. However, these data are fundamentally different from the detailed measurements of single currents traditionally used to invert measurements into biophysical models, and new methodology is needed. The approach taken in this report is based on minimization of a cost function comparing the predicted and measured waveforms, which seems to provide reasonable accuracy in analysis, but it is clear that some currents are still largely invisible even theoretically, and alternative approaches may lead to broader or more focused results.

For example, it was observed in Fig. 2 that the cost function HV + Ca is more sensitive than both HV and HCa (see (3)–(4)). This indicates that both voltage and calcium traces must be measured in order to get optimal inversion of the measurements. However, this depends on the application. For instance, if the main purpose is to study side effects on the IKr current, it may be sufficient to only consider voltage traces. In addition, cost functions which take into account measured extracellular potential or contractile force generated by the IM cells may also be used to better invert specific drug induced changes.

Uniqueness of conductance defined action potential models

One significant question is the uniqueness of the parameters obtained in inversion of the optical waveforms, as mathematical models of excitable tissue often exhibit non unique behavior. For example, in models of neurons it is well known that different cell models can provide similar neuronal activity, see e.g.38,39,40. Similar observations have been made for a variety of models of cardiac cells, in41 using the ten Tusscher et al. model19, and in42 using the O’Hara et al. model17. The implication of these observations is that it is generally very challenging to uniquely determine conductances from AP observations, and indeed, it has been clearly demonstrated that single action potential waveforms can have multiple conductance parameterizations that give low fit error when many parameters are allowed to vary37. Several methods have been tried to solve this problem; see e.g.43,44, and promising approaches have been suggested by a number of groups. For example, in41 it was shown that using several physical properties of the dynamics improve the invertibility of the conductances. More recently, optmized voltage-clamping protocols37 have been introduced to give better resolution of smaller currents and more uniquely determine conductances. We see in our results the same lack of uniqueness, especially when we try to invert smaller currents such Ito and IKs. However, we are able to observe that four major currents appear largely visible and invertible with a combined measure of voltage and calcium from a single paced waveform and a CPU-intensive method that avoids the differentiation of a rough cost-function.

Using correlations for parametrization and mapping

Others have also approached the question of how to map changes in cardiac dynamics between populations using model results. In a series of papers (see12,41,45,46,47) by Sobie and co-authors, a comprehensive theory has been developed for using correlations between simulation results to parameterize models and for mapping between species, and between immature and mature cells. Starting in45, it is observed that input parameters such as maximum conductances of ion currents are correlated with output parameters such as the APD and the net amplitude of the calcium transient. Such correlations are useful because they can be used to understand how natural variability of input parameters affect output characteristics in populations of cell models. The correlations can also, in principle, be used for parameterization by measuring output characteristics and using the inverse correlation matrix to parameterize input parameters.

In12, the correlation is taken one step further by observing that output parameters from simulations of one species are correlated to the output parameters of simulations based on a model of another species. Similarly, the authors observe that simulation outputs from a model of immature cells are correlated with output results of simulations based on a model of mature cells. Therefore, it is, in principle, possible to perform measurements of immature data and map the results to the mature case.

The correlation approach to mapping between species and between immature and mature cells is highly promising. However, the theory is based on observed correlations between simulated data and provide no mechanistic insight into the relations. In our approach, it follows directly from the assumptions that the proteins are the same for immature and mature cells, that there must be a mapping between models of immature and mature cells.

The maturation map

While the inversion of data from hiPSC-derived cells will be essential for understanding the electrophysiology of immature cells, understanding how such electrophysiolgical changes translate into mature cells could provide powerful means to screen drugs for side effects. We introduce the idea of a maturation map, which assumes that the essential difference between an immature (IM) cell and a mature (M) cell can be described by the number of proteins, the membrane area and volume of the cell, and the intracellular storage structures. Based on these assumptions, we have argued that we can map any IM parameter vector, pIM, to an associated M parameter vector, pM, simply by multiplying by a diagonal matrix Q: pM = QpIM. We have illustrated this mapping and noted that reasonable models of an IM AP are mapped over to a reasonable M AP. In addition, we have seen that measured IM data can be inverted to yield pIM, and then the maturation mapping gives the adult AP parameterized by pM = QpIM.

In the present report, we have simply addressed the mapping directly from an IM state to the M cells. However, maturation is clearly a dynamic process with rapid changes, and it may therefore be of interest to use this mapping to investigate the time dependent behaviour of the cells. Measurements of several time instances of IM cells may give insight into the developmental trajectories of hiPSC-CMs and how different maturation protocols alter the electrophysiological properties of generated test cells. Such studies may be useful for both choosing maturation protocols to optimize data inversion sensitivity, and for quality control measures of batch to batch cells.

In addition, taking into account more aspects of cellular electrophysiology could refine our approach. For example, one could take into account that proteins exist in various forms; for instance, the sodium channel has nine different forms with different associated possible channelopathies. These variants may proliferate at different rates and thus potentially lead to significant changes in the properties of the M cells.

hiPSC data sources

While our results show the promise of this methodology, considerable current limitations exist that need to be addressed. First, variability in hiPSC-CMs remains a challenge48,49. In the preparation of the data, we have dealt with variability by discarding individual voltage and calcium traces that are significantly different from the average behaviour of the cells. This seems to give sufficient accuracy for inversion, and the effects of the drugs we have considered have shown significant cellular changes. However, even if the average results clearly respond to the doses of the drugs applied in this study, work on reducing the variability of generated hiPSC-CMs in MPSs is clearly needed for batch to batch consistency.

In addition, improvements in data acquisition from the cell systems may also improve the methodology, in particular it may increase the sensitivity of cost functions to currents that are presently less visible. For instance, the voltage waveform can not currently be imaged at the time resolution needed to obtain accurate measurements of the upstroke, due to a combination of hardware and optical light collection limitations. In the same manner, the signal to noise ratio in this waveform, due to background dye absorption, prevents adequate resolution of the plateau phase and in particular of the notch in the action potential, preventing inversion of the Ito current. Improvements in the methodology for collection of high resolution optical voltage data will therefore lead to substantial improvements in mapping resolution.

It should also be noted that it is possible to measure the extracellular field potential in the microphysiological systems using a multi-electrode array (MEA) system, see e.g.1,50. Such data can be incorporated in our method by using the EMI model (see e.g.51.) instead of the common AP models. In this case, the function H given by (4) would have to be extended to include the EFPs. This would be considerably more computationally demanding than the present method, but it may also increase the accuracy of the inversion.

Extension to species - species mapping

The basic idea underpinning the maturation mapping is that the proteins populating the cell membrane are the same for the IM cells and the M cells; the reason for the significant difference in AP between these cell types is the difference in densities of membrane proteins. Similarly, the proteins of the cell membranes are also quite similar from one specie to another, but again the densities of these proteins vary considerably. Therefore, the procedure for detecting side effects of drugs developed in this report may be generalized to be used between species. More specifically; it may be possible to measure the effect of drugs for mouse cells and deduce the effect for human cells following the steps detailed in the Method section below. This may be of significance because of the abundance of mouse data.

Methods

Our aim is to enable automatic characterization of side-effects of drugs for mature cardiomyocytes based on measurements of voltage and calcium traces of immature cells in an MPS. Here, we describe the methods applied above; we briefly explain how appropriate optical measurements of voltage and calcium are obtained, how a model of the AP of a mature cardiomyocyte can be obtained from a model of an immature cardiomyocyte, and how data is inverted to define a mathematical model of the AP of immature cells. Furthermore, we describe how the effects of drugs on M cardiomyocytes can be estimated using measurements of the effect on IM cardiomyocytes.

Measuring voltage and calcium traces using an MPS

Using previously developed techniques3, cardiac MPS systems were loaded and matured prior to drug exposure. On the day upon which studies were performed, freshly measured drug was dissolved into DMSO (Cisapride) or media (Verapamil) and serially diluted. Each concentration of the drug to be tested was preheated for 15–20 min in a water bath at 37 °C and subsequently sequentially injected in the device. At each dose, after 5 min of exposure, the drug’s response on the microtissue was recorded using a Nikon Eclipse TE300 microscope fitted with a QImaging camera. Fluorescent images were acquired at 100 frames per second using filters to capture GCaMP and BeRST-1 fluorescence as previously described. Images were obtained across the entire chip for 6–8 seconds, with cell excitation paced at 1 Hz, to capture multiple beats for processing.

Fluorescence videos were analyzed using custom Python software utilizing the open source Bio-Formats tool to produce characteristic voltage and calcium waveforms for each chip and tested drug dose. Briefly, for each analysis, the fluorescent signal for the entire visual field was averaged, excluding pixels which did not change significantly in intensity over the acquisition. The signal was then smoothed using a 3 point median filter, and 5–7 individual action potentials or calcium transients overlayed by aligning the maximum dF/dt and then averaged into a single transient.

Inversion of voltage and cytosolic calcium traces

In order to complete the description of the steps presented in Table 2 (below), we need to explain how the inversion used in steps 4 and 5 is performed, and the key question is how to do the inversion. To this end, we assume that we have a base model of the form

$${\upsilon }_{t}=-\,\sum _{i}\,{q}_{i}{I}_{i}(\upsilon ,s),$$
(1)

where Ii represents the dynamics of the individual membrane proteins and qi represents the maximum conductance of the ion channels (or the maximum rate of an exchanger or a pump). Furthermore, υ is the transmembrane potential and s represents the remaining state variables of the model. In order to adjust this model to a set of measured data given by (υ*, c*), we seek parameters λi such the solution of

$${\upsilon }_{t}=-\,\sum \,\mathrm{(1}+{\lambda }_{i}){q}_{i}{I}_{i}(\upsilon ,s)$$
(2)

is as close as possible to the measured data, (υ*, c*). The distance from the computed solution (υ, c) = (υ(λ), c(λ)) to the measured data (υ*, c*) is given by a cost function H = H(λ).

Table 2 The table shows a summary of the method for computing possible side effects of drugs for mature cells based on measurements conducted on immature hiPSC-derived cells.

We consider the following cost functions

$${H}_{V}(\lambda )={(\sum _{j=1}^{4}{H}_{j}(\lambda )+\varepsilon \sum _{i}{\lambda }_{i}^{2})}^{1/2},{H}_{{\rm{Ca}}}(\lambda )={(\sum _{j=5}^{8}{H}_{j}(\lambda )+\varepsilon \sum _{i}{\lambda }_{i}^{2})}^{1/2},$$
(3)
$${H}_{V+{\rm{Ca}}}(\lambda )={(\sum _{j=1}^{8}{H}_{j}(\lambda )+\varepsilon \sum _{i}{\lambda }_{i}^{2})}^{1/2},$$
(4)

where

$${H}_{1}=\frac{|{\int }_{{t}_{0}(\lambda )}^{{t}_{1}(\lambda )}\upsilon (\lambda )dt-{\int }_{{t}_{0}^{\ast }}^{{t}_{1}^{\ast }}{\upsilon }^{\ast }dt|}{|{\int }_{{t}_{0}^{\ast }}^{{t}_{1}^{\ast }}{\upsilon }^{\ast }dt|},\,\,{H}_{2}=\frac{|{{\rm{APD}}}_{V\mathrm{,30}}(\lambda )-{{\rm{APD}}}_{V\mathrm{,30}}^{\ast }|}{|{{\rm{APD}}}_{V\mathrm{,30}}^{\ast }|},$$
$${H}_{3}=\frac{|{{\rm{APD}}}_{V,50}(\lambda )-{{\rm{APD}}}_{V\mathrm{,50}}^{\ast }|}{|{{\rm{APD}}}_{V\mathrm{,50}}^{\ast }|},\,\,{H}_{4}=\frac{|{{\rm{APD}}}_{V\mathrm{,80}}(\lambda )-{{\rm{APD}}}_{V\mathrm{,80}}^{\ast }|}{|{{\rm{APD}}}_{V\mathrm{,80}}^{\ast }|},$$
$${H}_{5}=\frac{|{(\frac{dc}{dt})}_{max}(\lambda )-{(\frac{dc}{dt})}_{max}^{\ast }|}{|{(\frac{dc}{dt})}_{max}^{\ast }|},\,\,{H}_{6}=\frac{|{{\rm{APD}}}_{{\rm{Ca}}\mathrm{,30}}(\lambda )-{{\rm{APD}}}_{{\rm{Ca}}\mathrm{,30}}^{\ast }|}{|{{\rm{APD}}}_{{\rm{Ca}}\mathrm{,30}}^{\ast }|},$$
$${H}_{7}=\frac{|{{\rm{APD}}}_{{\rm{Ca}}\mathrm{,50}}(\lambda )-{{\rm{APD}}}_{{\rm{Ca}}\mathrm{,50}}^{\ast }|}{|{{\rm{APD}}}_{{\rm{Ca}}\mathrm{,50}}^{\ast }|},\,\,{H}_{8}=\frac{|{{\rm{APD}}}_{{\rm{Ca}}\mathrm{,80}}(\lambda )-{{\rm{APD}}}_{{\rm{Ca}}\mathrm{,80}}^{\ast }|}{|{{\rm{APD}}}_{{\rm{Ca}}\mathrm{,80}}^{\ast }|}.$$

here, the star * is used to denote observed data, either generated by simulations or gathered from the MPS. Also, \({(\frac{dc}{dt})}_{max}\) is the maximal upstroke velocity of the calcium concentration. Furthermore, APDV,30 is defined as the length (in ms) of the time from the value of the transmembrane potential, in the upstroke, is 30% below its maximum value (t0) until it again is repolarized to 30% of its maximum value (t1). The values APDV,50 and APDV,80 are defined similarly. Likewise, the terms APD Ca,30, APD Ca,50 and APD Ca,80 represent the corresponding transient durations for the calcium concentration. In H1, we compute the integral of the transmembrane potential from t = t0 to t = t1. Note that HV only depends on characteristics of the voltage trace, whereas HCa only depends on characteristics of the calcium trace; finally, HV + Ca includes the terms of both the two former cost functions and therefore depends on the characteristics of both the voltage trace and the calcium trace.

The minimization procedure

The inversion procedure aims to minimize the cost function measuring the difference between the target and model voltage and calcium waveforms. In every minimization, we have an existing parameter vector \(\bar{p}\), and we seek an optimal perturbation of this vector where each component is given by (1 + λi)\({\bar{p}}_{i}\). Here, i runs over the components of the parameter vector and λi denotes the perturbation.

The cost function introduced above is irregular and hard to minimize. Therefore, we introduce a brute force search algorithm that avoids any attempt to take the gradient into account. To start searching for suitable values of λ = {λi}, we first set up a bounding box of allowed values of λ. This is initially set up so that each λi is in some interval, for instance [−0.5, 0.5]. Next, we draw N choices of λ randomly from the bounding box and compute H(λ) for each of these N choices. We then pick out the five choices of λ that give the smallest values of H(λ) and set up a new bounding box of reduced size around each of these five choices of λ. More specifically, these bounding boxes are set up by centering the boxes around the chosen λ and letting the length of the interval for each λi be reduced to 90% of the length of the previous intervals. Note that this means that the new bounding boxes are not necessarily contained in the initial bounding box, but may extend beyond the initial intervals. We do, however, set up a restriction so that no bounding box is allowed to contain values of λ smaller than or equal to −1. In addition, when searching for the effect of drugs, we assume that the drug is a channel blocker and therefore only consider λ (−1,0].

After setting up the five new bounding boxes, we draw N/5 choices of λ randomly from each box and compute H(λ) for each of these N choices of λ. We then select the five choices of λ that give the smallest values of H(λ) and repeat the steps above for a given number of iterations. For the applications of the minimization method reported in the Results section, we generally use 10 iterations and N = 5000.

Maturation through multiplication

Our model of the maturation process rely on the assumption that the individual membrane proteins are functionally invariant under maturation, whereas the number of proteins, the membrane area and the cell volume change significantly (see e.g.11,52,53,54). Also, different membrane proteins proliferate at different rates leading to large differences in the expression levels between IM and M cells. This, in turn, leads to characteristic differences between the IM and M voltage and calcium traces. The maturation process is illustrated in Fig. 8.

Figure 8
figure 8

Illustration of the assumptions underlying our model of maturation. (A) The immature cell with two types of membrane proteins, with a cytosolic space containing the sarcoplasmic reticulum with associated release and uptake proteins. (B) Maturation is multiplication in the sense that the number of proteins increases at a protein specific rate. (C) A specific protein in the IM cell is the same as in the M cell. (D) A drug affects every single protein in the IM cell in exactly the same manner as for the M cell. (E) Model of the transmembrane potential for IM and M cells, and the relation between these models; and how these models are affected when a drug is applied.

A drug effects a single protein in the same manner for IM and M cells

Since we assume that exactly the same proteins are present in the IM and M cells, it follows that the effect of a given drug on a protein in the IM case is identical to the effect on the same protein type in a M cell. This observation is essential in order to understand side effects on M cells based on measurements of the IM cells.

The membrane potential for IM and M cells in the presence of a single current

In order to illustrate the modeling process going from IM to M, we consider the following simplest possible case where the transmembrane potential υ (in mV) is governed by a single current

$$C\upsilon ^{\prime} (t)=-\,I,$$
(5)

with I = go(υ − υ0). Here, C is the membrane capacitance (in μF/cm2), g is the maximum conductance of the channels (in mS/cm2), o is the open probability of the channels (unitless), and υ0 is the resting potential of the channels (in mV). In this formulation, the current I is given in units of μA/cm2. The maximum conductance can be written on the form

$$g=\frac{N{g}_{0}}{A},$$
(6)

where g0 is the conductance (in mS) of a single channel, N is the number of channels and A is the membrane area of the cell (in cm2).

Let NIM and AIM denote the number of ion channels and the surface area of the IM cell, respectively. Then there are constants qN and qA such that the number of channels in the M cell is given by NM = qNNIM, and the membrane area of the M cell is given by AM = qAAIM. Therefore, the maximum conductance of the M cell can be expressed in terms of the maximum conductance of the IM cell as follows,

$${g}_{M}=\frac{{N}_{M}{g}_{0}}{{A}_{M}}=\frac{{q}_{N}{N}_{IM}{g}_{0}}{{q}_{A}{A}_{IM}}=\frac{{q}_{N}}{{q}_{A}}{g}_{IM}=q{g}_{IM},$$
(7)

with \(q=\frac{{q}_{N}}{{q}_{A}}\).

Here, we have explained that the representation of a single current can be mapped from IM to M simply by multiplying the maximum conductance by a factor. This derivation relies heavily on the assumption that the dynamics of the single channel, represented by the open probability o in (6), remains the same during maturation (see Fig. 8). As a consequence, the Markov model (see e.g.23) representing the open probability of the single channel should be the same for the IM and the M version of the channel protein. Similar arguments can be presented for other membrane proteins such as exchangers and pumps. Furthermore, the intracellular Calcium machinery can be treated in exactly the same manner, leaving the IM and M models of a single protein to be distinguished only by a factor. Details of the mapping of calcium concentration fluxes are provided in the supplementary information.

The factors for the individual components of an AP model can be gathered in a parameter vector p, and a diagonal matrix Q can be used to store the maturation mapping from the IM parameter vector to the M parameter vector such that pM = QpIM.

In Fig. 9, we illustrate the use of the maturation mapping for well established AP models of hiPSC-CMs using the Paci et al. model9, and of the adult human cardiomyocyte using the ten Tusscher et al. model19. For the Paci et al. model, we define the maturation map \({Q}_{P}=\mathrm{diag}(\tfrac{{q}_{A}}{{q}_{V}},\) qNa, qCaL, qto, qKs, qKr, qK1, qNaCa, qNaK, qpCa, qf, qbNa, qbCa, qleak, qup, qrel) = (1.7, 0.4, 3, 5, 20, 0.7, 1.3, 0.05, 0.3, 0.6, 0.1, 0.5, 0.4, 200, 1, 36). Since pIM is given by the paper9, we can compute pM = QPpIM. Similarly, for the ten Tusscher et al. model we use \({Q}_{T}=\mathrm{diag}(\tfrac{{q}_{A}}{{q}_{V}},\) qNa, qCaL, qto, qKs, qKr, qK1, qNaCa, qNaK, qpCa, qf, qpK, qbNa, qbCa, qleak, qup, qrel) = (1.7, 4, 4.2, 17, 40, 1, 2.2, 0.4, 0.7, 1.7, 0.05, 19, 0.1, 0.6, 500, 1.3, 34), and since pM is given by the paper19, we can compute the IM version by \({p}_{IM}={Q}_{T}^{-1}{p}_{M}\). The maturation maps are set up using an extended version of the standard inversion procedure described in Section 4.2 with characteristics of the currents INa, ICaL, IKr, and IK1 included in the cost function (see the supplementary information for details).

Figure 9
figure 9

Immature and mature versions of the Paci et al. model9 and the ten Tusscher et al. (tT) model19. The APs of the M cells are shorter and the upstroke velocity of the calcium transient is faster than for the IM case; compare left and right panels.

We observe that these AP models display characteristic differences between IM and M cells; the upstroke of calcium transient of the IM cells is considerably slower than for the M cells, and the action potential duration is longer for the IM cells than for the M cells.

Estimating side-effects drugs

The method for identifying side effects of drugs is summarized in Table 2. The method involves eight steps:

Step 1: Base model Assume that there exists an AP base model, characterized by a parameter vector pIM,B, representing a prototypical IM cell, and an associated base maturation map QB. The associated M cells are characterized by pM = QBpIM,B. The M model, parameterized by pM, provides a normal mature AP. No drug is involved in parameterizing the base model. Note also that the base model is used for numerous (independent) measurements. The base model in our computations is a modified version of the model of hiPSC-CMs suggested by Paci et al.9; see the supplementary information for details concerning the base model.

Step 2 and 3: MPS-measurements For the IM cells, we measure the transmembrane potential and the cytosolic calcium concentration, stored as (υC, cC), and make similar measurements for the case when a drug has been applied, stored as (υD, cD). Here C is for control (no drug) and D is for drug.

Step 4 and 5: Inversion Generally, the notation

$$(\upsilon ,c)\,\mathop{\longrightarrow }\limits^{{\rm{inversion}}(q)}\,p$$
(8)

means that the data (υ, c) are inverted to yield a model parameterized by the vector p, using the model parameterized by the vector q as a starting point for the inversion. The control data (no drug) given by (υC, cC) are inverted to yield the model parameterized by pIM,C, using the parameter vector pB as a starting point for the inversion. Likewise, the D-data are inverted to give the model pIM,D, where the parameter vector pIM,C is used as starting point.

Step 6: Update maturation map The maturation map can now be updated to secure that if Q is applied to the IM parameter vector, pIM,C, the resulting parameter vector is the base model of the M cell parameterized by the vector pM.

Step 7: Map from IM to M The updated maturation map Q is used to compute the parameterization of the M version of the drugged cells.

Step 8: Drug affected M cell The effect of the drug on the M cells is analyzed by comparing the vectors pM and pM,D. The components of pM,D that are significantly different from its pM counterpart, has been significantly affected by the drug. The effect of the drug on the mature AP is estimated by comparing the result of simulations of the models characterized by pM and pM,D.