Hassaan A Bukhari

Flavio Palmieri

Julia Ramírez

Pablo Laguna

Fellow IEEE José Esteban Ruiz

Dina Ferreira

Mark Potse

Carlos Sánchez

Esther Pueyo

Characterization of T wave Amplitude, Duration and Morphology Changes During Hemodialysis: Relationship with Serum Electrolyte Levels and Heart Rate

Keywords: ECG, in silico modeling, T wave morphology, transmural heterogeneity, potassium, calcium, heart rate, hemodialysis, time warping

Objective: Chronic kidney disease affects more than 10% of the world population. Changes in serum ion concentrations increase the risk for ventricular arrhythmias and sudden cardiac death, particularly in end-stage renal disease (ESRD) patients. We characterized how T wave amplitude, duration and morphology descriptors change with variations in serum levels of potassium and calcium and in heart rate, both in ESRD patients and in simulated ventricular fibers. Methods: Electrocardiogram (ECG) recordings from twenty ESRD patients undergoing hemodialysis (HD) and pseudo-ECGs (pECGs) calculated from twenty-two simulated ventricular fibers at varying transmural heterogeneity levels were processed to quantify T wave width (Tw), T wave slope-to-amplitude ratio (TS/A) and four indices of T wave morphological variability based on time warping (dw, d NL w , da and d NL a ). Serum potassium and calcium levels and heart rate were measured along HD. Results: d NL a was the marker most strongly correlated with serum potassium, dw with calcium and da with heart rate, after correction for covariates. Median values of partial correlation coefficients were 0.75, -0.74 and -0.90, respectively. For all analyzed T wave descriptors, high inter-patient variability was observed in the pattern of such relationships. This variability, accentuated during the first HD time points, was reproduced in the simulations and shown to be influenced by differences in transmural heterogeneity. Conclusion: Changes in serum potassium and calcium levels and in heart rate strongly affect T wave descriptors, particularly those quantifying morphological variability. Significance: ECG markers have the potential to be used for monitoring serum ion concentrations in ESRD patients.

I. INTRODUCTION

C HRONIC kidney disease represents a global health bur- den, with an estimated 10% of the population being affected. All stages of this disease, but particularly the late ones, are associated with increased mortality and decreased quality of life [START_REF] Hill | Global Prevalence of Chronic Kidney Disease -A Systematic Review and Meta-Analysis[END_REF]. Hemodialysis (HD) is a common treatment for patients in whom the disease has progressed to endstage renal disease (ESRD). The main causes of death among ESRD patients undergoing HD are cardiovascular diseases, all together accounting for 43% of mortality [START_REF] Kanbay | Sudden death in hemodialysis: an update[END_REF]. Many of these deaths are due to ventricular arrhythmias and sudden cardiac death [START_REF] Bozbas | Prevalence and Predictors of Arrhythmia in End Stage Renal Disease Patients on Hemodialysis[END_REF].

ESRD patients show impaired ability to maintain electrolyte balance in the bloodstream. Serum potassium ([K + ]) and calcium ([Ca 2+ ]) levels outside normal ranges, in the form of hypo-or hyperkalemia and hypo-or hypercalcemia, are known to increase the risk for life-threatening arrhythmias [START_REF] Weiss | Electrophysiology of Hypokalemia and Hyperkalemia[END_REF]- [START_REF] Noordam | Effects of Calcium, Magnesium, and Potassium Concentrations on Ventricular Repolarization in Unselected Individuals[END_REF]. HD can even enhance arrhythmic risk due to changes in volume and electrolyte concentrations associated with the intermittent nature of the treatment [START_REF] Poulikakos | Risk of Sudden Cardiac Death in Chronic Kidney Disease[END_REF].

[K + ] and [Ca 2+ ] variations are known to influence the electrocardiogram (ECG) [START_REF] Noordam | Effects of Calcium, Magnesium, and Potassium Concentrations on Ventricular Repolarization in Unselected Individuals[END_REF], [START_REF] Lanari | Electrocardiographic effects of potassium. I. Perfusion through the coronary bed[END_REF]- [START_REF] Van Mieghem | The clinical value of the ECG in noncardiac conditions[END_REF]. In a recent largescale study on unselected individuals, shorter QT intervals were associated with higher [K + ] and [Ca 2+ ] [START_REF] Noordam | Effects of Calcium, Magnesium, and Potassium Concentrations on Ventricular Repolarization in Unselected Individuals[END_REF]. In [START_REF] Attia | Novel Bloodless Potassium Determination Using a SignalProcessed SingleLead ECG[END_REF], a single-lead ECG estimator of [K + ] based on the ratio of the T wave downward slope and the square root of T wave amplitude was proposed and validated in 19 HD patients. On a similar basis, a multi-lead ECG estimator of [K + ] based on the ratio of the downward slope and amplitude of the T wave was proposed and validated in 45 HD patients [START_REF] Severi | Noninvasive potassium measurements from ECG analysis during hemodialysis sessions[END_REF]- [START_REF]Noninvasive quantification of blood potassium concentration from ECG in hemodialysis patients[END_REF]. Computational modeling has also been used to assess the effects of changes in [K + ], [Ca 2+ ] and sodium ([Na + ]) concentrations on simulated action potentials (APs) and ECGs [START_REF] Mesa | Effects of Serum Calcium Changes on the Cardiac Action Potential and the ECG in a Computational Model[END_REF]- [START_REF] Pilia | ECG as a tool to estimate potassium and calcium concentrations in the extracellular space[END_REF]. An inverse relationship between [K + ] and [Ca 2+ ], on the one hand, and simulated QT and RT intervals, on the other, was reported, with negligible effects of [Na + ] changes on those intervals. These in silico studies were, however, based on a single ventricular model not accounting for potential interindividual variability.

Although the mentioned studies suggest that it is possible to monitor changes in [K + ] and [Ca 2+ ] based on ECG analysis, further investigation is needed to demonstrate the feasibility of such approach. On the one hand, most of the proposed markers rely on only one specific ECG interval duration or wave amplitude that may present large variations not necessarily associated with electrolyte levels. Also, some of the proposed ECG markers cannot always be robustly measured due to difficulties in the delineation of low-amplitude waves, which could hinder their use for ambulatory monitoring. Importantly, the physiological underpinnings of changes in the proposed ECG markers in association with electrolyte variations have not been well established. We hypothesize that markers accounting for the whole T wave morphology can more robustly characterize repolarization changes associated with different [K + ] and [Ca 2+ ] levels and, thus, be better suited for non-invasive electrolyte estimation. Additionally, simulation of ECGs from a set of human ventricular tissue models representing potential inter-patient differences can help in the interpretation of the obtained results.

The aim of this work is to characterize T wave amplitude, time and morphology changes during HD in relation to [K + ] and [Ca 2+ ] levels. Since heart rate (HR) may play a role in those relationships, its effects are also assessed. To uncover potential cellular mechanisms underlying differential T wave responses to variations in [K + ], [Ca 2+ ] and RR (inverse of instantaneous HR), a set of transmural ventricular fibers covering a wide range of cellular heterogeneities is simulated and pseudo-ECGs (pECGs) are computed. A sensitivity analysis is performed to investigate the extent to which different proportions of endocardial, midmyocardial and epicardial cells contribute to explain inter-individual differences in T wave amplitude, time and morphology, particularly for [K + ] and [Ca 2+ ] values outside normal ranges. Preliminary results were presented as a conference contribution [START_REF] Bukhari | Transmural Ventricular Heterogeneities Play a Major Role in Determining T-Wave Morphology at Different Extracellular Potassium Levels[END_REF].

