-
Notifications
You must be signed in to change notification settings - Fork 0
/
fig4.m
223 lines (162 loc) · 7.31 KB
/
fig4.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
clear
load('D:\Data\Data_figure4.mat')
%% scatter ldg latency vs ncs larency
figure
idx=LDG_CSM_modulation<=0 & significant_response_any ;
scatter(LDG_latency(idx),NCS_latency(idx),12,'filled')
% title("Response latency of complex neurons")
xlabel('LDG latency (ms)')
ylabel('NCS lateny (ms)')
title([num2str(sum(idx)),' units'])
box off
ax = gca; ax.FontSize = 14; ax.FontName="Arial";
set(ax,'linewidth',1)
hl=150; h2=0:50:250;
xticks(h2);yticks(h2)
ll=min([min(NCS_latency(idx)),min(LDG_latency(idx))])-5;
xlim([-Inf,hl]); ylim([-Inf,hl])
axis square
line([ll,hl],[ll,hl],'Color','black','LineStyle','--','LineWidth',1)
%% rectangle latency vs IGR
IGR_1 = IGR(significant_response_any);
rect_latency_1 = rect_latency(significant_response_any);
figure
scatter(rect_latency_1,IGR_1,25,'filled')
xlabel('rectangle latency(ms)'); ylabel('IGR')
h1=lsline; h1.LineWidth = 2;
ax = gca; ax.FontSize = 14; ax.FontName="Arial";
%% scatter surround modulation vs IGR
figure
scatter(surround_modulation(significant_response_any),IGR_1,15,'filled','MarkerFaceColor',[ 0 0.4470 0.7410])
ylabel('IGR'); xlabel('surround modulation')
ax = gca; ax.FontSize = 18; ax.FontName="Arial"; set(ax,'linewidth',1.5)
axis square; h1 = refline; h1.LineWidth = 2;
%% histogram for surround_suppression and separated igr
idx=IGR<0 & significant_response_any;
idx2=IGR>=0 & significant_response_any;
ldg_pref_med=nanmedian(surround_modulation(idx));
ncs_pref_med=nanmedian(surround_modulation(idx2));
figure;hold on
histogram(surround_modulation(idx),25,'Normalization','probability','FaceColor','red');
histogram(surround_modulation(idx2),25,'Normalization','probability','FaceColor','blue');
xli1=line([ldg_pref_med ldg_pref_med],[0 .14],'Color','r','LineStyle','--','LineWidth',1.5);
text1=text(ldg_pref_med,-.9,'\leftarrow median');text1.FontSize = 16;
xli2=line([ncs_pref_med ncs_pref_med],[0 .14],'Color','b','LineStyle','--','LineWidth',1.5);
text2=text(ncs_pref_med,.9,'\leftarrow median'); text2.FontSize = 16;
set(get(get(xli1,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');
set(get(get(xli2,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');
xlabel('surround modulation'); ylabel('probability');box off;
legend('LDG-preferring','NCS-preferring','Location','northwest')
ax = gca; ax.FontSize = 18; ax.FontName="Arial";set(ax,'linewidth',1.5)
%% IGRF1 vs CSM
x = LDG_CSM_modulation(significant_response_both);
y = IGRf1(significant_response_both);
figure;
scatter(x,y,15,'filled')
ylabel('IGR_{F1}');xlabel('CSM index');box off
h1 = refline; h1.LineWidth = 2;
ax = gca; ax.FontSize = 14; ax.FontName="Arial";axis square
%% histogram for TPlatency
figure%('Visible','off');
histogram(TPlatency(significant_response_any),30);
xlabel('TP latency (ms)')
ylabel('# units')
% grid on
ax = gca;
ax.FontSize = 18;
ax.FontName="Arial";
xlim([0.126,1.182])
%% Icell/Ecell
X = categorical({'I cells','E cells'});
X = reordercats(X,{'I cells','E cells'});
%% I/E percentage
Icell_ncs_evoked=sum(Icell_ind & significant_response_NCS)/sum(Icell_ind)*100;
Icell_ldg_evoked=sum(Icell_ind & significant_response_LDG)/sum(Icell_ind)*100;
Ecell_ncs_evoked=sum(Ecell_ind & significant_response_NCS)/sum(Ecell_ind)*100;
Ecell_ldg_evoked=sum(Ecell_ind & significant_response_LDG)/sum(Ecell_ind)*100;
barr=[Icell_ncs_evoked,Icell_ldg_evoked;Ecell_ncs_evoked,Ecell_ldg_evoked];
figure
bar(X,barr)
ylabel('% of evoked cells')
legend('NCS evoked','LDG evoked','location','northwestoutside')
ax = gca; ax.FontSize = 14; ax.FontName="Arial";set(ax,'linewidth',1)
%% IE vs IGRf1
IGRf1_Icell=IGRf1(Icell_ind);
IGRf1_Ecell=IGRf1(Ecell_ind);
pd_Icell = fitdist(IGRf1_Icell,'Normal');
pd_Ecell = fitdist(IGRf1_Ecell,'Normal');
ci_Icell = pd_Icell.paramci;
ci_Ecell = pd_Ecell.paramci;
ci_mean = [ci_Icell(:,1)-pd_Icell.mean,ci_Ecell(:,1)-pd_Ecell.mean];
Y = [pd_Icell.mean,pd_Ecell.mean];
% [~,p2]=ttest2(IGRf1_Ecell,IGRf1_Icell);
figure;hold on
bar(X,Y,0.5)
errorbar(X,Y,ci_mean(1,:),ci_mean(2,:),'LineWidth', 2,'CapSize',20,'LineStyle', 'none')
ylabel('IGR_{F1}'); box on
ax = gca;ax.FontSize = 18; ax.FontName="Arial";
%% IE VS igr
IGR_Icell=IGR(Icell_ind);
IGR_Ecell=IGR(Ecell_ind);
pd_Icell = fitdist(IGR_Icell,'Normal');
pd_Ecell = fitdist(IGR_Ecell,'Normal');
ci_Icell = pd_Icell.paramci;
ci_Ecell = pd_Ecell.paramci;
ci_mean = [ci_Icell(:,1)-pd_Icell.mean,ci_Ecell(:,1)-pd_Ecell.mean];
Y = [pd_Icell.mean,pd_Ecell.mean];
% [~,p2]=ttest2(IGR_Ecell,IGR_Icell)
figure;hold on
bar(X,Y,0.5)
errorbar(X,Y,ci_mean(1,:),ci_mean(2,:),'LineWidth', 2,'CapSize',20,'LineStyle', 'none')
ylabel('IGR')
%% full screen experiment results
% IE VS igr non overlapping
fullfeild_IGR_Ecell=fullfeild_IGR(fullfeild_Ecell_ind & fullfeild_non_overlapping_V1 & fullfeild_significant_response_any);
fullfeild_IGR_Icell=fullfeild_IGR(~fullfeild_Ecell_ind & fullfeild_non_overlapping_V1& fullfeild_significant_response_any);
pd_Icell = fitdist(fullfeild_IGR_Icell,'Normal');
pd_Ecell = fitdist(fullfeild_IGR_Ecell,'Normal');
ci_Icell = pd_Icell.paramci;
ci_Ecell = pd_Ecell.paramci;
ci_mean = [ci_Icell(:,1)-pd_Icell.mean,ci_Ecell(:,1)-pd_Ecell.mean];
Y = [pd_Icell.mean,pd_Ecell.mean];
figure;hold on
bar(X,Y,0.5)
errorbar(X,Y,ci_mean(1,:),ci_mean(2,:),'LineWidth', 2,'CapSize',20,'LineStyle', 'none')
ylabel('IGR')
ax = gca; ax.FontSize = 18; ax.FontName="Arial";
% IE vs IGRf1 non overlapping
fullfeild_IGRf1_Ecell=fullfeild_IGRf1(fullfeild_Ecell_ind & fullfeild_non_overlapping_V1& fullfeild_significant_response_any);
fullfeild_IGRf1_Icell=fullfeild_IGRf1(~fullfeild_Ecell_ind & fullfeild_non_overlapping_V1& fullfeild_significant_response_any);
pd_Icell = fitdist(fullfeild_IGRf1_Icell,'Normal');
pd_Ecell = fitdist(fullfeild_IGRf1_Ecell,'Normal');
ci_Icell = pd_Icell.paramci;
ci_Ecell = pd_Ecell.paramci;
ci_mean = [ci_Icell(:,1)-pd_Icell.mean,ci_Ecell(:,1)-pd_Ecell.mean];
Y = [pd_Icell.mean,pd_Ecell.mean];
figure;hold on
bar(X,Y,0.5)
errorbar(X,Y,ci_mean(1,:),ci_mean(2,:),'LineWidth', 2,'CapSize',20,'LineStyle', 'none')
ylabel('IGR_{F1}'); box on
ax = gca;ax.FontSize = 18; ax.FontName="Arial";
%% I-E delay VS RF dist
idx1 =fullfeild_significant_response_any & fullfeild_NCS_CSM_modulation<0 &fullfeild_Icell_ind;
idx2 =fullfeild_significant_response_any & fullfeild_NCS_CSM_modulation<0 & ~fullfeild_Icell_ind;
figure
x = fullfeild_RF_distance(idx1); y = fullfeild_ncs_delay(idx1);
x= 2*atand(x./24); % convert to deg
scatter(x,y,25,"diamond",'filled'); hold on;
refline
xlabel('RF/inducer distance (degrees)');ylabel('NCS delay index')
ax = gca; ax.FontSize = 12; ax.FontName="Arial";
legend(['#',num2str(sum(~isnan(fullfeild_ncs_delay(idx1)))),' I cell'],"Box","off",'Location','northeastoutside','FontSize',13);axis square
ylim([-1,1])
figure
x = fullfeild_RF_distance(idx2); y = fullfeild_ncs_delay(idx2);
x= 2*atand(x./24); % convert to deg
scatter(x,y,25,"hexagram",'filled')
refline;
xlabel('RF/inducer distance (degree)');ylabel('NCS delay index')
ax = gca; ax.FontSize = 12; ax.FontName="Arial";
legend(['#',num2str(sum(~isnan(fullfeild_ncs_delay(idx2)))),' E cell' ...
],"Box","off",'Location','northeastoutside','FontSize',13);axis square
ylim([-1,1]) % xlim([0,10])