Filter Widgets
Five new classes are defined the beginning of gui.py.
Four of them are used to define the widgets that control filter parameters:
- BlockSizeFilterWidget is an integer range slider to specify minimum and maximum block sizes
- BlockLengthFilterWidget is another integer range slider, for block lengths
- CoverageFilterWidget is a single-value integer slider
- SupportFilterWidget is a checkbox that is either on or off
The initialization methods for each widget defines the widget's name (which will be displayed above the widget when it is shown in the GUI) and sets its initial values.
Initialization methods are also passed a reference to a SNPFilter object that has the code that will do the actual filtering before a chromosome is displayed. When a filter widget is updated (e.g. when the user moves a slider) a "callback function" is activated. The function will record the new setting in the SNPFilter so it is used the next time the filter is called.
The fifth class, called FilterBox, is a type of widget called a "layout". It provides a way to collect all the filter widgets in a single location and provides a common interface to all the filters.
FilterBox
Bases: Column
A FilterBox is a column layout that has labels and an instance of each of the filter widgets.
in the order they will be displayed.
| Parameters: |
|
|---|
Source code in src/xo/gui.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | |
widgets()
Return a list of filter widgets.
Source code in src/xo/gui.py
275 276 277 278 279 | |
BlockSizeFilterWidget
Bases: IntRangeSlider
Use an integer range slider to provide settings for the filter based on the count of the number of SNPs in a block.
Source code in src/xo/gui.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
filter_cb()
Callback activated when the slider changes. Saves the new slider settings in the filter object.
Source code in src/xo/gui.py
53 54 55 56 57 58 | |
BlockLengthFilterWidget
Bases: IntRangeSlider
Use an integer range slider to provide settings for the filter based on length of a block, defined as the number of bases between the first and last SNP.
Source code in src/xo/gui.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
filter_cb()
Callback activated when the slider changes. Saves the new slider settings in the filter object.
Source code in src/xo/gui.py
84 85 86 87 88 89 | |
CoverageFilterWidget
Bases: IntSlider
Use an integer slider to display the coverage cutoff value.
Source code in src/xo/gui.py
97 98 99 100 101 102 103 104 105 106 107 108 109 | |
filter_cb()
Callback activated when the slider changes. Saves the new slider settings in the filter object.
Source code in src/xo/gui.py
111 112 113 114 115 116 | |
SupportFilterWidget
Bases: Checkbox
Use a checkbox to tell the filter to keep SNPs if the base genome column matches the HMM state column.
Source code in src/xo/gui.py
125 126 127 128 129 130 131 132 133 134 | |
filter_cb()
Callback activated when the slider changes. Saves the new slider settings in the filter object.
Source code in src/xo/gui.py
136 137 138 139 140 141 | |