IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
bmtable.m
Go to the documentation of this file.
1 %> @ingroup graphicsapi
2 %>
3 %> @brief BioMarker Table
4 %>
5 %> This is old code that is still in use for its ability to draw the "Peak Location" plots
6 %>
7 %> It was originally a class to facilitate biomarker comparison between different datasets/methods. It can draw the
8 %> "grades" curves (e.g. loadings, p-values, feature frequency histograms) and Peak Location Plots thereof.
9 %>
10 %> It needs a lot of setup to work, so it is probably better to use @ref draw_loadings_pl.m instead. The classes @ref vis_loadings and
11 %> have an option to visualize loadings/grades vectors as "Peak Location" plots @ref vis_log_grades
12 %>
13 %> If want to use this class directly, use @ref demo_bmtable.m as a template to perform the following settings:
14 %> <ol>
15 %> <li>Assign @c blocks, @c datasets, @c peakdetectors, @c arts, @c units, and @c data_hint (optional)</li>
16 %> <li>Setup the @c grid property</li>
17 %> <li>Call draw_pl() or draw_lines()</li>
18 %> </ol>
19 %>
20 %> @sa draw_loadings_pl.m, demo_bmtable.m
21 %>
22 classdef bmtable
23  properties
24  %> 2D struct
25  %>
26  %> @c i_block, @c i_dataset, @c i_peakdetector, @c i_art, @c i_unit point to elements in respective properties;
27  %> @c flag_sig indicated whether to draw significance threshold line; @c params if passed to get_gradeslegend() and
28  %> get_grades() (please note: post-training!); @c peakidxs, @c peak_y, @c y are calculated with shake_grid().
29  grid = struct('i_block', {}, 'i_dataset', {}, 'i_peakdetector', {}, 'i_art', {}, 'i_unit', {}, 'params', {}, 'flag_sig', {}, ...
30  'peakidxs', {}, 'peak_y', {}, 'y', {});
31  %> array of irdata.
32  %>
33  %> datasets are used only if @ref rowname_type is 'dataset'. They are used to get row names (will be dataset.title)
34  %>
35  %> If not used, <code>grid.i_dataset</code> will be irrelevant.
36  datasets;
37  %> Cell of @ref block objects
38  blocks;
39  %> Cell of @ref peakdetector objects
40  peakdetectors;
41  %> Cell of @ref bmart objects
42  arts;
43  %> Cell of @ref bmunit objects
44  units;
45  %> Vector of indexes. As many elements as @c grid rows. Each element is the index of a grid column.
46  sig_j;
47  %> Significance level. Maybe the granularity of this will change (doubt it).
48  sig_threshold = -log10(0.05);
49  %> Vector of indexes. As many elements as @c grid rows. Each element is the index of a grid column.
50  rowname_j;
51  %> ='dataset'. May be @c 'dataset' or 'block'
52  rowname_type = 'dataset';
53  %> ='dataset'. May be @c 'dataset' or 'block'
54  colname_type = 'block';
55  %> Used to draw the hint spectrum
56  data_hint;
57  %> =3.5 Width for lineas and markers. Note that this number will be actually multiplied by the global SCALE.
58  linewidth = 3.5;
59  %> =0. Whether or not to train the blocks
60  flag_train = 0;
61  end;
62 
63  properties(SetAccess=protected)
64 % %> Dimensions (number of datasets) X (number of blocks)
65 % trainedblocks;
66  %> Row-wise information.
67  rowdata;
68  %> Column-wise information.
69  coldata;
70  %> Whether the x-axis is reverse or not
71  flag_reverse = 0;
72  end;
73 
74 
75  properties(SetAccess=protected)
76  flag_booted = 0;
77  flag_data = 0;
78  end;
79 
80  methods
81  function o = bmtable()
82 % o.classtitle = 'BMTable';
83 % o.flag_ui = 0; % Not published in GUI
84  end;
85 
86  function o = check_booted(o)
87  if ~o.flag_booted
88  o = o.boot();
89  end;
90  end;
91 
92  function o = boot(o)
93  o.flag_data = ~isempty(o.datasets);
94  o = o.shake_grid();
95  o = o.calc_cols();
96  end;
97 
98  %-------------------------------------------------------------------------------------------------------------------------------
99 
100  %> Draws all the grades curves from one row of the grid
101  %>
102  %> This function draws the grades for each item of one given row of the @ref bmtable::grid. Each grade is drawn separately, creating
103  %> a multi-panel figure; however, it does not use sub-plots; instead, it draws the whole figure from scratch in one single box-less
104  %> plot area.
105  function o = draw_lines(o, i_row)
106  o = o.check_booted();
107 
108  nj = size(o.grid, 2);
109  flag_sig = ~isempty(o.sig_j) && length(o.sig_j) >= i_row && o.sig_j(i_row) > 0;
110 
111  stuff = struct('ytick', [], 'yticklabel', {}, 'hh', [], 'legends', {});
112  stuff(1).ytick = [];
113 
114  % Determines x-extremities among all x-axes among all blocks in case
115  wn1 = Inf;
116  wn2 = -Inf;
117  for j = 1:nj
118  wn1 = min(wn1, min(o.grid{i_row, j}.x));
119  wn2 = max(wn2, max(o.grid{i_row, j}.x));
120  end;
121 
122  cnt = 1;
123  hhfrank = [];
124  for j = 1:nj
125  cel = o.grid{i_row, j};
126  yformat = o.units{cel.i_unit}.yformat;
127  dl = o.coldata(j);
128  y1 = cy(dl.maxy, dl);
129  y2 = cy(dl.miny, dl);
130 
131  stuff.ytick(end+1) = y1;
132  stuff.yticklabel{end+1} = sprintf(yformat, dl.maxy);
133 
134  % Significance hachure for current box
135  if flag_sig
136  o.draw_significance(o.grid{i_row, o.sig_j(i_row)}, cy([dl.maxy, dl.miny], dl));
137  end;
138 
139  % The grades curve itself
140  stuff = o.draw_line(i_row, j, stuff);
141 
142  % Significance threshold line
143  if flag_sig && o.sig_j(i_row) == j % I.e., the curve that gives the significance level is the very one just drawn.
144  draw_threshold_line([wn1, wn2], cy(o.sig_threshold, dl)); %, [1, 1, 1]*.3);
145  end;
146 
147  box;
148  %Per-curve box
149  plot([wn1, wn2, wn2, wn1, wn1], [y1, y1, y2, y2, y1], '-', 'Color', [1, 1 1]*0, 'LineWidth', scaled(2));
150  hold on;
151  % ???????????????????
152 % plot([wn1, wn2], [1, 1]*y2, '-', 'Color', [1, 1 .1]*0, 'Linewidth', 2);
153  if cnt < nj
154  % plot([wn1, wn2], [1, 1]*dl.axisylim(1), '-k', 'LineWidth', 2);
155  end;
156 
157  cnt = cnt+1;
158 
159  stuff.ytick(end+1) = y2;
160  stuff.yticklabel{end+1} = sprintf(yformat, dl.miny);
161  end;
162 
163 
164 
165  % Fabricates the x ticks
166  xtick = floor(max(wn1, wn2)/100)*100:-100:ceil(min(wn1, wn2)/100)*100;
167  for i = 1:length(xtick);
168  if xtick(i)/200 == floor(xtick(i)/200)
169  hhfrank(end+1) = text(xtick(i), -.05, format_number(xtick(i)), 'HorizontalAlignment', 'center');
170  end;
171  for j = 1:nj
172  dl = o.coldata(j);
173  ymin = cy(dl.miny, dl);
174  ymax = cy(dl.maxy, dl);
175  EHEH_NEGO = .015;
176  plot([1, 1]*xtick(i), ymin+[0, EHEH_NEGO], 'k', 'LineWidth', scaled(2));
177  plot([1, 1]*xtick(i), ymax+[0, -EHEH_NEGO], 'k', 'LineWidth', scaled(2));
178  end;
179  end;
180 
181 
182 
183  % Now fabricates the y ticks
184  xtext = iif(o.flag_reverse, wn2+scaled(3), wn1-scaled(3));
185  for i = 1:length(stuff.ytick)
186  hhfrank(end+1) = text(xtext, stuff.ytick(i), stuff.yticklabel{i}, 'HorizontalAlignment', 'right');
187  end;
188 
189 
190 
191  %---------------
192  set(gca, 'YLim', [-0.005, 1.005]);
193  set(gca, 'XLim', [min(wn1, wn2)-1, max(wn1, wn2)+1]);
194  if o.flag_reverse
195  set(gca, 'XDir', 'reverse');
196  end;
197  legend(stuff.hh, stuff.legends);
198  format_frank(gcf, scaled(1), hhfrank);
199  axis off;
200  set(gcf, 'Color', [1, 1, 1]);
201  end;
202 
203 
204 
205 
206 
207  %-------------------------------------------------------------------------------------------------------------------------------
208 
209  %> Draws the Peak Locations (PL) plot
210  function o = draw_pl(o, flag_wntext, flag_sig)
211  o = o.check_booted();
212 
213  global SCALE;
214  if ~exist('flag_wntext', 'var')
215  flag_wntext = 0;
216  end;
217 
218  if ~exist('flag_sig', 'var')
219  flag_sig = 0;
220  end;
221 
222  MARKER_MAXSIZE = 17*SCALE;
223  MARKER_MINSIZE = 8;
224 
225  [ni, nj] = size(o.grid);
226 
227  % Determines x-extremities among all x-axes among all blocks
228  wn1 = Inf;
229  wn2 = -Inf;
230  for i = 1:ni
231  for j = 1:nj
232  wn1 = min(wn1, min(o.grid{i, j}.x));
233  wn2 = max(wn2, max(o.grid{i, j}.x));
234  end;
235  end;
236 
237 
238  hh = [];
239  hout = [];
240 
241  xlim = [floor(round(wn1/50)*50/100)*100, ceil(round(wn2/50)*50/100)*100];
242 
243 
244  ll = struct.empty;
245 
246 
247  % % Significance indication
248  % if flag_sig
249  % for i_dataset = 1:ni
250  % height = i_dataset;
251  %
252  % item = o.items{i_dataset};
253  %
254  %
255  % for i = 1:length(item.bmresults)
256  % if strcmp(item.bmresults{i}.prefix, 'bmresult_p')
257  % bm_significance = item.bmresults{i};
258  % break;
259  % end;
260  % end;
261  %
262  % bmresult_draw_significance(bm_significance, o, [height+.45, height-.45]);
263  % end;
264  % end;
265 
266  if ~isempty(o.data_hint)
267  hint = mean(o.data_hint.X, 1);
268  hint = -hint/max(hint)*.5*ni+ni+1;
269  draw_hint_curve(o.data_hint.fea_x, hint);
270  hold on;
271  end;
272 
273 
274  % Draw the vertical lines which will help identify the wavenumbers
275  if 1
276  for x = ceil(wn1/50)*50:50:floor(wn2/50)*50
277 
278  % vertical bmresult cannot overlap the "natural" matlab tick
279  if x/200 == floor(x/200)
280  uf = 0.17/8*ni;
281  else
282  uf = 0.02/8*ni;
283  end;
284 
285  plot([x, x], [uf, ni+1-uf], '--', 'LineWidth', 1.5*SCALE, 'Color', .5*[1, 1, 1]);
286  hold on;
287  end;
288  end;
289 
290 
291  FLAG_ONEMARKERSCALE = 0;
292 
293  if FLAG_ONEMARKERSCALE
294  miny = Inf;
295  maxy = -Inf;
296  for i = 1:ni
297  for j = 1:nj
298  cel = o.grid{i, j};
299  ycalc = abs(cel.y(cel.peakidxs));
300  miny = min([ycalc(:)', miny]);
301  maxy = max([ycalc(:)', maxy]);
302  end;
303  end;
304  end;
305 
306 
307  % Calculates x for "rowname"
308  xspan = abs(wn2-wn1);
309  xspc = xspan*0.02;
310  xtext = iif(o.flag_reverse, wn2+xspc, wn1-xspc);
311 
312  for i = 1:ni
313  height = i;
314 
315  % Significance hachure for current line
316  flag_sig = ~isempty(o.sig_j) && length(o.sig_j) >= i && o.sig_j(i) > 0;
317  if flag_sig
318  o.draw_significance(o.grid{i, o.sig_j(i)}, [height+.45, height-.45]);
319  end;
320 
321  plot(xlim, height*[1, 1], 'k', 'LineWidth', scaled(3)); % Horizontal line
322  hold on;
323 
324  % "Row name"
325  hh(end+1) = text(xtext, height, o.get_rowname(i), 'HorizontalAlignment', 'right');
326  end;
327 
328 
329  % Makes box before the markers so that the markers appear on top
330  set(gca, 'XTick', ceil(wn1/100)*100:200:ceil(wn2/100)*100);
331  set(gca, 'XLim', [min(wn1, wn2)-1, max(wn1, wn2)+1]);
332  % set(gca, 'XGrid', 'on');
333  % set(gca, 'XMinorGrid', 'on');
334  % set(gca, 'XMinorTick', 'on');
335  set(gca, 'YTick', []); %1:ni);
336  % set(gca, 'YTickLabel', []);
337  set(gca, 'YLim', [0, ni+1]);
338  if o.flag_reverse
339  set(gca, 'XDir', 'reverse');
340  end;
341  set(gca, 'YDir', 'reverse');
342  make_box();
343 
344 
345  for i = 1:ni
346  height = i;
347 
348  for j = 1:nj
349  ll = o.add_legend(i, j, ll);
350  cel = o.grid{i, j};
351  art = o.arts{cel.i_art};
352  y = cel.y(cel.peakidxs);
353  ycalc = abs(y);
354  if sum(y == Inf) == numel(y)
355  ycalc(y == Inf) = 0;
356  else
357  ycalc(y == Inf) = max(y(y ~= Inf));
358  end;
359  x = cel.x(cel.peakidxs);
360  no_markers = length(x);
361 
362  if max(ycalc) ~= min(ycalc)
363  if ~FLAG_ONEMARKERSCALE
364  miny = min(ycalc);
365  maxy = max(ycalc);
366  end;
367  markersizes = (ycalc-miny)/(maxy-miny)*(MARKER_MAXSIZE-MARKER_MINSIZE)+MARKER_MINSIZE;
368  else
369  markersizes = ones(1, no_markers)*MARKER_MAXSIZE;
370  end;
371 
372  for i_marker = 1:no_markers
373  % Plots the markers
374  htemp = plot(x(i_marker), height, 'LineStyle', 'none', 'Marker', art.marker, 'Color', art.color, ...
375  'MarkerSize', markersizes(i_marker)*art.markerscale, 'LineWidth', o.linewidth*SCALE); %, 'MarkerFaceColor', 'w');
376  if flag_wntext
377  text(x(i_marker), height-.1, sprintf('%4.0f', x(i_marker)));
378  end;
379  end;
380  end;
381  end;
382 
383  o.make_legend(ll);
384  format_frank(gcf, scaled(1), hh);
386  end;
387  end;
388 
389 
390 
391 
392  %=================================================================================================================================
393 
394 
395 
396 
397  % Lower-level stuff
398  methods(Access=protected)
399  %> Draws a line an updates 'stuff' structure. This structure contains yticks, yticklabels,
400  %> handles for legends and legend texts
401  function stuff = draw_line(o, i, j, stuff)
402  global SCALE;
403  cel = o.grid{i, j};
404  dl = o.coldata(j);
405  art = o.arts{cel.i_art};
406 
407  ypeaks = protect_against_inf(cel.y);
408 
409 
410  % Draws the curve <----------------------------
411  if ~o.units{cel.i_unit}.flag_hist
412  % htemp will be used for legend if there is no peak idx
413  htemp = plot(cel.x, cy(cel.y, dl), 'Color', art.color, 'LineWidth', o.linewidth*SCALE);
414  else
415  htemp = stem(cel.x, cy(cel.y, dl), 'Color', art.color, 'LineWidth', o.linewidth*SCALE*1.5, 'Marker', 'none', 'BaseValue', cy(0, dl));
416  end;
417  hold on;
418 
419  % Zero line
420  if o.units{cel.i_unit}.flag_zeroline
421  plot([cel.x(1), cel.x(end)], [1, 1]*cy(0, dl), 'Color', art.color, 'LineWidth', o.linewidth*SCALE);
422  stuff.ytick(end+1) = cy(0, dl);
423  stuff.yticklabel{end+1} = '0';
424  end;
425 
426  % Legend: tries to use marker as symbol, otherwise the line
427  if ~isempty(cel.peakidxs)
428  stuff.hh(end+1) = plot(cel.x(cel.peakidxs), cy(ypeaks(cel.peakidxs), dl), ...
429  'Color', art.color, 'Marker', art.marker, 'LineWidth', o.linewidth*SCALE, 'MarkerSize', 15*sqrt(SCALE), 'LineStyle', 'none' ...
430  );
431  else
432  stuff.hh(end+1) = htemp;
433 
434  end;
435  if strcmp(o.colname_type, 'dataset')
436  if isempty(o.datasets)
437  irerror('Wants to take legend from dataset, but datasets property is empty!');
438  end;
439  stuff.legends{end+1} = o.datasets(cel.i_dataset).title;
440  elseif strcmp(o.colname_type, 'block')
441  stuff.legends{end+1} = o.get_gradeslegend(cel);
442  end;
443  end;
444 
445 
446 
447  function o = draw_significance(o, cel, yy)
448  y1 = yy(1);
449  y2 = yy(2);
450  flagg = cel.y >= o.sig_threshold;
451 
452  spc = abs(cel.x(2)-cel.x(1));
453 
454  % Non-significant intervals will ba hatched
455  flag_in = 0; % Inside a non-significant
456  for i = 1:length(flagg)+1
457  if flag_in && (i > length(flagg) || flagg(i))
458  flag_in = 0;
459  draw_hachure([cel.x(i-1)-spc/4, y2, abs(cel.x(mark)-cel.x(i-1))+spc/2, y1-y2]);
460  hold on;
461  elseif ~flag_in && i <= length(flagg) && ~flagg(i)
462  flag_in = 1;
463  mark = i;
464  end;
465  end;
466 
467  hold on;
468  end;
469 
470 
471  %> Empowers grid with calculated fields
472  %>
473  %> <h3>grid.params</h3>
474  %> Grid cell parameters have defaults "idx_fea"=1 and "flag_abs"=1
475  function o = shake_grid(o)
476 
477  [ni, nj] = size(o.grid);
478  for i = 1:ni
479  for j = 1:nj
480  cel = o.grid{i, j};
481 
482  if ~isempty(cel.params)
483  cel.params = setbatch(struct(), cel.params); % Converts {name, value, ...} into proper fields
484 
485  if ~isfield(cel.params, 'idx_fea')
486  cel.params.idx_fea = 1;
487  end;
488  if ~isfield(cel.params, 'flag_abs')
489  cel.params.flag_abs = 1;
490  end;
491  end;
492 
493  cel.block = o.get_initialblock(cel);
494  if o.flag_data && o.flag_train
495  cel.block = cel.block.boot();
496  cel.block = cel.block.train(o.datasets(cel.i_dataset));
497  end;
498 
499  cel.y = o.get_grades(cel);
500  cel.x = o.get_grades_x(cel);
501  if cel.i_peakdetector > 0 && numel(o.peakdetectors) > 0
502  pd = o.peakdetectors{cel.i_peakdetector};
503  pd = pd.boot(cel.x, cel.y);
504  cel.peakidxs = pd.use([], cel.y);
505  else
506  cel.peakidxs = [];
507  end;
508  o.grid{i, j} = cel;
509 
510  if i == 1 && j == 1
511  o.flag_reverse = cel.x(1) > cel.x(end);
512  end;
513  end;
514  end;
515  end;
516 
517 
518 
519  %> Calculations before draw_lines()
520  %>
521  %> First pass finds minima and maxima for each column across all rows. This will ensure that all draw_lines() (using one row only)
522  %> will nevertheless use y-scales that will be the same for any row wich which draw_lines() is called.
523  %>
524  %> Second pass will transfer the minima and maxima to absolute graphical coordinates, as I am not using subplots, but drawing the
525  %> figure from scratch instead
526  function o = calc_cols(o)
527  [ni, nj] = size(o.grid);
528 
529  % First pass: Searches for maximum and minimum over all row cases of method j
530  for j = 1:nj
531  maxy = -Inf;
532  miny = Inf;
533  for i = 1:ni
534  ytemp = protect_against_inf(o.grid{i, j}.y);
535 % ytemp(ytemp == Inf) = 0; % This intervention prevents log(0) from flattening some scale
536 
537  maxy = max(maxy, max(ytemp));
538  miny = min(miny, min(ytemp));
539 
540  if o.units{o.grid{i, j}.i_unit}.flag_zeroline || o.units{o.grid{i, j}.i_unit}.flag_zero
541  miny = min(miny, 0);
542  maxy = max(maxy, 0);
543  end;
544  end;
545 
546 
547  o.coldata(j).maxy = maxy;
548  o.coldata(j).miny = miny;
549  end;
550 
551 
552  FRAMEPERC = .85;
553  spacing = (1-FRAMEPERC)/(nj-1);
554  height = FRAMEPERC/nj;
555 
556  % Second pass: calculates absolute y limits, offsets and scales
557  ypos = 0;
558  for j = nj:-1:1
559  o.coldata(j).scale = 1/(o.coldata(j).maxy-o.coldata(j).miny)*FRAMEPERC/nj;
560  o.coldata(j).offset = ypos;
561 
562  if j == nj
563  a1 = 0;
564  else
565  a1 = spacing/2;
566  end;
567  if j == 1
568  a2 = 0;
569  else
570  a2 = spacing/2;
571  end;
572  o.coldata(j).axisylim = [ypos-a1, ypos+height+a2];
573 
574  ypos = ypos+height+spacing;
575  end;
576  end;
577 
578  %> Makes legends: plots the markers then calls the legend() function passing the appropriate handles to it.
579  %>
580  %> Currently used only by the PL plot. draw_lines() does not use it
581  function o = make_legend(o, ll)
582  global SCALE;
583  n = numel(ll);
584  ss = cell(1, n); % strings
585  hh = zeros(1, n); % handles
586  for i = 1:n
587  cel = o.grid{ll(i).i, ll(i).j};
588  art = o.arts{cel.i_art};
589  % plots somewhere out of the plot area, just to give the handle to legend()
590  hh(i) = plot(0, 10, 'Marker', art.marker, 'Color', art.color, 'MarkerSize', 10, 'LineWidth', o.linewidth*SCALE, 'LineStyle', 'none');
591 
592 
593  if strcmp(o.colname_type, 'dataset')
594  ss{i} = o.datasets(cel.i_dataset).title;
595  elseif strcmp(o.colname_type, 'block')
596  ss{i} = o.get_gradeslegend(cel);
597  end;
598  end;
599  legend(hh, ss);
600  end;
601 
602 
603  %> Checks if new (block, params) case is found; if not, adds case
604  function ll = add_legend(o, i, j, ll)
605  cel = o.grid{i, j};
606  flag_found = 0;
607  if numel(ll) > 0
608  idxs = find([ll.i_block] == cel.i_block);
609  for idx = idxs
610  if compare(cel.params, ll(idx).params)
611  flag_found = 1;
612  break;
613  end;
614  end;
615  end;
616  if ~flag_found
617  ll(end+1).i_block = cel.i_block;
618  ll(end).params = cel.params;
619  ll(end).i = i;
620  ll(end).j = j;
621  end;
622  end;
623 
624 
625  function z = get_rowname(o, i)
626  if ~isempty(o.rowname_j)
627  j = o.rowname_j(i);
628  else
629  j = 1;
630  end;
631  cel = o.grid{i, j};
632  z = 'Undefined';
633  switch o.rowname_type
634  case 'dataset'
635  z = o.datasets(cel.i_dataset).title;
636  case 'block'
637  z = o.get_gradeslegend(cel);
638  end;
639  end;
640 
641  function blk = get_initialblock(o, cel)
642  blk = o.blocks{cel.i_block};
643  end;
644 
645  %>
646  %>
647  %> <h3>fcon_linear</h3>
648  %> Sensitive to "idx_fea"=1 and "flag_abs"=1 in @c params
649  function g = get_grades(o, cel)
650  blk = cel.block;
651  params = cel.params;
652 
653  if isa(blk, 'fcon_linear') || isa(blk, 'block_cascade_base')
654  g = blk.L(:, params.idx_fea)';
655  if params.flag_abs
656  g = abs(g);
657  end;
658  elseif isa(blk, 'fsel')
659  if ~isempty(blk.grades)
660  g = blk.grades;
661  else
662  g = zeros(1, numel(blk.grades_x));
663  g(blk.v) = 1;
664  end;
665  end;
666  end;
667 
668 
669  function x = get_grades_x(o, cel)
670  blk = cel.block;
671 % params = cel.params;
672 
673  if isa(blk, 'fcon_linear') || isa(blk, 'block_cascade_base')
674  x = blk.L_fea_x;
675  elseif isa(blk, 'fsel')
676  x = blk.fea_x;
677  else
678  irerror(sprintf('Cannot get grades x for object of class "%s"', class(blk)));
679  end;
680  end;
681 
682  %> @brief Grades legend for cell
683  %>
684  %> Backwards, calls of get_L_fea_names(), then sequence of get_description calls
685  %>
686  %> others: makes default with idx_fea and flag_abs
687  function s = get_gradeslegend(o, cel)
688  blk = cel.block;
689  params = cel.params;
690 
691  s = blk.get_description();
692  if isa(blk, 'block_cascade_base') || isa(blk, 'fcon_linear')
693  names = blk.get_L_fea_names(params.idx_fea);
694  s = cat(2, s, ' ', names{1});
695  end;
696  end;
697  end;
698 end
Feature Construction - Linear Transformations base class.
Definition: fcon_linear.m:2
Feature Selection (FSel) class.
Definition: fsel.m:4
function compare(in o1, in o2)
function make_box()
Representation of a Unit.
Definition: bmunit.m:5
function irerror(in s)
Dataset class.
Definition: irdata.m:30
Peak Detector.
Definition: peakdetector.m:6
Art stuff for BioMarker Tables.
Definition: bmart.m:5
function setbatch(in o, in params)
Base Block class.
Definition: block.m:2
function boot(in o)
Configures the structure to deal with new type of data.
function draw_hint_curve(in x, in y, in color)
function draw_threshold_line(in x, in y, in width, in color)
function scaled(in i)
Property grid
Definition: bmtable.m:31
Visualization - Grades vector calculated by any as_grades.
Definition: vis_log_grades.m:4
function iif(in cond, in x1, in x2)
function resize_legend_markers(in size, in flag_line)
function cy(in y, in dl)
Visualization - Loadings plots or Peak Location plots for loadings vectors.
Definition: vis_loadings.m:4
function format_frank(in F, in scale, in handles)
Analysis Session (AS) base class.
Definition: as.m:6
BioMarker Table.
Definition: bmtable.m:22
function protect_against_inf(in y)
function format_number(in n)
Cascade block: sequence of blocks represented by a block.
function draw_hachure(in position)
function draw_loadings_pl(in x, in L, in x_hint, in hint, in legends, in flag_abs, in peakd, in colorindexes)