-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgather_exp_info.m
82 lines (71 loc) · 2.5 KB
/
gather_exp_info.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
function [exp_info, input_s_all] = gather_exp_info
sr_dirs = prepSR;
% set up full channel name lists for analyses later
layer_names = [
arrayfun(@(k) strcat("Sup", num2str(k)), (8:-1:1)')
"L4"
arrayfun(@(k) strcat("Inf", num2str(k)), (1:8)')
];
make_layer_names = @(regions) reshape(string(regions(:)') + "_" + layer_names, [], 1);
exp_info = [
struct('type', 'm1_v1', 'all_chan_names', make_layer_names(["M1", "V1"]), ...
'days', {{
% '2020-01-30'
% '2020-01-31'
% '2020-02-06'
% '2020-03-05'
% '2020-03-06'
% '2020-03-10'
% '2020-03-11'
% not using any of the above - short probe recordings
'2020-10-26'
% '2020-10-27'
'2020-10-28'
'2020-10-29'
}})
struct('type', 'bilateral', 'all_chan_names', make_layer_names(["V1L", "V1R"]), ...
'days', {{
'2021-01-27'
'2021-01-29'
'2021-01-31'
'2021-02-02'
}})
% struct('type', 'm1_v1_csd', 'all_chan_names', make_layer_names(["M1", "V1"]), ...
% 'days', {{
% '2020-10-26_csd'
% % '2020-10-27_csd'
% '2020-10-28_csd'
% '2020-10-29_csd'
% }})
% struct('type', 'bilateral_csd', 'all_chan_names', make_layer_names(["V1L", "V1R"]), ...
% 'days', {{
% '2021-01-27_csd'
% '2021-01-29_csd'
% '2021-01-31_csd'
% '2021-02-02_csd'
% }})
];
exp_types = {exp_info.type}';
% Collect datasets on each day
for kE = 1:length(exp_types)
this_days = exp_info(kE).days;
this_ndays = length(this_days);
exp_info(kE).input_s = struct(...
'name', this_days, ...
'mt_res_in', cell(this_ndays, 1), ...
'nmf_res_out', cell(this_ndays, 1), ...
'xval_fig_dir', cell(this_ndays, 1));
for kD = 1:this_ndays
% Build input to concat_and_nmf
curr_day = this_days{kD};
exp_info(kE).input_s(kD).nmf_res_out = fullfile(sr_dirs.results, curr_day, 'nmf_res.mat');
exp_info(kE).input_s(kD).xval_fig_dir = fullfile(sr_dirs.results, curr_day);
% find all "layers" results files under this day
res_fn = 'mt_res_layers.mat';
res_entries = dir(fullfile(sr_dirs.results, curr_day, '*', res_fn));
dirs = sort({res_entries.folder});
exp_info(kE).input_s(kD).mt_res_in = fullfile(dirs, res_fn);
end
end
input_s_all = vertcat(exp_info.input_s);
end