II. MATERIALS AND METHODS

A. Study population and data analysis

The study population included 20 ESRD patients from Hospital Clínico Universitario de Zaragoza (HCUZ). 48-hour 12-lead ECGs were acquired at a sampling frequency of 1 kHz with an amplitude resolution of 3.75 µV (H12+, Mortara Instruments, Milwaukee, WI, USA). The acquisition started 5 minutes before the onset of HD treatment and lasted for 48 hours (Fig. 1, bottom blue line). Five blood samples were taken and analyzed for [K + ] and [Ca 2+ ] during the HD session: the first one at the HD onset and the next three samples every hour during the HD session (Fig. 1, K1 to K4 in red). The 5th blood sample was collected at the end of the HD (K5, at minute 215 or 245, depending on the patient). A 6th blood sample, K6, was taken after 48 hours, immediately before the next HD session, but was not analyzed as part of this work. The study protocol was approved by the ethical committee (CEICA ref. PI18/003) and all patients signed the informed consent form. Table I shows the population characteristics.

B. ECG pre-processing

Pre-processing of ECG signals from ESRD patients included band-pass filtering (0.5 -40 Hz) to remove baseline wander as well as muscular and powerline noise. A waveletbased single-lead delineation method was used for QRS detection and wave delineation of each of the twelve leads [START_REF] Martínez | A wavelet-based ECG delineator: evaluation on standard databases[END_REF].

Principal component (PC) analysis was spatially applied to the T waves of the eight independent leads [START_REF] Castells | Principal Component Analysis in ECG Signal Processing[END_REF] to enhance the T wave energy. In a 10-minute window at the end of the HD session, the coefficients defining the PC transformation were obtained from the eigenvectors of the 8 × 8 inter-lead auto-correlation matrix estimated by including all segmented T waves within the window. The first PC computed by projecting the ECG recording was used for subsequent ECG analysis, as it is the transformed lead where the T waves have maximal energy, thus allowing better morphological characterization.

The T waves in the first PC were delineated using the single-lead delineation algorithm described in [START_REF] Martínez | A wavelet-based ECG delineator: evaluation on standard databases[END_REF]. The onset, peak and end of the T waves were determined and used for subsequent computation of T wave markers.

C. Time, amplitude and morphology-based T wave descriptors 1) Time and amplitude T wave markers: Time-and amplitude-based T wave descriptors were computed from mean warped T waves (MWTWs). To obtain a MWTW, which is an optimal representative average both in temporal and amplitude domains [START_REF] Ramírez | Variability of Ventricular Repolarization Dispersion Quantified by Time-Warping the Morphology of the T-Waves[END_REF], two-minute ECG segments at the end of each HD hour were analyzed. A predominant T wave polarity was defined as the most frequent in the analyzed two-minute window. T waves having the predominant polarity were aligned with respect to their gravity center and used to compute an initial MWTW [START_REF] Ramírez | Variability of Ventricular Repolarization Dispersion Quantified by Time-Warping the Morphology of the T-Waves[END_REF]. After removing outliers from the selected T waves, the remaining T waves presenting strong correlation (Spearman's correlation coefficient > 0.98) with the previous initial MWTW were considered to compute the final MWTW.

The analyzed T wave descriptors, computed from MWTWs, included:

• T w , representing T wave width calculated from T wave onset to T wave end (expressed in ms). • T S/A , representing the ratio between the downward slope and the amplitude of the T wave (expressed in 1/ms) [START_REF] Corsi | Validation of a novel method for non-invasive blood potassium quantification from the ECG[END_REF], [START_REF]Noninvasive quantification of blood potassium concentration from ECG in hemodialysis patients[END_REF].

2) T wave markers based on morphological characteristics:

Morphology-based T wave descriptors were computed using the time-warping methodology described previously [START_REF] Ramírez | Variability of Ventricular Repolarization Dispersion Quantified by Time-Warping the Morphology of the T-Waves[END_REF]. For the patients' ECGs, reference T waves were calculated from the MWTW at the end of the HD session, as this is the time when the patient was discharged from hospital with restored serum ion levels, thus being an acceptable reference for ambulatory monitoring.

The T wave for a given HD stage was expressed as f s (t s ) = [f s (t s (1)), ..., f s (t s (N s ))] and the reference T wave as f r (t r ) = [f r (t r (1)), ..., f r (t r (N r ))] , where t r = [t r (1), ..., t r (N r )] , t s = [t s (1), ..., t s (N s )] and N r and N s are the total durations of t r and t s . Fig. 2 (a) shows f r and f s , with their respective time domains, t r and t s . Let γ(t r ) be the warping function that relates t r and t s , such that f s (γ(t r )) denotes the time-domain warping of f s (t s ) using γ(t r ). The square-root slope function (SRSF) transformation was used to find the optimal warping function by warping the SRSFs of the original T waves [START_REF] Ramírez | Variability of Ventricular Repolarization Dispersion Quantified by Time-Warping the Morphology of the T-Waves[END_REF]. This transformation is defined as:

q f (t) = sign( ḟ (t))| ḟ (t)| 1 2 . ( 1
)
The optimal warping function was determined as the one minimizing the SRSF amplitude difference:

γ * (t r )=arg min γ(t r ) q f r (t r ) -q f s (γ (t r )) γ (t r ) . (2)
A dynamic programming algorithm was used to obtain the function γ * (t r ) that optimally warps f r (t r ) into f s (t s ). This function is shown in Fig. 2 (d). The warped T wave, f s (γ * (t r )), is shown in Fig. 2 (b), together with the reference T wave, f r (t r ).

The descriptor d w , shown in Fig. 2 (d), was used to quantify the level of warping required to optimally align the T waves f s (t s ) and f r (t r ):

d w = s d |s d | 1 N r Nr n=1 |γ * (t r (n)) -t r (n) |, (3)
where

s d = N u r n=1 (γ * (t r (n)) -t r (n)) + Nr n=N u r +1 (t r (n) - γ * (t r (n))
) is used to account for the sign, with N u r denoting the number of samples in the T wave upslope.

The amplitude descriptor d a was computed from the area contained between f r (t r ) and f s (γ * (t r )) normalized by the L2-norm of f r (t r ), thus quantifying amplitude differences after time warping the two T waves:

d a = s a |s a | f s (γ * (t r )) -f r (t r ) f r (t r ) × 100, (4)
where

s a = Nr n=1 (f s (γ * (t r (n))) -f r (t r (n))
) is used to account for the sign.

Both d w and d a incorporate information from the linear and non-linear warping required to fit both T waves in the time domain and of the remaining amplitude differences, respectively. The non-linear components can be quantified as:

d NL w = 1 N r Nr n=1 |γ * (t r (n)) -γ * l (t r (n))|, (5)
d NL a = f r (t r ) f r (t r ) - f s (γ * (t r )) f s (γ * (t r )) × 100, (6)
where γ * l (t r ) (light green line in Fig. 2 (d)) was derived by linearly fitting γ * (t r ) through the least absolute residual method [START_REF] Holland | Robust regression using iteratively reweighted least-squares[END_REF]. The set of all morphology-based T wave markers analyzed in this study included:

