![]() |
IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
|
BioMarker Table.
This is old code that is still in use for its ability to draw the "Peak Location" plots
It was originally a class to facilitate biomarker comparison between different datasets/methods. It can draw the "grades" curves (e.g. loadings, p-values, feature frequency histograms) and Peak Location Plots thereof.
It needs a lot of setup to work, so it is probably better to use draw_loadings_pl.m instead. The classes vis_loadings and have an option to visualize loadings/grades vectors as "Peak Location" plots vis_log_grades
If want to use this class directly, use demo_bmtable.m as a template to perform the following settings:
blocks, datasets, peakdetectors, arts, units, and data_hint (optional) grid property Public Member Functions | |
| function | bmtable () |
| function | check_booted (in o) |
| function | boot (in o) |
| function | draw_lines (in o, in i_row) |
| function | draw_pl (in o, in flag_wntext, in flag_sig) |
| Draws the Peak Locations (PL) plot. More... | |
Public Attributes | |
| Property | grid |
| Property | datasets |
| Property | blocks |
| Cell of block objects. More... | |
| Property | peakdetectors |
| Cell of peakdetector objects. More... | |
| Property | arts |
| Cell of bmart objects. More... | |
| Property | units |
| Cell of bmunit objects. More... | |
| Property | sig_j |
Vector of indexes. As many elements as grid rows. Each element is the index of a grid column. More... | |
| Property | sig_threshold |
| Significance level. Maybe the granularity of this will change (doubt it). More... | |
| Property | rowname_j |
Vector of indexes. As many elements as grid rows. Each element is the index of a grid column. More... | |
| Property | rowname_type |
='dataset'. May be 'dataset' or 'block' More... | |
| Property | colname_type |
='dataset'. May be 'dataset' or 'block' More... | |
| Property | data_hint |
| Used to draw the hint spectrum. More... | |
| Property | linewidth |
| =3.5 Width for lineas and markers. Note that this number will be actually multiplied by the global SCALE. More... | |
| Property | flag_train |
| =0. Whether or not to train the blocks More... | |
Protected Member Functions | |
| function | draw_line (in o, in i, in j, in stuff) |
| function | draw_significance (in o, in cel, in yy) |
| function | shake_grid (in o) |
| function | calc_cols (in o) |
| function | make_legend (in o, in ll) |
| function | add_legend (in o, in i, in j, in ll) |
| Checks if new (block, params) case is found; if not, adds case. More... | |
| function | get_rowname (in o, in i) |
| function | get_initialblock (in o, in cel) |
| function | get_grades (in o, in cel) |
| function | get_grades_x (in o, in cel) |
| function | get_gradeslegend (in o, in cel) |
| Grades legend for cell. More... | |
Protected Attributes | |
| Property | rowdata |
| Row-wise information. More... | |
| Property | coldata |
| Column-wise information. More... | |
| Property | flag_reverse |
| Whether the x-axis is reverse or not. More... | |
| Property | flag_booted |
| Property | flag_data |
| function bmtable::bmtable | ( | ) |
|
protected |
Checks if new (block, params) case is found; if not, adds case.
| function bmtable::boot | ( | in | o | ) |
|
protected |
Calculations before draw_lines()
First pass finds minima and maxima for each column across all rows. This will ensure that all draw_lines() (using one row only) will nevertheless use y-scales that will be the same for any row wich which draw_lines() is called.
Second pass will transfer the minima and maxima to absolute graphical coordinates, as I am not using subplots, but drawing the figure from scratch instead
| function bmtable::check_booted | ( | in | o | ) |
|
protected |
Draws a line an updates 'stuff' structure. This structure contains yticks, yticklabels, handles for legends and legend texts
| function bmtable::draw_lines | ( | in | o, |
| in | i_row | ||
| ) |
Draws all the grades curves from one row of the grid
This function draws the grades for each item of one given row of the bmtable::grid. Each grade is drawn separately, creating a multi-panel figure; however, it does not use sub-plots; instead, it draws the whole figure from scratch in one single box-less plot area.
| function bmtable::draw_pl | ( | in | o, |
| in | flag_wntext, | ||
| in | flag_sig | ||
| ) |
Draws the Peak Locations (PL) plot.
|
protected |
|
protected |
Sensitive to "idx_fea"=1 and "flag_abs"=1 in params
|
protected |
|
protected |
Grades legend for cell.
Backwards, calls of get_L_fea_names(), then sequence of get_description calls
others: makes default with idx_fea and flag_abs
|
protected |
|
protected |
|
protected |
Makes legends: plots the markers then calls the legend() function passing the appropriate handles to it.
Currently used only by the PL plot. draw_lines() does not use it
|
protected |
Empowers grid with calculated fields
Grid cell parameters have defaults "idx_fea"=1 and "flag_abs"=1
|
protected |
| Property bmtable::colname_type |
| Property bmtable::data_hint |
| Property bmtable::datasets |
array of irdata.
datasets are used only if rowname_type is 'dataset'. They are used to get row names (will be dataset.title)
If not used, grid.i_dataset will be irrelevant.
|
protected |
| Property bmtable::flag_train |
| Property bmtable::grid |
2D struct
i_block, i_dataset, i_peakdetector, i_art, i_unit point to elements in respective properties; flag_sig indicated whether to draw significance threshold line; params if passed to get_gradeslegend() and get_grades() (please note: post-training!); peakidxs, peak_y, y are calculated with shake_grid().
| Property bmtable::linewidth |
| Property bmtable::peakdetectors |
Cell of peakdetector objects.
| Property bmtable::rowname_j |
| Property bmtable::rowname_type |
| Property bmtable::sig_j |
| Property bmtable::sig_threshold |