-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cell assembly structure data extraction script
186 lines (127 loc) · 3.64 KB
/
Cell assembly structure data extraction script
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
%%%% CA structure histograms
% Average first within CA type
% Then average across files
clc;
clear all;
files = dir(fullfile('CAstructurePhase105','*.txt'));
files(1).name;
ylimsize = 24;
%a = load(files(1).name)
for i = 1:size(files,1);
rawdat = CAtext(files(i).name);
%Extract raw data from text file corresponding to CA type
CA16PHONO = rawdat(1:6, 3:14);
CA79MOTOR = rawdat(7:9, 3:14);
CA1012VISUAL = rawdat(10:12, 3:14);
%Average CA type CA struct
CA16PHONOav = round(mean(CA16PHONO));
CA79MOTORav = round(mean(CA79MOTOR));
CA1012VISUALav = round(mean(CA1012VISUAL));
%Add averages of CA's from each CA structure to a matrix
PHONOMATRIX(i,:) = CA16PHONOav;
MOTORMATRIX(i,:) = CA79MOTORav;
VISUALMATRIX(i,:)= CA1012VISUALav;
%Compute average across trials
PHONOTOTAL = round(mean(PHONOMATRIX));
MOTORTOTAL = round(mean(MOTORMATRIX));
VISUALTOTAL = round(mean(VISUALMATRIX));
%Compute errorbar values,divide STD by SQRoot of N
end
x = 1:6;
%%%STDE calculations:
%%Extrasylvian
stderrorphonE = std( PHONOMATRIX (:,1:6) ) / sqrt( length( PHONOMATRIX (:,1:6)));
stderrorvisE = std( MOTORMATRIX (:,1:6) ) / sqrt( length( MOTORMATRIX (:,1:6)));
stderrormotE = std( VISUALMATRIX(:,1:6) ) / sqrt( length( VISUALMATRIX (:,1:6)));
%%Perisylvian
stderrorphonP = std( PHONOMATRIX (:,7:12)) / sqrt( length( PHONOMATRIX (:,7:12)));
stderrorvisP = std( MOTORMATRIX (:,7:12)) / sqrt( length( MOTORMATRIX (:,7:12)));
stderrormotP = std( VISUALMATRIX(:,7:12)) / sqrt( length( VISUALMATRIX (:,7:12)));
areanamesPS = {'V1'; 'TO'; 'AT'; 'PF_{D}'; 'PM_{D}'; 'M1_{D}'};
areanamesES = {'A1'; 'AB'; 'PB'; 'PF_{V}'; 'PM_{V}'; 'M1_{V}'};
%% Figure 1 Extraslyvian
%Split Perisylvian / Extraslyvian
%histogram(CA16PHONOav);
figure(1)
suptitle('Extraslyvian Areas')
subplot(1,2,1)
bar(PHONOTOTAL(1:6))
title('Articulatory')
set(gca,'xticklabel',areanamesPS)
ylim([0 ylimsize])
xlabel('Cortical area')
ylabel('No. CA cells')
hold on
er = errorbar(PHONOTOTAL(1:6), stderrorphonE(1:6));
er.Color = [0 0 0];
er.LineStyle = 'none';
hold off
%%
figure(2)
subplot(1,2,1)
bar(MOTORTOTAL(1:6))
title('Motor')
set(gca,'xticklabel',areanamesPS)
xlabel('Cortical area')
ylim([0 ylimsize])
ylabel('No. CA cells')
hold on
er = errorbar(MOTORTOTAL(1:6), stderrormotE(1:6));
er.Color = [0 0 0];
er.LineStyle = 'none';
hold off
%%
subplot(1,2,2)
bar(VISUALTOTAL(1:6))
title('Visual')
set(gca,'xticklabel',areanamesPS)
ylim([0 ylimsize])
xlabel('Cortical area')
ylabel('No. CA cells')
hold on
er = errorbar(VISUALTOTAL(1:6), stderrorvisE(1:6));
er.Color = [0 0 0];
er.LineStyle = 'none';
hold off
%% Figure 2 Perisylvian
figure(3)
suptitle('Perisylvian Areas')
subplot(1,2,1)
bar(PHONOTOTAL(7:12))
title('Articulatory')
set(gca,'xticklabel',areanamesES)
ylim([0 ylimsize])
xlabel('Cortical area')
ylabel('No. CA cells')
hold on
er = errorbar(PHONOTOTAL(7:12), stderrorphonP(1:6));
er.Color = [0 0 0];
er.LineStyle = 'none';
hold off
%%
figure(4)
subplot(1,2,1)
bar(MOTORTOTAL(7:12))
title('Motor')
set(gca,'xticklabel',areanamesES)
ylim([0 ylimsize])
xlabel('Cortical area')
ylabel('No. CA cells')
hold on
er = errorbar(MOTORTOTAL(7:12), stderrormotP(1:6));
er.Color = [0 0 0];
er.LineStyle = 'none';
hold off
%%
subplot(1,2,2)
bar(VISUALTOTAL(7:12))
title('Visual')
set(gca,'xticklabel',areanamesES)
ylim([0 ylimsize])
xlabel('Cortical area')
ylabel('No. CA cells')
hold on
er = errorbar(VISUALTOTAL(7:12), stderrorvisP(1:6));
er.Color = [0 0 0];
er.LineStyle = 'none';
hold off