forked from TASBE/TASBEFlowAnalytics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcsv_for_sample_set.m
43 lines (33 loc) · 1.28 KB
/
csv_for_sample_set.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
% Copyright (C) 2010-2017, Raytheon BBN Technologies and contributors listed
% in the AUTHORS file in TASBE analytics package distribution's top directory.
%
% This file is part of the TASBE analytics package, and is distributed
% under the terms of the GNU General Public License, with a linking
% exception, as described in the file LICENSE in the TASBE analytics
% package distribution's top directory.
function csv_for_sample_set(batch_description,results,filename)
if nargin<3, filename = 'batch.csv'; end
batch_size = size(batch_description,1);
fprintf('Outputting summary data');
f = fopen(filename,'w');
AP = getAnalysisParameters(results{1,1});
channels = getChannelNames(AP);
fprintf(f,'Sample Name');
for i=1:numel(channels), fprintf(f,',%s,,',channels{i}); end
fprintf(f,'\n');
for i=1:numel(channels), fprintf(f,',Count,Mean (log10 MEFL),S.D. of Events (fold)'); end
fprintf(f,'\n');
for i=1:batch_size,
condition_name = batch_description{i,1};
r = results{i,1};
fprintf(f,'%s',condition_name);
for j=1:numel(channels),
[means stds histograms] = get_channel_population_results(r,channels{j});
fprintf(f,',%i,%.2f,%.2f',sum(histograms),log10(means),stds);
end
fprintf(f,'\n');
fprintf('.');
end
fprintf('\n');
for i=1:size(results,1),
end