• d w , representing temporal variations in T wave morphology (expressed in ms), • d a , representing amplitude variations in T wave morphology (expressed as a %), • d NL w , representing non-linear temporal variations in T wave morphology (expressed in ms),

• d NL a , representing non-linear amplitude variations in T wave morphology (expressed as a %).

D. Relationship between T wave markers and [K + ], [Ca 2+ ] and HR variations

To assess the effects of [K + ], [Ca 2+ ] and RR on each investigated T wave marker at the different time points during HD, linear correlation analysis was performed [START_REF] Freedman | Statistics (international student edition)[END_REF], [START_REF] Benesty | Pearson correlation coefficient[END_REF]. Let X represent [K + ], [Ca 2+ ] or RR and let Y be one of the analyzed time-, amplitude-and morphology-based T wave markers. The correlation coefficient between X and Y was computed as:

ρ XY = (X -X)(Y -Ȳ ) (X -X) 2 • (Y -Ȳ ) 2 . ( 7
)
To independently quantify the effects of

[K + ], [Ca 2+
] and RR on each T wave marker, linear partial correlation analysis was performed [START_REF] Zuo | Biological network inference using low order partial correlation[END_REF], [START_REF] Fleiss | A Note on the Partial Correlation Coefficient[END_REF]. The correlation coefficient after removing the effects of Z in both X and Y was calculated as:

ρ XY •Z = ρ XY -ρ XZ ρ ZY (1 -ρ 2 XZ ) • (1 -ρ 2 ZY ) . (8)
The correlation coefficient between X and Y after removing the effects of two variables Z 0 and Z 1 was calculated as:

ρ XY •Z 0 Z 1 = ρ XY •Z 0 -(ρ XZ 1 •Z 0 ) • (ρ Y Z 1 •Z 0 ) (1 -ρ 2 XZ 1 •Z 0 ) • (1 -ρ 2 Y Z 1 •Z 0 ) . (9)
In this study,

Y ∈ {T w , T S/A , d w , d a , d NL w , d NL a }, X ∈ {[K + ], [Ca 2+ ], RR}, Z 0 , Z 1 ∈ {[K + ], [Ca 2+ ],
RR}, and X and Ȳ are the sample means.

E. In silico population of human ventricular fibers

Transmural electrical propagation from ventricular endocardium to epicardium was simulated using one-dimensional fibers of 1.65 cm in length [START_REF]Noninvasive quantification of blood potassium concentration from ECG in hemodialysis patients[END_REF], [START_REF] Gima | Ionic current basis of electrocardiographic waveforms: a model study[END_REF]. Cellular electrophysiology was represented by the human ventricular AP model proposed by Ten Tusscher and Panfilov [START_REF] Ten Tusscher | Alternans and spiral breakup in a human ventricular tissue model[END_REF]. To adequately represent the relationship between AP duration (APD) and [Ca 2+ ], the updates to the Ten Tusscher-Panfilov model published in [START_REF] Severi | From in vivo plasma composition to in vitro cardiac electrophysiology and in silico virtual heart: the extracellular calcium enigma[END_REF] were incorporated. In the original model, the L-type calcium current was described as:

I CaL = G CaL • d • f • f 2 • f Cass • 4 • (V -15)F 2 RT • [Ca 2+ ] -0.25[Ca 2+ ] ss e ( 2(V -15)F RT ) 1 -e ( 2(V -15)F RT ) , (10)
where d is a voltage-dependent activation gate, f and f 2 are voltage-dependent inactivation gates, f Cass is an inactivation gate dependent on the calcium concentration in the dyadic space (in mM) , denoted by [Ca 2+ ] ss , and V is the transmembrane potential (in mV). The formulations for f 2 and f Cass in [START_REF] Severi | From in vivo plasma composition to in vitro cardiac electrophysiology and in silico virtual heart: the extracellular calcium enigma[END_REF] read:

df Cass dt = k • f Cass,inf -f Cass τ fCass , (11)
where k = 0 if f Cass,inf > f Cass and V > -60 mV, and k = 1 otherwise, and

f Cass,inf = 0.9 1 + exp [Ca 2+ ]ss-1.95 0.15 + 0.1, (12)
where

τ fCass = 80 1 + [Ca 2+ ]ss 0.05 2 + 1, (13)
f 2,inf = 0.3 1 + e ( Vm +35 7 ) + 0.7. (14)
Different proportions of endocardial, midmyocardial and epicardial cells were simulated in a total of 22 combinations with 10% variations in the proportion of each cell type: endocardial layer ranging from 10% to 50%, midmyocardial layer from 10% to 50% and epicardial layer from 20% to 80%. We used the notation Cxyz, where C stands for the word "case" and x, y and z denote the first digit of the proportions of endocardial, midmyocardial and epicardial cells, respectively (e.g. C334 represents the case with 30%, 30% and 40% of endocardial, midmyocardial and epicardial cells, respectively). The combinations of transmural heterogeneities used in this study are shown in Table II. A train of 10 stimuli was applied to the first cell of each fiber with a basic cycle length of 1000 ms and amplitude equal to 1.5 times the diastolic threshold. The initial state for each simulation was pre-calculated from a single cell simulation, where the values of the model state variables after 1000 paced beats were considered as representative of the cell at steady state. To compute electrical propagation, a finite element-based software [START_REF] Heidenreich | Adaptive macro finite elements for the numerical solution of monodomain equations in cardiac electrophysiology[END_REF] was used with a time step of 0.01 ms and space discretization of 0.01 cm. pECGs were computed as described in previous studies [START_REF] Gima | Ionic current basis of electrocardiographic waveforms: a model study[END_REF] using the expression:

V e = ∇V • ∇ 1 r dr, (15)
where is a constant proportional to the ratio of intracellular and extracellular conductivities, V is the transmembrane potential and r is the distance between each cell in the fiber and the virtual electrode located, in this study, 2 cm away from the last epicardial cell in the fiber direction.

F. Effects of [K + ], [Ca 2+ ] and HR variations on simulated T waves

To assess the extent of the contribution of each investigated factor, i.e. [K + ], [Ca 2+ ] and RR, to T wave characteristics, simulations were conducted for each ventricular fiber under varying values of those factors and the corresponding pECGs were computed. The range of simulated [K + ] values included the default level in the Ten Tusscher-Panfilov model, i.e.

[K + ] = 5.4 mM, as well as other levels below and above it: [K + ] ∈ {3, 4, 5.4, 6.2} mM. In the case of [Ca 2+ ], the range of simulated values included the default level of 2 mM, and values around it: [Ca 2+ ] ∈ {1.4, 2, 2.6, 3.2} mM. For RR, the variations were in accordance to the range measured from the ECGs of the patients: RR ∈ {0.6, 0.8, 1, 1.2} s. In the following, the notation F{[K + ], [Ca 2+ ] , RR} is used to represent simulated cases with varying [K + ], [Ca 2+ ] and RR.

The last pECG beat of each simulated condition was delineated using the same delineation method mentioned above [START_REF] Martínez | A wavelet-based ECG delineator: evaluation on standard databases[END_REF]. The time-, amplitude-and morphology-based T wave descriptors of section II-C were measured over those pECGs. For warping-based markers, reference T waves were calculated from the simulated beats generated for minimum [K + ] (3 mM) and maximum [Ca 2+ ] (3.2 mM) and RR (1.2 s), that is F{3 mM; 3.2 mM; 1.2 s}.

