OpenMS  2.7.0
SpectraIDViewTab.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-2021.
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: Timo Sachsenberg $
32 // $Authors: Timo Sachsenberg $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
41 
42 #include <QtWidgets>
43 #include <QLineEdit>
44 #include <QComboBox>
45 #include <QTableWidget>
46 #include <QCheckBox>
47 
48 namespace OpenMS
49 {
55  class OPENMS_GUI_DLLAPI SpectraIDViewTab :
56  public QWidget,
57  public DefaultParamHandler,
58  public DataTabBase
59  {
60  Q_OBJECT
61  public:
63  SpectraIDViewTab(const Param& preferences, QWidget* parent = nullptr);
65  ~SpectraIDViewTab() override = default;
66 
67  // docu in base class
68  bool hasData(const LayerData* layer) override;
69 
71  void updateEntries(LayerData* model) override;
74 
76  void clear() override;
77 
79  bool ignore_update = false;
80 
81  protected slots:
84  signals:
86  void spectrumSelected(int spectrum_index, int pep_id_index, int pep_hit_index);
88  void spectrumDeselected(int spectrum_index);
90  void requestVisibleArea1D(double lower_mz, double upper_mz);
91 
92  private:
94  void fillRow_(const MSSpectrum& spectrum, const int spec_index, const QColor background_color);
95 
96  LayerData* layer_ = nullptr;
97  QCheckBox* hide_no_identification_ = nullptr;
98  QCheckBox* create_rows_for_commmon_metavalue_ = nullptr;
99  TableView* table_widget_ = nullptr;
100  QTableWidget* fragment_window_ = nullptr;
101  bool is_ms1_shown_ = false;
102 
103  private slots:
105  void saveIDs_();
107  void updatedSingleCell_(QTableWidgetItem* item);
109  void currentCellChanged_(int row, int column, int old_row, int old_column);
110  };
111 }
all tabs need to implement this interface
Definition: DataSelectionTabs.h:57
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:93
Class that stores the data for one layer.
Definition: LayerData.h:96
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
Management and storage of parameters / INI files.
Definition: Param.h:70
Tabular visualization / selection of identified spectra.
Definition: SpectraIDViewTab.h:59
void requestVisibleArea1D(double lower_mz, double upper_mz)
request to zoom into a 1D spec
void currentCellChanged_(int row, int column, int old_row, int old_column)
Cell clicked in table_widget; emits which spectrum (row) was clicked, and may show additional data.
void fillRow_(const MSSpectrum &spectrum, const int spec_index, const QColor background_color)
partially fill the bottom-most row
void updateEntries_()
Rebuild table entries.
bool hasData(const LayerData *layer) override
LayerData * getLayer()
get layer data
void saveIDs_()
Saves the (potentially filtered) IDs as an idXML or mzIdentML file.
void spectrumSelected(int spectrum_index, int pep_id_index, int pep_hit_index)
request to show a specific spectrum, and (if available) a specific pepId + pepHit in there (otherwise...
void spectrumDeselected(int spectrum_index)
request to unshow a spectrum
~SpectraIDViewTab() override=default
Destructor.
void updateEntries(LayerData *model) override
set layer data and create table anew; if given a nullptr, behaves as clear()
void updatedSingleCell_(QTableWidgetItem *item)
update PeptideIdentification / PeptideHits, when data in the table changes (status of checkboxes)
void clear() override
clears all visible data from table widget and voids the layer
SpectraIDViewTab(const Param &preferences, QWidget *parent=nullptr)
Constructor.
A better QTable for TOPPView, which supports exporting to TSV and conveniently adding data to cells a...
Definition: TableView.h:48
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47