TAPIR GUI executable

This documents the functions in the TAPIR.py executable and also the underlying views and models (see TOC at the end). The main window is MainWindow which contains a single main widget ApplicationView. The ApplicationView is the main widget, it contains the left side tree structure (PeptideTreeWidget) and the right side graph area (GraphArea).

TAPIR Main Window

class TAPIR.MainWindow(settings)

Bases: PyQt4.QtGui.QMainWindow

The main window running the application.

  • It contains a reference to the actual MS data model (DataModel in MSData)
  • It contains a reference to the main widget (ApplicationView)
  • It loads files through loadFiles() which delegates the call to the data model
plotsUpdated() : Handle an update in plots (and draw time taken to plot)

Reference to the underlying data model (of type DataModel)


Reference to the actual main widget (of type ApplicationView)

loadFiles(pyFileList, fileType=None)

Load a set of files to display

  1. Try to load single yaml file
  2. Try to load a list of only mzML or sqMass files
  3. Try to load a mixed list of mzML, sqMass and other files (.tsv)

For the third option, the data files (mzML or sqMass) are separated from the annotation files (tsv, traml) and loaded using DataModel.loadMixedFiles.

  • pyFileList (list of str) – List of paths to files
  • fileType (str) – Description of the type of file the metadata file (valid: simple, yaml, traml, openswath)

Slot: updates the status bar when ApplicationView emits TAPIR.ApplicationView.plotsUpdated()


Show the open file dialog to load a new dataset.


Update global settings (after closing the settings dialog) in the application and data model

TAPIR ApplicationView (central window)

class TAPIR.ApplicationView(parent, settings)

Bases: PyQt4.QtGui.QWidget

The main/central widget for the application which is directly called from the MainWindow.

It hosts the following graphical widgets:
  • self.leftside : Reference to the left side widget (of type PeptideTreeWidget)
  • self.graph_layout : Reference to the right side widget (of type GraphArea)
treeSelectionChanged(): Handle a change in the selection in the tree
plotsUpdate(): When the plots need to be updated

Add a plot for each run that needs to be displayed (calls the underlying GraphArea)

Parameters:datamodel (DataModel) – The data model containing data to plot

Access to the underlying hierarchical data model (proteins, precursors, peptides, transitions)

Returns:The underlying hierarchical data model (displayed on the right side)
Return type:PeptideTree

Qt signal emitted when plots need to be updated due to selecting a different peptide


Grab the selectionChanged signal from the PeptideTreeWidget and accordingly update the graphing area on the right.

TAPIR Widgets

class TAPIR.GraphArea(use_guiqwt=True)

Bases: PyQt4.QtGui.QWidget

The Graph Area is displayed on the right side of the main area (see ApplicationView)

The actual implementation of the plotting is in the Plot module.

plotZoomChanged(): Handle plot emitting a zoomChanged signal

The underlying list of plots (either of type GuiQwtMultiLinePlot or QwtMultiLinePlot)


Add a plot for each run that needs to be displayed

Parameters:datamodel (DataModel) – The data model containing data to plot

Add dummy plots for testing

plotZoomChanged(xmin, xmax, ymin, ymax)

Slot to deal with the underlying plot emitting a zoomChanged signal, needs to reset all axis using min/max values

update_all_plots(chr_transition, show_legend)

We update the plots for all runs.

  1. Load the data from the ChromatogramTransition object
  2. Plot the data for each plot, calling update_all_curves on each plot
class TAPIR.PeptideTreeWidget(firstColumnName)

Bases: PyQt4.QtGui.QWidget

The Peptide Tree Widget is displayed on the left side of the main area (see ApplicationView). It consists of a PeptidesTreeView widget and a search box below.

treeViewSelectionChangedSlot() : Handle a change in the selection in the tree (and pass forward through selectionChanged signal)
selectionChanged : when the peptide selection is changed
- self._precursor_model

The underlying peptide tree model (of type PeptideTree)

- self.treeView

The underlying peptide tree view widget (of type PeptidesTreeView)

- self.treeLineEdit

A place for input below the tree

- self.treeComboBox

A combo box relating to the column for search


Slot connected to the signal generated by pressing return in the text field


Slot connected to the signal generated by changing the text in the text field


Access to the underlying precursor model

Returns:The underlying precursor model
Return type:PeptideTree

Set up the model and the view

This sets up the layout as follows:
  1. self.treeView widget

  2. searchbox_layout layout

    2.1 self.treeLineEdit (QtGui.QLineEdit) 2.2 self.treeComboBox (QtGui.QComboBox)


Qt signal emitted when the peptide selection changes

treeViewSelectionChangedSlot(newvalue, oldvalue)
class TAPIR.ConfigDialog(parent, settings)

Bases: PyQt4.QtGui.QDialog

Configuration Dialog


Responds to the close and save action

class TAPIR.Settings(runMode, use_guiqwt=False)

Bases: object