G. Sensitivity analysis for assessment of inter-individual variability

Sensitivity analysis was performed to assess how the proportion, a, of endocardial, midmyocardial and epicardial cell layers, p, modulated T wave morphology descriptors, Y , at different [K + ], [Ca 2+ ] or RR levels. For each T wave descriptor at each given concentration of [K + ] ([Ca 2+ ] or RR, respectively), the percentage of change (D Y ;p;ai ) and its sensitivity (S Y ;p;a1,a2 ) to changes in the proportion of cells of each ventricular layer were computed as follows [START_REF] Romero | Impact of ionic current variability on human ventricular cellular electrophysiology[END_REF]:

D Y ;p;ai = Y p;ai -Y C334 Y C334 • 100, i = 1, 2 (16)
where Y p;a is the average value of the T wave marker Y from all possible combinations Cxyz sharing a proportion a, at the p layer of endocardial, midmyocardial or epicardial cells, p ∈ {Endo, Mid, Epi}, with respect to case C334, which was used as a reference [START_REF] Pueyo | Mechanisms of ventricular rate adaptation as a predictor of arrhythmic risk[END_REF]. The values of a 1 and a 2 were taken as the minimum and maximum proportions of cells in each layer, respectively: 10% and 50% for endocardial and midmyocardial cells, and 20% and 80% for epicardial cells.

Y C334 is the value of the T wave descriptor for reference case C334. Thus, D Y ;p;ai measures the mean percentage of change in the T wave marker Y when varying the proportion of cells in layer p to a percentage a with respect to that in C334. S Y ;p;a1,a2 measures the sensitivity of Y when varying the proportion of cells in layer p from a 1 to a 2 .

III. RESULTS

A. Characterization of T wave changes during HD

Fig. 3, panels (a-f), presents the results for all the T wave markers during the HD session for the 20 analyzed patients. The evolution of [K + ], [Ca 2+ ] and RR during the session is shown in panels (g-i). The bottom panels illustrate variations in T waves for one patient during the session, with the reference T wave at the end of the HD session shown in blue and each investigated T wave shown in red. [K + ] and [Ca 2+ ] vary strongly during the session, whereas the RR interval varies much less.

A decreasing trend of T S/A , d w , d NL w d a and d NL a and an increasing trend of T w during the HD session can be observed. In the bottom panels, significant changes in the T wave morphology are seen to accompany the fluctuations of [K + ], [Ca 2+ ] and RR during the session. In the example shown in the bottom panels of Fig. 3 T wave markers computed from the simulated pECGs are presented in panels (i-n) for the different levels of [K + ]. All T wave markers present clear variations with [K + ], reproducing a behavior observed in the patients (Fig. 3). A decreasing trend of d w and d NL a from the maximum to the minimum level of [K + ] was observed in all the simulated cases (panels j and n). Monotonic trends of T w , T S/A , d a and d NL w were observed in most of the simulated cases (panels i, l, m and n).

The bottom panels in Fig. 4 illustrate variations in T waves for simulated fiber C154 from the maximum to the minimum level of [K + ] corresponding to the average value of [K + ] during HD in the analyzed patients, with the reference T wave (blue) and each investigated T wave (red) being displayed. More peaked T waves with varying width and morphology are observed with increasing [K + ] levels for the case shown.

C. In silico assessment of T wave changes due to [Ca 2+ ] and HR variations

APs and T wave markers computed from pECGs at varying [Ca 2+ ] and RR are shown in Fig. 5. Panels (a and b) illustrate changes in APs for simulated case C154 and F{5.4mM; [Ca 2+ ]; 1.0s} under varying [Ca 2+ ] while panels (e and f) present APs for F{5.4mM; 2.0mM; RR} under varying RR for endocardial (black), midmyocardial (green) and epicardial (red) cells of a simulated fiber. Simulated pECGs, and specifically T waves, are presented for varying [Ca 2+ ] and RR in panels (c, d, g, h, i and j).

From panels (a-d), it can be observed that lower [Ca 2+ ] causes AP prolongation in all the cell types and, consequently, longer QT intervals. Panel (i) shows that the width and amplitude of the T wave increase with decreasing [Ca 2+ ] and ] and RR during the session. In the bottom panels, the central line (red) indicates the median, whereas bottom and top edges show the 25th and 75th percentiles, respectively. Each purple dot corresponds to an individual patient. In the bottom panels, red T waves illustrate the PCA-transformed T waves of a patient from the start to the end of the HD session, with ∆ denoting the change in [K + ] with respect to the end of the HD session. The blue line indicates the reference T wave at the end of the HD session used in the computation of time-warping markers.

the morphology varies too. From panels (e-h) it can be seen that an increase in the RR interval causes AP prolongation and, thus, longer QT intervals (panels e-h). In the middle panel (j), the width and amplitude of the T wave are shown to increase with increasing RR, which is accompanied by changes in the T wave shape.

Changes in the T wave markers when varying [Ca

D. Contribution of [K + ], [Ca 2+ ] and HR variations to T wave changes in vivo and in silico

To assess the relationship between electrolyte or RR variations and the corresponding changes in T wave markers, a correlation analysis was performed, both for ECG recordings from the patients and simulated pECGs. Results are presented in Fig. 6 Most of the analyzed T wave markers strongly correlated with [K + ]. T w , T S/A , d w and d NL a were the most highly correlated ones, with median ρ of -0.94, 0.87, 0.88 and 0.80, respectively, in the patients, and -0.97, 0.86, 0.97 and 0.95, respectively, in the simulations. However, only d NL a was strongly correlated with [K + ] when the effects of [Ca 2+ ] and RR in the patient's data were removed (median value of partial correlation coefficient of 0.75).

Similarly, T w , T S/A , d w and d NL a were strongly correlated with [Ca 2+ ] (median value of ρ of 0.79, -0.82, -0.80 and -0.74, respectively, in the patients, and -0.75, 0.91, 0.42 and -0.99, respectively, in the simulations). In this case, only d w was strongly correlated with [Ca 2+ ] when removing the effects of [K + ] and RR (median value of partial correlation coefficient of -0.74) in the patients' data.

As for the relationship between T wave markers and RR, only d a presented a strong correlation in both patients' and simulated ECGs (median ρ of -0.67 for Pearson correlation and -0.90 for partial correlation in the patients, and of 0.99 for Pearson correlation in the simulations).

E. Mechanisms for inter-individual differences in the effects of [K + ], [Ca 2+ ] and RR on T wave changes

The results of the linear regression analysis performed to investigate how different proportions of endocardial, midmyocardial and epicardial cells contribute to explain individual T wave responses when varying [K + ] are presented in Fig. 7 for a commonly used T wave marker, T w , and a morphologybased marker, d NL a . Cell proportions are represented in the xaxis, with solid lines showing fitted linear regression models for T w and d NL a for all simulated cases. Both T w and d NL a present clear relationships with transmural heterogeneities, being such relationships more or less accentuated depending on the [K + ] level. The highest sensitivities, shown in Table III, and coefficients of determination, R 2 shown in Fig. 7, of the time-based marker T w are with respect to variations in the proportion of endocardial (positive correlation) and midmyocardial cells (negative correlation), with a more notable dependence for low [K + ] values. In the case of the morphology-based marker d NL a , the highest sensitivity and R 2 are observed for midmyocardial (positive correlation) and epicardial (negative correlation) variations, particularly under high [K + ] values. Sensitivity results for all the analyzed T wave markers at varying [Ca 2+ ] and RR are presented in Tables IV andV. ] levels outside the normal range are associated with increased mortality [START_REF] Bozbas | Prevalence and Predictors of Arrhythmia in End Stage Renal Disease Patients on Hemodialysis[END_REF], [START_REF] El-Sherif | Electrolyte disorders and arrhythmogenesis[END_REF], [START_REF] Brown | Comparative mortality from cardiovascular disease in patients with chronic renal failure[END_REF]- [START_REF] Ajam | Cardiac Arrhythmias in Patients with End Stage Renal Disease (ESRD) on Hemodialysis; Recent Update and Brief Literature Review[END_REF]. The availability of non-invasive tools to monitor serum [K + ] and [Ca 2+ ] concentrations, particularly in ESRD patients, might transmural ventricular fibers to unravel potential underpinnings of the high inter-individual differences in T wave responses observed in the patients in response to electrolyte and heart rate variations.

