-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparseExperimentsXls_dLGN.m
71 lines (57 loc) · 3.28 KB
/
parseExperimentsXls_dLGN.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
function [batchopt] = parseExperimentsXls_dLGN(path,user)
[xls_num,xls_txt]=xlsread(path);
loadcol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'BatchAnalyze')));
mousecol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'ExperimentalDay')));
expcol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'RecordingsSW')));
expcols2 = find(~cellfun(@isempty, strfind(xls_txt(1,:),'RecordingsSW_slice_nr')));
category = find(~cellfun(@isempty, strfind(xls_txt(1,:),'Category_SW')));
if user==1
expcol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'RecordingsMF')));
expcols2 = find(~cellfun(@isempty, strfind(xls_txt(1,:),'RecordingsMF_slice_nr')));
category = find(~cellfun(@isempty, strfind(xls_txt(1,:),'Category_MF')));
end
% samesitecol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'SameSiteID')));
% baselinecol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'Baseline')));
% basepaircol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'Baselinepair')));
% basepair14col = find(~cellfun(@isempty, strfind(xls_txt(1,:),'Baselinepair14')));
% recoverycol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'fullRec')));
loaddrivecol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'loaddrive')));
animalname = find(~cellfun(@isempty, strfind(xls_txt(1,:),'Animal_ID')));
% airpuffcol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'Airpuff')));
% spontcol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'ExpIDsSpont')));
% sftfcol = find(~cellfun(@isempty, strfind(xls_txt(1,:),'ExpIDsSFTF')));
k = 1;
batchopt.XLS.txt = xls_txt;
batchopt.XLS.num = xls_txt;
for i = 2:size(xls_txt,1)
ana{k}= xls_num(i-1,loadcol-1);
if ~ana{k}
disp(['skipping experiments ' xls_txt{i,mousecol} ' (no batchload flag)']);
continue
end
batchopt.mouse{k} = xls_txt(i,mousecol);
batchopt.mouseID{k} = xls_txt(i,animalname);
expcellids{k} = xls_txt(i,expcol);
expcellids2{k} = xls_txt(i,expcols2);
expcellids3{k} = xls_txt(i,category);
% spontcellids{k} = xls_txt(i,spontcol);
% sftfcellids{k} = xls_txt(i,sftfcol);
% puffcellids{k} = xls_txt(i,airpuffcol);
%batchopt.exp_ids{k} = (expcellids{k}{1});
batchopt.exp_ids{k} = str2num((expcellids{k}{1}));
batchopt.exp_ids2{k} = str2num((expcellids2{k}{1}));
batchopt.exp_ids3{k} = str2num((expcellids3{k}{1}));
% batchopt.spont_ids{k} = str2num((spontcellids{k}{1}));
% batchopt.sftf_ids{k} = str2num((sftfcellids{k}{1}));
% batchopt.puff_ids{k} = str2num((puffcellids{k}{1}));
%
% batchopt.samesite{k} = xls_num(i-1,samesitecol-1);
% batchopt.baseline{k} = xls_num(i-1,baselinecol(1)-1);
% try
% batchopt.baselinepair{k} = eval(cell2mat(xls_txt(i,basepaircol(1))));
% batchopt.baselinepair14{k} = eval(cell2mat(xls_txt(i,basepair14col)));
% batchopt.recovery{k} = xls_num(i-1,recoverycol-1);
% end
batchopt.loaddrive{k} = xls_txt(i,loaddrivecol);
k = k+1;
end