-
Notifications
You must be signed in to change notification settings - Fork 3
/
cleanup_cohort.m
50 lines (50 loc) · 1.4 KB
/
cleanup_cohort.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
%% clean_cohort
% create by: Benjamin Green
%% -----------------------------------------
% check the bytes and number of files in all samples of a cohort
% for any issues. Then prepare the batch and merge files.
%
function cleanup_cohort(wd, fw)
%
% get specimen names for the CS
%
samplenames = find_specimens(wd);
%
% cycle through and search for the xml files
%
out = zeros(length(samplenames), 8);
%
for i2 = 1:length(samplenames)
%
sname = samplenames{i2};
[im3_err_val, expectim3num] = check_im3s(wd, sname);
[fw_err_val] = check_fw_fw01(fw, sname, expectim3num);
[flatw_err_val] = check_flatws(wd, sname, expectim3num);
[xml_err_val] = check_xmls(wd, sname, expectim3num);
[comps_err_val] = check_components(wd, sname, expectim3num);
[tbl_err_val] = check_tables(wd, sname, expectim3num);
%
vals = [im3_err_val, fw_err_val, flatw_err_val, xml_err_val, comps_err_val, tbl_err_val];
total_err_val = sum(vals);
%
out(i2,:) = [i2, vals, total_err_val];
%
fprintf([sname,' Complete\n'])
%
end
%
tout = array2table(out);
tout.slideid = samplenames';
tout = tout(:, [9,2:8]);
names = {'slideid','im3','fw','flatw','xml','comps','tbl','total'};
tout.Properties.VariableNames = names;
%
loc = [wd,'\upkeep_and_progress\sample_error_codes.csv'];
try
writetable(tout, loc)
catch
end
%
%convert_batch(main, wd);
%
end