R 2 =0.7068 R 2 =0.5058 R 2 =0.3744 R 2 =0.3515 T w (ms) R 2 =0.6715 R 2 =0.5639 R 2 =0.5101 R 2 =0.0154 [K + ]=3mM [K + ]=4mM [K + ]=5.4mM [K + ]=6.2mM T w (ms) R 2 =0.0046 R 2 =0.3156 R 2 =0.2373 R 2 =0
d NL a (%) R 2 = 0.4644 R 2 =0.5070 R 2 =0.6606 (a) (b) (c) (d) (e) (f)

A. T wave analysis in ESRD patients during HD

We evaluated commonly used markers describing T wave time and amplitude characteristics, like its width (T w ) and its downward slope-to-amplitude ratio (T S/A ), as well as more recently proposed markers describing morphological characteristics computed by warping-based techniques (d w , d a , d NL w and d NL a ). Those markers were measured at sequential time points during HD, as large changes in serum electrolyte concentrations can be expected during this period. We showed that such an analysis indeed allows to provide a characterization of T wave changes for a wide range of [K + ], [Ca 2+ ] and HR variations. Of all investigated markers, d NL a and d w were shown to be the ones most strongly correlated with [K + ] (>0.75) and [Ca 2+ ] (< -0.74), respectively, after removing the effects of the other electrolyte concentration and HR. The marker d a was by far the one most highly correlated with RR (< -0.90) after accounting for [K + ] and [Ca 2+ ] variations. These results emphasize the importance of considering more complex markers to fully characterize the ECG repolarization response during HD. Although T w and T S/A showed high correlation with [K + ] or [Ca 2+ ], the correlation was remarkably diminished after controlling for additional effects occurring during HD. This is relevant for the development of ECG-based methods that allow monitoring [K + ] or [Ca 2+ ] levels, as only a fraction of the observed amplitude and slope changes can be attributed to a specific ion concentration.

Variations in serum electrolyte levels, mainly [K + ] and [Ca 2+ ], have been shown to alter ventricular properties in the ECG [START_REF] Noordam | Effects of Calcium, Magnesium, and Potassium Concentrations on Ventricular Repolarization in Unselected Individuals[END_REF], [START_REF] El-Sherif | Electrolyte disorders and arrhythmogenesis[END_REF], [START_REF] Van Mieghem | The clinical value of the ECG in noncardiac conditions[END_REF], [START_REF] Gardner | ECG Diagnosis: The Effect of Ionized Serum Calcium Levels on Electrocardiogram[END_REF], [START_REF] Chorin | Electrocardiographic Manifestations of Calcium Abnormalities[END_REF]. In particular, previous studies have described that ECGs recorded under hyperkalemic conditions commonly present peaked T waves as compared to normal levels of [K + ] [4], [START_REF] Levis | ECG Diagnosis: Hypokalemia[END_REF], [START_REF] El-Sherif | Electrolyte disorders and arrhythmogenesis[END_REF], [START_REF] Slovis | ABC of clinical electrocardiography: Conditions not primarily affecting the heart[END_REF]. In this study, we could observe such behavior in some of the ESRD patients' recordings, as illustrated in the bottom panels of Fig. 3 showing peaky, high-amplitude T waves for high [K + ] at the beginning of HD to smoother, low-amplitude waves for low [K + ] at the end of HD. However, a decrease in T wave amplitude could not be consistently measured for all patients, but large inter-individual variability was noted in the relationship between [K + ] and T wave amplitude. Other studies have analyzed the effects of [K + ] changes on the width, slope and amplitude-to-slope ratio of the T wave as well as the ratio of the T wave amplitude to the R wave amplitude [START_REF] Corsi | Validation of a novel method for non-invasive blood potassium quantification from the ECG[END_REF], [START_REF]Noninvasive quantification of blood potassium concentration from ECG in hemodialysis patients[END_REF], [START_REF] Kharche | Simulating the effects of serum potassium on the ECG[END_REF], [START_REF] Dillon | Noninvasive potassium determination using a mathematically processed ECG: proof of concept for a novel "bloodless, blood test[END_REF], [START_REF] Peter | Statistical Investigation of Correlations Between Serum Potassium Levels and Electrocardiographic Findings in Patients on Intermittent Hemodialysis Therapy[END_REF]. The main limitation of these descriptors is that, even if some of them may show a high degree of correlation with the level of [K + ], their changes cannot be exclusively attributed to [K + ] variations, as confirmed in our study by including in the analysis additional confounders like variations in [Ca 2+ ] or HR.

Regarding the analysis of the T wave shape, a morphology combination score (MCS) based on T wave asymmetry, flatness and notching [START_REF] Andersen | A robust method for quantification of IKr-related T-wave morphology abnormalities[END_REF]- [START_REF] Tischer | Influence of type of sport on cardiac repolarization assessed by electrocardiographic T-wave morphology combination score[END_REF] has been used to analyze its relationship with [K + ] in a primary care population [START_REF] Krogager | The relationship between serum potassium concentrations and electrocardiographic characteristics in 163,547 individuals from primary care[END_REF]. A remarkable association between MCS and [K + ] could only be found among individuals with [K + ] in the range 2-4.1 mM, but not among those with [K + ] in the range 4.2-6 mM. In ESRD patients, we found that morphological variability, specifically quantified by our analyzed T wave marker d NL a was closely related to serum [K + ] in a wide range of values, covering both hyper-and hypokalemic values.

As for the effects of [Ca 2+ ] variations on the ECG, a recent large-scale study has found that low [Ca 2+ ] values are associated with clinically relevant QT prolongation in the general population [START_REF] Noordam | Effects of Calcium, Magnesium, and Potassium Concentrations on Ventricular Repolarization in Unselected Individuals[END_REF]. In chronic patients undergoing HD, changes in [Ca 2+ ] have been found to be negative correlated with changes in the last part of the ECG repolarization measured by the T-peak to T-end interval [START_REF]Hemodialysis-induced repolarization abnormalities on ECG are influenced by serum calcium levels and ultrafiltration volumes[END_REF]. In this study, we showed that the full repolarization duration measured by T w indeed presents an inverse relationship with [Ca 2+ ] after removing the effects of other confounders. Nevertheless, such a relationship between T w and [Ca 2+ ] was not as strong as that of other markers like d w reflecting temporal variations in T wave morphology.

