OpenMS
Loading...
Searching...
No Matches
SpectraIDViewTab.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
15
16#include <QtWidgets>
17#include <QCheckBox>
18
19#include <unordered_map>
20#include <vector>
21
22namespace OpenMS
23{
24 class LayerDataPeak;
25
31 class OPENMS_GUI_DLLAPI SpectraIDViewTab :
32 public QWidget,
34 public DataTabBase
35 {
36 Q_OBJECT
37 public:
39 SpectraIDViewTab(const Param& preferences, QWidget* parent = nullptr);
41 ~SpectraIDViewTab() override = default;
42
43 // docu in base class
44 bool hasData(const LayerDataBase* layer) override;
45
47 void updateEntries(LayerDataBase* model) override;
50
52 void clear() override;
53
55 bool ignore_update = false;
56
57 protected slots:
61 void updateProteinEntries_(int spec_cell_row_idx);
64 signals:
66 void spectrumSelected(int spectrum_index, int pep_id_index, int pep_hit_index);
68 void spectrumDeselected(int spectrum_index);
70 void requestVisibleArea1D(double lower_mz, double upper_mz);
71
72 private:
74 void fillRow_(const MSSpectrum& spectrum, const int spec_index, const QColor& background_color);
76 static QString extractNumFromAccession_(const QString& listItem);
78 void openUniProtSiteWithAccession_(const QString& accession);
79
81 {
82 void resizeEvent(QResizeEvent * event) override;
83 };
84
85 LayerDataPeak* layer_ = nullptr;
86 QCheckBox* hide_no_identification_ = nullptr;
87 QCheckBox* create_rows_for_commmon_metavalue_ = nullptr;
88 TableView* table_widget_ = nullptr;
89 TableView* protein_table_widget_ = nullptr;
90 QTableWidget* fragment_window_ = nullptr;
91 QSplitter* tables_splitter_ = nullptr;
92 bool is_first_time_loading_ = true;
93 std::unordered_map<std::string, std::vector<const PeptideIdentification*>> protein_to_peptide_id_map;
94
95 private slots:
97 void saveIDs_();
99 void updatedSingleCell_(QTableWidgetItem* item);
101 void currentCellChanged_(int row, int column, int old_row, int old_column);
102
105
108
110 void updatedSingleProteinCell_(QTableWidgetItem* /*item*/);
112 void proteinCellClicked_(int row, int column);
113 };
114}
all tabs need to implement this interface
Definition DataSelectionTabs.h:31
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
Class that stores the data for one layer.
Definition LayerDataBase.h:170
Class that stores the data for one layer of type PeakMap.
Definition LayerDataPeak.h:29
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
Management and storage of parameters / INI files.
Definition Param.h:46
Definition SpectraIDViewTab.h:81
void resizeEvent(QResizeEvent *event) override
Tabular visualization / selection of identified spectra.
Definition SpectraIDViewTab.h:35
void requestVisibleArea1D(double lower_mz, double upper_mz)
request to zoom into a 1D spec
void proteinCellClicked_(int row, int column)
Protein Cell clicked in protein_table_widget; emits which protein (row) was clicked,...
void openUniProtSiteWithAccession_(const QString &accession)
open browser to navigate to uniport site with accession
LayerDataBase * getLayer()
get layer data
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 updateEntries_()
Rebuild table entries.
bool hasData(const LayerDataBase *layer) override
void switchOrientation_()
Switch horizontal or vertical layout of the PSM and Proteintable.
void fillRow_(const MSSpectrum &spectrum, const int spec_index, const QColor &background_color)
partially fill the bottom-most row
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
void currentSpectraSelectionChanged_()
Cell selected or deselected: this is only used to check for deselection, rest happens in currentCellC...
void updateProteinEntries_(int spec_cell_row_idx)
Rebuild protein table entries.
~SpectraIDViewTab() override=default
Destructor.
std::unordered_map< std::string, std::vector< const PeptideIdentification * > > protein_to_peptide_id_map
Definition SpectraIDViewTab.h:93
void updatedSingleCell_(QTableWidgetItem *item)
update PeptideIdentification / PeptideHits, when data in the table changes (status of checkboxes)
void createProteinToPeptideIDMap_()
Create 'protein accession to peptide identification' map using C++ STL unordered_map.
void updatedSingleProteinCell_(QTableWidgetItem *)
update ProteinHits, when data in the table changes (status of checkboxes)
static QString extractNumFromAccession_(const QString &listItem)
extract the required part of the accession
void clear() override
clears all visible data from table widget and voids the layer
SpectraIDViewTab(const Param &preferences, QWidget *parent=nullptr)
Constructor.
void updateEntries(LayerDataBase *model) override
set layer data and create table anew; if given a nullptr or the layer is not LayerDataPeak,...
A better QTable for TOPPView, which supports exporting to TSV and conveniently adding data to cells a...
Definition TableView.h:22
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19