-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInhibitoryCortex_pulse_stitchtogether_0709.m
executable file
·254 lines (206 loc) · 8.5 KB
/
InhibitoryCortex_pulse_stitchtogether_0709.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
clear
clc
close all
numsims=10;
numfull=5;
branges=cell(1, numsims/numfull);
bstart=2691;
bstartcsv=bstart;
for i=1:numsims/numfull
branges{i}=bstart+(i-1)*numfull:(bstart+numfull-1)+(i-1)*numfull;
end
close all
for i=1:numsims/numfull
brange=branges{i};
%% File names
load('progress_postpulse_2691to2700.mat');
load('progress_prepulse_2691to2700.mat');
%% Parameters
numcells=500;
endtime=2000;
pulsetime=1000;
dt=.01;
steps=endtime/dt+1;
% brange=106:105;
numgsyn=20;
numI=37;
loopnum=numgsyn*numI;
%% Construct Full Parameter Regime From Smaller Runs
Synchrony_full=zeros(numI+1, numgsyn+1);
popfreq_full=zeros(numI+1, numgsyn+1);
count=1;
for b=brange
temp=csvread(csvname{1+b-bstartcsv,1});
for k=1:(length(temp)/numI)
Synchrony_full(1:numI, count)=temp((1+(k-1)*numI):(k*numI));
count=count+1;
end
end
count=1;
for b=brange
temp2=csvread(csvname{1+b-bstartcsv,2});
for k=1:(length(temp2)/numI)
popfreq_full(1:numI, count)=temp2((1+(k-1)*numI):(k*numI));
count=count+1;
end
end
%% Input data from csv files
b=brange(1);
current=cd;
cd('/Users/scottrich/OneDrive - UHN/1) Compute Canada Files');
% cd('E:\OneDrive - UHN\1) Compute Canada Files');
str1=sprintf('InhibitoryNetwork_%d_TrackVariables.csv', b);
str2=sprintf('InhibitoryNetwork_%d_SpikeTimes.csv', b);
str3=sprintf('InhibitoryNetwork_%d_InputCurrents.csv', b);
str4=sprintf('InhibitoryNetwork_%d_ConnectivityMatricies.csv', b);
str5=sprintf('InhibitoryNetwork_%d_Parameters.csv', b);
% trackvariables=csvread(str1);
% spikes=csvread(str2);
% currents=csvread(str3);
% connectivity=csvread(str4);
variables=csvread(str5);
cd(current);
csvname4=sprintf('Synchrony_postpulse_full_state%d_probii%1.0f_std%1.0f_num%dto%d.csv', variables(1,5), variables(1,1)*100, variables(1,4), brange(1),brange(end));
csvname3=sprintf('PopulationFreq_postpulse_full_state%d_probii%1.0f_std%1.0f_num%dto%d.csv', variables(1,5), variables(1,1)*100, variables(1,4), brange(1),brange(end));
csvwrite(csvname4,Synchrony_full);
csvwrite(csvname3,popfreq_full);
%% Plot Full Parameter Regime
figure('units','normalized','position',[0 0 1 1])
colormap jet
subaxis(1,2,1, 'Spacing', 0.01, 'Padding', 0.05, 'Margin', 0.05, 'PaddingBottom', 0.12, 'PaddingTop', 0.075, 'PaddingLeft', 0.07, 'PaddingRight', 0.01);
pcolor(Synchrony_full)
caxis([0 1])
colorbar
xlabels=0.25:.5:5;
ylabels=100:100:1000;
set(gca,'TickDir','out')
set(gca,'box','off')
set(gca, 'XTick', 1.5:2:20.5);
set(gca, 'XTickLabel', xlabels);
set(gca, 'YTick', 1.5:4:37.5);
set(gca, 'YTickLabel', ylabels);
xtickangle(45)
ytickangle(45)
set(gca, 'FontSize', 20);
% ylabel({'Inter-connectivity Density'; 'Compared to E-E Density'}, 'FontSize', 26)
% xlabel('Inhibitory Synaptic Weight (nS)', 'FontSize', 26)
ylabel('External Applied Current (pA)', 'FontSize', 26)
title('Synchrony Measure', 'FontSize', 30);
subaxis(1,2,2, 'Spacing', 0.01, 'Padding', 0.05, 'Margin', 0.05, 'PaddingBottom', 0.12, 'PaddingTop', 0.075, 'PaddingRight', 0.01, 'PaddingLeft', 0.05);
pcolor(popfreq_full)
caxis([0 200])
colorbar
set(gca,'TickDir','out')
set(gca,'box','off')
set(gca, 'XTick', 1.5:2:20.5);
set(gca, 'XTickLabel', xlabels);
set(gca, 'YTick', []);
set(gca, 'YTickLabel', ylabels);
xtickangle(45)
ytickangle(45)
set(gca, 'FontSize', 20);
% ylabel({'Inter-connectivity Density'; 'Compared to E-E Density'}, 'FontSize', 26)
% xlabel('Inhibitory Synaptic Weight (nS)', 'FontSize', 26)
% ylabel('External Applied Current (pA)', 'FontSize', 26)
title('Mean Firing Frequency (Hz)', 'FontSize', 30);
supAxis=[.0750 .10 .85 .85];
str1= sprintf('Inhibitory Synaptic Weight (nS)');
str3= sprintf('Connectivity Density: %1.2f; State: %1.0f; Post-Pulse', variables(1,1), variables(1,5));
[ax,h]=suplabel(str1, 'x', supAxis);
set(h, 'FontSize', 26);
[ax3,h3]=suplabel(str3, 't', supAxis);
set(h3, 'FontSize', 20);
str1=sprintf('FullRange_postpulse_state%d_probii%1.0f_std%1.0f_num%dto%d.png', variables(1,5), variables(1,1)*100, variables(1,4), brange(1),brange(end));
% saveas(gcf, str1)
set(gcf,'PaperPositionMode','auto')
print(str1, '-dpng', '-r0');
%% Construct Full Parameter Regime From Smaller Runs PRE PULSE
Synchrony_full=zeros(numI+1, numgsyn+1);
popfreq_full=zeros(numI+1, numgsyn+1);
count=1;
for b=brange
temp=csvread(csvname2{1+b-bstartcsv,1});
for k=1:(length(temp)/numI)
Synchrony_full(1:numI, count)=temp((1+(k-1)*numI):(k*numI));
count=count+1;
end
end
count=1;
for b=brange
temp2=csvread(csvname2{1+b-bstartcsv,2});
for k=1:(length(temp2)/numI)
popfreq_full(1:numI, count)=temp2((1+(k-1)*numI):(k*numI));
count=count+1;
end
end
%% Input data from csv files
b=brange(1);
current=cd;
cd('/Users/scottrich/OneDrive - UHN/1) Compute Canada Files');
% cd('E:\OneDrive - UHN\1) Compute Canada Files');
str1=sprintf('InhibitoryNetwork_%d_TrackVariables.csv', b);
str2=sprintf('InhibitoryNetwork_%d_SpikeTimes.csv', b);
str3=sprintf('InhibitoryNetwork_%d_InputCurrents.csv', b);
str4=sprintf('InhibitoryNetwork_%d_ConnectivityMatricies.csv', b);
str5=sprintf('InhibitoryNetwork_%d_Parameters.csv', b);
% trackvariables=csvread(str1);
% spikes=csvread(str2);
% currents=csvread(str3);
% connectivity=csvread(str4);
variables=csvread(str5);
cd(current);
csvname4=sprintf('Synchrony_prepulse_full_state%d_probii%1.0f_std%1.0f_num%dto%d.csv', variables(1,5), variables(1,1)*100, variables(1,4), brange(1),brange(end));
csvname3=sprintf('PopulationFreq_prepulse_full_state%d_probii%1.0f_std%1.0f_num%dto%d.csv', variables(1,5), variables(1,1)*100, variables(1,4), brange(1),brange(end));
csvwrite(csvname4,Synchrony_full);
csvwrite(csvname3,popfreq_full);
%% Plot Full Parameter Regime
figure('units','normalized','position',[0 0 1 1])
colormap jet
subaxis(1,2,1, 'Spacing', 0.01, 'Padding', 0.05, 'Margin', 0.05, 'PaddingBottom', 0.12, 'PaddingTop', 0.075, 'PaddingLeft', 0.07, 'PaddingRight', 0.01);
pcolor(Synchrony_full)
caxis([0 1])
colorbar
xlabels=0.25:.5:5;
ylabels=100:100:1000;
set(gca,'TickDir','out')
set(gca,'box','off')
set(gca, 'XTick', 1.5:2:20.5);
set(gca, 'XTickLabel', xlabels);
set(gca, 'YTick', 1.5:4:37.5);
set(gca, 'YTickLabel', ylabels);
xtickangle(45)
ytickangle(45)
set(gca, 'FontSize', 20);
% ylabel({'Inter-connectivity Density'; 'Compared to E-E Density'}, 'FontSize', 26)
% xlabel('Inhibitory Synaptic Weight (nS)', 'FontSize', 26)
ylabel('External Applied Current (pA)', 'FontSize', 26)
title('Synchrony Measure', 'FontSize', 30);
subaxis(1,2,2, 'Spacing', 0.01, 'Padding', 0.05, 'Margin', 0.05, 'PaddingBottom', 0.12, 'PaddingTop', 0.075, 'PaddingRight', 0.01, 'PaddingLeft', 0.05);
pcolor(popfreq_full)
caxis([0 200])
colorbar
set(gca,'TickDir','out')
set(gca,'box','off')
set(gca, 'XTick', 1.5:2:20.5);
set(gca, 'XTickLabel', xlabels);
set(gca, 'YTick', []);
set(gca, 'YTickLabel', ylabels);
xtickangle(45)
ytickangle(45)
set(gca, 'FontSize', 20);
% ylabel({'Inter-connectivity Density'; 'Compared to E-E Density'}, 'FontSize', 26)
% xlabel('Inhibitory Synaptic Weight (nS)', 'FontSize', 26)
% ylabel('External Applied Current (pA)', 'FontSize', 26)
title('Mean Firing Frequency (Hz)', 'FontSize', 30);
supAxis=[.0750 .10 .85 .85];
str1= sprintf('Inhibitory Synaptic Weight (nS)');
str3= sprintf('Connectivity Density: %1.2f; State: %1.0f; Pre-Pulse', variables(1,1), variables(1,5));
[ax,h]=suplabel(str1, 'x', supAxis);
set(h, 'FontSize', 26);
[ax3,h3]=suplabel(str3, 't', supAxis);
set(h3, 'FontSize', 20);
str1=sprintf('FullRange_prepulse_state%d_probii%1.0f_std%1.0f_num%dto%d.png', variables(1,5), variables(1,1)*100, variables(1,4), brange(1),brange(end));
% saveas(gcf, str1)
set(gcf,'PaperPositionMode','auto')
print(str1, '-dpng', '-r0');
end