B. T wave analysis in simulated ventricular tissues at varying [K + ], [Ca 2+ ] and HR

All the T wave markers analyzed in this study showed a diversity of patterns in their relationship with electrolyte variations during HD. Both the general trend of such relationships as well as the high inter-individual variability were well reproduced by our simulated ventricular fibers for most of the markers. This can be explained by the fact that we simulated 22 different transmural fibers accounting for proportions of endocardial, midmyocardial and epicardial cells varying within plausible limits, as reported in previous studies [START_REF] Gima | Ionic current basis of electrocardiographic waveforms: a model study[END_REF], [START_REF] Pueyo | Mechanisms of ventricular rate adaptation as a predictor of arrhythmic risk[END_REF], [START_REF] Loewe | A Heterogeneous Formulation of the Himeno et al Human Ventricular Myocyte Model for Simulation of Body Surface ECGs[END_REF], [START_REF] Pueyo | A multiscale investigation of repolarization variability and its role in cardiac arrhythmogenesis[END_REF].

In accordance with our findings on the ECGs from ESRD patients, d NL a and d w were highly correlated with [K + ] or [Ca 2+ ] in our simulations. We are not aware of other in silico studies investigating morphological variability in the T wave of the ECG in relation to electrolyte variations as those occurring during HD.

Our simulation results also indicated a strong association between T w and both [K + ] and [Ca 2+ ]. In agreement with our ECG data, an increase in [K + ] led to shortening of the repolarization time quantified by T w in our transmural fibers. Other computational studies have shown divergent results in this regard. In [START_REF] Pilia | ECG as a tool to estimate potassium and calcium concentrations in the extracellular space[END_REF], prolongation of the RT interval has been reported in response to increased [K + ], which is acknowledged by the authors to be in contrast with clinical data but possibly explained by factors other than [K + ]. In [START_REF]Noninvasive quantification of blood potassium concentration from ECG in hemodialysis patients[END_REF], [START_REF] Pilia | ECG-based Estimation of Potassium and Calcium Concentrations: Proof of Concept with Simulated Data[END_REF], a simulated increase in [K + ] has been shown to lead to QT shortening, which would be in line with our results. As regards simulation of [Ca 2+ ] effects on the ECG, our results on T w reduction with increasing [Ca 2+ ] are concordant with the reported shortening of the repolarization time in [START_REF] Mesa | Effects of Serum Calcium Changes on the Cardiac Action Potential and the ECG in a Computational Model[END_REF], [START_REF] Loewe | A Heterogeneous Formulation of the Himeno et al Human Ventricular Myocyte Model for Simulation of Body Surface ECGs[END_REF], [START_REF] Pilia | ECG-based Estimation of Potassium and Calcium Concentrations: Proof of Concept with Simulated Data[END_REF]. Also, our results at the cellular level are aligned with those obtained with the recently proposed human ventricular AP model developed in [START_REF] Bartolucci | Simulation of the Effects of Extracellular Calcium Changes Leads to a Novel Computational Model of Human Ventricular Action Potential With a Revised Calcium Handling[END_REF], which, in contrast to most AP models, is able to reproduce a physiological APD-[Ca 2+ ] relationship.

Moreover, in our simulations, the marker T S/A quantifying the T wave slope-to-amplitude ratio was shown to correlate strongly with [K + ] and [Ca 2+ ]. These results are in agreement with [START_REF] Corsi | Validation of a novel method for non-invasive blood potassium quantification from the ECG[END_REF], [START_REF]Noninvasive quantification of blood potassium concentration from ECG in hemodialysis patients[END_REF], in which T S/A has been proposed as an index to monitor [K + ] during HD and a cause-effect sequence for the observed decrease in T S/A was provided through computational simulations.

The above discussed results show that in silico modeling and simulation can help to gain insight into the ECG changes observed in response to hypo/hyperkalemia and hypo/hypercalcemia. In contrast to other computational studies that use one single cell or tissue electrophysiological model, our proposed research considers a population of human ventricular tissue fibers, which can be used to shed light on the highly inter-individual relationships between ECG markers and

[K + ] or [Ca 2+ ].

C. Potential mechanisms for inter-individual T wave responses to electrolyte and HR variations

We computed T wave marker sensitivities to explain how different transmural heterogeneities can contribute to explain distinct T wave responses to variations in [K + ], [Ca 2+ ] and HR. The morphological descriptors d w , d NL w , d a and d NL a generally showed higher sensitivity to variations in the proportions of the ventricular layers than the time and amplitude markers T w and T S/A . Previous experimental and theoretical studies have described how cell distributions across the ventricular wall affect ECG repolarization and, in particular, T wave morphology [START_REF] Ramírez | Variability of Ventricular Repolarization Dispersion Quantified by Time-Warping the Morphology of the T-Waves[END_REF], [START_REF] Janusek | The roles of mid-myocardial and epicardial cells in T-wave alternans development: a simulation study[END_REF]- [START_REF] Hooft Van Huysduynen | Validation of ECG indices of ventricular repolarization heterogeneity: a computer simulation study[END_REF]. Our study confirms these observations on the impact of transmural heterogeneities on T wave width, amplitude and shape characteristics, not only at physiological electrolyte concentrations but also at high and low [K + ] and [Ca 2+ ] levels and at different heart rates. Even if transmural heterogeneities can contribute to inter-individual differences in the T wave response to electrolyte and HR variations, other ventricular heterogeneities, like interventricular, apicobasal or anteroposterior, may play a relevant role, which should be assessed in further studies.

We found that d w and d NL w are the most sensitive markers for variations in cell type proportions, particularly of endocardial and epicardial layers, at all [K + ] levels and at low [Ca 2+ ] levels. T w showed remarkably lower sensitivity. As for markers related to amplitude characteristics, we showed that d a is highly sensitive to variations in cell type proportions, particularly of midmyocardial and epicardial cells, this being true for a variety of tested [K + ], [Ca 2+ ] and HR values. d NL a is less sensitive and T S/A even less so. Our results on the sensitivity of T wave morphological markers with respect to variations in transmural heterogeneities, and more specifically to the proportion of epicardial cells within the ventricular wall, are aligned with computational findings presented by Janusek et al. [START_REF] Janusek | The roles of mid-myocardial and epicardial cells in T-wave alternans development: a simulation study[END_REF], which demonstrated the influence of epicardial cells on the development of T wave alternans, a form of repolarization variability [START_REF] Janusek | The roles of mid-myocardial and epicardial cells in T-wave alternans development: a simulation study[END_REF]. The contribution of variations in the midmyocardial layer to T wave morphology has been shown in a recent study too [START_REF] Priya | Do M-cells contribute significantly in T-wave morphology during normal and arrhythmogenesis conditions like short QT Syndrome?[END_REF].

D. Study limitations and future research

This study investigated 20 ECG recordings of ESRD patients during an HD session, with 5 blood samples available along HD. Future studies should investigate application of the proposed methods to larger numbers of patients and, if possible, with more available blood samples during the full 48hour ECG recording. This would allow more robust assessment of the relationship between changes in T wave markers and specific variations in [K + ], [Ca 2+ ] or HR, potentially using nonlinear regression statistical techniques [START_REF] Izenman | Modern multivariate statistical techniques: regression, classification, and manifold learning, ser. Springer texts in statistics[END_REF], [START_REF] Draper | Applied regression analysis[END_REF].

