OpenMS
MetaDataBrowser.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Marc Sturm $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // OpenMS_GUI config
12 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13 
18 
19 //QT
20 #include <QtWidgets/QDialog>
21 #include <QtWidgets/QTreeWidget>
22 class QTreeWidgetItem;
23 class QPushButton;
24 class QStackedWidget;
25 class QHBoxLayout;
26 class QVBoxLayout;
27 class QGridLayout;
28 
29 namespace OpenMS
30 {
31  class BaseVisualizerGUI;
32  class Acquisition;
33  class AcquisitionInfo;
34  class ContactPerson;
35  class Digestion;
36  class ExperimentalSettings;
37  class Gradient;
38  class HPLC;
39  class PeptideIdentification;
40  class Instrument;
41  class IonDetector;
42  class IonSource;
43  class MassAnalyzer;
44  class MetaInfo;
45  class MetaInfoDescription;
46  class MetaInfoInterface;
47  class MetaInfoRegistry;
48  class Modification;
49  class PeptideHit;
50  class Precursor;
51  class DataProcessing;
52  class ProteinHit;
53  class ProteinIdentification;
54  class Sample;
55  class SampleTreatment;
56  class Software;
57  class SourceFile;
58  class SpectrumSettings;
59  class Tagging;
60  class DocumentIdentifier;
61  class Product;
62 
78  class OPENMS_GUI_DLLAPI MetaDataBrowser :
79  public QDialog
80  {
81  Q_OBJECT
82 
83 public:
84 
86  MetaDataBrowser(bool editable = false, QWidget * parent = nullptr, bool modal = false);
87 
89  void add(PeakMap & exp)
90  {
91  add(static_cast<ExperimentalSettings &>(exp));
92  treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
93  }
94 
96  void add(MSSpectrum & spectrum)
97  {
98  //spectrum settings
99  add(static_cast<SpectrumSettings &>(spectrum));
100 
101  //MetaInfoDescriptions
102  for (Size i = 0; i < spectrum.getFloatDataArrays().size(); ++i)
103  {
104  add(spectrum.getFloatDataArrays()[i]);
105  }
106  for (Size i = 0; i < spectrum.getIntegerDataArrays().size(); ++i)
107  {
108  add(spectrum.getIntegerDataArrays()[i]);
109  }
110  for (Size i = 0; i < spectrum.getStringDataArrays().size(); ++i)
111  {
112  add(spectrum.getStringDataArrays()[i]);
113  }
114 
115  add(static_cast<MetaInfoInterface &>(spectrum));
116 
117  treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
118  }
119 
121  void add(FeatureMap& map)
122  {
123  //identifier
124  add(static_cast<DocumentIdentifier &>(map));
125 
126  //protein ids
127  for (Size i = 0; i < map.getProteinIdentifications().size(); ++i)
128  {
129  add(map.getProteinIdentifications()[i]);
130  }
131 
132  //unassigned peptide ids
133  for (Size i = 0; i < map.getUnassignedPeptideIdentifications().size(); ++i)
134  {
136  }
137 
138  treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
139  }
140 
142  void add(Feature & feature);
144  void add(ConsensusFeature & feature);
145 
147  void add(ConsensusMap & map);
148 
154  template <class MetaDataType>
155  void add(MetaDataType & meta_data_object)
156  {
157  visualize_(meta_data_object);
158  treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
159  }
160 
162  bool isEditable() const;
163 
167 
168 public slots:
169 
171  void setStatus(const std::string& status);
172 
173 protected slots:
174 
176  void showDetails_();
177 
179  void saveAll_();
180 
181 protected:
182 
184 
185  void visualize_(ExperimentalSettings & meta, QTreeWidgetItem * parent = nullptr);
186  void visualize_(SpectrumSettings & meta, QTreeWidgetItem * parent = nullptr);
187  void visualize_(MetaInfoInterface & meta, QTreeWidgetItem * parent = nullptr);
188  void visualize_(Sample & meta, QTreeWidgetItem * parent = nullptr);
189  void visualize_(HPLC & meta, QTreeWidgetItem * parent = nullptr);
190  void visualize_(Digestion & meta, QTreeWidgetItem * parent = nullptr);
191  void visualize_(Modification & meta, QTreeWidgetItem * parent = nullptr);
192  void visualize_(Tagging & meta, QTreeWidgetItem * parent = nullptr);
193  void visualize_(Gradient & meta, QTreeWidgetItem * parent = nullptr);
194  void visualize_(Software & meta, QTreeWidgetItem * parent = nullptr);
195  void visualize_(ScanWindow & meta, QTreeWidgetItem * parent = nullptr);
196  void visualize_(SourceFile & meta, QTreeWidgetItem * parent = nullptr);
197  void visualize_(ContactPerson & meta, QTreeWidgetItem * parent = nullptr);
198  void visualize_(Instrument & meta, QTreeWidgetItem * parent = nullptr);
199  void visualize_(IonSource & meta, QTreeWidgetItem * parent = nullptr);
200  void visualize_(IonDetector & meta, QTreeWidgetItem * parent = nullptr);
201  void visualize_(MassAnalyzer & meta, QTreeWidgetItem * parent = nullptr);
202  void visualize_(DataProcessingPtr & meta, QTreeWidgetItem * parent = nullptr);
203  void visualize_(ProteinIdentification & meta, QTreeWidgetItem * parent = nullptr);
204  void visualize_(ProteinHit & meta, QTreeWidgetItem * parent = nullptr);
205  void visualize_(PeptideHit & meta, QTreeWidgetItem * parent = nullptr);
206  void visualize_(Acquisition & meta, QTreeWidgetItem * parent = nullptr);
207  void visualize_(AcquisitionInfo & meta, QTreeWidgetItem * parent = nullptr);
208  void visualize_(MetaInfoDescription & meta, QTreeWidgetItem * parent = nullptr);
209  void visualize_(Precursor & meta, QTreeWidgetItem * parent = nullptr);
210  void visualize_(Product & meta, QTreeWidgetItem * parent = nullptr);
211  void visualize_(InstrumentSettings & meta, QTreeWidgetItem * parent = nullptr);
212  void visualize_(PeptideIdentification & meta, QTreeWidgetItem * parent = nullptr);
213  void visualize_(DocumentIdentifier & meta, QTreeWidgetItem * parent = nullptr);
215 
217  template <typename ContainerType>
218  void visualizeAll_(ContainerType & container, QTreeWidgetItem * parent)
219  {
220  for (typename ContainerType::iterator it = container.begin(); it != container.end(); ++it)
221  {
222  visualize_(*it, parent);
223  }
224  }
225 
228 
230  void filterHits_(double threshold, bool higher_better, int tree_item_id);
232  void showAllHits_(int tree_item_id);
233 
235  std::string status_list_;
236 
238  bool editable_;
239 
241  QStackedWidget * ws_;
243  QPushButton * saveallbutton_;
245  QPushButton * closebutton_;
247  QPushButton * cancelbutton_;
249  QPushButton * undobutton_;
250 
253  };
254 }
Description of the combination of raw data to a single spectrum.
Definition: AcquisitionInfo.h:29
Information about one raw data spectrum that was combined with several other raw data spectra.
Definition: Acquisition.h:25
A base class for all visualizer classes.
Definition: BaseVisualizerGUI.h:40
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:45
A container for consensus elements.
Definition: ConsensusMap.h:66
Contact person information.
Definition: ContactPerson.h:23
Meta information about digestion of a sample.
Definition: Digestion.h:25
Manage source document information.
Definition: DocumentIdentifier.h:30
Description of the experimental settings.
Definition: ExperimentalSettings.h:36
A container for features.
Definition: FeatureMap.h:80
const std::vector< ProteinIdentification > & getProteinIdentifications() const
const std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
An LC-MS feature.
Definition: Feature.h:46
Representation of a HPLC gradient.
Definition: Gradient.h:27
Representation of a HPLC experiment.
Definition: HPLC.h:25
Description of the settings a MS Instrument was run with.
Definition: InstrumentSettings.h:23
Description of a MS instrument.
Definition: Instrument.h:39
Description of a ion detector (part of a MS Instrument)
Definition: IonDetector.h:22
Description of an ion source (part of a MS Instrument)
Definition: IonSource.h:23
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
const IntegerDataArrays & getIntegerDataArrays() const
Returns a const reference to the integer meta data arrays.
const FloatDataArrays & getFloatDataArrays() const
Returns a const reference to the float meta data arrays.
const StringDataArrays & getStringDataArrays() const
Returns a const reference to the string meta data arrays.
Description of a mass analyzer (part of a MS Instrument)
Definition: MassAnalyzer.h:23
A meta data visualization widget.
Definition: MetaDataBrowser.h:80
bool isEditable() const
Check if mode is editable or not.
void visualize_(PeptideHit &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(SpectrumSettings &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(InstrumentSettings &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(Gradient &meta, QTreeWidgetItem *parent=nullptr)
QPushButton * cancelbutton_
Cancel Button.
Definition: MetaDataBrowser.h:247
void visualize_(Sample &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(Instrument &meta, QTreeWidgetItem *parent=nullptr)
void filterHits_(double threshold, bool higher_better, int tree_item_id)
Filters hits according to a score threshold. Takes the score orientation into account.
void visualize_(AcquisitionInfo &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(ProteinIdentification &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(ExperimentalSettings &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(ProteinHit &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(ContactPerson &meta, QTreeWidgetItem *parent=nullptr)
void add(ConsensusMap &map)
Adds a consensus map.
void visualize_(IonSource &meta, QTreeWidgetItem *parent=nullptr)
std::string status_list_
A list of setting errors due to invalid formats.
Definition: MetaDataBrowser.h:235
void visualizeAll_(ContainerType &container, QTreeWidgetItem *parent)
Visualizes all elements of a container.
Definition: MetaDataBrowser.h:218
void visualize_(Digestion &meta, QTreeWidgetItem *parent=nullptr)
MetaDataBrowser(bool editable=false, QWidget *parent=nullptr, bool modal=false)
Constructor with flag for edit mode.
QStackedWidget * ws_
A widgetstack that keeps track of all widgets.
Definition: MetaDataBrowser.h:241
void showAllHits_(int tree_item_id)
Shows hits.
void add(Feature &feature)
Adds a feature.
QTreeWidget * treeview_
The tree.
Definition: MetaDataBrowser.h:252
QPushButton * saveallbutton_
Save button.
Definition: MetaDataBrowser.h:243
void visualize_(Precursor &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(MetaInfoDescription &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(MetaInfoInterface &meta, QTreeWidgetItem *parent=nullptr)
void setStatus(const std::string &status)
Set a list of error strings due to invalid date format.
QPushButton * closebutton_
Close Button.
Definition: MetaDataBrowser.h:245
void saveAll_()
Saves all changes and close explorer.
bool editable_
Indicates the mode.
Definition: MetaDataBrowser.h:238
void visualize_(SourceFile &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(Modification &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(PeptideIdentification &meta, QTreeWidgetItem *parent=nullptr)
void add(FeatureMap &map)
Adds a feature map.
Definition: MetaDataBrowser.h:121
QPushButton * undobutton_
Undo Button.
Definition: MetaDataBrowser.h:249
void visualize_(IonDetector &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(Software &meta, QTreeWidgetItem *parent=nullptr)
void showDetails_()
Raises the corresponding viewer from the widget stack according to the item selected in the tree.
void add(PeakMap &exp)
Adds a peak map.
Definition: MetaDataBrowser.h:89
void visualize_(DocumentIdentifier &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(Acquisition &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(Product &meta, QTreeWidgetItem *parent=nullptr)
void add(MSSpectrum &spectrum)
Adds a peak spectrum.
Definition: MetaDataBrowser.h:96
void visualize_(ScanWindow &meta, QTreeWidgetItem *parent=nullptr)
void add(MetaDataType &meta_data_object)
A generic function to add data.
Definition: MetaDataBrowser.h:155
void add(ConsensusFeature &feature)
Adds a consensus feature.
void visualize_(HPLC &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(MassAnalyzer &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(DataProcessingPtr &meta, QTreeWidgetItem *parent=nullptr)
void visualize_(Tagging &meta, QTreeWidgetItem *parent=nullptr)
void connectVisualizer_(BaseVisualizerGUI *ptr)
Connects the Signals of all visualiser classes with Slot setStatus()
Description of the meta data arrays of MSSpectrum.
Definition: MetaInfoDescription.h:24
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:35
Meta information about chemical modification of a sample.
Definition: Modification.h:27
Representation of a peptide hit.
Definition: PeptideHit.h:31
Class that displays all meta information for PeptideIdentification objects.
Definition: PeptideIdentificationVisualizer.h:31
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:39
Precursor meta information.
Definition: Precursor.h:35
Product meta information.
Definition: Product.h:24
Representation of a protein hit.
Definition: ProteinHit.h:34
Class that displays all meta information for ProteinIdentification objects.
Definition: ProteinIdentificationVisualizer.h:31
Representation of a protein identification run.
Definition: ProteinIdentification.h:50
Meta information about the sample.
Definition: Sample.h:35
Description of the software used for processing.
Definition: Software.h:24
Description of a file location, used to store the origin of (meta) data.
Definition: SourceFile.h:22
Representation of 1D spectrum settings.
Definition: SpectrumSettings.h:39
Meta information about tagging of a sample e.g. ICAT labeling.
Definition: Tagging.h:25
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
static String number(double d, UInt n)
Definition: StringUtils.h:191
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition: DataProcessing.h:110
Scan window description.
Definition: ScanWindow.h:22