-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_fig8.m
More file actions
106 lines (84 loc) · 3.12 KB
/
plot_fig8.m
File metadata and controls
106 lines (84 loc) · 3.12 KB
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
%%%% plot aradi and holmes fig 8 %%%%%
%%% reducing skdr conductance increases bursting %%%
%NORMAL
initparams
t_startinj = 0;
t_stopinj = 200;
t_run = 300;
I_ext = 90;
[g,e,elecparam, calciump] = setparams(gna, gfkdr, gskdr, gka, gtca, gnca, glca, gbk, gsk, ggaba, gkir, gleak, ena, ek, ecl, ekir, C, I_ext, tau, reCa, B, depth, F, t_startinj, t_stopinj);
declareglobal(g, e, elecparam, calciump);
tspan = [0; t_run];
y0 = [V_m; m_0; h_0; nf_0; ns_0; k_0; l_0; a_0; b_0; c_0; d_0; e_0; tcai_0; ncai_0; lcai_0; r_0; s_0; q_0; p_0];
[t,y] = ode15s(@granulecell, tspan, y0);
fig = figure();
tiledlayout(2,1)
nexttile
plot(t, y(:,1))
xlabel('Time (ms)')
ylabel ('Voltage (mV')
%%% reduce skdr by 90%
initparams
gskdr = gskdr * 0.1;
t_startinj = 0;
t_stopinj = 200;
t_run = 300;
I_ext = 90;
[g,e,elecparam, calciump] = setparams(gna, gfkdr, gskdr, gka, gtca, gnca, glca, gbk, gsk, ggaba, gkir, gleak, ena, ek, ecl, ekir, C, I_ext, tau, reCa, B, depth, F, t_startinj, t_stopinj);
declareglobal(g, e, elecparam, calciump);
tspan = [0; t_run];
y0 = [V_m; m_0; h_0; nf_0; ns_0; k_0; l_0; a_0; b_0; c_0; d_0; e_0; tcai_0; ncai_0; lcai_0; r_0; s_0; q_0; p_0];
[t,y] = ode15s(@granulecell, tspan, y0);
nexttile
txt = 'g_{skdr} reduced by 90%';
plot(t, y(:,1), 'DisplayName', txt)
legend('location', 'best')
xlabel('Time (ms)')
ylabel ('Voltage (mV')
%%%%%%%%%%%%%%%%% IF curves %%%%%%%%%%%%%%%%%%%
initparams
i_ext = 30:1:200 ;
t_startinj = 100;
t_stopinj = 500;
t_run = 550;
clear freq i_store
for i=1:length(i_ext)
I_ext = i_ext(i);
[g,e,elecparam, calciump] = setparams(gna, gfkdr, gskdr, gka, gtca, gnca, glca, gbk, gsk, ggaba, gkir, gleak, ena, ek, ecl, ekir, C, I_ext, tau, reCa, B, depth, F, t_startinj, t_stopinj);
declareglobal(g, e, elecparam, calciump);
tspan = [0; t_run];
y0 = [V_m; m_0; h_0; nf_0; ns_0; k_0; l_0; a_0; b_0; c_0; d_0; e_0; tcai_0; ncai_0; lcai_0; r_0; s_0; q_0; p_0];
[t,y] = ode15s(@granulecell, tspan, y0);% options);
if max(t) == t_run
freq(i) = length(findpeaks(y(:,1), 'MinPeakHeight', -10));
i_store(i) = i_ext(i);
end
comb = [i_store; freq];
comb( :, all(~comb,1) ) = []; %remove 0s.
end
fig2 = figure();
hold on
plot(comb(1,:), comb(2,:), '-o')
gskdr = gskdr * 0.1;
clear freq i_store
for i=1:length(i_ext)
I_ext = i_ext(i);
[g,e,elecparam, calciump] = setparams(gna, gfkdr, gskdr, gka, gtca, gnca, glca, gbk, gsk, ggaba, gkir, gleak, ena, ek, ecl, ekir, C, I_ext, tau, reCa, B, depth, F, t_startinj, t_stopinj);
declareglobal(g, e, elecparam, calciump);
tspan = [0; t_run];
y0 = [V_m; m_0; h_0; nf_0; ns_0; k_0; l_0; a_0; b_0; c_0; d_0; e_0; tcai_0; ncai_0; lcai_0; r_0; s_0; q_0; p_0];
[t,y] = ode15s(@granulecell, tspan, y0);% options);
if max(t) == t_run
freq(i) = length(findpeaks(y(:,1), 'MinPeakHeight', -10));
i_store(i) = i_ext(i);
end
comb = [i_store; freq];
comb( :, all(~comb,1) ) = []; %remove 0s.
end
plot(comb(1,:), comb(2,:), '-o')
hold off
legend({'Control', 'g_{skdr} reduced by 90%'})
xlabel('I_{ext} (pA)')
ylabel('Number of Spikes')
saveas(fig, 'plot_redgskdr.jpeg')
saveas(fig2, 'plot_redgskdr_IF.jpeg')