Other electrolytes on top of [K + ] and [Ca 2+ ] could modulate T wave changes during HD. In particular, variations in magnesium ([Mg 2+ ]) have been reported to be possibly involved in observed alterations in ECG repolarization [START_REF] Noordam | Effects of Calcium, Magnesium, and Potassium Concentrations on Ventricular Repolarization in Unselected Individuals[END_REF], [START_REF] Naksuk | Association of Serum Magnesium on Mortality in Patients Admitted to the Intensive Cardiac Care Unit[END_REF]- [START_REF] Van Den Bergh | Electrocardiographic abnormalities and serum magnesium in patients with subarachnoid hemorrhage[END_REF]. In the present study, [Mg 2+ ] was not investigated due to the unavailability of serum [Mg 2+ ] levels.

Our electrophysiological simulations considered human transmural ventricular fibers. Future research is aimed at extending the investigations of the present study to include simulations in bi-ventricular models embedded in patientspecific torso models, from which more realistic ECGs can be computed. This research will additionally allow exploring the role of other types of ventricular heterogeneities, on top of transmural ones, on the T wave response to electrolyte and HR variations.

V. CONCLUSIONS Descriptors of T wave width (T w ), slope-to-amplitude ratio (T S/A ) and morphological variability (d w , d a , d NL w and d NL a ) vary remarkably with varying [K + ], [Ca 2+ ] and HR, but a wide range of patterns is observed for such relationships. Among the proposed descriptors, d NL a d w and d a are the ones that best correlate with [K + ], [Ca 2+ ] and HR, respectively. The proportion of midmyocardial and epicardial cells has a large impact on T wave markers, particularly for serum electrolyte concentrations and HR out of their physiological levels. This suggests that transmural heterogeneities can modulate patientdependent T wave responses to changes in electrolyte concentrations and HR in ESRD patients. These findings can have major relevance for non-invasive monitoring and prediction of arrhythmic events in these patients.

Fig. 2 .

 2 Fig. 2. Linear and non-linear time warping for a patient. Panel (a) shows reference (blue) and investigated (red) T waves obtained from an ECG segment during HD. Panel (b) shows the warped T waves, which have the same duration while keeping the original amplitude. Panel (c) depicts the warped T waves after normalization by their L2-norms. The area (cyan region) between both T waves in panel (d) represents dw, which quantifies the total amount of warping. The light green solid line is the linear regression function γ * l (t r ) best fitted to γ * (t r ). The marker d NL w quantifies the non-linear warping by computing the area of the dashed purple region between γ * (t r ) and γ * l (t r ).

  for a particular patient, tall and narrow peaked PCA-transformed T waves are observed at the start of the HD session corresponding to maximal [K + ]. B. In silico assessment of T wave changes due to [K + ] variations T wave markers computed from simulated pECGs at varying [K + ] are shown in Fig. 4. Panels (a-d) show the simulated APs along the 1-D fiber for the simulated case C154 and F{[K + ]; 2.0 mM; 1.0 s} when [K + ] is varied from 6.2 mM to 3 mM. The range of simulated [K + ] values approximately corresponds to the maximum and minimum [K + ] range calculated from the patients' blood data. The corresponding changes in the simulated pECGs are shown in panels (e-h). It can be observed from the figure that a variation in [K + ] causes AP shortening or prolongation in endocardial, midmyocardial and epicardial cells and therefore shorter or longer QT intervals as well as variations in the width, amplitude and morphology of the T wave.

Fig. 3 .

 3 Fig. 3. Panels a-f: Changes in Tw, TS/A, dw, da, d NL w and d NL a during the HD session. Panels g-i: Variations in [K + ], [Ca 2+] and RR during the session. In the bottom panels, the central line (red) indicates the median, whereas bottom and top edges show the 25th and 75th percentiles, respectively. Each purple dot corresponds to an individual patient. In the bottom panels, red T waves illustrate the PCA-transformed T waves of a patient from the start to the end of the HD session, with ∆ denoting the change in [K + ] with respect to the end of the HD session. The blue line indicates the reference T wave at the end of the HD session used in the computation of time-warping markers.

  2+ ], F{5.4mM; [Ca 2+ ]; 1.0 s} (red bar), and when varying RR, F{5.4mM; 2.0mM; RR} (green bar), are presented for the 22 simulated cases in panels (k-p) and compared with the changes measured after varying [K + ] F{[K + ]; 2.0mM; 1.0s} (blue bar). A monotonic rise in d w and d NL w (panels l and m) as well as decreasing trends in d a and d NL a (panels o and p) are observed from the minimum to the maximum levels of [Ca 2+ ]. However, T w and T S/A do not show a clear trend at varying levels of [Ca 2+ ] (panels k and n). As for the effects of increasing RR, trends towards lower T S/A , d w , d NL w and d NL a can be observed (panels l, m, n and p). Similarly, an increasing trend of d a and a monotonic rise in T w at increasing RR (panels k and o) are shown. It can be noted from the figure that T wave markers, particularly morphology-based ones, show remarkable variations at varying [K + ], [Ca 2+ ] and RR. However, [K + ]-induced variations are more visible than those induced by [Ca 2+ ] and RR.

Fig. 4 .

 4 Fig. 4. Panels a-d: Simulated endocardial (black), midmyocardial (green) and epicardial (red) APs for simulated fiber C154, and F {[K + ]; 2.0 mM; 1.0 s}. Panels e-h: ECGs for varying [K + ]. Panels i-n: Changes in Tw, TS/A, dw, da, d NL w and d NL a for simulated fibers when varying [K + ]. Central red lines indicate the median, whereas bottom and top edges show the 25th and 75th percentiles, respectively. Each purple dot corresponds to an individual simulated fiber. In the bottom panels, red traces indicate the T waves of a simulated fiber from an initial (maximum) to a final (minimum) value of [K + ] corresponding to average [K + ] values in the analyzed patients. The blue line indicates the reference T wave used when computing time-warping markers.

Fig. 5 .

 5 Fig. 5. Panels a, b: Simulated endocardial (black), midmyocardial (green) and epicardial (red) APs for simulated fiber C154, F {5.4mM; [Ca 2+ ]; 1.0 s} under varying [Ca 2+ ]. Panels c, d, i: ECGs and T waves for [Ca 2+ ] variations. Panels e, f: Simulated endocardial (black), midmyocardial (green) and epicardial (red) APs for simulated fiber C154, F {5.4mM; 2.0mM; RR}, under varying RR. Panels g, h, j: ECGs and T waves for RR variations. Panels k-p: Changes in Tw, TS/A, dw, da, d NL w and d NL a for varying [K + ], F {[K + ]; 2.0mM; 1.0 s} (blue boxplots), [Ca 2+ ], F {5.4mM; [Ca 2+ ]; 1.0 s} (red boxplots), and RR, F {5.4mM; 2.0mM; RR} (green boxplots), in the horizontal axis for the 22 simulated fibers. Central lines indicate the median, whereas bottom and top edges show the 25th and 75th percentiles, respectively. Values of [K + ] ∈ {3.0, 4.0, 5.4, 6.2} mM, [Ca 2+ ] ∈ {1.4, 2.0, 2.6, 3.2} mM, and RR ∈ {0.6, 0.8, 1.0, 1.2} s are used.

