-
Notifications
You must be signed in to change notification settings - Fork 1
/
PlottingActivationKinetics1NormalisedPeakSine.m
286 lines (210 loc) · 6.2 KB
/
PlottingActivationKinetics1NormalisedPeakSine.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
function PlottingActivationKinetics1PlotNormalisedPeakSine()
% This script generates data for subpanel A 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 the 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 1 identified manually
exp = [0
0.0042411
0.008519
0.0177
0.0619
0.2267
]';
model = [0.0051949
0.0089096
0.0092176
0.0169
0.049
0.1492
]';
wang = [0.00063753
0.0037895
0.0318
0.1027
0.1679
0.2705
]';
diveroli = [0.0038698
0.0099015
0.0218
0.0615
0.1678
0.4616
]';
mazhari = [0.00060942
0.0032698
0.027
0.1008
0.1899
0.388
]';
tentusscher = [0.0319
0.0239
0.0422
0.1176
0.2251
0.2783
]';
zeng = [0.0252
0.0831
0.204
0.3648
0.4019
0.4022
]';
% 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_1
save activation_kinetics_1_iv_experiment.txt experimental_data -ascii
save activation_kinetics_1_iv_prediction.txt model_data -ascii
save activation_kinetics_1_iv_wang.txt wang_data -ascii
save activation_kinetics_1_iv_mazhari.txt mazhari_data -ascii
save activation_kinetics_1_iv_diveroli.txt diveroli_data -ascii
save activation_kinetics_1_iv_tentusscher.txt tentusscher_data -ascii
save activation_kinetics_1_iv_zeng.txt zeng_data -ascii
cd ..
cd ..
cd ..
cd Code