87
93
@improvement Use DataRepository singleton to share data between TOPPView and the canvas classes (Hiwi)
89
@improvement For painting single mass traces with no width we currently paint each line twice (once going down, and then coming back up).
90
This could be more efficient...
95
@improvement For painting single mass traces with no width we currently paint each line twice (once going down, and then coming back up).
96
This could be more efficient...
92
98
@improvement Keep spectrum browser widgets of all layers in memory in order to avoid rebuilding the entire tree view every time the active layer changes (Hiwi, Johannes)
94
@todo Add TOPPView live-tutorial (Stephan, Marc)
100
@todo Add TOPPView live-tutorial (Stephan, Marc)
96
102
@ingroup TOPPView_elements
98
class OPENMS_GUI_DLLAPI TOPPViewBase
100
public DefaultParamHandler
104
class OPENMS_GUI_DLLAPI TOPPViewBase :
106
public DefaultParamHandler
104
110
friend class TestTOPPView;
107
///@name Type definitions
110
typedef LayerData::FeatureMapType FeatureMapType;
111
//Feature map managed type
112
typedef LayerData::FeatureMapSharedPtrType FeatureMapSharedPtrType;
114
//Consensus feature map type
115
typedef LayerData::ConsensusMapType ConsensusMapType;
116
//Consensus map managed type
117
typedef LayerData::ConsensusMapSharedPtrType ConsensusMapSharedPtrType;
120
typedef LayerData::ExperimentType ExperimentType;
121
//Main managed data type (experiment)
122
typedef LayerData::ExperimentSharedPtrType ExperimentSharedPtrType;
123
///Peak spectrum type
124
typedef ExperimentType::SpectrumType SpectrumType;
128
TOPPViewBase(QWidget* parent=0);
133
@brief Opens and displays data from a file
135
Loads the data and adds it to the application by calling addData_()
137
@param filename The file to open
138
@param show_options If the options dialog should be shown (otherwise the defaults are used)
139
@param caption Sets the layer name and window caption of the data. If unset the file name is used.
140
@param add_to_recent If the file should be added to the recent files after opening
141
@param window_id in which window the file is opened if opened as a new layer (0 or default equals current window).
142
@param spectrum_id determines the spectrum to show in 1D view.
144
void addDataFile(const String& filename, bool show_options, bool add_to_recent, String caption="", UInt window_id=0, Size spectrum_id=0);
146
@brief Opens and displays a data from a database
148
Loads the data and adds it to the application by calling addData_()
150
@param db_id The id in the database
151
@param show_options If the options dialog should be shown (otherwise the defaults are used)
152
@param caption Sets the layer name and window caption of the data. If unset the file name is used.
153
@param window_id in which window the file is opened if opened as a new layer (0 or default equals current window).
155
void addDataDB(UInt db_id, bool show_options, String caption="", UInt window_id=0);
158
@brief Adds a peak or feature map to the viewer
160
@param feature_map The feature data (empty if not feature data)
161
@param consensus_map The consensus feature data (empty if not consensus feature data)
162
@param peptides The peptide identifications (empty if not ID data)
163
@param peak_map The peak data (empty if not peak data)
164
@param data_type Type of the data
165
@param show_as_1d Force dataset to be opened in 1D mode (even if it contains several spectra)
166
@param show_options If the options dialog should be shown (otherwise the defaults are used)
167
@param filename source file name (if the data came from a file)
168
@param caption Sets the layer name and window caption of the data. If unset the file name is used. If set, the file is not monitored foro changes.
169
@param window_id in which window the file is opened if opened as a new layer (0 or default equals current
170
@param spectrum_id determines the spectrum to show in 1D view.
172
void addData(FeatureMapSharedPtrType feature_map, ConsensusMapSharedPtrType consensus_map, std::vector<PeptideIdentification>& peptides, ExperimentSharedPtrType peak_map, LayerData::DataType data_type, bool show_as_1d, bool show_options, bool as_new_window = true, const String& filename="", const String& caption="", UInt window_id=0, Size spectrum_id=0);
174
/// Opens all the files in the string list
175
void loadFiles(const StringList& list, QSplashScreen* splash_screen);
178
@brief Loads the preferences from the filename given.
180
If the filename is empty, the application name + ".ini" is used as filename
182
void loadPreferences(String filename="");
184
/// Stores the preferences (used when this window is closed)
185
void savePreferences();
187
/// Returns the parameters for a SpectrumCanvas of dimension @p dim
188
Param getSpectrumParameters(UInt dim);
190
/// Returns the active Layer data (0 if no layer is active)
191
const LayerData* getCurrentLayer() const;
193
//@name Accessors for the main gui components.
194
//@brief The top level enhanced workspace and the EnhancedTabWidgets resing in the EnhancedTabBar.
196
/// returns a pointer to the EnhancedWorkspace containing SpectrumWidgets and TOPPASWidgets
197
EnhancedWorkspace* getWorkspace() const;
199
/// returns a pointer to the active SpectrumWidget (0 if none is active)
200
SpectrumWidget* getActiveSpectrumWidget() const;
202
/// returns a pointer to the active TOPPAS widget (0 if none is active)
203
TOPPASWidget* getActiveTOPPASWidget() const;
205
/// returns a pointer to the active Spectrum1DWidget (0 the active window is no Spectrum1DWidget or there is no active window)
206
Spectrum1DWidget* getActive1DWidget() const;
208
/// returns a pointer to the active Spectrum2DWidget (0 the active window is no Spectrum2DWidget or there is no active window)
209
Spectrum2DWidget* getActive2DWidget() const;
211
/// returns a pointer to the active Spectrum3DWidget (0 the active window is no Spectrum2DWidget or there is no active window)
212
Spectrum3DWidget* getActive3DWidget() const;
215
/// returns a pointer to the active SpectrumCanvas (0 if none is active)
216
SpectrumCanvas* getActiveCanvas() const;
219
/// returns a pointer to the SpectraIdentificationViewWidget
220
SpectraIdentificationViewWidget* getSpectraIdentificationViewWidget();
222
/// Opens the provided spectrum widget in a new window
223
void showSpectrumWidgetInWindow(SpectrumWidget* sw, const String& caption);
226
/// changes the current path according to the currently active window/layer
227
void updateCurrentPath();
228
/// shows the URL stored in the data of the sender QAction
230
/// shows the file dialog for opening files
231
void openFileDialog();
232
/// shows the file dialog for opening example files
233
void openExampleDialog();
234
/// shows the DB dialog for opening files
235
void openDatabaseDialog();
236
/// shows the goto dialog
237
void showGoToDialog();
238
/// enable TOPPAS tab in the view dock widget
239
void setTOPPASTabEnabled(bool enabled);
240
/// shows the preferences dialog
241
void preferencesDialog();
242
/// Shows statistics (count,min,max,avg) about Intensity, Quality, Charge and meta data
243
void layerStatistics();
244
/// lets the user edit the meta data of a layer
246
/// get's called if a layer got activated
247
void layerActivated();
248
/// get's called if a layer got deactivated
249
void layerDeactivated();
250
/// Activation of 1D spectrum
251
void activate1DSpectrum(int index);
252
/// Deactivation of 1D spectrum
253
void deactivate1DSpectrum(int index);
254
/// closes the active window
256
/// updates the toolbar
257
void updateToolBar();
258
/// adapts the layer bar to the active window
259
void updateLayerBar();
260
/// adapts view bar to the active window
261
void updateViewBar();
262
/// changes the behavior according to the selected view in the spectra view bar and calls updateSpectraViewBar()
263
void viewChanged(int);
264
/// adapts the filter bar to the active window
265
void updateFilterBar();
266
/// enabled/disabled menu entries depending on the current state
268
/// brings the tab corresponding to the active window in front
269
void updateTabBar(QWidget* w);
270
/// tile the open windows vertically
272
/// tile the open windows horizontally
273
void tileHorizontal();
275
@brief Shows a status message in the status bar.
277
If @p time is 0 the status message is displayed until showStatusMessage is called with an empty message or a new message.
278
Otherwise the message is displayed for @p time ms.
280
void showStatusMessage(std::string msg, OpenMS::UInt time);
281
/// shows m/z and rt in the status bar
282
void showCursorStatus(double mz, double rt);
283
/// shows m/z and rt in the status bar (inverting RT and m/z)
284
void showCursorStatusInvert(double mz, double rt);
286
void showTOPPDialog();
287
/// Annotates current layer with ID data
288
void annotateWithID();
289
/// Shows the theoretical spectrum generation dialog
290
void showSpectrumGenerationDialog();
291
/// Shows the spectrum alignment dialog
292
void showSpectrumAlignmentDialog();
293
/// Shows the spectrum with index @p index of the active layer in 1D
294
void showSpectrumAs1D(int index);
295
/// Shows the current peak data of the active layer in 2D
296
void showCurrentPeaksAs2D();
297
/// Shows the current peak data of the active layer in 3D
298
void showCurrentPeaksAs3D();
299
/// Shows the 'About' dialog
300
void showAboutDialog();
301
/// Saves the whole current layer data
303
/// Saves the visible layer data
304
void saveLayerVisible();
305
/// Toggles the grid lines
306
void toggleGridLines();
307
/// Toggles the axis legends
308
void toggleAxisLegends();
309
/// Shows current layer preferences
310
void showPreferences();
311
/// dialog for inspecting database meta data
312
void metadataDatabaseDialog();
313
/// dialog for inspecting file meta data
314
void metadataFileDialog();
316
/** @name TOPPAS pipeline slots
320
@brief Opens and displays a TOPP pipeline from a file.
321
@param filename Name of the file to be opened
322
@param in_new_window Indicates wether a new window should be created or merged with the opened one
324
void addTOPPASFile(const String& filename, bool in_new_window);
325
/// adds toppas widget to the current workspace
326
void showTOPPipelineInWindow_(TOPPASWidget* tw, const String& caption);
327
/// creates a new TOPPAS pipeline
329
/// shows the dialog for saving the current TOPPAS pipeline and updates the current tab caption
330
void saveCurrentPipelineAs();
331
/// saves the pipeline (determined by qt's sender mechanism)
333
/// paste pipeline into current pipeline
334
void includePipeline();
335
/// load toppas resource file
336
void loadPipelineResourceFile();
337
/// save toppas resource file
338
void savePipelineResourceFile();
339
/// refresh the toppas pipeline parameters
340
void refreshPipelineParameters();
341
/// runs the the toppas pipeline
343
/// aborts the the toppas pipeline
344
void abortPipeline();
345
/// message after successful completion of pipeline
346
void showPipelineFinishedLogMessage();
347
/// Saves @p scene to the clipboard
348
void saveToClipboard(TOPPASScene* scene);
349
/// Sends the clipboard content to the sender of the connected signal
350
void sendClipboardContent();
351
/// Called when a tool is started
353
/// Called when a tool is finished
355
/// Called when a tool crashes
357
/// Called when a tool execution fails
359
/// Called when a file was successfully written to an output vertex
360
void outputVertexFinished(const String& file);
361
/// Called when a TOPP tool produces (error) output.
362
void updateTOPPOutputLog(const QString& out);
363
/// Open files in this TOPPView instance (also updated 'recently opened files' list)
364
void openFilesInTOPPView(QStringList all_files);
367
/** @name Toolbar slots
370
void setDrawMode1D(int);
371
void setIntensityMode(int);
372
void changeLayerFlag(bool);
373
void changeLabel(QAction*);
374
void changeUnassigned(QAction*);
376
void toggleProjections();
380
/** @name Layer manager and filter manager slots
383
/// slot for layer manager selection change
384
void layerSelectionChange(int);
385
/// Enables/disables the data filters for the current layer
386
void layerFilterVisibilityChange(bool);
387
/// slot for layer manager context menu
388
void layerContextMenu(const QPoint& pos);
389
/// slot for log window context menu
390
void logContextMenu(const QPoint& pos);
391
/// slot for layer manager visibility change (check box)
392
void layerVisibilityChange(QListWidgetItem* item);
393
/// slot for filter manager context menu
394
void filterContextMenu(const QPoint& pos);
395
/// slot for editing a filter
396
void filterEdit(QListWidgetItem* item);
397
/// slot for editing the preferences of the current layer
398
void layerEdit(QListWidgetItem* /*item*/);
401
/** @name TOPPAS protected slots
404
/// Inserts a new TOPP tool in the current window at (x,y)
405
void insertNewVertex_(double x, double y, QTreeWidgetItem* item = 0);
406
/// Inserts a new TOPP tool at the center of the current window at (x,y)
407
void insertNewVertexInCenter_(QTreeWidgetItem* item);
410
/// slot for the finished signal of the TOPP tools execution
411
void finishTOPPToolExecution(int exitCode, QProcess::ExitStatus exitStatus);
412
/// aborts the execution of a TOPP tool
413
void abortTOPPTool();
414
/// retuns the last invoked TOPP tool with the same parameters
415
void rerunTOPPTool();
416
/// shows the spectrum browser and updates it
417
void showSpectrumBrowser();
418
/// shows the spectrum metadata
419
void showSpectrumMetaData(int spectrum_index);
421
/** @name Tabbar slots
424
/// Closes the window corresponding to the data of the tab with identifier @p id
425
void closeByTab(int id);
426
/// Raises the window corresponding to the data of the tab with identifier @p id
427
void enhancedWorkspaceWindowChanged(int id);
428
/// Opens a file from the recent files menu
429
void openRecentFile();
430
/// Slot for drag-and-drop of layer manager to tabbar
431
void copyLayer(const QMimeData* data, QWidget* source, int id=-1);
434
/// Appends process output to log window
435
void updateProcessLog();
437
/// Called if a data file has been externally changed
438
void fileChanged_(const String&);
441
/// Initializes the default parameters on TOPPView construction.
442
void initializeDefaultParameters_();
444
/// unique list of files referenced by all layers
445
std::set<String> getFilenamesOfOpenFiles_();
447
/// Tries to open a db connection (queries the user for the DB password)
448
void connectToDB_(DBConnection& db);
450
@brief Shows a dialog where the user can select files
452
QStringList getFileList_(const String& path_overwrite = "");
454
/// Returns the enhanced tabbar widget with id @p id
455
EnhancedTabBarWidgetInterface* window_(int id) const;
457
///@name dock widgets
459
QDockWidget* layer_dock_widget_;
460
QDockWidget* views_dockwidget_;
461
QDockWidget* filter_dock_widget_;
464
///@name Spectrum selection widgets
466
SpectraViewWidget* spectra_view_widget_;
467
SpectraIdentificationViewWidget* spectra_identification_view_widget_;
470
/// Layer management widget
471
QListWidget* layer_manager_;
473
///@name Filter widgets
475
QListWidget* filters_;
476
QCheckBox* filters_check_box_;
479
/// Watcher that tracks file changes (in order to update the data in the different views)
480
FileWatcher* watcher_;
482
/// Holds the messageboxes for each layer that are currently popped up (to avoid popping them up again, if file changes again before the messagebox is closed)
483
bool watcher_msgbox_;
486
/// Log output window
493
//common intensity modes
495
QButtonGroup* intensity_button_group_;
498
QToolBar* tool_bar_1d_;
499
QButtonGroup* draw_group_1d_;
502
QToolBar* tool_bar_2d_peak_;
503
QToolBar* tool_bar_2d_feat_;
504
QToolBar* tool_bar_2d_cons_;
505
QToolBar* tool_bar_2d_ident_;
506
QAction* dm_precursors_2d_;
507
QAction* dm_hull_2d_;
508
QAction* dm_hulls_2d_;
509
QToolButton* dm_label_2d_;
510
QActionGroup* group_label_2d_;
511
QToolButton* dm_unassigned_2d_;
512
QActionGroup* group_unassigned_2d_;
513
QAction* dm_elements_2d_;
514
QAction* projections_2d_;
515
QAction* dm_ident_2d_;
519
EnhancedWorkspace* ws_;
521
///Tab bar. The address of the corresponding window to a tab is stored as an int in tabData()
522
EnhancedTabBar* tab_bar_;
527
/// Label for messages in the status bar
528
QLabel* message_label_;
529
/// m/z label for messages in the status bar
531
/// RT label for messages in the status bar
535
/// @name Recent files
537
///adds a Filename to the recent files
538
void addRecentFile_(const String& filename);
539
///update the recent files menu
540
void updateRecentMenu_();
541
/// list of the recently opened files
542
QStringList recent_files_;
543
/// list of the recently opened files actions (menu entries)
544
std::vector<QAction*> recent_actions_;
548
/// @name TOPP tool execution
550
/// Runs the TOPP tool according to the information in topp_
552
///Information needed for execution of TOPP tools
568
/// check if all avaiable preferences get set by the .ini file. If there are some missing entries fill them with default values.
569
void checkPreferences_();
570
///@name reimplemented Qt events
572
void closeEvent(QCloseEvent* event);
575
///Log message states
578
LS_NOTICE, ///< Notice
579
LS_WARNING, ///< Warning
580
LS_ERROR ///< Fatal error
582
/// Shows a log message in the log_ window
583
void showLogMessage_(LogState state, const String& heading, const String& body);
585
///Additional context menu for 2D layers
586
QMenu* add_2d_context_;
588
/// Apply TOPP tool. If @p visible is true, only the visible data is used, otherwise the whole layer is used.
589
void showTOPPDialog_(bool visible);
591
/// The current path (used for loading and storing).
592
/// Depending on the preferences this is static or changes with the current window/layer.
593
String current_path_;
595
///@name TOPPAS variables
597
/// Path to temporary directory used in TOPPAS
598
QString toppas_tmp_path_;
600
/// z-value counter for new inserted TOPPAS nodes
601
static qreal toppas_z_value_;
603
/// Offset counter for new inserted TOPPAS nodes (to avoid invisible stacking)
604
static int toppas_node_offset_;
606
/// The toppas clipboard
607
TOPPASScene* toppas_clipboard_scene_;
610
/// Tabwidget that hold the different views on the loaded data
611
QTabWidget* views_tabwidget_;
612
/// The current TOPPView view behavior
613
TOPPViewBehaviorInterface* view_behavior_;
614
/// TOPPView behavior for the identification view
615
TOPPViewIdentificationViewBehavior* identificationview_behavior_;
616
/// TOPPView behavior for the spectra view
617
TOPPViewSpectraViewBehavior* spectraview_behavior_;
619
// static helper functions
621
/// Returns true if @p contains at least one MS1 spectrum
622
static bool containsMS1Scans(const ExperimentType& exp);
624
/// Estimates the noise by evaluating n_scans random scans of MS level 1. Assumes that 4/5 of intensities is noise.
625
float estimateNoiseFromRandomMS1Scans(const ExperimentType& exp, UInt n_scans = 10);
627
/// Counts the number of exact zero valued intensities in all MS1 spectra
628
static UInt countMS1Zeros(const ExperimentType& exp);
630
/// Returns true if the experiment map contains peptide identifications
631
static bool hasPeptideIdentifications(const ExperimentType& map);
113
///@name Type definitions
116
typedef LayerData::FeatureMapType FeatureMapType;
117
//Feature map managed type
118
typedef LayerData::FeatureMapSharedPtrType FeatureMapSharedPtrType;
120
//Consensus feature map type
121
typedef LayerData::ConsensusMapType ConsensusMapType;
122
//Consensus map managed type
123
typedef LayerData::ConsensusMapSharedPtrType ConsensusMapSharedPtrType;
126
typedef LayerData::ExperimentType ExperimentType;
127
//Main managed data type (experiment)
128
typedef LayerData::ExperimentSharedPtrType ExperimentSharedPtrType;
129
///Peak spectrum type
130
typedef ExperimentType::SpectrumType SpectrumType;
134
TOPPViewBase(QWidget* parent = 0);
139
@brief Opens and displays data from a file
141
Loads the data and adds it to the application by calling addData_()
143
@param filename The file to open
144
@param show_options If the options dialog should be shown (otherwise the defaults are used)
145
@param caption Sets the layer name and window caption of the data. If unset the file name is used.
146
@param add_to_recent If the file should be added to the recent files after opening
147
@param window_id in which window the file is opened if opened as a new layer (0 or default equals current window).
148
@param spectrum_id determines the spectrum to show in 1D view.
150
void addDataFile(const String& filename, bool show_options, bool add_to_recent, String caption = "", UInt window_id = 0, Size spectrum_id = 0);
152
@brief Opens and displays a data from a database
154
Loads the data and adds it to the application by calling addData_()
156
@param db_id The id in the database
157
@param show_options If the options dialog should be shown (otherwise the defaults are used)
158
@param caption Sets the layer name and window caption of the data. If unset the file name is used.
159
@param window_id in which window the file is opened if opened as a new layer (0 or default equals current window).
161
void addDataDB(UInt db_id, bool show_options, String caption = "", UInt window_id = 0);
164
@brief Adds a peak or feature map to the viewer
166
@param feature_map The feature data (empty if not feature data)
167
@param consensus_map The consensus feature data (empty if not consensus feature data)
168
@param peptides The peptide identifications (empty if not ID data)
169
@param peak_map The peak data (empty if not peak data)
170
@param data_type Type of the data
171
@param show_as_1d Force dataset to be opened in 1D mode (even if it contains several spectra)
172
@param show_options If the options dialog should be shown (otherwise the defaults are used)
173
@param filename source file name (if the data came from a file)
174
@param caption Sets the layer name and window caption of the data. If unset the file name is used. If set, the file is not monitored foro changes.
175
@param window_id in which window the file is opened if opened as a new layer (0 or default equals current
176
@param spectrum_id determines the spectrum to show in 1D view.
178
void addData(FeatureMapSharedPtrType feature_map, ConsensusMapSharedPtrType consensus_map, std::vector<PeptideIdentification>& peptides, ExperimentSharedPtrType peak_map, LayerData::DataType data_type, bool show_as_1d, bool show_options, bool as_new_window = true, const String& filename = "", const String& caption = "", UInt window_id = 0, Size spectrum_id = 0);
180
/// Opens all the files in the string list
181
void loadFiles(const StringList& list, QSplashScreen* splash_screen);
184
@brief Loads the preferences from the filename given.
186
If the filename is empty, the application name + ".ini" is used as filename
188
void loadPreferences(String filename = "");
190
/// Stores the preferences (used when this window is closed)
191
void savePreferences();
193
/// Returns the parameters for a SpectrumCanvas of dimension @p dim
194
Param getSpectrumParameters(UInt dim);
196
/// Returns the active Layer data (0 if no layer is active)
197
const LayerData* getCurrentLayer() const;
199
//@name Accessors for the main gui components.
200
//@brief The top level enhanced workspace and the EnhancedTabWidgets resing in the EnhancedTabBar.
202
/// returns a pointer to the EnhancedWorkspace containing SpectrumWidgets
203
EnhancedWorkspace* getWorkspace() const;
205
/// returns a pointer to the active SpectrumWidget (0 if none is active)
206
SpectrumWidget* getActiveSpectrumWidget() const;
208
/// returns a pointer to the active Spectrum1DWidget (0 the active window is no Spectrum1DWidget or there is no active window)
209
Spectrum1DWidget* getActive1DWidget() const;
211
/// returns a pointer to the active Spectrum2DWidget (0 the active window is no Spectrum2DWidget or there is no active window)
212
Spectrum2DWidget* getActive2DWidget() const;
214
/// returns a pointer to the active Spectrum3DWidget (0 the active window is no Spectrum2DWidget or there is no active window)
215
Spectrum3DWidget* getActive3DWidget() const;
218
/// returns a pointer to the active SpectrumCanvas (0 if none is active)
219
SpectrumCanvas* getActiveCanvas() const;
222
/// returns a pointer to the SpectraIdentificationViewWidget
223
SpectraIdentificationViewWidget* getSpectraIdentificationViewWidget();
225
/// Opens the provided spectrum widget in a new window
226
void showSpectrumWidgetInWindow(SpectrumWidget* sw, const String& caption);
229
/// changes the current path according to the currently active window/layer
230
void updateCurrentPath();
231
/// shows the URL stored in the data of the sender QAction
233
/// shows the file dialog for opening files
234
void openFileDialog();
235
/// shows the file dialog for opening example files
236
void openExampleDialog();
237
/// shows the DB dialog for opening files
238
void openDatabaseDialog();
239
/// shows the goto dialog
240
void showGoToDialog();
241
/// shows the preferences dialog
242
void preferencesDialog();
243
/// Shows statistics (count,min,max,avg) about Intensity, Quality, Charge and meta data
244
void layerStatistics();
245
/// lets the user edit the meta data of a layer
247
/// get's called if a layer got activated
248
void layerActivated();
249
/// gets called when a layer changes in zoom
250
void layerZoomChanged();
251
/// link the zoom of individual windows
253
/// get's called if a layer got deactivated
254
void layerDeactivated();
255
/// Activation of 1D spectrum
256
void activate1DSpectrum(int index);
257
/// Activation of 1D with multiple entries (e.g. chromatograms)
258
void activate1DSpectrum(std::vector<int, std::allocator<int> > indices);
259
/// Deactivation of 1D spectrum
260
void deactivate1DSpectrum(int index);
261
/// closes the active window
263
/// updates the toolbar
264
void updateToolBar();
265
/// adapts the layer bar to the active window
266
void updateLayerBar();
267
/// adapts view bar to the active window
268
void updateViewBar();
269
/// changes the behavior according to the selected view in the spectra view bar and calls updateSpectraViewBar()
270
void viewChanged(int);
271
/// adapts the filter bar to the active window
272
void updateFilterBar();
273
/// enabled/disabled menu entries depending on the current state
275
/// brings the tab corresponding to the active window in front
276
void updateTabBar(QWidget* w);
277
/// tile the open windows vertically
279
/// tile the open windows horizontally
280
void tileHorizontal();
282
@brief Shows a status message in the status bar.
284
If @p time is 0 the status message is displayed until showStatusMessage is called with an empty message or a new message.
285
Otherwise the message is displayed for @p time ms.
287
void showStatusMessage(std::string msg, OpenMS::UInt time);
288
/// shows m/z and rt in the status bar
289
void showCursorStatus(double mz, double rt);
290
/// shows m/z and rt in the status bar (inverting RT and m/z)
291
void showCursorStatusInvert(double mz, double rt);
293
void showTOPPDialog();
294
/// Annotates current layer with ID data
295
void annotateWithID();
296
/// Shows the theoretical spectrum generation dialog
297
void showSpectrumGenerationDialog();
298
/// Shows the spectrum alignment dialog
299
void showSpectrumAlignmentDialog();
300
/// Shows the spectrum with index @p index of the active layer in 1D
301
void showSpectrumAs1D(int index);
302
void showSpectrumAs1D(std::vector<int, std::allocator<int> > indices);
303
/// Shows the current peak data of the active layer in 2D
304
void showCurrentPeaksAs2D();
305
/// Shows the current peak data of the active layer in 3D
306
void showCurrentPeaksAs3D();
307
/// Shows the 'About' dialog
308
void showAboutDialog();
309
/// Saves the whole current layer data
311
/// Saves the visible layer data
312
void saveLayerVisible();
313
/// Toggles the grid lines
314
void toggleGridLines();
315
/// Toggles the axis legends
316
void toggleAxisLegends();
317
/// Shows current layer preferences
318
void showPreferences();
319
/// dialog for inspecting database meta data
320
void metadataDatabaseDialog();
321
/// dialog for inspecting file meta data
322
void metadataFileDialog();
324
/** @name Toolbar slots
327
void setDrawMode1D(int);
328
void setIntensityMode(int);
329
void changeLayerFlag(bool);
330
void changeLabel(QAction*);
331
void changeUnassigned(QAction*);
333
void toggleProjections();
336
/// Loads a file given by the passed string
337
void loadFile(QString);
340
/** @name Layer manager and filter manager slots
343
/// slot for layer manager selection change
344
void layerSelectionChange(int);
345
/// Enables/disables the data filters for the current layer
346
void layerFilterVisibilityChange(bool);
347
/// slot for layer manager context menu
348
void layerContextMenu(const QPoint& pos);
349
/// slot for log window context menu
350
void logContextMenu(const QPoint& pos);
351
/// slot for layer manager visibility change (check box)
352
void layerVisibilityChange(QListWidgetItem* item);
353
/// slot for filter manager context menu
354
void filterContextMenu(const QPoint& pos);
355
/// slot for editing a filter
356
void filterEdit(QListWidgetItem* item);
357
/// slot for editing the preferences of the current layer
358
void layerEdit(QListWidgetItem* /*item*/);
361
/// slot for the finished signal of the TOPP tools execution
362
void finishTOPPToolExecution(int exitCode, QProcess::ExitStatus exitStatus);
363
/// aborts the execution of a TOPP tool
364
void abortTOPPTool();
365
/// retuns the last invoked TOPP tool with the same parameters
366
void rerunTOPPTool();
367
/// shows the spectrum browser and updates it
368
void showSpectrumBrowser();
369
/// shows the spectrum metadata
370
void showSpectrumMetaData(int spectrum_index);
372
/** @name Tabbar slots
375
/// Closes the window corresponding to the data of the tab with identifier @p id
376
void closeByTab(int id);
377
/// Raises the window corresponding to the data of the tab with identifier @p id
378
void enhancedWorkspaceWindowChanged(int id);
379
/// Opens a file from the recent files menu
380
void openRecentFile();
381
/// Slot for drag-and-drop of layer manager to tabbar
382
void copyLayer(const QMimeData* data, QWidget* source, int id = -1);
385
/// Appends process output to log window
386
void updateProcessLog();
388
/// Called if a data file has been externally changed
389
void fileChanged_(const String&);
391
/// Initializes the default parameters on TOPPView construction.
392
void initializeDefaultParameters_();
394
/// unique list of files referenced by all layers
395
std::set<String> getFilenamesOfOpenFiles_();
397
/// Tries to open a db connection (queries the user for the DB password)
398
void connectToDB_(DBConnection& db);
400
@brief Shows a dialog where the user can select files
402
QStringList getFileList_(const String& path_overwrite = "");
404
/// Returns the enhanced tabbar widget with id @p id
405
EnhancedTabBarWidgetInterface* window_(int id) const;
407
///@name dock widgets
409
QDockWidget* layer_dock_widget_;
410
QDockWidget* views_dockwidget_;
411
QDockWidget* filter_dock_widget_;
414
///@name Spectrum selection widgets
416
SpectraViewWidget* spectra_view_widget_;
417
SpectraIdentificationViewWidget* spectra_identification_view_widget_;
420
/// Layer management widget
421
QListWidget* layer_manager_;
423
///@name Filter widgets
425
QListWidget* filters_;
426
QCheckBox* filters_check_box_;
429
/// Watcher that tracks file changes (in order to update the data in the different views)
430
FileWatcher* watcher_;
432
/// Holds the messageboxes for each layer that are currently popped up (to avoid popping them up again, if file changes again before the messagebox is closed)
433
bool watcher_msgbox_;
435
/// Stores whether the individual windows should zoom together (be linked) or not
438
QAction* linkZoom_action_;
440
/// Log output window
447
//common intensity modes
449
QButtonGroup* intensity_button_group_;
452
QToolBar* tool_bar_1d_;
453
QButtonGroup* draw_group_1d_;
456
QToolBar* tool_bar_2d_peak_;
457
QToolBar* tool_bar_2d_feat_;
458
QToolBar* tool_bar_2d_cons_;
459
QToolBar* tool_bar_2d_ident_;
460
QAction* dm_precursors_2d_;
461
QAction* dm_hull_2d_;
462
QAction* dm_hulls_2d_;
463
QToolButton* dm_label_2d_;
464
QActionGroup* group_label_2d_;
465
QToolButton* dm_unassigned_2d_;
466
QActionGroup* group_unassigned_2d_;
467
QAction* dm_elements_2d_;
468
QAction* projections_2d_;
469
QAction* dm_ident_2d_;
473
EnhancedWorkspace* ws_;
475
///Tab bar. The address of the corresponding window to a tab is stored as an int in tabData()
476
EnhancedTabBar* tab_bar_;
481
/// Label for messages in the status bar
482
QLabel* message_label_;
483
/// m/z label for messages in the status bar
485
/// RT label for messages in the status bar
489
/// @name Recent files
491
///adds a Filename to the recent files
492
void addRecentFile_(const String& filename);
493
///update the recent files menu
494
void updateRecentMenu_();
495
/// list of the recently opened files
496
QStringList recent_files_;
497
/// list of the recently opened files actions (menu entries)
498
std::vector<QAction*> recent_actions_;
502
/// @name TOPP tool execution
504
/// Runs the TOPP tool according to the information in topp_
506
///Information needed for execution of TOPP tools
523
/// check if all available preferences get set by the .ini file. If there are some missing entries fill them with default values.
524
void checkPreferences_();
525
///@name reimplemented Qt events
527
void closeEvent(QCloseEvent* event);
530
///Log message states
533
LS_NOTICE, ///< Notice
534
LS_WARNING, ///< Warning
535
LS_ERROR ///< Fatal error
537
/// Shows a log message in the log_ window
538
void showLogMessage_(LogState state, const String& heading, const String& body);
540
///Additional context menu for 2D layers
541
QMenu* add_2d_context_;
543
/// Apply TOPP tool. If @p visible is true, only the visible data is used, otherwise the whole layer is used.
544
void showTOPPDialog_(bool visible);
546
/// The current path (used for loading and storing).
547
/// Depending on the preferences this is static or changes with the current window/layer.
548
String current_path_;
550
/// Tabwidget that hold the different views on the loaded data
551
QTabWidget* views_tabwidget_;
552
/// The current TOPPView view behavior
553
TOPPViewBehaviorInterface* view_behavior_;
554
/// TOPPView behavior for the identification view
555
TOPPViewIdentificationViewBehavior* identificationview_behavior_;
556
/// TOPPView behavior for the spectra view
557
TOPPViewSpectraViewBehavior* spectraview_behavior_;
559
// static helper functions
561
/// Returns true if @p contains at least one MS1 spectrum
562
static bool containsMS1Scans(const ExperimentType& exp);
564
/// Estimates the noise by evaluating n_scans random scans of MS level 1. Assumes that 4/5 of intensities is noise.
565
float estimateNoiseFromRandomMS1Scans(const ExperimentType& exp, UInt n_scans = 10);
567
/// Counts the number of exact zero valued intensities in all MS1 spectra
568
static UInt countMS1Zeros(const ExperimentType& exp);
570
/// Returns true if the experiment map contains peptide identifications
571
static bool hasPeptideIdentifications(const ExperimentType& map);
574
/// Suffix appended to caption of tabs when layer is shown in 3D
575
static const String CAPTION_3D_SUFFIX_;