Fig. 6 .

 6 Fig. 6. Panel a: Pearson correlation coefficients between each T wave marker (Tw, TS/A, dw, da, d NL w and d NL a ) and [K + ] (left), [Ca 2+ ] (middle) or RR (right) for the analyzed patients. Panel b: Partial correlation coefficients between each T wave marker (Tw, TS/A, dw, da, d NL w and d NL a ) and [K + ] (left), [Ca 2+ ] (middle) or RR (right) for the analyzed patients after removing the effects of the other two variables among [K + ], [Ca 2+ ] and RR. Panel c: Pearson correlation coefficients between each T wave marker (Tw, TS/A, dw, da, d NL w and d NL a ) and [K + ] (left), [Ca 2+ ] (middle) or RR (right) for the simulated fibers under varying [K + ], F {[K + ]; 2.0mM; 1.0 s} (left), [Ca 2+ ], F {5.4mM; [Ca 2+ ]; 1.0 s} (middle) and RR, F {5.4mM; 2.0mM; RR} (right). Each purple dot represents the correlation coefficient for an individual patient or simulated fiber. Central red lines indicate the median, whereas bottom and top edges show the 25th and 75th percentiles, respectively.

Fig. 7 .

 7 Fig. 7. Panels a-c: Fitted regression lines for the average values of Tw for all simulated cases sharing the same proportion of endocardial, midmyocardial or epicardial cells at different [K + ] levels. Panels d-f: Fitted regression lines for the average values of d NLa for all simulated cases sharing the same proportion of endocardial, midmyocardial or epicardial cells at different [K + ], with the reference value for [K + ] = 3 mM. Coefficients of determination (R 2 ), estimated as the square of the linear correlation coefficient between the analyzed T wave markers and each cell type (endocardial, midmyocardial or epicardial), are indicated.

TABLE I CHARACTERISTICS

 I OF THE ESRD STUDY POPULATION. VALUES ARE EXPRESSED AS NUMBER (%) FOR CATEGORICAL VARIABLES AND MEDIAN (INTERQUARTILE RANGE) FOR CONTINUOUS VARIABLES.

	Characteristics	Quantity
	Age [years]	72 (10)
	Gender [male/female]	14/6
	Electrolyte concentrations
	[K + ] [Pre HD] (mM)	5.36 (1.69)
	[K + ] [End HD] (mM)	3.25 (0.63)
	[Ca 2+ ] [Pre HD] (mM)	2.15 (0.17)
	[Ca 2+ ] [End HD] (mM)	2.35 (0.17)
		#Patients (%)
	HD session duration
	240 min	17 (85%)
	210 min	3 (15%)
	Dialysate composition
	Potassium (1.5 mEq/L)	17 (85%)
	Potassium (variable mEq/L)	3 (15%)
	Calcium (1.5 mEq/L)	6 (30%)
	Calcium (1.25 mEq/L)	14 (70%)

/215 Fig. 1. Diagram of the study protocol. K1 to K6 are the time points (in minutes) for blood sample extraction.

TABLE II SIMULATED

 II TRANSMURAL DISTRIBUTIONS OF CELL TYPES.

	% Endo\Epi 20	30	40	50	60	70	80
	10			C154 C145 C136 C127 C118
	20		C253 C244 C235 C226 C217
	30	C352 C343 C334 C325 C316
	40	C442 C433 C424 C415
	50	C532 C523 C514

TABLE III RESULTS

 III OF THE SENSITIVITY ANALYSIS, S Y ;p;a 1 ,a 2 , FOR DIFFERENT VALUES OF [K + ], WHEN VARYING CELL PROPORTIONS IN LAYER p FROM a 1 TO a 2 .

	S Y ;p;a 1 ,a 2	Y	Tw	TS/A	dw	da	d NL w	d NL a
	p, a 1 , a 2	[K + ] (mM)	%	%	%	%	%	%
	Endo, 10, 50	4.0 6.2	2.9 2.2	7.2 7.2	108.3 21.9 78.7 16.2	97.7 3.1	0.4 9.7
	Mid, 10, 50	4.0 6.2	4.5 0.3	1.4 11.1	41.5 10.7	43.5 53.7	9.2 8.2	10.9 11.8
	Epi, 20, 80	4.0 6.2	1.3 1.1	8.2 12.4	102.3 16.7 41.6 36.8	86.1 2.6	10.1 17.2
			IV. DISCUSSION
	Serum [K

+ ] and [Ca 2+

TABLE IV RESULTS

 IV OF THE SENSITIVITY ANALYSIS, S Y ;p;a 1 ,a 2 , FOR DIFFERENT VALUES OF [Ca 2+ ], WHEN VARYING CELL PROPORTIONS IN LAYER p FROM a 1 TO a 2 .

	S Y ;p;a 1 ,a 2	Y	Tw	TS/A	dw	da	d NL w	d NL a
	p, a 1 , a 2	[Ca 2+ ] (mM)	%	%	%	%	%	%
	Endo, 10, 50	1.4 2.6	4.5 -11.4 45.0 -22.2 34.2 4.5 -11.6 7.5 -3.9 1.5	10.4 10.9
	Mid, 10, 50	1.4 2.6	0.3 -12.3 39.0 -0.2 -10.4 9.0	42.3 -11.7 14.1 63.6 11.2 16.2
	Epi, 20, 80	1.4 2.6	-0.8 12.7 -84.3 -21.7 -26.5 -19.3 0.2 11.1 -14.4 -25.6 -7.0 -25.6

have a significant impact on clinical practice. In this work, we characterized changes in ECG markers measuring duration, amplitude and morphology of the T wave during HD in ESRD patients and we assessed their relationship with [K + ], [Ca 2+ ] and HR variations. In addition, we simulated human

TABLE V RESULTS

 V OF THE SENSITIVITY ANALYSIS, S Y ;p;a 1 ,a 2 , FOR DIFFERENT VALUES OF RR, WHEN VARYING CELL PROPORTIONS IN LAYER p FROM a 1 TO a 2 .

	S Y ;p;a 1 ,a 2	Y	Tw	TS/A	dw	da	d NL w	d NL a
	p, a 1 , a 2	RR (s)	%	%	%	%	%	%
	Endo, 10, 50	0.6 1.0	0.5 0.1	-0.8 -7.3 -8.4 50.5 -1.7 -76.7 -11.6 -40.6 -11.1 4.6
	Mid, 10, 50	0.6 1.0	-2.7 -5.2 19.6 0.1 -11.3 -29.0 20.6 -1.9 32.6 82.2	26.6 8.7
	Epi, 20, 80	0.6 1.0	0.3 -0.9 12.2 7.5	-9.3 -16.2 -13.5 -29.9 65.7 -7.9 32.6 -14.8
		180
		160
	w (ms)	140
	T
		120
		100

ACKNOWLEDGMENT

This work was supported by projects ERC-StG 638284 (ERC), PID2019-105674RB-I00 and PID2019-104881RB-I00 (Ministerio de Ciencia e Innovación), Marie Skłodowska-Curie grants 786833 and 764738 (European Commission) and by European Social Fund (EU) and Aragón Government through BSICoS group T39 20R and project LMP124-18. Computations were performed by the ICTS NANBIOSIS (HPC Unit at University of Zaragoza).