-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_BD_HCcontrast.m
More file actions
165 lines (135 loc) · 4.54 KB
/
plot_BD_HCcontrast.m
File metadata and controls
165 lines (135 loc) · 4.54 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
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
%%% "FI", complete granule cell model %%%
%%% weird results %%%
%%%%%%%%%%%%%%%%%%% HEALTHY CONTROL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
initparams
gkir = gkir * 0 ;
% sodium conductances : unchanged
% gkfbar: unchanged
% gksbar: unchanged
% ka: unchanged
% kir: removed [abe is removing this]
warning('off')
t_startinj = 0;
t_stopinj = 500;
t_run = 500;
i_ext = [35:0.25:60, 60:1:125];
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
%%%%%%%%%%%%%%%%%%% BD - LR %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% sodium conductances : 1.03
% kdr: 1.15 (applies to fast and slow potassium)
% ka: 0.0096/0.008
% kir: removed
initparams
gna = gna * 1.03;
gfkdr = 16 * 1.15 ; % mS/cm^2 Santhakumar
gskdr = 6 * 1.15; % mS/cm^2 Santhakumar
gka = 12 * 0.0096/0.008; % mS/cm^2 Santhakumar
gkir = 0.0144 * 0; % mS/cm^2 Yim
t_startinj = 0;
t_stopinj = 500;
t_run = 500;
clear freq2 i_store2
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
freq2(i) = length(findpeaks(y(:,1), 'MinPeakHeight', -10));
i_store2(i) = i_ext(i);
end
comb2 = [i_store2; freq2];
comb2( :, all(~comb2,1) ) = []; %remove 0s.
end
%%%%%%%%%%%%%%%%%%% BD - LNR %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% sodium conductances : 0.026/0.033
% kdr: 1.3 (applies to fast and slow potassium)
% ka: 0.0104/0.008
% kir: removed [abe is removing this]
initparams
gna = gna * 0.026/0.033;
gfkdr = 16 * 1.3 ; % mS/cm^2 Santhakumar
gskdr = 6 * 1.3; % mS/cm^2 Santhakumar
gka = 12 * 0.0104/0.008; % mS/cm^2 Santhakumar
gkir = 0.0144 * 0; % mS/cm^2 Yim
t_startinj = 0;
t_stopinj = 500;
t_run = 500;
clear freq3 i_store3
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
freq3(i) = length(findpeaks(y(:,1), 'MinPeakHeight', -10));
i_store3(i) = i_ext(i);
end
comb3 = [i_store3; freq3];
comb3( :, all(~comb3,1) ) = []; %remove 0s.
end
fig1 = figure();
hold on
scatter(i_store, freq)
scatter(i_store2, freq2)
scatter(i_store3, freq3)
hold off
xlim([35, 125])
legend({'Healthy', 'BD-LR', 'BD-LNR'})
xlabel('I_{ext}')
ylabel('Number of Spikes')
fig3 = figure();
nexttile
hold on
plot(comb(1,:), comb(2,:), '-o')
plot(comb2(1,:), comb2(2,:), '-o')
plot(comb3(1,:), comb3(2,:), '-o')
hold off
legend({'Healthy', 'BD-LR', 'BD-LNR'}, 'location', 'best')
xlabel('I_{ext} (pA)')
ylabel('Number of Spikes')
nexttile
xlim([40,60])
hold on
plot(comb(1,:), comb(2,:), '-o')
plot(comb2(1,:), comb2(2,:), '-o')
plot(comb3(1,:), comb3(2,:), '-o')
hold off
legend({'Healthy', 'BD-LR', 'BD-LNR'}, 'location', 'best')
xlabel('I_{ext} (pA)')
ylabel('Number of Spikes')
saveas(fig3, 'plot_BD_IF.jpeg')
fig2 = figure();
hold on
Fit = polyfit(i_store,freq,1);
new_is2 = linspace(min(i_store), max(i_store), 1000);
plot(polyval(Fit,new_is2))
Fit2 = polyfit(i_store2,freq2,1);
new_is2 = linspace(min(i_store2), max(i_store2), 1000);
plot(polyval(Fit2,new_is2))
Fit3 = polyfit(i_store3,freq3,1);
new_is2 = linspace(min(i_store3), max(i_store3), 1000);
plot(polyval(Fit3,new_is2))
hold off
xlim([35,200])
legend({'Healthy', 'BD-LR', 'BD-LNR'})
xlabel('I_{ext}')
ylabel('Number of Spikes')