samsifter.gui package

Widgets, dialogs and corresponding data containers for the SamSifter GUI.

composites module

Composed widgets used to visualize filter parameters in a vertical form layout.

class FileChooser(parent=None, suffix_string='CSV files (*.csv *.CSV)')[source]

Bases: PyQt4.QtGui.QWidget

Combined LineEdit and Pushbutton for standard file dialog to select a file.

get_filename()[source]
get_suffix_string()[source]
highlight(boolean=True)[source]

Indicates errors or pending actions by changing background color.

Parameters:boolean (bool, optional) – Enable highlighting of the QlineEdit widget, defaults to True.
set_filename(filename)[source]

Sets a new filename.

Maintains cursor position and validates the input on the fly. Tooltips and highlights of the QLineEdit widget are set to help resolving potential errors.

Parameters:filename (str) – Path to existing and readable input file.
set_suffix_string(suffix_string)[source]
show_dialog()[source]

Opens OS-specific file selection dialog in user’s home directory.

class OptionSwitcher(parent=None, options=(True, False))[source]

Bases: PyQt4.QtGui.QWidget

Group of coupled radio buttons to choose between exclusive options.

Defaults to a simple True or False switch but arbitrary lists of options are supported and their options internally referenced by list indices. The first option in a list is considered the default value.

get_current_index()[source]
get_options()[source]
set_current_index(index)[source]
set_options(options)[source]
class SliderSpinboxCombo(parent=None, minimum=0.0, maximum=100.0, default=0.0, precision=2)[source]

Bases: PyQt4.QtGui.QWidget

Slider coupled with Spinbox for setting numerical values between a minimum and maximum.

denormalize(value)[source]

Translates normalized slider values to absolute spinbox values.

Parameters:value (float) – Current value of slider widget.
get_value()[source]
normalize(value)[source]

Translates absolute spinbox values to normalized slider values.

Parameters:value (float) – Current value of spinbox widget.
on_slider_value_change(value)[source]

Handle changes to the slider value.

Parameters:value (float) – New value of slider widget.
on_spinner_value_change(value)[source]

Handle changes to the spinbox value.

Parameters:value (float) – New value of spinbox widget.
set_value(value)[source]

dialogs module

Dialogs to configure options for Bash script export and SAM2RMA.

This module also includes container objects for the specified options.

class BashOptions(use_basenames=True, processing_mode=3, print_commands=False, stop_on_error=True)[source]

Bases: builtins.object

Options for the export of a workflow to a bash script.

PARALLEL_MODE = 3
SEQUENTIAL_MODE = 2
SINGLE_MODE = 1
get_print_commands()[source]
get_processing_mode()[source]
get_stop_on_error()[source]
get_use_basenames()[source]
set_print_commands(boolean=True)[source]
set_processing_mode(mode=3)[source]
set_stop_on_error(boolean=True)[source]
set_use_basenames(boolean=False)[source]
class BashOptionsDialog(parent=None)[source]

Bases: PyQt4.QtGui.QDialog

Modal dialog to set Bash script export options.

Switches between three types of processing modes and sets the Bash options to print executed commands and/or stop on errors.

The available processing modes are:

  1. Single Mode processes only the specified input file and produces the specified output file similar to running the workflow in the GUI. This mode should be used with unmodified filenames unless all input files are located in the same directory as the exported bash script.
  2. Sequential Mode processes a list of arbitrary input files one file after another and saves the output to files renamed with the filename extension sifted. This mode should be used with shortened filenames unless all of the required list files (CSV) are available at identical paths from all machines that this script is deployed to.
  3. Parallel Mode speeds up the process by distributing jobs across all available CPU cores and running them in parallel. This requires the installation of GNU parallel. Similar to sequential mode above it should be used with shortened filenames unless all of the required list files (CSV) are available at identical paths from all machines that this script is deployed to.
get_options()[source]

Shows dialog and returns options unless user decides to cancel.

Returns:New Bash export settings.
Return type:BashOptions
save_options()[source]

Stores current settings in BashOptions object to be returned.

Closes the dialog when done.

class RmaOptions(sam2rma_path='/usr/local/megan/tools/sam2rma', top_percent=1, max_expected=0.01, min_score=50, min_support_percent=0.05, min_support=1)[source]

Bases: builtins.object

Options for the conversion of SAM to RMA files.

Based on the command line arguments of SAM2RMA released with MEGAN 5.8.3. Sets default options as used by the Krause Lab in February 2015.

get_max_expected()[source]
get_min_score()[source]
get_min_support()[source]
get_min_support_percent()[source]
get_sam2rma_path()[source]
get_top_percent()[source]
set_max_expected(max_expected)[source]
set_min_score(min_score)[source]
set_min_support(min_support)[source]
set_min_support_percent(min_support_percent)[source]
set_sam2rma_path(sam2rma_path)[source]
set_top_percent(top_percent)[source]
class RmaOptionsDialog(saved_options=None, parent=None)[source]

Bases: PyQt4.QtGui.QDialog

Modal dialog to set SAM2RMA conversion settings.

get_options()[source]

Shows dialog and returns options unless user decides to cancel.

Returns:New SAM2RMA settings.
Return type:RmaOptions
reset_form()[source]

Resets all form elements to defaults.

save_options()[source]

Stores current settings in BashOptions object to be returned.

Closes the dialog when done.

widgets module

Widgets for the main component of the SamSifter GUI representing workflows.

class FilterWidget(item, parent=None)[source]

Bases: PyQt4.QtGui.QWidget

Representation of a filter action in GUI.

Shows name, description and input/output requirements for filter items. Further provides a simple way to edit settings for all parameters of a tool or filter. Parameters are divided between two tabs for a) required and b) optional parameters and the focus is set on the required parameters.

add_parameter(parameter)[source]

Adds specific composite widget to the parameter form.

Chooses the widget based on type of parameter and divides them between the required and the optional tab depending on parameter settings.

Parameters:parameter (FilterParameter) – Filter parameter to be displayed.
on_value_change(value)[source]

Handles changes to editor values by emitting another signal.

value_changed
class InputWidget(parent=None)[source]

Bases: PyQt4.QtGui.QWidget

Representation of file input action in GUI.

Provides a way to specify the input file for the workflow.

highlight(boolean=True)[source]

Indicates errors or pending actions by changing background color.

Parameters:boolean (bool) – Activate highlighting of errors, defaults to True.
set_filename(filename)[source]

Update filename in text box.

Retains current cursor position despite updates.

Parameters:filename (str) – Readable path to an existing directory for the existing input file.
show_dialog()[source]

Opens OS-specific file selection dialog to set the input file.

class OutputWidget(parent=None)[source]

Bases: PyQt4.QtGui.QWidget

Representation of file output action in GUI.

Provides a way to specify an output file for the workflow and set options for post-processing, eg. the compilation of statistics files and creation of an RMA file.

highlight(boolean=True)[source]

Indicates errors or pending actions by changing background color.

Parameters:boolean (bool) – Activate highlighting of errors, defaults to True.
set_filename(filename)[source]

Updates filename in text box.

Retains current cursor position despite updates.

Parameters:filename (str) – Writable path to an existing directory for the new output file.
show_dialog()[source]

Opens OS-specific file selection dialog to specify output file.

Table Of Contents

Previous topic

samsifter.tools package

Next topic

samsifter.models package

This Page