OpenMS  2.6.0
MetaDataBrowser.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-2020.
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: Marc Sturm $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 // OpenMS_GUI config
38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
39 
44 
45 //QT
46 #include <QtWidgets/QDialog>
47 #include <QtWidgets/QTreeWidget>
48 class QTreeWidgetItem;
49 class QPushButton;
50 class QStackedWidget;
51 class QHBoxLayout;
52 class QVBoxLayout;
53 class QGridLayout;
54 
55 namespace OpenMS
56 {
57  class BaseVisualizerGUI;
58  class Acquisition;
59  class AcquisitionInfo;
60  class ContactPerson;
61  class Digestion;
62  class ExperimentalSettings;
63  class Gradient;
64  class HPLC;
65  class PeptideIdentification;
66  class Instrument;
67  class IonDetector;
68  class IonSource;
69  class MassAnalyzer;
70  class MetaInfo;
71  class MetaInfoDescription;
72  class MetaInfoInterface;
73  class MetaInfoRegistry;
74  class Modification;
75  class PeptideHit;
76  class Precursor;
77  class DataProcessing;
78  class ProteinHit;
79  class ProteinIdentification;
80  class Sample;
81  class SampleTreatment;
82  class Software;
83  class SourceFile;
84  class SpectrumSettings;
85  class Tagging;
86  class DocumentIdentifier;
87  class Product;
88 
104  class OPENMS_GUI_DLLAPI MetaDataBrowser :
105  public QDialog
106  {
107  Q_OBJECT
108 
109 public:
110 
112  MetaDataBrowser(bool editable = false, QWidget * parent = nullptr, bool modal = false);
113 
115  void add(PeakMap & exp)
116  {
117  add(static_cast<ExperimentalSettings &>(exp));
118  treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
119  }
120 
122  void add(MSSpectrum & spectrum)
123  {
124  //spectrum settings
125  add(static_cast<SpectrumSettings &>(spectrum));
126 
127  //MetaInfoDescriptions
128  for (Size i = 0; i < spectrum.getFloatDataArrays().size(); ++i)
129  {
130  add(spectrum.getFloatDataArrays()[i]);
131  }
132  for (Size i = 0; i < spectrum.getIntegerDataArrays().size(); ++i)
133  {
134  add(spectrum.getIntegerDataArrays()[i]);
135  }
136  for (Size i = 0; i < spectrum.getStringDataArrays().size(); ++i)
137  {
138  add(spectrum.getStringDataArrays()[i]);
139  }
140 
141  add(static_cast<MetaInfoInterface &>(spectrum));
142 
143  treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
144  }
145 
147  void add(FeatureMap& map)
148  {
149  //identifier
150  add(static_cast<DocumentIdentifier &>(map));
151 
152  //protein ids
153  for (Size i = 0; i < map.getProteinIdentifications().size(); ++i)
154  {
155  add(map.getProteinIdentifications()[i]);
156  }
157 
158  //unassigned peptide ids
159  for (Size i = 0; i < map.getUnassignedPeptideIdentifications().size(); ++i)
160  {
162  }
163 
164  treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
165  }
166 
168  void add(Feature & feature);
170  void add(ConsensusFeature & feature);
171 
173  void add(ConsensusMap & map);
174 
180  template <class MetaDataType>
181  void add(MetaDataType & meta_data_object)
182  {
183  visualize_(meta_data_object);
184  treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
185  }
186 
188  bool isEditable();
189 
193 
194 public slots:
195 
197  void setStatus(std::string status);
198 
199 protected slots:
200 
202  void showDetails_();
203 
205  void saveAll_();
206 
207 protected:
208 
210 
211  void visualize_(ExperimentalSettings & meta, QTreeWidgetItem * parent = nullptr);
212  void visualize_(SpectrumSettings & meta, QTreeWidgetItem * parent = nullptr);
213  void visualize_(MetaInfoInterface & meta, QTreeWidgetItem * parent = nullptr);
214  void visualize_(Sample & meta, QTreeWidgetItem * parent = nullptr);
215  void visualize_(HPLC & meta, QTreeWidgetItem * parent = nullptr);
216  void visualize_(Digestion & meta, QTreeWidgetItem * parent = nullptr);
217  void visualize_(Modification & meta, QTreeWidgetItem * parent = nullptr);
218  void visualize_(Tagging & meta, QTreeWidgetItem * parent = nullptr);
219  void visualize_(Gradient & meta, QTreeWidgetItem * parent = nullptr);
220  void visualize_(Software & meta, QTreeWidgetItem * parent = nullptr);
221  void visualize_(ScanWindow & meta, QTreeWidgetItem * parent = nullptr);
222  void visualize_(SourceFile & meta, QTreeWidgetItem * parent = nullptr);
223  void visualize_(ContactPerson & meta, QTreeWidgetItem * parent = nullptr);
224  void visualize_(Instrument & meta, QTreeWidgetItem * parent = nullptr);
225  void visualize_(IonSource & meta, QTreeWidgetItem * parent = nullptr);
226  void visualize_(IonDetector & meta, QTreeWidgetItem * parent = nullptr);
227  void visualize_(MassAnalyzer & meta, QTreeWidgetItem * parent = nullptr);
228  void visualize_(DataProcessingPtr & meta, QTreeWidgetItem * parent = nullptr);
229  void visualize_(ProteinIdentification & meta, QTreeWidgetItem * parent = nullptr);
230  void visualize_(ProteinHit & meta, QTreeWidgetItem * parent = nullptr);
231  void visualize_(PeptideHit & meta, QTreeWidgetItem * parent = nullptr);
232  void visualize_(Acquisition & meta, QTreeWidgetItem * parent = nullptr);
233  void visualize_(AcquisitionInfo & meta, QTreeWidgetItem * parent = nullptr);
234  void visualize_(MetaInfoDescription & meta, QTreeWidgetItem * parent = nullptr);
235  void visualize_(Precursor & meta, QTreeWidgetItem * parent = nullptr);
236  void visualize_(Product & meta, QTreeWidgetItem * parent = nullptr);
237  void visualize_(InstrumentSettings & meta, QTreeWidgetItem * parent = nullptr);
238  void visualize_(PeptideIdentification & meta, QTreeWidgetItem * parent = nullptr);
239  void visualize_(DocumentIdentifier & meta, QTreeWidgetItem * parent = nullptr);
241 
243  template <typename ContainerType>
244  void visualizeAll_(ContainerType & container, QTreeWidgetItem * parent)
245  {
246  for (typename ContainerType::iterator it = container.begin(); it != container.end(); ++it)
247  {
248  visualize_(*it, parent);
249  }
250  }
251 
253  void connectVisualizer_(BaseVisualizerGUI * ptr);
254 
256  void filterHits_(double threshold, bool higher_better, int tree_item_id);
258  void showAllHits_(int tree_item_id);
259 
261  std::string status_list_;
262 
264  bool editable_;
265 
267  QStackedWidget * ws_;
269  QPushButton * saveallbutton_;
271  QPushButton * closebutton_;
273  QPushButton * cancelbutton_;
275  QPushButton * undobutton_;
276 
279  };
280 }
OpenMS::Software
Description of the software used for processing.
Definition: Software.h:48
OpenMS::MetaDataBrowser::undobutton_
QPushButton * undobutton_
Undo Button.
Definition: MetaDataBrowser.h:275
OpenMS::InstrumentSettings
Description of the settings a MS Instrument was run with.
Definition: InstrumentSettings.h:47
OpenMS::MetaDataBrowser::visualizeAll_
void visualizeAll_(ContainerType &container, QTreeWidgetItem *parent)
Visualizes all elements of a container.
Definition: MetaDataBrowser.h:244
OpenMS::BaseVisualizerGUI
A base class for all visualizer classes.
Definition: BaseVisualizerGUI.h:64
OpenMS::MetaDataBrowser::status_list_
std::string status_list_
A list of setting errors due to invalid formats.
Definition: MetaDataBrowser.h:261
OpenMS::AcquisitionInfo
Description of the combination of raw data to a single spectrum.
Definition: AcquisitionInfo.h:52
OpenMS::MetaDataBrowser::treeview_
QTreeWidget * treeview_
The tree.
Definition: MetaDataBrowser.h:278
OpenMS::Sample
Meta information about the sample.
Definition: Sample.h:59
OpenMS::ExperimentalSettings
Description of the experimental settings.
Definition: ExperimentalSettings.h:59
OpenMS::Modification
Meta information about chemical modification of a sample.
Definition: Modification.h:51
ConsensusMap.h
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::ProteinHit
Representation of a protein hit.
Definition: ProteinHit.h:58
OpenMS::MetaDataBrowser::ws_
QStackedWidget * ws_
A widgetstack that keeps track of all widgets.
Definition: MetaDataBrowser.h:267
OpenMS::MetaInfoDescription
Description of the meta data arrays of MSSpectrum.
Definition: MetaInfoDescription.h:48
QDialog
OpenMS::MetaDataBrowser::add
void add(FeatureMap &map)
Adds a feature map.
Definition: MetaDataBrowser.h:147
OpenMS::MetaDataBrowser::add
void add(MSSpectrum &spectrum)
Adds a peak spectrum.
Definition: MetaDataBrowser.h:122
OpenMS::MetaDataBrowser::closebutton_
QPushButton * closebutton_
Close Button.
Definition: MetaDataBrowser.h:271
OpenMS::ProteinIdentificationVisualizer
Class that displays all meta information for ProteinIdentification objects.
Definition: ProteinIdentificationVisualizer.h:54
QWidget
OpenMS::ProteinIdentification
Representation of a protein identification run.
Definition: ProteinIdentification.h:70
OpenMS::MSSpectrum::getStringDataArrays
const StringDataArrays & getStringDataArrays() const
Returns a const reference to the string meta data arrays.
OpenMS::Acquisition
Information about one raw data spectrum that was combined with several other raw data spectra.
Definition: Acquisition.h:49
OpenMS::Instrument
Description of a MS instrument.
Definition: Instrument.h:63
OpenMS::DataProcessingPtr
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition: DataProcessing.h:135
OpenMS::Precursor
Precursor meta information.
Definition: Precursor.h:57
OpenMS::Tagging
Meta information about tagging of a sample e.g. ICAT labeling.
Definition: Tagging.h:49
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::ScanWindow
Scan window description.
Definition: ScanWindow.h:46
OpenMS::MetaInfoInterface
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:60
OpenMS::DocumentIdentifier
Manage source document information.
Definition: DocumentIdentifier.h:55
OpenMS::MetaDataBrowser::add
void add(PeakMap &exp)
Adds a peak map.
Definition: MetaDataBrowser.h:115
OpenMS::MetaDataBrowser::editable_
bool editable_
Indicates the mode.
Definition: MetaDataBrowser.h:264
FeatureMap.h
OpenMS::ConsensusFeature
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:69
OpenMS::MetaDataBrowser::cancelbutton_
QPushButton * cancelbutton_
Cancel Button.
Definition: MetaDataBrowser.h:273
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:80
OpenMS::FeatureMap::getUnassignedPeptideIdentifications
const std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
OpenMS::MSSpectrum::getFloatDataArrays
const FloatDataArrays & getFloatDataArrays() const
Returns a const reference to the float meta data arrays.
OpenMS::HPLC
Representation of a HPLC experiment.
Definition: HPLC.h:50
OpenMS::MetaDataBrowser
A meta data visualization widget.
Definition: MetaDataBrowser.h:104
MSExperiment.h
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:97
OpenMS::PeptideIdentification
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62
OpenMS::Feature
An LC-MS feature.
Definition: Feature.h:70
OpenMS::PeptideIdentificationVisualizer
Class that displays all meta information for PeptideIdentification objects.
Definition: PeptideIdentificationVisualizer.h:54
OpenMS::SourceFile
Description of a file location, used to store the origin of (meta) data.
Definition: SourceFile.h:46
OpenMS::SpectrumSettings
Representation of 1D spectrum settings.
Definition: SpectrumSettings.h:63
QTreeWidget
OpenMS::Product
Product meta information.
Definition: Product.h:48
OpenMS::IonSource
Description of an ion source (part of a MS Instrument)
Definition: IonSource.h:47
OpenMS::IonDetector
Description of a ion detector (part of a MS Instrument)
Definition: IonDetector.h:46
OpenMS::MSSpectrum::getIntegerDataArrays
const IntegerDataArrays & getIntegerDataArrays() const
Returns a const reference to the integer meta data arrays.
OpenMS::ContactPerson
Contact person information.
Definition: ContactPerson.h:47
OpenMS::MetaDataBrowser::saveallbutton_
QPushButton * saveallbutton_
Save button.
Definition: MetaDataBrowser.h:269
OpenMS::Digestion
Meta information about digestion of a sample.
Definition: Digestion.h:49
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
OpenMS::Gradient
Representation of a HPLC gradient.
Definition: Gradient.h:52
StandardTypes.h
OpenMS::MassAnalyzer
Description of a mass analyzer (part of a MS Instrument)
Definition: MassAnalyzer.h:47
OpenMS::FeatureMap::getProteinIdentifications
const std::vector< ProteinIdentification > & getProteinIdentifications() const
non-mutable access to the protein identifications
OpenMS::PeptideHit
Representation of a peptide hit.
Definition: PeptideHit.h:55
OpenMS::MetaDataBrowser::add
void add(MetaDataType &meta_data_object)
A generic function to add data.
Definition: MetaDataBrowser.h:181