10 %> Cell of subsetsprocessors to perform biomarkers comparisons
using different subsetsprocessors. If used, the comparison will be per stab
11 %> Note that
this property does not have a corresponding GUI input at the moment.
14 flag_draw_stability = 1;
16 flag_biocomp_per_clssr = 1;
17 flag_biocomp_per_stab = 1;
20 flag_biocomp_per_ssp = 1;
21 %> Whether to show the nf4grades statistics
23 %> =10. Stabilization number to be used in the
"all" comparison
26 %> Whether to generate a table where the varying element will be the nf4grades of a fixed-nf4grades
subsetsprocessor
27 flag_biocomp_nf4grades = 1;
32 o.classtitle = 'Biomarker comparison tables';
33 o.inputclass = 'soitem_merger_merger_fhg';
38 methods(Access=protected)
39 function out = do_use(o, item)
41 if o. flag_biocomp_per_clssr || o.flag_biocomp_per_stab || o.flag_biocomp_all || o.flag_nf4grades
45 s = o.get_standardheader(item);
47 out.html = [s, o.get_html_graphics(item)];
48 out.title = item.get_description();
54 %> Generates a table with the best in each architecture, with its respective time and confidence interval
55 %> @param item a soitem_merger_merger_fhg
object
56 function s = get_html_graphics(o, item)
59 if o.flag_biocomp_per_clssr
61 % Finds out methodologies with more than one variation ("stabilizations")
62 groupidxs = item.find_methodologygroups();
65 % Generates sub-reports for these groups separately
67 if i > 1; s = cat(2, s, '<hr />', 10); end;
68 s = cat(2, s, sprintf('<h1>FHG setup: "%s"</h1>\n', item.items(1).s_methodologies{groupidxs{i}(1)}), o.get_html_biocomparison(item, groupidxs{i}));
71 s = cat(2, s,
'<h1>FHG setups table merge</h1>', item.html_biocomparisontable_stab(
def_subsetsprocessor(o.subsetsprocessor), o.peakdetector, o.biocomparer));
73 s = cat(2, s,
'<hr />', 10);
76 if o.flag_biocomp_per_stab
77 stabs = unique(item.items(1).stabs);
78 stabs(stabs < 0) = [];
79 for i = 1:numel(stabs)
80 [s_temp, M(:, :, :, i), titles_temp] = o.get_html_biocomparison(item, item.find_stab(stabs(i))); %#ok<AGROW>
81 s = cat(2, s, sprintf(
'<h1>Stabilization: "stab%02d"</h1>\n', stabs(i)), s_temp);
88 s = cat(2, s, o.get_html_stab_x_coherence(M, titles));
89 s = cat(2, s,
'<hr />', 10);
93 idxs = item.find_stab(o.stab4all); % Picks one representant from each group
94 idxs = idxs(:)
'; % makes 10, 20, 10, 20, ...
95 idxs = [idxs, item.find_single()];
96 s = cat(2, s, '<h1>Comparison of Methodologies</h1>
', 10, o.get_html_biocomparison(item, idxs));
97 % Generates one report for comparison among ALL different methodologies
98 s = cat(2, s, '<hr />
', 10);
101 if o.flag_biocomp_nf4grades
102 s = cat(2, s, '<h1>Comparison of nf4grades</h1>
', 10);
103 stabs = unique(item.items(1).stabs);
104 stabs(stabs < 0) = [];
105 for i = 1:numel(stabs)
106 s = cat(2, s, sprintf('<h2>Comparison of nf4grades - stab%02d</h2>\n
', stabs(i)));
107 s = cat(2, s, o.get_html_biocomp_nf4grades(item, item.items(1).find_stab(stabs(i))));
110 s = cat(2, s, sprintf('<h2>Comparison of nf4grades - stab-all</h2>\n
'));
111 s = cat(2, s, o.get_html_biocomp_nf4grades(item, find(item.items(1).stabs >= 0))); %#ok<FNDSB>
112 s = cat(2, s, '<hr />
', 10);
115 if o.flag_biocomp_per_ssp
116 s = cat(2, s, '<h1>Comparison of subsetsprocessors</h1>
', 10);
118 stabs = unique(item.items(1).stabs);
119 stabs(stabs < 0) = [];
120 for i = 1:numel(stabs)
121 s = cat(2, s, sprintf('<h2>Comparison of subsetsprocessors - stab%02d</h2>\n
', stabs(i)));
122 s = cat(2, s, o.get_html_biocomp_ssps(item, item.items(1).find_stab(stabs(i))));
125 s = cat(2, s, sprintf('<h2>Comparison of subsetsprocessors - stab-all</h2>\n
'));
126 s = cat(2, s, o.get_html_biocomp_ssps(item, find(item.items(1).stabs >= 0))); %#ok<FNDSB>
127 s = cat(2, s, '<hr />
', 10);
132 % Average stability curves
133 if o.flag_draw_stability
134 idxs = find(item.items(1).stabs >= 0);
136 ni = numel(item.items);
141 log_rep = item.items(j).logs(idxs(i));
142 ds_stab(i) = log_rep.extract_dataset_stabilities(); %#ok<AGROW>
143 ds_stab(i).classlabels = {sprintf('stab%02d
', item.items(j).stabs(idxs(i)))}; %#ok<AGROW>
146 ds = o.merge_ds_stab(ds_stab);
150 maximize_window([], 1.8);
151 s = cat(2, s, o.save_n_close([], 0), '<hr />
', 10);
157 %-----> nf for grades table
158 s = cat(2, s, o.get_html_nf4grades(item, 1:numel(item.items(1).logs)));
159 s = cat(2, s, '<hr />
', 10);
162 % Reports the objects used
163 s = cat(2, s, '<h2>Setup of some objects used</h2>
');
164 a = {def_subsetsprocessor(o.subsetsprocessor), def_peakdetector(o.peakdetector), def_biocomparer(o.biocomparer)};
167 s = cat(2, s, '<p><b>
', obj.get_description, '</b></p>
', 10, '<
pre>
', obj.get_report(), '</
pre>
', 10);
170 if o.flag_biocomp_per_ssp
174 s = cat(2, s, '<p><b>
', obj.get_description, '</b></p>
', 10, '<
pre>
', obj.get_report(), '</
pre>
', 10);
177 s = cat(2, s, '<hr />
', 10);
181 function s = get_html_biocomp_nf4grades(o, item, idxs)
183 [temp, M, titles] = item.html_biocomparisontable_nf4grades(idxs, def_subsetsprocessor(o.subsetsprocessor), o.peakdetector, o.biocomparer);
186 % Draws as image as well, easier to perceive
190 xtick = 1:size(M, 1);
191 set(gca(), 'xtick
', xtick, 'ytick
', xtick, 'xticklabel
', titles, 'yticklabel
', titles);
193 format_frank([], [], hcb);
194 s = cat(2, s, o.save_n_close([], 0));
198 function ssps = get_ssps(o)
199 if isempty(o.subsetsprocessors)
200 ssps = report_log_fselrepeater_histcomp.get_defaultsubsetsprocessors();
202 ssps = o.subsetsprocessors;
206 function s = get_html_biocomp_ssps(o, item, idxs)
208 [temp, M, titles] = item.html_biocomparisontable_ssps(idxs, o.get_ssps(), o.peakdetector, o.biocomparer); %#ok<NASGU,ASGLU>
215 function [s, M, titles] = get_html_biocomparison(o, item, idxs)
216 ssp = def_subsetsprocessor(o.subsetsprocessor);
218 [s_temp, M, titles] = item.html_biocomparisontable(idxs, ssp, o.peakdetector, o.biocomparer);
227 function s = get_html_nf4grades(o, item, idxs)
228 ssp = subsetsprocessor(); %#ok<CPROP,PROP>
229 ssp.nf4gradesmode = 'stability
';
231 s = cat(2, s, '<h2>Number of informative features</h2>
', 10, item.html_nf4grades(idxs, ssp));
235 % creates a log_celldata to represent better what is in the table
236 function s = get_html_stab_x_coherence(o, M, titles)
237 ds = o.get_dataset_stab_x_coherence(M, titles);
241 maximize_window([], 1.8);
242 s = o.save_n_close([], 0);
246 %> Returns a dataset containing (stabilization) x (coherence index) information
247 function ds = get_dataset_stab_x_coherence(o, M, titles)
249 [nor, dummy, no_datasets, no_stabs] = size(M); %#ok<ASGLU>
251 no = nor*(nor-1)/2*no_datasets;
252 ds.X = zeros(no, no_stabs);
253 ds.classes = zeros(no, 1);
257 for i = 2:nor % These for's iterate through the upper triangle of M
259 ds.X(k:k+no_datasets-1, :) = M(i, j, :, :);
260 ds.classes(k:k+no_datasets-1, :) = l;
261 ds.classlabels{l+1} = sprintf(
'%s vs. %s', titles{i}, titles{j});
267 ds.title = [o.title,
' - stabilization curves'];
268 ds.xname =
'Stabilization';
269 ds.yname =
'Coherence';
272 ds = ds.assert_fix();
276 methods(Access=
protected)
277 %> Merges datasets but first makes sure they all have same number of features
278 function ds = merge_ds_stab(o, daa) %#ok<MANU>
283 [ro, co] = size(temp);
284 daa(i).X = NaN(ro, nf);
285 daa(i).X(1:ro, 1:co) = temp;
287 daa(i) = daa(i).assert_fix(); % just in
case
Pre-processing block base class.
Generated by irreport, carries HTML contents.
function def_subsetsprocessor(in out)
static function get_defaultsubsetsprocessors()
Processor of a set of subsets of features.
Base for all reports that operate on a soitem object.
function data_merge_rows(in datasets)