-
Notifications
You must be signed in to change notification settings - Fork 1
/
PlottingActivationKinetics2NormalisedPeakSine.m
287 lines (209 loc) · 6.17 KB
/
PlottingActivationKinetics2NormalisedPeakSine.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
function PlottingActivationKinetics2PlotNormalisedPeakSine()
% This script generates data for subpanel B in Figure E6
exp_ref = '16713110';
%Identify temperature for experiment
if strcmp(exp_ref,'16708016')==1
temperature = 21.8;
end
if strcmp(exp_ref,'16708060')==1
temperature = 21.7;
end
if strcmp(exp_ref,'16704047')==1
temperature = 21.6;
end
if strcmp(exp_ref,'16704007')==1
temperature = 21.2;
end
if strcmp(exp_ref,'16713003')==1
temperature = 21.3;
end
if strcmp(exp_ref,'16713110')==1||strcmp(exp_ref,'16715049')==1
temperature = 21.4;
end
if strcmp(exp_ref,'16707014')==1
temperature = 21.4;
end
if strcmp(exp_ref,'16708118')==1
temperature = 21.7;
end
% Import protocols
cd ../Protocols
V=importdata('sine_wave_protocol.mat');
V_AP=importdata('ap_protocol.mat');
cd ..
% Import parameter sets for literature models
cd ParameterSets
W=importdata('WangModelSimulatedParameters.mat');
DV=importdata('DiVeroliRTModelSimulatedParameters.mat');
M=importdata('MazhariModelSimulatedParameters.mat');
TT=importdata('TenTusscherModelSimulatedParameters.mat');
Z=importdata('ZengModelSimulatedParameters.mat');
Z_tol=importdata('ZengTolModelSimulatedParameters.mat');
cd ..
% Import experimental data for sine wave and action potential protocols
cd ExperimentalData
cd(exp_ref)
D=importdata(['sine_wave_',exp_ref,'_dofetilide_subtracted_leak_subtracted.mat']);
D_AP=importdata(['ap_',exp_ref,'_dofetilide_subtracted_leak_subtracted.mat']);
cd ..
cd ..
cd Code
% Identify parameter set with maximum likelihood fit to sine wave
[chain,likelihood] = FindingBestFitsAfterMCMC('hh',{'sine_wave'},exp_ref);
[i,v]= max(likelihood);
k= chain(v,:);
I=SimulatingData(35,{'sine_wave'},k,V,temperature);
% Calculate conductance scaling factor for literature models to minimise square difference between
% literature model simulation and action potential experiment for exp_ref
% Wang model
IW = SimulatingData(27,{'sine_wave'},W,V,temperature);
IW_AP = SimulatingData(27,{'ap'},W,V_AP,temperature);
c=0;
for a = 0.000001:0.01:5
c=c+1;
Diff(1,c) = sum((D_AP-a.*IW_AP).^2)./length(IW_AP);
end
[i,v]=min((Diff(1,:)));
sw = v*0.01+0.000001;
JW = sw.*IW;
IW=JW;
% DiVeroli model
ID = SimulatingData(5,{'sine_wave'},DV,V,temperature);
ID_AP = SimulatingData(5,{'ap'},DV,V_AP,temperature);
c=0;
for a = 0.000001:0.01:5
c=c+1;
Diff(1,c) = sum((D_AP-a.*ID_AP).^2)./length(ID_AP);
end
[i,v]=min((Diff(1,:)));
sd = v*0.01+0.000001;
JD = sd.*ID;
ID=JD;
% Mazhari model
IM = SimulatingData(16,{'sine_wave'},M,V,temperature);
IM_AP = SimulatingData(16,{'ap'},M,V_AP,temperature);
c=0;
for a = 0.000001:0.01:5
c=c+1;
Diff(1,c) = sum((D_AP-a.*IM_AP).^2)./length(IM_AP);
end
[i,v]=min((Diff(1,:)));
sm = v*0.01+0.000001;
JM = sm.*IM;
IM=JM;
%TenTusscher model
IT = SimulatingData(26,{'sine_wave'},TT,V,temperature);
IT_AP = SimulatingData(26,{'ap'},TT,V_AP,temperature);
c=0;
for a = 0.000001:0.01:5
c=c+1;
Diff(1,c) = sum((D_AP-a.*IT_AP).^2)./length(IT_AP);
end
[i,v]=min((Diff(1,:)));
st = v*0.01+0.000001;
JT = st.*IT;
IT=JT;
% Zeng model (note that we use to version of the Zeng model with the singularities removed for simulating the action potential protocol)
IZ = SimulatingData(29,{'sine_wave'},Z,V,temperature);
IZ_AP = SimulatingData(2999,{'ap'},Z_tol,V_AP,temperature);
c=0;
for a = 0.000001:0.01:5
c=c+1;
Diff(1,c) = sum((D_AP-a.*IZ_AP).^2)./length(IZ_AP);
end
[i,v]=min((Diff(1,:)));
sz = v*0.01+0.000001;
JZ = sz.*IZ;
IZ=JZ;
% Calculate normalisation factor by identifying the maximum negative peak current during the
% voltage step to -120 mV around 1.5 seconds in the sine wave protocol. This current corresponds
% roughly to the current measured when the channel is maximally open during the sine wave protocol.
norm_I=max(abs(I(15002:15200)));
norm_IW=max(abs(IW(15002:15200)));
norm_IM=max(abs(IM(15002:15200)));
norm_ID=max(abs(ID(15002:15200)));
norm_IT=max(abs(IT(15002:15200)));
norm_IZ=max(abs(IZ(15002:15200)));
norm_exp=max(abs(D(15040:15200)));
% Peaks from experiments and simulations for activation kinetics protocol 2 identified manually
exp = [0
0.012
0.0118
0.0706
0.169
0.244
]';
model = [0.0892
0.1278
0.0501
0.0699
0.1514
0.22]';
wang = [0.0021377
0.0248
0.1469
0.2161
0.2161
0.2161
]';
diveroli = [0.0082182
0.0229
0.0297
0.0955
0.210096
0.2667
]';
mazhari = [0.0021425
0.0297
0.2164
0.4691
0.4691
0.4691
]';
tentusscher = [0.8699
0.1597
0.0796
0.0802
0.0802
0.0802
]';
zeng = [0.0285
0.0803
0.1386
0.1553
0.1554
0.1554
]';
% Plot and save normalised traces
T= [3,10,30,100,300,1000];
figure(1)
plot(T,exp./abs(norm_exp),'color','r','Marker','o','LineWidth',2)
hold on
plot(T,model./abs(norm_I),'color','b','Marker','o','LineWidth',2)
plot(T,wang./abs(norm_IW),'color','k','Marker','o','LineWidth',2)
plot(T,diveroli./abs(norm_ID),'color','c','Marker','o','LineWidth',2)
plot(T,mazhari./abs(norm_IM),'color','g','Marker','o','LineWidth',2)
plot(T,tentusscher./abs(norm_IT),'color','m','Marker','o','LineWidth',2)
plot(T,zeng./abs(norm_IZ),'color','y','Marker','o','LineWidth',2)
xlabel('Time (ms)')
ylabel('Normalised Current')
set(gca,'FontSize',20)
experimental_data = [log10(T),exp./abs(norm_exp)];
model_data = [log10(T),model./abs(norm_I)];
wang_data = [log10(T),wang./abs(norm_IW)];
diveroli_data=[log10(T),diveroli./abs(norm_ID)];
mazhari_data = [log10(T),mazhari./abs(norm_IM)];
tentusscher_data = [log10(T),tentusscher./abs(norm_IT)];
zeng_data = [log10(T),zeng./abs(norm_IZ)];
cd ../Figures/figure_e_6/activation_kinetics_2
save activation_kinetics_2_iv_experiment.txt experimental_data -ascii
save activation_kinetics_2_iv_prediction.txt model_data -ascii
save activation_kinetics_2_iv_wang.txt wang_data -ascii
save activation_kinetics_2_iv_mazhari.txt mazhari_data -ascii
save activation_kinetics_2_iv_diveroli.txt diveroli_data -ascii
save activation_kinetics_2_iv_tentusscher.txt tentusscher_data -ascii
save activation_kinetics_2_iv_zeng.txt zeng_data -ascii
cd ..
cd ..
cd ..
cd Code