trifusion.app module¶
-
class
trifusion.app.
TriFusionApp
(**kwargs)[source]¶ Bases:
kivy.app.App
Attributes
directory
New in version 1.0.7.
name
New in version 1.0.7.
proxy_ref
Default implementation of proxy_ref, returns self. root_window
New in version 1.9.0.
uid
user_data_dir
New in version 1.7.0.
active_group active_group_name alignment_list current_lgd dataset_file export_mode fancy_bt file_overwrite old_mouse_over ortho_groups ortho_search_options orto_search_height plt_patch prev_tb previous_stats_toggle process_grid_wgt process_height process_options screen stats_summary stats_table touch Methods
add_bookmark_bt
(bk, wgt, fc_wgt[, name, ...])This will add a bookmark button, along with its removal button. add_dataset_bt
(bt, wgt, ds_type)Method for addition of a button to a widget. add_project_bt
(name, file_num, ds_type, grid_wgt)Wrapper that adds a project button to the sidepanel :param name: string, name of the project :param file_num: int, number of files associated with project :param ds_type: string, type of dataset. apply_property
Adds properties at runtime to the class. bind
Bind an event type or a property to a callback. bookmark_init
(wgt, dev_wgt, fc_wgt[, ...])This will create a pickle file containing a list with the bookmarks for the file chooser menu. bookmark_load
(value, wgt)Provided a bookmark button object, it loads the bookmark file path that is stored in the button id. build
()build_config
(config)New in version 1.0.7.
build_settings
(settings)New in version 1.0.7.
change_taxa_name
(old_name, new_name)Changes the taxa name on a double tap check_action
(text, func[, bt_wgt, args, ...])General purpose method that pops a dialog checking if the user wants to perform a certain action. check_file
(path, file_name, idx[, bw])Method used by some filechooser dialogs. check_filters
(value)Method that validates the input of the text input in filter settings. check_partition_split
(value, prange)Method that validates the text input for manual split of partitions. check_partitions_file
()This will make some checks on the partitions file provided by the user. check_variation_filters
(value)Same function as check_filters method, but checks only for clear_orto_input
()Clears any input for the orthology screen and related variables and clear_process_input
()Clears any input for the process/statistics screen and related close_settings
(*largs)Close the previously opened settings panel. create_folder
(text)create_property
Create a new property at runtime. create_settings
()Create the settings panel. destroy_settings
()New in version 1.8.0.
dialog_about
()Dialog with the about information on TriFusion dialog_codonfilter
()Generates dialog for alignment filter in the additional options of dialog_create_group_from_file
(ds_type)Creates a filechooser dialog to select a file containing a taxa/file list that will be used to generate a data set group :param ds_type: string. dialog_dataset_creator
(ds_type[, popup_level])Creates a dialog to choose between creating a data set from a file dialog_exclude_orto_taxa
(plt_idx)dialog_execution
()Generates the dialog for Process execution. dialog_export_graphic
()Creates a filechooser dialog for graphics exportation. dialog_export_groups
()Dialog for group exportation. dialog_export_groups_filechooser
(idx)When clicking Export groups in the main dialog for group exportation, the user is redirected to a filechooser to choose the output directory and output file name, in the case of group exportation. dialog_fasta_extra
()Dialog with extra options for fasta output format dialog_filechooser
([idx, popup_level])Generates a file chooser popup for the user to select an output file dialog_fileoverwrite
(msg)General dialog for querying whether an existing file should be dialog_filter
()Generates the settings popup for filtering options dialog_filter_report
(filtered_stats, nalns)Generates graphic report at the end of a processing operation dialog_floatcheck
(text, t[, dl])Creates a floating label with informative text on the right upper corner of the app. dialog_format
()Creates the dialog containing the buttons to select output formats. dialog_general_info
(idx)Generates the popup with information for several components of the application :param idx: string. dialog_ima2_extra
([popup_level])Dialog with extra options for IMa2 output format dialog_import_groups
()Creates filechooser dialog to select group files to be imported dialog_import_partitions
()Creates a filechooser dialog to select a partition file and import its scheme to the current partition. dialog_inflation
()Creates dialog for inflation values selection dialog_load_partfile
()dialog_mcl_fix
()Opens a dialog with information for fixing the missing MCL executable dialog_nexus_extra
()Dialog with extra options for nexus output format dialog_ortho_filter
()Creates dialog for orthology cluster filters dialog_orto_execution
()Creates and populates the pre-execution dialog for orthology search dialog_orto_setfilter
(group_name)A similar dialog to dialog_ortho_filter but for the explore screen. dialog_partition_files
(partition_name)Shows a popup listing the files associated with a given partition dialog_partitions
(btx)Shows a small widget with partition information dialog_partitions_split
()dialog_phylip_extra
()Dialog with extra options for phylip output format dialog_plot_check_filters
(previous_filt, ...)Dialog that is triggered when exiting a plot screen and the current plot filters are different from the filters before entering the plot screen. dialog_protein_filter
()dialog_remove_from_file
()Creates a filechooser dialog to select a text file containing a list of files or taxa names to be removed in the side panel. dialog_reverse_concatenation
([title])Generates a general purpose file chooser to request additional data dialog_reverse_inlist
()dialog_search_report
(stat_storage, groups)Creates the dialog that reports the results of the Orthology search :param stat_storage: dictionary. dialog_select_from_file
()Creates a filechooser dialog to select a text file containing a list dialog_select_gene
(plt_idx)Generates dialog for selecting gene for single gene plot creation dialog_select_taxa_group
()Shows a subpopup listing the taxa groups that have already been created. dialog_set_exclude_orto_taxa
()Creates a dialog for the orthology change filters option. dialog_taxafilter
()Generates dialog for taxa filter in the additional options of the dialog_taxagroup
(ds_type[, popup_level])Creates the layout for the taxa group creation popup. dialog_text
(title, idx[, msg])Generates a simple text dialog to capture text input :param title: string. dialog_usearch_fix
()Opens a dialog with information for fixing the missing USEARCH dialog_variationfilter
()Generates the settings popup for variation filter options dialog_warning
(msg1, msg2)dialog_zorro
()disengage_groups
()Methods used to unselect all module header buttons, in case the user dismiss_all_popups
(*args)Method that force closes all popups in thre screen dismiss_close_float
(*args)Use to automatically remove any possibly CloseFloat widgets from the dismiss_exit
(*args)Dismiss function for exit popup dismiss_plot_wgt
()Removes plot widgets from the root window dismiss_popup
(*args)General purpose method to close popups from the screen dismiss_stats_toggle
()Removes the stats toggle widget dismiss_subpopup
(*args)General purpose method to close sub-popups from the screen dispatch
Dispatch an event across all the handlers added in bind/fbind(). dispatch_children
dispatch_generic
display_settings
(settings)New in version 1.8.0.
events
Return all the events in the class. export_graphic
(path, file_name, bw)Saves the current plot object into a file based on file name and export_names
(path, file_name)Export the names of buttons in the corresponding tab in the side panel It listens to the self.export_mode attribute, which is a tuple object with the first element being either “file” or “taxa” and the second element as “all” or “selected”. export_table
(path, file_name[, ext, warning_dlg])Saves the current_table list attribute to a .csv file. fbind
A method for advanced, and typically faster binding. funbind
Similar to fbind()
.get_active_group_light
()get_active_sets
([file_set_name, taxa_set_name])Returns a tuple with the file set list as first element and taxa set list as second element. get_application_config
([defaultpath])New in version 1.0.7.
get_application_icon
()Return the icon of the application. get_application_name
()Return the name of the application. get_file_information
([file_name, mode])Similar to get_taxa_information, but generating information for the files in the file tab. get_popup_info
(value)This function determines whether the taxa information has changed since it has been update (when files are removed). get_property_observers
Returns a list of methods that are bound to the property/event get_proteome_information
(proteome_file)Returns informative stats for a given proteome_file :param proteome_file: string. get_running_app
()Return the currently running application instance. get_taxa_information
()This method will gather all available information for all taxa and sets a number of related attributes. get_taxon_information
(tx, aln_list)Akin to the get_taxa_information method, but it only looks for the information of a single taxon. getter
Return the getter of a property. go_carousel
(slide, bt_id)Method used by other buttons outside the side buttons of the side go_previous_screen
()Method that returns to the previous screen, set by go_screen
(idx[, direct])Method used to go to a specific screen by specifying and index and transition direction :param idx: integer. is_event_type
Return True if the event_type is already registered. load_config
()(internal) This function is used for returning a ConfigParser with load_files
([selection, aln_list])Loads the selected input files into the program using the AlignmentList object provided by aln_list. load_files_dragndrop
(*args)This function gives functionality to the drag and drop feature that automatically loads files when droped into the app window. load_files_startup
(file_list)Gives support for loading data into the app when launching the app via command line and providing the files as arguments. load_files_subproc
(files)load_groups
(groups_obj, default_filters)Loads the group files generated by the Orthology search or manually imported into the app. load_kv
([filename])This method is invoked the first time the app is being run if no widget tree has been constructed before for this app. load_plot
(file_path, scatter_wgt)Loads a new plot into a ScatterLayout. load_proteomes
(selection)Similar to load method, but specific for loading proteome files. load_screen
(idx)Loads the current screen according to the corresponding kv file more_stats_table_bts
()Increases the MAX_TABLE_N attribute by 50 and adds more buttons mouse_zoom
(*vals)param vals: touch event list on_config_change
(config, section, key, value)Event handler fired when a configuration token has been changed by the settings page. on_icon
(instance, icon)on_pause
()Event handler called when Pause mode is requested. on_resume
()Event handler called when your application is resuming from the Pause mode. on_start
()Event handler for the on_start event which is fired after initialization (after build() has been called) but before the application has started running. on_stop
()Event handler for the on_stop event which is fired when the application has finished running (i.e. on_title
(instance, title)open_project
(name)Closes the current data set and opens the project identified by name open_settings
(*largs)Open the application settings panel. operation_queue_init
()This will create the skeleton for the tree view of the operations queued for execution in an appropriate screen of the side panel. orthology_card
([group_name, bt])Generates the descriptive cards with general information for a group file. orthology_clear_options
()Resets orthology search options to default values orthology_search_exec
()Main function that executes all queued procedures of the orthology orto_change_state
()Toggle selection or deselection of group checkboxes orto_check_state
()sets the “Compare” button disabled attribute according to the orto_compare_groups
([groups_objs, ...])Switches to the orthology group comparison screen and presents the initial plot comparing total orthologs across group files :param groups_objs: MultiGroupLight object. orto_export_groups
(export_idx[, output_dir, ...])This will handle the group exportation of the orthology screen. orto_generate_report
(out_dir[, ns])Generates full orthology report on the specified directory. orto_report_dialog
()Generates a filechooser upon clicking on the “Generate full report” button in Orthology Explore. orto_show_plot
(active_group, plt_idx[, ...])Loads a orto_plot screen for orthology graphical exploration based on the plot index. orto_write_plot
(plot_data, plt_idx)Provide with the data structure and a plt_idx string identifier, this function will create the plot file and update the plot screen. partitions_change_name
(partition_name, new_name)Changes name of a partition partitions_import_scheme
(partition_file)Imports partitions in partition_file and applies to the alignment_list partition object. partitions_merge
(name)Merge active partitions partitions_merge_dialog
()Dialog that appears when clicking merge partitions asking for the partitions_split
([new_range, new_names])Split an active partition populate_input_files
([mode])This method grabs the input files that were selected in the populate_partitions
()Populates the partitions tab in the side bar from the partitions object associated with alignment objects. populate_species
()This method grabs the taxa names from the input files that were populate_stats_footer
(footer)Populates the footer of the Statistics screen with information on popup_info
(value)Generates the pop up information content for the pressed taxa or process_clear_options
()process_exec
()Main function that executes all queued procedures of the process projects_init
()Initializes the projects attribute properties
Return all the properties in the class in a dictionary of key/property class. property
Get a property instance from the property name. register_event_type
Register an event type with the dispatcher. remove_all
()Functionality for the remove all button for taxa and file buttons in the side panel. remove_all_groups
()Removes all loaded orthology groups remove_bookmark_bt
(value)Adds functionality to the removal button associated with each bookmark button. remove_bt
(value[, parent_wgt])Functionality for the “X” remove buttons in the side panel. remove_bt_from_selection
(idx[, txt_file])Adds functionality to the dropdown button options for removing file or taxa buttons contained in a text file :param idx: string, either ‘Files’ or ‘Taxa’. remove_fancy_dropdown
()Removes FancyDropDown widgets from the root window remove_groups
(value)Removes orthology group buttons remove_partition_box
()Removes a currently active partition box when clicking the X button remove_project
(wgt)Gives functionality to the remove project button remove_taxa_bt
(bt, wgt)Method for addition of a button to a widget. remove_taxa_group
(rm_wgt)Removes the data set group button from the app list and repopulate_partitions
()Wrapper method that re-populates partitions after changes run
()Launches the app in standalone mode. run_in_background
(func, second_func, args1)This method is intended to run time/resource consuming operations in the background, without freezing the app, and return the final result to the main thread. save_bookmark
(path, wgt, fc_wgt[, popup_level])This adds functionality to the FileChooser “Add bookmark” button. save_codonfilter
(filter_act, position_list)Stores the information of the alignment filter dialog of the process save_dataset_group
(source_wgt, name, ds_type)Adds a taxa group declared using the taxa group creator popup to the list of taxa groups in the side panel :param source_wgt, gridlayout of the selected items :param name: string, name of the group :param ds_type: string. save_file
(path[, file_name, idx, ...])Adds functionality to the save button in the output file chooser. save_format
(value)Method that stores the output formats specified through the formats dialog in the Process screen. save_gapfilter
(filter_act, within_chk, ...)Stores the information of the FilterDialog save_ima2_opts
(pop_string, mutation, inheritance)Check each text input parameter given by the user and, if they checkout, saves them. save_inflation
(inflation_wgt)Save inflation values :param inflation_wgt: Widget. save_main_operation
(op)This controls the appearance of the general options after the user chooses the main operation (Conversion vs. save_model
(part_name, partition_wgt[, apply_all])Saves the model currently set in the partitions dialog. save_operation_queue
()This populate the operations queue tree view with the operations and save_ortho_filters
(gene_filt, sp_filt)Save orthology clusters filters :param gene_filt: int. save_project
(name)Saves the current alignment_list or proteome_list for quick access to the data sets. save_protein_filters
(min_len, max_stop)Saves protein length and stop percentage filters :param min_len: int. save_reverseconc_partfile
(partfile)Save partition file for reverse concatenation an update button in reverse concatenation dialog :param partfile: string. save_reverseconc_settings
([use_parts])Handles the information provided by the LoadDialog with settings for the reverse concatenation :param use_parts: boolean. save_taxafilter
(filter_act, filter_mode, ...)Stores the information of the taxa filter dialog of the process screen :param filter_mode: string, determines the taxa filtering mode. save_text
(text, idx)Saves a text input, whose attribute depends on the idx argument :param text: string. save_variationfilter
(filter_act, *pargs)Stores the information of the variation filter dialog. save_zorro_settings
(suffix)Handles the information provided by the user in the ZorroDialog search_add_gene_table_line
(gene_table[, start])Wraps the creation of gene table lines into the table_grid widget. search_sort_gene_table
(sortby[, ascending])Sorts the gene table by any column header. search_statistics_clear
()Clears the search in the gene table summary statistics search_statistics_gene_table
(s)Searches the summary statistic gene table view, according to the provided string. select_bt
(value)Functionality to the Select All/Deselect All buttons of the side panel. select_bt_from_file
(idx, txt_file)Adds functionality to the dropdown button options for selecting file or taxa buttons contained in a text file :param idx: string, either ‘Files’ or ‘Taxa’. select_taxa_group
(bt)Gives functionality to the buttons in the dialog_select_taxa_group. set_codon_model
(codon_partition[, wgt])Changes the model spinners when changing the codon partitioning setter
Return the setter of a property. show_back_bt
()Adds a back button to self.root_window, which will navigate to the previous screen. show_plot_toolbar
([toolbar_type])Adds a PlotToolbar BoxLayout to self.root_window. show_popup
(title, content[, size_hint, ...])General purpose method to create a popup widget show_stats_toggle
(args1, args2, active_bt[, ...])Adds a toggle widget to some Statistics plots that allow the user to toggle plots between the whole data set and species perspectives :param args1: dictionary, key must be “plt_idx”, and value the plot index string for the species plot type :param args2: dictionary, key must be “plt_idx”, and value the plot index string for the average plot type :param active_bt: string, identifier of the active button. sidepanel_add_bts
(idx, tab_name[, partition_fls])Wrapper that adds buttons to the corresponding File, Taxa or Partitions panel. sidepanel_animation
(width, wgt)sidepanel_clear_search
(panel)Clears previous search string and populates with the original buttons :param panel: string, the panel to clear the search. sidepanel_create_bts
(idx)sidepanel_create_part_bts
(idx)Creates buttons for each partition :param idx: string. sidepanel_invert_selection
(panel)Parameters: sidepanel_load_more_filebts
()sidepanel_moreopts_dialog
(bt)sidepanel_on_touch
(touch)This function is binded to the app Window so that it can handle any touch_up events. sidepanel_remove_moreopts
()Removes widgets from the more options dialog sidepanel_search_bts
(txt, panel)Performs a search for file or taxa buttons in the side panel based on the text string provided :param txt: string, the expression used for the search :param panel: string, the panel to perform the search. statistics_populate_groups
(ds_type)This method is called when the dataset selection buttons in the Statistics sidepanel are pressed. statistics_show_summary
([force, tp])Creates a subprocess for calculating summary statistics for the curently acitve data set. stats_clear_search
()Clears stats gene search to default buttons stats_handle_outliers
(operation, ds_type)Function that handles the processing of outliers in the stats plots stats_load_more_genes
()Functionality to the load next 20 genes in the stats gene selection stats_search_genes
(txt)Searches loaded genes for the single gene display of the Statistics stats_select_plot
(gn_idx, sp_idx, avg_idx)Dialog used for plot type selection when choosing an option from the stats_sethline
(val, plt_file[, inverted])Sets an horizontal threshold bar to the current plot object stats_show_plot
(plt_idx[, additional_args])Wrapper that executes plot data gathering and execution. stats_write_plot
(plot_data, footer, plt_idx)Provided with the data structure and a plt_idx string identifier, this function will create the plot file and app variable, and load it into the Statistics screen. stop
(*largs)Stop the application. switch_path_wgt
(wgt_id, path_bx, fc_wgt)taxagroup_move_taxa
(source_wgt, sink_wgt, ...)Method that adds functionality to the addition/removal buttons (<<, <, >>, >) in the taxa group dialog. taxagroups_add_group
(name, wgt, ds_type)Adds a dataset button, and corresponding removal button, to the group list gridlayut of the Dataset dialog. taxagroups_display_group
(name, ds_type)Gives functionality to the group buttons in the dataset dialog. taxagroups_show_taxa
(name_wgt)Creates a popup listing the taxa included in a taxa group given by toggle_fancy_dropdown
(bt, values[, ...])Adds functionality to the File/Taxa dropdown menus using a toggle_groups
(wgt)This method generates a desired behaviour for groups of toggle buttons By default, when a toggle button is pressed, the state will be down and a new screen/slide is presented. toggle_multi_selection
(value)Adds multiple selection using shift+click for general purpose lists toggle_orto_soptions
()Controls the toggling of the GridLayout with the advanced options toggle_process_options
()Controls the toggling of the GridLayout with the additional options for the process screen. toggle_selection
(value)Adds functionality for the file and taxa toggle buttons in the side panel. toggle_sidepanel
()Method controlling the animation toggling of the side panel toggle_stats_options
(bt, idx)Toggles the main data exploration analyses options in the Statistics toggle_stats_panel
([force_close, force_open])Controls the animation of the statistics panel :param force_close: Boolean. unbind
Unbind properties from callback functions with similar usage as bind()
.unbind_uid
Uses the uid returned by fbind()
to unbind the callback.unregister_event_types
Unregister an event type in the dispatcher. update_file_label
()Sets and updates a label on the Files tab of the side panel, update_main_operations
(op)Updates the app attribute containing the main operations of the Process screen, self.main_operations. update_partition_label
()Setsand updates a label on the Partitions tab of the side panel, update_partitions
()Updates partition buttons following any change to input data update_process_switch
(switch_id, state)Listens and updates the attribute process_switches when their state changes. update_sp_label
()Sets and updates a label on the Taxa tab of the side panel, informing how many taxa are selected out of the total taxa. update_tabs
()Wrapper that updates the contents of the files and taxa tabs update_taxa
()This checks whether some taxa that were specific to some file(s) were removed when that file is removed. -
MAX_FILE_BUTTON
¶ Integer with the maximum number of file Buttons allowed in the “Files” tab of the sidepanel. Prevents the loading of all file Buttons in very large datasets.
-
MAX_PARTITION_BUTTON
¶ Integer with the maximum number of partition Buttons allowed in the “Partitions” tab of the sidepanel. Prevents the loading of all partition Buttons in very large datasets.
-
MAX_TABLE_N
= 50¶ Integer with the maximum number of rows allowed for the gene table in the :class:`trifusion.data.resources.custom_widgets.GeneTable object.
-
active_file_inf
¶ Dictionary that maps a filename string to the several informative properties for the active data set, shown when clicking the information button in the sidepanel.
-
active_file_list
¶ List with the paths of the active alignment files loaded into TriFusion. Can be changed during the session.
-
active_group
= None¶ Reference to a
GroupLight
object, currently active.
-
active_group_name
= None¶ String with name of the currently active
GroupLight
.
-
active_partitions
¶ List of currently active partitions.
-
active_proteome_files
¶ List of active proteome files.
-
active_taxa_list
¶ List with the active taxa loaded into TriFusion. Can be changed during the session.
-
active_tx_inf
¶ Dictionary that maps a taxon string to the several informative properties for the active data set, shown when clicking the information button in the sidepanel.
-
add_bookmark_bt
(bk, wgt, fc_wgt, name=None, rm_bt=True, popup_level=1)[source]¶ This will add a bookmark button, along with its removal button. Only a bookmark path will be necessary.
The path of the bookmark will be associated to the respective button by it’s id.
Parameters: - bk – string. bookmark file path
- wgt – Widget, preferentially a gridlayout where the bookmark
buttons will be added :param fc_wgt: FileChooser widget in which bookmark operations will be performed :param name: string, optional name for bookmark button instead of the basename of the path :param rm_bt: Boolean, If True, a removal button will be added with the bookmark, else the removal button will not be added. The latter case is used for System devices bookmarks. :param popup_level: int, specifies the level of the check_action popup
that appears when attempting to remove a bookmark
-
add_dataset_bt
(bt, wgt, ds_type)[source]¶ Method for addition of a button to a widget. This method was created for the automatic upated of the widgets height when moving buttons in the taxa group creation dialog :param bt: The button widget :param wgt: The sink widget :param ds_type: string. Data set type. It may be either “taxa” or “files”
-
add_project_bt
(name, file_num, ds_type, grid_wgt)[source]¶ Wrapper that adds a project button to the sidepanel :param name: string, name of the project :param file_num: int, number of files associated with project :param ds_type: string, type of dataset. Can be either ‘orthology’ or ‘process’ :param grid_wgt: GridLayut widget where the project is to be added
-
alignment_list
= None¶ Reference to a
AlignmentList
object.
-
arrow_block
¶ bool attribute that ocks arrow keys keybindings when a text input is focused.
-
available_screens
¶ List of paths to screen files.
-
bm_file
¶ String with path to bookmarks file.
-
bookmark_init
(wgt, dev_wgt, fc_wgt, popup_level=1)[source]¶ This will create a pickle file containing a list with the bookmarks for the file chooser menu. If no file exists, it will create an empty one. If a file already exists, it will load the available bookmarks
Parameters: - wgt – Widget object where the bookmark button will be
- dev_wgt – Widget object where the system bookmarks will be
- fc_wgt – Filechooser widget associated with the bookmarks
- popup_level – int, specifies the level of the check_action popup that appears when attempting to remove a bookmark
-
bookmark_load
(value, wgt)[source]¶ Provided a bookmark button object, it loads the bookmark file path that is stored in the button id. :param value: bookmark button object :param wgt: Filechooser widget that will show the bookmark
-
bookmarks
= [[], {}]¶ List with information of the bookmarks for the filechoosers. The first element is a list with the full path of the bookmarks. The second element is a dictionary mapping the full path to the bookmark name.
-
bookmarks_bt
= []¶ List of bookmark Button widgets. Used for mouse over purposes.
-
cds_db
¶ List with paths to the CDS files corresponding to proteomes.
-
change_taxa_name
(old_name, new_name)[source]¶ Changes the taxa name on a double tap :param old_name: string, original taxon name :param new_name: string, new taxon name
-
check_action
(text, func, bt_wgt=None, args=None, popup_level=1, check_wgt=<class 'trifusion.data.resources.custom_widgets.CheckDialog'>)[source]¶ General purpose method that pops a dialog checking if the user wants to perform a certain action. This method should be passed as a function on the ‘on_*’ with the final function and original widget triggering the event as arguments.
By default, the check action dialog is a CheckDialog widget, but alternative widgets can be used by passing them to the check_wgt option. If so, properties such as size, separator color, etc must be specified for such cases.
Parameters: - text – string, text to appear in the dialog
- func – final function if the users chooses to proceed
- bt_wgt – widget where the initial ‘on_‘ event occurred
- args – list, of arguments to be passed on to func
- popup_level – int, level of popup. 1 for _popup, 2 for
_subpopup and 3 for exit popup :param check_wgt: Widget. Specified the check dialog widget
Usage example: This can be applied to the removal button of the bookmarks. In this case, the event of the removal button must be like this:
- remove_button.bind(partial(self.check_action,
- self.remove_bookmark_bt))
where, self.check_action is this method, and self.remove_bookmark_bt is the function that will actually remove the bookmark button. This function is then bound to the “OK” button of the check dialog. By default, the last argument is the bt_wgt.
-
check_file
(path, file_name, idx, bw=None)[source]¶ Method used by some filechooser dialogs. Checks whether the provided file name already exists. If so, issues a check_action popup. If not, proceeds as normal :param path: string, complete path :param file_name: string, file name :param idx: string, operation identifier :param bw: bool, argument specific for export_graphic idx. Determines whether a figure will be exported in original color or grayscale
-
static
check_filters
(value)[source]¶ Method that validates the input of the text input in filter settings. It handles common mistakes, such as using ”,” instead of ”.” for decimal places and truncates values between the range of 0 and 100. If the text input cannot be converted to float, it will return false and the slider value will not change :param value: text_input.text
-
static
check_partition_split
(value, prange)[source]¶ Method that validates the text input for manual split of partitions. Ensures that the input can be converted to int, and whether it is inside the available range.
-
check_partitions_file
()[source]¶ This will make some checks on the partitions file provided by the user. It will check for errors in the format of the file itself, and whether the partitions are correctly defined
-
static
check_variation_filters
(value)[source]¶ Same function as check_filters method, but checks only for integer compliance :param value: text_input.text
-
clear_orto_input
()[source]¶ Clears any input for the orthology screen and related variables and attributes
-
clear_process_input
()[source]¶ Clears any input for the process/statistics screen and related variables and attributes
-
codon_filter_settings
¶ List attribute storing the alignment filter settings. This will determine which codon positions will be written to the output (only for DNA sequences), so this will consist of a list containing 3 elements that correspond to each position. Positions will be saved or filtered depending on the boolean value of the list position. Ex. [True, True, True] will save all positions, whereas [True, True, False] will only save the first two positions.
-
conversion_suffix
¶ String with suffix to add for conversion operation of Process execution.
-
count_files
¶ Integer that servers as a counter of the number of file Buttons currently loaded into the “Files” tab of the sidepanel.
-
count_partitions
¶ Integer that servers as a counter of the number of partition Buttons currently loaded into the “Partitions” tab of the sidepanel.
-
create_partfile
¶ bool attribute that determines whether the partition file associated with the phylip format should be created (True) or not (False).
-
cur_dir
= '.'¶ String with the current working directory. Used to fetch the kivy screen files.
-
current_lgd
= None¶ matplotlib.Legend object associated to the current plot. Can be None.
-
current_plot
¶ matplotlib.Figure object of the current plot.
-
current_plt_idx
¶ List that contains two elements. The first is the string identifier of the current plot analyses. The second is the list of arguments that should be passed to the respective plotting method.
-
current_screen
¶ String with the name of the current Screen object.
-
current_table
¶ List with table data associated with the current plot.
-
dataset_file
= None¶ String attribute with path to a data set file.
-
dialog_codonfilter
()[source]¶ Generates dialog for alignment filter in the additional options of the process screen
-
dialog_create_group_from_file
(ds_type)[source]¶ Creates a filechooser dialog to select a file containing a taxa/file list that will be used to generate a data set group :param ds_type: string. Identifies the data set type. Either taxa or files
-
dialog_dataset_creator
(ds_type, popup_level=1)[source]¶ Creates a dialog to choose between creating a data set from a file or manually
Parameters: ds_type – string. Identifier of the data type. Can be either taxa or files :param popup_level: integer, The level of the dialog popup. Can be either 1 (creates _popup instance) or 2 (creates _subpopup instance)
-
dialog_execution
()[source]¶ Generates the dialog for Process execution. It also preforms several sanity checks before issuing the dialog
-
dialog_export_graphic
()[source]¶ Creates a filechooser dialog for graphics exportation. It differs from other filechooser dialogs in the presence of a spinner to select the graphical extension :return:
-
dialog_export_groups_filechooser
(idx)[source]¶ When clicking Export groups in the main dialog for group exportation, the user is redirected to a filechooser to choose the output directory and output file name, in the case of group exportation. :param idx: string. Determines the export mode: if “protein” or “nucleotide”, it will export sequence files, if “group”, it will export to another group file
-
dialog_filechooser
(idx=None, popup_level=1)[source]¶ Generates a file chooser popup for the user to select an output file
Parameters: idx – string. An id of where the filechooser is calling. This allows the addition of custom behaviours for different dialogs :param popup_level: int, level of popup. 1 for _popup, 2 for _subpopup and 3 for exit popup
-
dialog_fileoverwrite
(msg)[source]¶ General dialog for querying whether an existing file should be overwritten or skipped
-
dialog_filter_report
(filtered_stats, nalns)[source]¶ Generates graphic report at the end of a processing operation with active filters :param filtered_stats: Dictionary with the values of the filtered
alignments for each filter typeParameters: nalns – integer, total number of processed alignments
-
dialog_floatcheck
(text, t, dl=5)[source]¶ Creates a floating label with informative text on the right upper corner of the app. This is used for showing errors, warnings and general informative messages that fade in and fade out after a time :param text: string, text to appear in the label :param t: string, with type of check. Can be either error or info :param dl: integer, duration of the float
-
dialog_general_info
(idx)[source]¶ Generates the popup with information for several components of the application :param idx: string. Identifier of the informative content to be shown. It must be present in the dictionary keys of the informative_storage variable in data/resources/info_data.py
-
dialog_import_partitions
()[source]¶ Creates a filechooser dialog to select a partition file and import its scheme to the current partition. If one or more partitions are active, ask the user if we wants to import the partition scheme to the selected partitions or to the whole dataset :return:
-
dialog_orto_execution
()[source]¶ Creates and populates the pre-execution dialog for orthology search
-
dialog_orto_setfilter
(group_name)[source]¶ A similar dialog to dialog_ortho_filter but for the explore screen. Contains an additional option of applying the specified filters to all group files :param group_name: string. name for the group object
-
dialog_partition_files
(partition_name)[source]¶ Shows a popup listing the files associated with a given partition :param partition_name: string, name of partition :return:
-
dialog_partitions
(btx)[source]¶ Shows a small widget with partition information
Parameters: btx – Button widget that will be used to determine which partition is being viewed and the position of the partitions dialog
-
dialog_plot_check_filters
(previous_filt, prev_tx, current_filt, current_tx)[source]¶ Dialog that is triggered when exiting a plot screen and the current plot filters are different from the filters before entering the plot screen. Will ask the user if the filters should be updated for the remaining app or not.
-
dialog_remove_from_file
()[source]¶ Creates a filechooser dialog to select a text file containing a list of files or taxa names to be removed in the side panel.
Then calls: self.remove_bt_from_file
-
dialog_reverse_concatenation
(title='Choose input file')[source]¶ Generates a general purpose file chooser to request additional data :param title: string, A custom title for the load data dialog popup
-
dialog_search_report
(stat_storage, groups)[source]¶ Creates the dialog that reports the results of the Orthology search :param stat_storage: dictionary. Each entry corresponds to an inflation value, which will have a list as a value. The list will contain:
[total_orts, species_compliant_orts, gene_compliant_orts, final_orts]
-
dialog_select_from_file
()[source]¶ Creates a filechooser dialog to select a text file containing a list of files or taxa names to be selected in the side panel
Calls: select_bt_from_file
-
dialog_select_gene
(plt_idx)[source]¶ Generates dialog for selecting gene for single gene plot creation
-
dialog_select_taxa_group
()[source]¶ Shows a subpopup listing the taxa groups that have already been created. Each taxa group will be a Button widget
-
dialog_taxafilter
()[source]¶ Generates dialog for taxa filter in the additional options of the process screen
-
dialog_taxagroup
(ds_type, popup_level=1)[source]¶ Creates the layout for the taxa group creation popup. :param ds_type: string. Data set type. It may be either “taxa” or “files” :param popup_level: integer, The level of the dialog popup. Can be either 1 (creates _popup instance) or 2 (creates _subpopup instance)
-
dialog_text
(title, idx, msg=None)[source]¶ Generates a simple text dialog to capture text input :param title: string. Title of the popup :param idx: string. Identifier of the dialog :param msg: string. Option message to appear in the dialog input text
-
dialog_usearch_fix
()[source]¶ Opens a dialog with information for fixing the missing USEARCH executable
-
disengage_groups
()[source]¶ Methods used to unselect all module header buttons, in case the user enters the main filechooser
-
dismiss_close_float
(*args)[source]¶ Use to automatically remove any possibly CloseFloat widgets from the root window, when a Popup is automatically dismissed
-
drag_c
= 0¶ Integer that works as a counter of the number of files that were dropped into TriFusion’s window.
-
drag_files
= []¶ List that stores the paths of files drag and dropped into TriFusion’s window.
-
export_graphic
(path, file_name, bw)[source]¶ Saves the current plot object into a file based on file name and extension :param path: string, path to final directory :param file_name: string, name of graphic file :param bw: bool, Determined whether the graphic will be in the original colors (False) or grayscale (True)
-
export_mode
= None¶ Tuple attribute that determines the export mode in the sidepanel. The first element can be either ‘taxa’ or ‘file’. The second element can be ‘all’ or ‘select’.
-
export_names
(path, file_name)[source]¶ Export the names of buttons in the corresponding tab in the side panel It listens to the self.export_mode attribute, which is a tuple object with the first element being either “file” or “taxa” and the second element as “all” or “selected”.
Parameters: path – string. Path to the output file. :param file_name. Name of the output file.
-
export_table
(path, file_name, ext='.csv', warning_dlg=True)[source]¶ Saves the current_table list attribute to a .csv file. :param path: string, path to final directory :param file_name: string, name of table file :param warning_dlg: boolean. If True, issue a float dialog when the operation is done. If false do not issue the float dialog.
-
fancy_bt
= None¶ Reference to the
FancyButton
object from the current mouse over.
-
fancy_dropped
¶ bool attribute of whether the :class:’trifusion.data.resources.custom_widgets.FancyDropDown object if active (True) or not (False).
-
file_apply_all
= False¶ bool attribute that determines whether the behaviour of
file_overwrite
should be applied to all files (True) or not (False).
-
file_groups
¶ Dictionary storing custom file groups defined in TriFusion. Keys are group names and values are a list of filenames.
-
file_list
= []¶ List with the paths of alignment files loaded into TriFusion. This attribute should not be modified unless the files are removed from the application.
-
file_overwrite
= None¶ Attribute controlling whether output files should be overwritten or skipped. Has a None value when inactive, “overwrite” when there is an instruction to overwrite, and “skip” when there is a instruction to skip.
-
filename_map
¶ Dictionary mapping the basename of alignment files to their full path. Some parts of TriFusion need only the basename of the alignment files, so this attributes allows the conversion.
-
gene_master_table
= []¶ List with the table data from the :class:`trifusion.data.resources.custom_widgets.GeneTable object.
-
gene_table_selection
= []¶ Pandas DataFrame with the selection of gene summary statistics for the :class:`trifusion.data.resources.custom_widgets.GeneTable object.
-
get_active_sets
(file_set_name=None, taxa_set_name=None)[source]¶ Returns a tuple with the file set list as first element and taxa set list as second element. List sets are only return for non None arguments. If, for example, only file_set_name is provided, then the return tuple will be ([file list], None) :param file_set_name: string, name of file set :param taxa_set_name: string, name of file set
-
get_file_information
(file_name=None, mode='alignment')[source]¶ Similar to get_taxa_information, but generating information for the files in the file tab. :param mode: string. The type of file information to retrieve. May be ‘alignment’ or ‘proteome’
Returns: file_inf (dictionary). Contains all relevant content for the file popup. It contains the following keys:
- ..:mode: alignment:
- aln_format: The format of the input file
- seq_type: The sequence type. If DNA, RNA, Protein.
- n_taxa: Number of taxa
- aln_len: Length of the alignment
- model: The model of sequence evolution, if applicable.
This isusually only present on Nexus input format
- ..mode: proteome:
- n_seq: Number of sequences
- n_res: Number of residues
-
get_popup_info
(value)[source]¶ This function determines whether the taxa information has changed since it has been update (when files are removed). If so, it updates the taxa information and issues popup_info. Else, just issues popup_info :param value: Button object that issued the function
-
static
get_proteome_information
(proteome_file)[source]¶ Returns informative stats for a given proteome_file :param proteome_file: string. Path to proteome file
-
get_taxa_information
()[source]¶ This method will gather all available information for all taxa and sets a number of related attributes. This methods should only be used to generate data for the complete data set. The active data set is usually only gathered for a single taxon and upon demand.
Sets the self.original_tx_inf attribute. Contains the relevant information for the taxa popup. All corresponding values are the result of additions across all active input alignments. Contains the following keys:
- length: Total alignment length including missing data and gaps
- indel: The number columns containing indel/gaps
- missing: The number of columns containing missing data
- effective_len: Alignment length excluding gaps and missing
data - effective_len_per: Same as above but in percentage - fl_coverage: The number of files containing the focal taxon - fl_coverage_per: Same as above but in percentage
-
get_taxon_information
(tx, aln_list)[source]¶ Akin to the get_taxa_information method, but it only looks for the information of a single taxon.
Parameters: - tx – string, taxon name
- aln_list – AlignmentList object from where the information
will be retrieved
-
go_carousel
(slide, bt_id)[source]¶ Method used by other buttons outside the side buttons of the side panel to go to specific slides of the side panel :param slide: int, the index of the target slide :param bt_id: string, the id of the corresponding button :return:
-
go_previous_screen
()[source]¶ Method that returns to the previous screen, set by self.previous_screen
-
go_screen
(idx, direct='left')[source]¶ Method used to go to a specific screen by specifying and index and transition direction :param idx: integer. Index value of the screen from self.screen_names :param direct: string. The direction of the transition
-
group_prefix
¶ String with prefix for orthology search group files.
-
hap_prefix
¶ String with the haplotype prefix for collapse operation.
-
home_path
= u'/home/diogo'¶ String with path to home directory.
-
ima2_options
¶ Four element list of additional options for IMa2 format:
- str - population file path
- str - Population tree string
- list - mutation model for each partition (one element if
- applies to all)
- list - inheritance scalaer for each partition (one element if
applies to all)
-
index
¶ Integer with the index of the current screen. The index is retrieved from the
screen_names
attribute.
-
is_control_pressed
¶ bool attribute that stores information on whether the control key is being pressed (True) or not (False).
-
is_shift_pressed
¶ bool attribute that stores information on whether the shift key is being pressed (True) or not (False).
-
last_sp_bt
= {'Files': None, 'Taxa': None, 'Partitions': None}¶ Dictionary that stores the last selected Button object in the sidepanel for Files, Taxa and Partitions.
last_sp_bt = {“Files”: None, “Taxa”: None, “Partitions”: None}
-
ld_hat
¶ bool attribute that determines whether the Fasta output format shoud be compliant with LDhat (True) or a regular fasta (False).
-
load_files
(selection=None, aln_list=None)[source]¶ Loads the selected input files into the program using the AlignmentList object provided by aln_list. The loading process is divided in phases:
.: Load the AlignmentList object from a pickle object
.: Check for invalid alignments (duplicates, invalid input formats, sequences with unequal length) and issue warning message
.: If any valid input files passed all checks, then the app structures are updated
To allow different files to be loaded in different occasions, all checks are performed on the aln_list object, and not in the app attribute self.alignment_list
Parameters: aln_pickle – string, path to pickle file with the AlignmentObject :param selection: list, with the path of all files provided to the app
-
load_files_dragndrop
(*args)[source]¶ This function gives functionality to the drag and drop feature that automatically loads files when droped into the app window. Note that this method will issue different data loding methods depending on the active screen. Proteome alignments will be opened in the Orthology screen, while sequence alignment will be opened in the Process and Statistics screens. :param args: list, first element is the SDL2 object, second element is the file path
-
load_files_startup
(file_list)[source]¶ Gives support for loading data into the app when launching the app via command line and providing the files as arguments. Issues the same dialog as the load_files_dragndrop to let the user choose whether the input files are alignments or proteomes :param file_list: list, with file paths as strings or unicode
-
load_groups
(groups_obj, default_filters)[source]¶ Loads the group files generated by the Orthology search or manually imported into the app. This method only accepts MultiGroup objects. Loading groups from files is more computationally intensive and should be done in the background using the run_in_background and load_group_files methods.
Parameters: - groups_obj – MultiGroup object
- default_filters – Tuple. With filters for MultiGroups object
-
static
load_plot
(file_path, scatter_wgt)[source]¶ Loads a new plot into a ScatterLayout. This will clear all previous content and load a new image based on the file_path argument. This assumes that the current screen is a plot related screen. :param file_path: string. Path to the image to be loaded :param scatter_wgt: ScatterLayout object, where the plot is to be loaded :return:
-
load_proteomes
(selection)[source]¶ Similar to load method, but specific for loading proteome files. Given the potential size of these files, they are not stored in memory, but instead are processed on the fly
Parameters: selection – list. Contains complete paths to the proteome files
-
load_screen
(idx)[source]¶ Loads the current screen according to the corresponding kv file :param idx: The index of the screen to be loaded
-
loaded_screens
= {}¶ Dictionary that maps the screen name to a Screen object. Entries are only populated when Screens are loaded for the first time. This allows the state of each screen to be saved.
-
lock_side_panel
¶ bool that prevents the animation of the sidepanel when True.
-
lock_stats
¶ bool attribute that determines whether statistics background processes should be interrupted (True) or not (False).
-
log_file
¶ String with path to TriFusion’s log file.
-
main_nodes
¶ Dictionary that maps string identifiers of main nodes to those Node objects.
-
main_operations
¶ Dictionary mapping the main operations to a bool value. The active main operation, if any, has a True value. Only one True value can exist for the main operations.
-
mcl_file
¶ String with path to mcl executable.
-
mcl_inflation
¶ List with inflation values, as strings, for the mcl execution.
-
missing_filter_settings
¶ Two element list attribute storing the missing data filter settings. The first element is a three element tuple:
- bool. Whether the missing data filter is active (True) or not (False).
- int. Percentage of gaps allowed.
- int, Percentage of missing data allowed.
The second element is a two element tuple:
- bool. Whether the minimum taxa representation filter is active (True) or not (False).
- int. Percentage of the min taxa representation
-
more_stats_table_bts
()[source]¶ Increases the MAX_TABLE_N attribute by 50 and adds more buttons to the summary statistics gene table view
-
mouse_over_bts
¶ Attributes storing the ToggleButton objects from Taxa/File/Partitions tabs in the sidepanel. Used mostly for mouse over events.
-
mouse_over_ready
¶ bool attribute that is a locking mechanism of the mouse over event. When there is a scheduled event for a mouse over this attribute is set to False, which prevents further events from being scheduled in the meantime. When the scheduled event is dispatched, the lock is released and it returns to True.
-
mouse_position
¶ List of the mouse position coordinates in [xpos, ypos].
-
old_mouse_over
= None¶ Label widget of the previous mouse over. Used so that this label can be removed.
-
open_project
(name)[source]¶ Closes the current data set and opens the project identified by name :param name: string, name of the project
-
operation_queue_init
()[source]¶ This will create the skeleton for the tree view of the operations queued for execution in an appropriate screen of the side panel.
-
operation_tv
¶ TreeView object containing the queue of operations.
-
original_file_inf
¶ Dictionary that maps a filename string to the several informative properties for the entire loaded data set, shown when clicking the information button in the sidepanel.
-
original_tx_inf
¶ Dictionary that maps a taxon string to the several informative properties for the entire loaded data set, shown when clicking the information button in the sidepanel.
-
ortho_dir
¶ String with path to OrthoMCL output directory.
-
ortho_group_files
¶ List with paths to ortholog group files loaded into TriFusion.
-
ortho_groups
= None¶ Reference to a
MultiGroupLight
object.
-
ortho_search_options
= None¶ Reference to the :class:`trifusion.data.resources.custom_widgets.OrthologySearchGrid object, containing the additional option’s widgets of the Orthology Search screen.
-
ortholog_prefix
¶ String with prefix for ortholog groups.
-
orthology_card
(group_name=None, bt=None)[source]¶ Generates the descriptive cards with general information for a group file. :param group_name :param bt: ToggleButton instance
-
orthology_search_exec
()[source]¶ Main function that executes all queued procedures of the orthology module
-
orto_check_state
()[source]¶ sets the “Compare” button disabled attribute according to the number of active check boxes
-
orto_compare_groups
(groups_objs=None, selected_groups=None)[source]¶ Switches to the orthology group comparison screen and presents the initial plot comparing total orthologs across group files :param groups_objs: MultiGroupLight object. Provide only when updating filters in the plot screen :param selected_groups: list. If provided, should contain the name of the groups that should be plotted.
-
orto_export_dir
¶ String with path to directory for ortholog exports.
-
orto_export_groups
(export_idx, output_dir=None, output_name=None)[source]¶ This will handle the group exportation of the orthology screen. The intensive export methods will run in the background while updating the main process of their process. :param export_idx: string, with the identifier of exportation. Can be either ‘group’, ‘protein’ or ‘dna’ the database from which sequences will be retrieved :param output_dir: string. Path to output directory :param output_name: string, for group exportation, provide the name of the output filtered file
-
orto_generate_report
(out_dir, ns=None)[source]¶ Generates full orthology report on the specified directory. :param out_dir: string, path to directory where the report will be generated
-
orto_max_gene
¶ Integer with maximum number of gene copies allowed for each ortholog group.
-
orto_min_sp
¶ Integer with the minimum taxa representation allowed for each ortholog group..
-
orto_plt_method
= {'Taxa distribution': [<function bar_plot>, 'Species_distribution.png'], 'Taxa gene copies': [<function bar_plot>, 'Species_copy_number.png'], 'Gene copy distribution': [<function bar_plot>, 'Gene_copy_distribution.png'], 'Taxa coverage': [<function bar_plot>, 'Species_coverage.png']}¶ Dictionary that maps the string identifier of orthology plot analyses to a list. This list has two elements. The first is the plotting method defined in
trifusion.base.plotter
, and the second is the name of the temporary figure file that will be generated.
-
orto_report_dialog
()[source]¶ Generates a filechooser upon clicking on the “Generate full report” button in Orthology Explore. The filechooser will provide the directory where the report will be generated
-
orto_search_height
= None¶ Integer with the height property of the
ortho_search_options
object.
-
orto_show_plot
(active_group, plt_idx, filt=None, exclude_taxa=None)[source]¶ Loads a orto_plot screen for orthology graphical exploration based on the plot index. This method can be called in three ways:
- ..: Orthology Explore screen button, which generates the plot for
- the first time and sets initial attributes for plot screen header. This only uses the plt_idx argument.
- ..: Update button in plot screen, used after gene/species filters
- have been changed. This uses the plt_idx and filt arguments.
- ..: Taxa filter button in plot screen, used after changing the taxa
- that should be included in the plot analysis. This uses the plt_idx and exclude_taxa arguments
Parameters: - active_group – Group Object.
- plt_idx – string, id of the plot in plt_method to issue the
appropriate method :param filt: list, contains the gn and sp filters for group object, respectively. If none, this will set a new plot and all plot screen attributes. Else, it will only update the plot image and ortholog statistics. :param exclude_taxa: list, each element should be a taxon name to be excluded from the plot
-
orto_write_plot
(plot_data, plt_idx)[source]¶ Provide with the data structure and a plt_idx string identifier, this function will create the plot file and update the plot screen. :param plot_data: list/np array, data structure to be used in plot construction :param plt_idx: string, identification string of the plot.
-
output_dir
¶ String with path to output directory for Process execution.
-
output_file
¶ String with path to output file for Process execution.
-
output_formats
¶ List of output currently selected output formats for Process execution.
-
partitions_change_name
(partition_name, new_name)[source]¶ Changes name of a partition :param partition_name: string, Original partition name :param new_name: string, new partition name :return:
-
partitions_file
¶ String with path to partitions file.
-
partitions_import_scheme
(partition_file)[source]¶ Imports partitions in partition_file and applies to the alignment_list partition object. It applies to the entire alignment_list for now. :param partition_file: string, path to partition file
-
partitions_merge
(name)[source]¶ Merge active partitions
Parameters: name – string. Name of the new partition
-
partitions_merge_dialog
()[source]¶ Dialog that appears when clicking merge partitions asking for the name of the new partition
-
partitions_split
(new_range=None, new_names=None)[source]¶ Split an active partition
Parameters: new_range – Optional. Tuple containing the new ranges for the new partitions :param new_names: Optional. Tuple containing the new names for each new partition
-
phylip_truncate_name
¶ bool attribute that determines whether taxa names should be truncated to 10 characters (True) or not (False) in a phylip output file.
-
plot_backups
= {}¶ Dictionary that maps Statistics plot analyses identifiers to their respective table data in a list object. This object is only populated when those analyses are executed.
-
plot_screens
¶ List of screens dedicated for plots.
-
plt_patch
= None¶ Stores matplotlib.patches objects that may be added to plots.
-
populate_input_files
(mode='alignment')[source]¶ This method grabs the input files that were selected in the FileChooser widget and populates the File tab in the main side panel with toggle and remove buttons for each file
Parameters: mode – string. Determines which list will be used to populate. If alignment, it will use file_list; If proteome, it will use proteome_list
-
populate_partitions
()[source]¶ Populates the partitions tab in the side bar from the partitions object associated with alignment objects.
This method is used when input files are loaded into the program, which means there will be no issue with multiple files being associated with the same partitions. This kind of change is done a posteriori when importing partition files or setting the partitions manually.
-
populate_species
()[source]¶ This method grabs the taxa names from the input files that were selected in the FileChooser widget and populates the Taxa tab in the main side panel with toggle and remove buttons for each taxon
Populates the footer of the Statistics screen with information on the active number of genes and taxa :param footer: list, first element contains the number of genes, the second element contains the number of taxa
-
popup_info
(value)[source]¶ Generates the pop up information content for the pressed taxa or file button :param value: the button object is provided when binding
-
prev_tb
= None¶ Attribute that stores the previous Button for general purpose multi selection of toggle buttons using shift clicking
-
previous_mouse_over
¶ The Button text property of the previous mouse over event. This will allow the assessment of whether the current mouse collision is for the same button (in which case the mouse over will not be triggered) or for a different button (in which case the mouse over is triggered).
-
previous_screen
¶ String with the name of the last Screen object.
-
previous_sets
= {'Files': [], 'Taxa': [], 'Stats': []}¶ Dictionary storing previous data sets defined in TriFusion. This is used to evaluate whether the plot methods should be executed or ignored. The Stats key refers to the previous active data sets when the stats summary statistics overview was performed. It should contain two lists, the first with the file set and the second with the taxa set.
previous_sets = {“Files”: [], “Taxa”: [], “Stats”: []}
-
previous_stats_toggle
= None¶ Reference to :class:`~trifusion.data.resources.custom_widgets.StatsToggleWgt object. It’s used to restore the widget to the Statistics screen when exiting and entering it when a plot is loaded.
-
process_grid_wgt
= None¶ Reference to the :class:`trifusion.data.resources.custom_widgets.ProcessGeneral object with the general options widgets of the Process screen.
-
process_height
= None¶ Integer with the height property of the
process_options
object.
-
process_options
= None¶ Reference to the :class:`trifusion.data.resources.custom_widgets.AdditionalProcessContents object with the additional options widgets of the Process screen.
-
projects_file
¶ String with path to projects file.
-
protein_db
¶ String with path to protein database file.
-
protein_max_stop
¶ Integer with the maximum percentage of stops for OrthoMCL.
-
protein_min_len
¶ Integer with the minimum protein length for OrthoMCL.
-
proteome_files
= []¶ List of paths to proteome files loaded into TriFusion.
-
removable_media
= []¶ List attribute that stores paths of currently active removable media.
-
remove_all
()[source]¶ Functionality for the remove all button for taxa and file buttons in the side panel. This method will remove all files and taxa from the program
-
remove_bookmark_bt
(value)[source]¶ Adds functionality to the removal button associated with each bookmark button. This will not only remove the :param value: The removal button widget
-
remove_bt
(value, parent_wgt=None)[source]¶ Functionality for the “X” remove buttons in the side panel. It removes button pairs with similar id’s and can be used in both files and taxa tabs :param value: Button widget to be removed :param parent_wgt: Button widget contained. If provided, it overrides value.parent
-
remove_bt_from_selection
(idx, txt_file=None)[source]¶ Adds functionality to the dropdown button options for removing file or taxa buttons contained in a text file :param idx: string, either ‘Files’ or ‘Taxa’. :param txt_file: string, path to txt file containing the files/taxa names to be selected. If this is not provided, then the selected files/taxa will be removed instead
-
remove_groups
(value)[source]¶ Removes orthology group buttons :param value: Instance of remove button
-
remove_project
(wgt)[source]¶ Gives functionality to the remove project button :param wgt: remove button
-
static
remove_taxa_bt
(bt, wgt)[source]¶ Method for addition of a button to a widget. This method was created for the automatic upated of the widgets height when moving buttons in the taxa group creation dialog :param bt: The button widget :param wgt: The source widget
-
remove_taxa_group
(rm_wgt)[source]¶ Removes the data set group button from the app list and corresponding data set group attribute :param rm_wgt: widget, widget of the removal button
-
rev_infile
¶ String with nameo the alignment file to be reverse concatenated.
-
run_in_background
(func, second_func, args1, args2=None, no_arg2=False, msg='Crunching data...', cancel=True)[source]¶ This method is intended to run time/resource consuming operations in the background, without freezing the app, and return the final result to the main thread. This means that complex methods that perform multiple changes to the App’s attributes are not suitable for this method (changes in a secondary thread will not change the App in the main thread). Therefore, the simplest solution to the problem is to isolate the time consuming parts of those methods, run them in the background, and get their result. Then, their result is piped to the follow-up fuction provided as argument :param func: intensive callable bound method to run in the background :param second_func: Follow-up bound method that will use the value returned by func :param args1: list, with the arguments for func t method. No keywords allowed :param args2: list, with arguments for second_func. These will be added to the argument list returned by func :param no_arg2: Boolean. Whether func will return something to second_func :param msg: string, message to appear in waiting dialog. :param cancel: Boolean, Shows a functional cancel button that interrupts the background process, if True.
-
save_bookmark
(path, wgt, fc_wgt, popup_level=1)[source]¶ This adds functionality to the FileChooser “Add bookmark” button. It will grab the selected path and add it to a storage list that will be saved as a pickle object and stored in a file defined in self.bm_file. :param path: String containing the path of the bookmark :param wgt: Widget where the bookmark will be added :param fc_wgt: FileChooser widget that the bookmark will affect :param popup_level: int, specifies the level of the check_action popup
that appears when attempting to remove a bookmark
-
save_codonfilter
(filter_act, position_list)[source]¶ Stores the information of the alignment filter dialog of the process screen :param filter_act: Boolean, whether the filter is active (True) or not (False) :param position_list: A list of three elements, containing which positions should be saved (True) or filtered (False)
-
save_dataset_group
(source_wgt, name, ds_type, group_file=False)[source]¶ Adds a taxa group declared using the taxa group creator popup to the list of taxa groups in the side panel :param source_wgt, gridlayout of the selected items :param name: string, name of the group :param ds_type: string. Data set type. It may be either “taxa” or “files” :param group_file: boolean, If True get the group items from the self.dataset_file file.
-
save_file
(path, file_name=None, idx=None, auto_close=True, suffix='')[source]¶ Adds functionality to the save button in the output file chooser. It gathers information on the specified path through filechooser, file name through textinput and the widget text when called.
For now, only one main output file can be provided, so the its path is stored in a string attribute.
Parameters: - path – string. complete path
- file_name – string. file name only
- idx – string. An id of where the filechooser is calling. This
allows the addition of custom behaviours for different dialogs :param auto_close: Boolean. When True, the dismiss_popup method is called in the end of the function :param suffix: string. Allow the addition of a suffix to the file name or to be save in an attribute
-
save_format
(value)[source]¶ Method that stores the output formats specified through the formats dialog in the Process screen.
The active formats are stored in a self.output_formats list
Parameters: value – widget object.
-
save_gapfilter
(filter_act, within_chk, among_chk, gap_val, mis_val, min_tx_val)[source]¶ Stores the information of the FilterDialog :param filter_act: Boolean, whether the filter is active (True) or not (False) :param within_chk: Boolean, whether the within alignment filter is active (True) or not (False) :param among_chk: Boolean, whether the multiple alignments filter is active (True) or not (False) :param gap_val: integer, proportion of gap threshold :param mis_val: integer, proportion of missing data threshold :param min_tx_val: integer, proportion of minimum taxa representation
-
save_ima2_opts
(pop_string, mutation, inheritance)[source]¶ Check each text input parameter given by the user and, if they checkout, saves them. :param pop_string: string, with population tree :param mutation: string, with mutation model :param inheritance: string, with inheritance scalar
-
save_inflation
(inflation_wgt)[source]¶ Save inflation values :param inflation_wgt: Widget. Widget containing the inflation values
-
save_main_operation
(op)[source]¶ This controls the appearance of the general options after the user chooses the main operation (Conversion vs. Concatenation). When the main operation is chosen for the first time, the general options are introduced, but further selection of the main operation only changes the state of the operations button. :param op: string, the main operations. values are “concatenation”
and “conversion”
-
save_model
(part_name, partition_wgt, apply_all=False)[source]¶ Saves the model currently set in the partitions dialog. :param part_name: string, name of partition :param partition_wgt: Widget of the Partitions dialog :param apply_all: boolean, whether the current model will be applied to all partitions or not
-
save_operation_queue
()[source]¶ This populate the operations queue tree view with the operations and options selected by the user
As of now, it listens to information stored in:
- self.main_operations, to gather the main operation
- self.process_switches, to gather secondary operations
- self.output_formats, to gather information on the output
formats - self.
-
save_ortho_filters
(gene_filt, sp_filt)[source]¶ Save orthology clusters filters :param gene_filt: int. Integer for gene filter threshold :param sp_filt: int. Integer for species filter threshold
-
save_project
(name)[source]¶ Saves the current alignment_list or proteome_list for quick access to the data sets. It automatically detects whether the current data set is from the orthology or process modules.
Parameters: name – string, name of the project
-
save_protein_filters
(min_len, max_stop)[source]¶ Saves protein length and stop percentage filters :param min_len: int. Minimum sequence length :param max_stop: int. Maximum percentage of stop codons
-
save_reverseconc_partfile
(partfile)[source]¶ Save partition file for reverse concatenation an update button in reverse concatenation dialog :param partfile: string. Path to partition file
-
save_reverseconc_settings
(use_parts=False)[source]¶ Handles the information provided by the LoadDialog with settings for the reverse concatenation :param use_parts: boolean. If True, use a partition file. Else Use user defined partitions
-
save_taxafilter
(filter_act, filter_mode, taxa_group)[source]¶ Stores the information of the taxa filter dialog of the process screen :param filter_mode: string, determines the taxa filtering mode. Can be either ‘Contain’ or ‘Exclude’ :param taxa_group: string, with the name of the taxa group that should be present in the taxa_group attribute
-
save_text
(text, idx)[source]¶ Saves a text input, whose attribute depends on the idx argument :param text: string. The text to be assigned to the attribute :param idx: string. This will determine which attribute will be used property
-
save_variationfilter
(filter_act, *pargs)[source]¶ Stores the information of the variation filter dialog. :param filter_act: Boolean, whether the filter is active (True) or not (False) :param pargs, list of tuples, with first element being the checkbox active property and the second element the value of said parameter
-
save_zorro_settings
(suffix)[source]¶ Handles the information provided by the user in the ZorroDialog :param suffix: string, suffix of the ZORRO files
-
screen
= None¶ Currently open Screen object.
-
screen_names
¶ List of basename screen names.
-
search_add_gene_table_line
(gene_table, start=0)[source]¶ Wraps the creation of gene table lines into the table_grid widget. :param gene_table :return:
-
search_sort_gene_table
(sortby, ascending=True)[source]¶ Sorts the gene table by any column header. :param str sortby: Column header name to perform the sort :param bool ascending: Whether the sorting will be ascending or descending
-
search_statistics_gene_table
(s)[source]¶ Searches the summary statistic gene table view, according to the provided string. :param s: string. Used to search alignment names.
-
secondary_operations
= OrderedDict([('collapse', False), ('filter', False), ('gcoder', False), ('consensus', False)])¶ Dictionary mapping the secondary operations to a bool value. Active secondary operations have a True value.
-
secondary_options
¶ Dictionary mapping secondary options to a bool value. Active secondary options have a True value.
-
select_bt
(value)[source]¶ Functionality to the Select All/Deselect All buttons of the side panel. The method was made in such a way that it could be of general use for buttons in the files and taxa tabs
Parameters: value – Button widget.
-
select_bt_from_file
(idx, txt_file)[source]¶ Adds functionality to the dropdown button options for selecting file or taxa buttons contained in a text file :param idx: string, either ‘Files’ or ‘Taxa’. :param txt_file: string, path to txt file containing the files/taxa names to be selected
-
select_taxa_group
(bt)[source]¶ Gives functionality to the buttons in the dialog_select_taxa_group. Saves the taxa group name and closes subpopup
Parameters: bt – Button object
-
sequence_types
¶ String attribute storing the sequence type of alignment files currently loaded.
-
set_codon_model
(codon_partition, wgt=None)[source]¶ Changes the model spinners when changing the codon partitioning
Parameters: codon_partition – string. The codon partition string that should correspond to a key in partition_model :param wgt: Widget object containing the partitions dialog
-
show_back_bt
()[source]¶ Adds a back button to self.root_window, which will navigate to the previous screen. This is meant for headless plot screens
-
show_plot_toolbar
(toolbar_type='orto')[source]¶ Adds a PlotToolbar BoxLayout to self.root_window. This is meant to be an auxiliary toolbar for specific operations related to plots. :param toolbar_type: string, determines whether an orto plot toolbar is displayed (‘orto’) or a stats plot toolbar (‘stats’)
-
show_popup
(title, content, size_hint=(0.9, 0.9), size=None, separator_color=None, close_bt=None, auto_dissmiss=True, popup_level=1, border_color=None)[source]¶ General purpose method to create a popup widget
Parameters: - title (str) – Title of the popup
- content (widget) – The contents of the popup widget
- size_hint (tuple) – Size hint for the widget
- size (tuple) – The absolute size for the popup. If this
argument is used, the size_hint will be ignored :param list separator_color: List with rgb color of popup separator :param bool close_bt: If True, Adds a (X) button to the top right of the popup that dismisses the popup :param bool auto_dismiss: Sets whether the popup should be automatically dismissed on pressing Esc :param int popup_level: Determines the level of the popup. Two values are currently supported. 1 assigns the popup to _popup; 2 assigns the popup to _subpopup
-
show_side_panel
¶ bool controlling the toggling of main headers. Is set to True when the sidepanel is open and False when not.
-
show_stats_toggle
(args1, args2, active_bt, single_gene=None)[source]¶ Adds a toggle widget to some Statistics plots that allow the user to toggle plots between the whole data set and species perspectives :param args1: dictionary, key must be “plt_idx”, and value the plot index string for the species plot type :param args2: dictionary, key must be “plt_idx”, and value the plot index string for the average plot type :param active_bt: string, identifier of the active button. Can be either “sp” (Species), “avg” (Average) or “gene” (Single gene) :param single_gene: dictionary, key must be “plt_idx”, and value the plot index string for the single gene plot type
-
sidepanel_add_bts
(idx, tab_name, partition_fls=None)[source]¶ Wrapper that adds buttons to the corresponding File, Taxa or Partitions panel. Also prevents duplicates from being entered and adds buttons for mouse over events. :param idx: string. Identifier of the current item. It will be the name of the button :param tab_name: string. Identifies in which side panel gridlayout the button will be added :param partition_fls: string. Only for Partitions tab_name. Includes full path of the alignment for the partition.
-
sidepanel_clear_search
(panel)[source]¶ Clears previous search string and populates with the original buttons :param panel: string, the panel to clear the search. Can be either ‘files’ or ‘taxa’
-
sidepanel_create_part_bts
(idx)[source]¶ Creates buttons for each partition :param idx: string. unique identifier of partition
-
sidepanel_on_touch
(touch)[source]¶ This function is binded to the app Window so that it can handle any touch_up events. Once the side panel is open, this allows any mouse click outside the panel to close it. It gathers information on the mouse and side panel position and evaluates a collision. It will trigger the side panel closing only when four conditions are met:
- When there is a mouse input outside the side panel
- When the variable controlling the side panel (show_side_panel) is
True, meaning that the panel is extended - When the mouse input is outside the previous button in the action bar, which is also used to toggle the side panel. This prevents issues of toggling the side panel twice with one mouse input - When a popup is not open. There are several buttons in the side bar that open whose position is outside the side bar. The user should be able to click anywhere in the popup without the side panel closing.
In addition, it will handle the status of the partition box dialog, associated with the sidepanel. While this box is active, the sidepanel must remain open. However, clicks outside the partition box will close it.
Parameters: touch – Touch event
-
sidepanel_search_bts
(txt, panel)[source]¶ Performs a search for file or taxa buttons in the side panel based on the text string provided :param txt: string, the expression used for the search :param panel: string, the panel to perform the search. Can be either ‘files’ or ‘taxa’.
-
sp_file_bts
¶ List of widgets from individual files in the “Files” tab of the sidepanel. This attribute is used when searching for files and for loading only Button subsets of very large data sets. Each element will be a tuple containing the main Button, the information Button, and the remove Button widgets.
-
sp_moreopts
¶ - bool attribute of whether the side panel’s MoreOptions dialog is active
- (True) or not (False).
-
sp_partition_bts
¶ List of widgets from individual partitions in the “Partitions” tab of the sidepanel. This attribute is used when searching for partitions and for loading only Button subsets of very large data sets. Each element will be a tuple containing the main Button, the counter Button, and the edit Button widgets.
-
sp_taxa_bts
¶ List of widgets from individual taxa in the “Taxa” tab of the sidepanel. This attribute is used when searching for taxa and for loading only Button subsets of very large data sets. Each element will be a tuple containing the main Button, the information Button, and the remove Button widgets.
-
sqldb
¶ String with path to sqlite database.
-
statistics_populate_groups
(ds_type)[source]¶ This method is called when the dataset selection buttons in the Statistics sidepanel are pressed. They populate the respective dropdown menu with the currently set groups :param ds_type: string, data set type. Can be either ‘taxa’ or ‘files’
-
statistics_show_summary
(force=False, tp='stats')[source]¶ Creates a subprocess for calculating summary statistics for the curently acitve data set. It will show either stats or table mode, depending on the option provided in the ‘t’ argument. :param force: Bool, Clear all widgets from Stats scatter and show summary :param tp: string, Show overall summary statistics (‘stats’) or summary statistics for each gene in table view (‘table’)
-
stats_handle_outliers
(operation, ds_type)[source]¶ Function that handles the processing of outliers in the stats plots :param operation: string, three operations are available:
.:remove: Removes outliers from data set .:export: Export outliers to text file .:view: Opens a new dialog with the list of outliersParameters: ds_type – string, two ds_types are available: .:Taxa: Removes taxa .:Files: Removes files
-
stats_load_more_genes
()[source]¶ Functionality to the load next 20 genes in the stats gene selection dialog
-
stats_plt_method
= {'Proportion of nucleotides or residues sp': [<function stacked_bar_plot>, 'char_proportions_sp.png'], 'Segregating sites outliers': [<function outlier_densisty_dist>, 'Segregating_sites_outliers.png'], 'Distribution of missing data': [<function histogram_smooth>, 'missing_data_distribution.png'], 'Allele Frequency Spectrum gn': [<function histogram_plot>, 'allele_frequency_spectrum_gn.png'], 'Distribution of missing orthologs': [<function bar_plot>, 'missing_gene_distribution.png'], 'Pairwise sequence similarity sp': [<function triangular_heat>, 'similarity_distribution_sp.png'], 'Gene occupancy': [<function interpolation_plot>, 'gene_occupancy.png'], 'Allele Frequency Spectrum': [<function histogram_plot>, 'allele_frequency_spectrum.png'], 'Allele Frequency Spectrum prop': [<function histogram_plot>, 'allele_frequency_spectrum_prop.png'], 'Distribution of sequence size all': [<function histogram_plot>, 'avg_seqsize.png'], 'Segregating sites prop': [<function histogram_plot>, 'segregating_sites_prop.png'], 'Sequence size outliers sp': [<function outlier_densisty_dist>, 'Sequence_size_outliers_sp.png'], 'Pairwise sequence similarity': [<function histogram_plot>, 'similarity_distribution.png'], 'Segregating sites gn': [<function sliding_window>, 'segregating_sites_gn.png'], 'Segregating sites': [<function histogram_plot>, 'segregating_sites.png'], 'Distribution of sequence size': [<function box_plot>, 'avg_seqsize_species.png'], 'Missing data outliers': [<function outlier_densisty_dist>, 'Missing_data_outliers.png'], 'Segregating sites outliers sp': [<function outlier_densisty_dist>, 'Segregating_sites_outliers_sp.png'], 'Cumulative distribution of missing genes': [<function bar_plot>, 'cumulative_distribution_missing_genes.png'], 'Proportion of nucleotides or residues': [<function bar_plot>, 'char_proportions.png'], 'Distribution of taxa frequency': [<function histogram_plot>, 'distribution_taxa_frequency.png'], 'Pairwise sequence similarity gn': [<function sliding_window>, 'similarity_distribution_gn.png'], 'Segregating sites sp': [<function triangular_heat>, 'segregating_sites_sp.png'], 'Sequence size outliers': [<function outlier_densisty_dist>, 'Sequence_size_outliers.png'], 'Missing data outliers sp': [<function outlier_densisty_dist>, 'Missing_data_outliers_sp.png'], 'Distribution of missing data sp': [<function stacked_bar_plot>, 'missing_data_distribution_sp.png'], 'Alignment length/Polymorphism correlation': [<function scatter_plot>, 'length_polymorphism_correlation.png'], 'Distribution of missing orthologs avg': [<function histogram_plot>, 'missing_gene_distribution_avg.png']}¶ Dictionary that maps the string identifier of statistics plot analyses to a list. This list has two elements. The first is the plotting method defined in
trifusion.base.plotter
, and the second is the name of the temporary figure file that will be generated.
-
stats_search_genes
(txt)[source]¶ Searches loaded genes for the single gene display of the Statistics screen
-
stats_select_plot
(gn_idx, sp_idx, avg_idx)[source]¶ Dialog used for plot type selection when choosing an option from the stats panel
-
stats_sethline
(val, plt_file, inverted=False)[source]¶ Sets an horizontal threshold bar to the current plot object :param val: integer, The y-axis value for the horizontal line :param plt_file: string, The path to the plot file :param inverted: Boolean, Determine whether the shade will be above or below the plot
-
stats_show_plot
(plt_idx, additional_args=None)[source]¶ Wrapper that executes plot data gathering and execution. The method that gathers the data for plot production runs in the background. Once it’s finished, that data is fed to the stats_write_plot method that will create the plot file and load it into the program.
Parameters: plt_idx – string, identification string of the plot. Usually is the text property of the issuing button. :param additional_args:
-
stats_summary
= None¶ Reference to the :class:`trifusion.data.resources.custom_widgets.StatsSummary object containing the widgets of the overall summary statistics in the Statistics screen.
-
stats_table
= None¶ Reference to the :class:`trifusion.data.resources.custom_widgets.GeneTable object containing the widgets of the gene table summary statistics in the Statistics screen.
-
stats_write_plot
(plot_data, footer, plt_idx)[source]¶ Provided with the data structure and a plt_idx string identifier, this function will create the plot file and app variable, and load it into the Statistics screen.
To configure the Gene/Species/Average plot trigger, this method impors the stats_compliant object from data/resources/stats.py
Parameters: plot_data – list/np array, data structure to be used in plot construction :param footer: List, containing information on the number of active genes and taxa :param plt_idx: string, identification string of the plot. Usually is the text property of the issuing button.
-
taxa_filter_settings
¶ List attribute storing the taxa filter settings. The first element of the list should be the filter mode (either “Contain” or “Exclude”) and the second element should be a string with the name of the taxa group (from the
taxa_group
attribute).
-
taxa_groups
¶ Dictionary storing custom taxa groups defined in TriFusion. Keys are group names and values are a list of taxon names.
-
taxagroup_move_taxa
(source_wgt, sink_wgt, all_taxa, ds_type)[source]¶ Method that adds functionality to the addition/removal buttons (<<, <, >>, >) in the taxa group dialog. :param source_wgt: widget, the gridlayout from where the buttons will be moved :param sink_wgt: widget, the gridlayout to where buttons will be moved :param all_taxa: Boolean, if True its as if alsa taxa were selected to be moved :param ds_type: string. Data set type. It may be either “taxa” or “files”
-
taxagroups_add_group
(name, wgt, ds_type)[source]¶ Adds a dataset button, and corresponding removal button, to the group list gridlayut of the Dataset dialog. :param name: string, name of the group :param wgt: GridLayout widget where the buttons will be added :param ds_type: string, dataset type, whether ‘taxa’ or ‘files’
-
taxagroups_display_group
(name, ds_type)[source]¶ Gives functionality to the group buttons in the dataset dialog. It displays the group constitution in the dialog :param name: :param ds_type:
-
taxagroups_show_taxa
(name_wgt)[source]¶ Creates a popup listing the taxa included in a taxa group given by name :param name_wgt: widget, widget containing the name of the group as text
-
temp_dir
¶ String with path to temporary directory.
-
terminate_background
¶ bool attribute used to determine if a generic background process should be terminated by the user. Value is True by default and they only change on the start up of the appropriate background function.
-
terminate_group_export
¶ bool attribute used to determine if a ortholog export background process should be terminated by the user. Value is True by default and they only change on the start up of the appropriate background function.
-
terminate_load_files
¶ bool attribute used to determine if a file loading background process should be terminated by the user. Value is True by default and they only change on the start up of the appropriate background function.
-
terminate_orto_search
¶ bool attribute used to determine if a orthology search background process should be terminated by the user. Value is True by default and they only change on the start up of the appropriate background function.
-
terminate_process_exec
¶ bool attribute used to determine if a process execution background process should be terminated by the user. Value is True by default and they only change on the start up of the appropriate background function.
-
terminate_stats
¶ bool attribute used to determine if a summary statists background process should be terminated by the user. Value is True by default and they only change on the start up of the appropriate background function.
-
toggle_fancy_dropdown
(bt, values, orientation='down', add_ds_type=None)[source]¶ Adds functionality to the File/Taxa dropdown menus using a FancyDropDown widget :param Button bt: Button instance that was pressed :param list values: List of values that will populate the dropdown menu :param str orientation: Whether the dropdown will go ‘down’ or ‘up’ :param str add_ds_type: If not None, it will provide the additional data set buttons of the appropriate ds_type (‘files’ or ‘taxa’)
-
static
toggle_groups
(wgt)[source]¶ This method generates a desired behaviour for groups of toggle buttons By default, when a toggle button is pressed, the state will be down and a new screen/slide is presented. However, if the same toggle button is pressed again, it’s state will return to the normal state while the same screen/slide is showed. To prevent this behaviour, this method will disable the active toggle button in the group and enable any other previously disabled button.
To allow a seamless transition, ensure that background_disabled_dow is the same as background_down, and that disabled_color is the same as color.
Parameters: wgt – The toggle button widget. Must belong to a group.
-
toggle_multi_selection
(value)[source]¶ Adds multiple selection using shift+click for general purpose lists of toggle buttons in data set creator
-
toggle_orto_soptions
()[source]¶ Controls the toggling of the GridLayout with the advanced options for the Orthology screen, Ortholog search slide
-
toggle_process_options
()[source]¶ Controls the toggling of the GridLayout with the additional options for the process screen.
-
toggle_selection
(value)[source]¶ Adds functionality for the file and taxa toggle buttons in the side panel. It adds or removes the selected taxa from the active lists
Parameters: value – Button widget.
-
toggle_stats_options
(bt, idx)[source]¶ Toggles the main data exploration analyses options in the Statistics screen
-
toggle_stats_panel
(force_close=None, force_open=None)[source]¶ Controls the animation of the statistics panel :param force_close: Boolean. If True, close the stats panel regardless of current position :param force_open: Boolean. If True, open the stats panel regardless of current position
-
touch
= None¶ Touch object. Can be used to query the type of touch on certain events.
-
trigger_taxa_update
= False¶ bool attribute that determined whether taxa information needs to be updated (True) or not (False).
-
update_file_label
()[source]¶ Sets and updates a label on the Files tab of the side panel, informing how many files are selected out of the total files
-
update_main_operations
(op)[source]¶ Updates the app attribute containing the main operations of the Process screen, self.main_operations. Only one main operation can be active. :param op: The name of the operation to turn on (all others will be disabled)
-
update_partition_label
()[source]¶ Setsand updates a label on the Partitions tab of the side panel, informing how partitions files are selected out of the total partitions
-
update_process_switch
(switch_id, state)[source]¶ Listens and updates the attribute process_switches when their state changes. :param switch_id: string, name of the switch according to the keys in process_switches :param state: Boolean, current state of the corresponding switch
-
update_sp_label
()[source]¶ Sets and updates a label on the Taxa tab of the side panel, informing how many taxa are selected out of the total taxa. If the taxa list is empty, it disables the select/deselect buttons
-
update_taxa
()[source]¶ This checks whether some taxa that were specific to some file(s) were removed when that file is removed.
-
use_app_partitions
¶ bool atribute determining whether reverse concatenation will use a partition file (False) or the partitions defined in the app (True).
-
use_nexus_models
¶ bool attribute that determines whether the substitution models associated to alignment partitions should be written to the nexus file (True) or not (False).
-
use_nexus_partitions
¶ bool attribute that determines whether the charset partitions block in nexus format should be written (True) or not (False).
-
usearch_db
¶ String with name of usearch’s database file.
-
usearch_evalue
¶ String with evalue for usearch execution.
-
usearch_file
¶ String with path to usearch executable.
-
usearch_output
¶ String with name of the usearch output file.
-
variation_filter
¶ List attribute storing the alignment variation filter settings. The elements correspond to:
- Minimum variable sites.
- Maximum variable sites.
- Minimum informative sites.
- Maximum informative sites.
-
zorro_dir
¶ String with the directory containing the zorro files.
-
zorro_suffix
¶ String with the suffix of zorro files.
-