OpenMS
SwathTabWidget.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2023.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Chris Bielow $
32 // $Authors: Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 // OpenMS_GUI config
38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
39 
46 
47 #include <QTabWidget> // our base class
48 
49 #include <vector>
50 #include <utility> // for std::pair
51 
52 namespace Ui
53 {
54  class SwathTabWidget;
55 }
56 
57 namespace OpenMS
58 {
59  class InputFile;
60  class OutputDirectory;
61  class ParamEditor;
62 
63 
64  namespace Internal
65  {
66  class SwathTabWidget;
67 
69  class OPENMS_GUI_DLLAPI SwathTabWidget : public QTabWidget
70  {
71  Q_OBJECT
72 
73  public:
74  template <typename> friend class WizardGUILock;
75 
76  explicit SwathTabWidget(QWidget *parent = nullptr);
78 
80 
81  QStringList getPyProphetOutputFileNames() const;
82 
83  private slots:
87  void broadcastNewCWD_(const QString& new_cwd);
88 
89 
91 
93 
95 
96  private:
99  bool findPythonScript_(const String& path_to_python_exe, String& script_name);
100 
103 
106 
108  QString getCurrentOutDir_() const;
109 
112  std::vector<std::pair<String, bool>> getPyProphetInputFiles() const;
113 
116 
118 
119 
123  void writeLog_(const QString& text, const QColor& color = "#000000", bool new_section = false);
125  void writeLog_(const String& text, const QColor& color = "#000000", bool new_section = false);
126 
130 
131  Ui::SwathTabWidget *ui;
134 
137  };
138 
139  }
140 } // ns OpenMS
141 
142 // this is required to allow Ui_SwathTabWidget (auto UIC'd from .ui) to have a InputFile member
OpenMS::TableView TableView
Definition: SwathTabWidget.h:146
OpenMS::InputFile InputFile
Definition: SwathTabWidget.h:143
OpenMS::OutputDirectory OutputDirectory
Definition: SwathTabWidget.h:144
OpenMS::ParamEditor ParamEditor
Definition: SwathTabWidget.h:145
A wrapper around ExternalProcess to conveniently show a MessageBox when an error occurs.
Definition: ExternalProcessMBox.h:55
A simple widget with a line-edit and a browse button to choose filenames.
Definition: gui/include/OpenMS/VISUAL/InputFile.h:57
A multi-tabbed widget for the SwathWizard offering setting of parameters, input-file specification an...
Definition: SwathTabWidget.h:70
QStringList getPyProphetOutputFileNames() const
std::vector< std::pair< String, bool > > getPyProphetInputFiles() const
ExternalProcessMBox ep_
to run external programs and pipe their output into our log
Definition: SwathTabWidget.h:136
void writeLog_(const QString &text, const QColor &color="#000000", bool new_section=false)
fill osw_result_files_ according to the the currently specified input mzMLs
bool findPythonScript_(const String &path_to_python_exe, String &script_name)
void checkPyProphetInput_()
check if input to pyProphet is already present in the output directory of OSW
void updateWidgetsfromSwathParam_()
update Widgets given a param object
Param swath_param_wizard_
small selection of important parameters which the user can directly change in the Wizard
Definition: SwathTabWidget.h:133
void updateSwathParamFromWidgets_()
collect all parameters throughout the Wizard's controls and update 'swath_param_'
StringList getMzMLInputFiles() const
SwathTabWidget(QWidget *parent=nullptr)
StringList osw_result_files_
list of .osw files produced by OSW which are currently available
Definition: SwathTabWidget.h:135
QString getCurrentOutDir_() const
where to write OSW output and pyProphet output
Param swath_param_
the global Swath parameters which will be passed to OpenSwathWorkflow.exe, once updated with paramete...
Definition: SwathTabWidget.h:132
void writeLog_(const String &text, const QColor &color="#000000", bool new_section=false)
convenient overload for String
void broadcastNewCWD_(const QString &new_cwd)
update the current working directory for all file input fields
Ui::SwathTabWidget * ui
Definition: SwathTabWidget.h:131
RAII class to switch to certain TabWidget, disable the GUI and go back to the orignal Tab when this c...
Definition: WizardHelper.h:50
A simple widget with a line-edit and a browse button to choose filenames.
Definition: OutputDirectory.h:57
A GUI for editing or viewing a Param object.
Definition: ParamEditor.h:180
Management and storage of parameters / INI files.
Definition: Param.h:70
A more convenient string class.
Definition: String.h:60
A better QTable for TOPPView, which supports exporting to TSV and conveniently adding data to cells a...
Definition: TableView.h:48
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
Definition: FLASHDeconvWizardBase.h:63