Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

MetaDataBrowser.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Timo Sachsenberg $
00032 // $Authors: Marc Sturm $
00033 // --------------------------------------------------------------------------
00034 
00035 #ifndef OPENMS_VISUAL_METADATABROWSER_H
00036 #define OPENMS_VISUAL_METADATABROWSER_H
00037 
00038 #include <OpenMS/KERNEL/MSExperiment.h>
00039 #include <OpenMS/KERNEL/FeatureMap.h>
00040 #include <OpenMS/KERNEL/ConsensusMap.h>
00041 
00042 //QT
00043 #include <QtGui/QDialog>
00044 #include <QtGui/QTreeWidget>
00045 class QTreeWidgetItem;
00046 class QPushButton;
00047 class QStackedWidget;
00048 class QHBoxLayout;
00049 class QVBoxLayout;
00050 class QGridLayout;
00051 
00052 namespace OpenMS
00053 {
00054   class BaseVisualizerGUI;
00055   class Acquisition;
00056   class AcquisitionInfo;
00057   class ContactPerson;
00058   class Digestion;
00059   class ExperimentalSettings;
00060   class Gradient;
00061   class HPLC;
00062   class PeptideIdentification;
00063   class Instrument;
00064   class IonDetector;
00065   class IonSource;
00066   class MassAnalyzer;
00067   class MetaInfo;
00068   class MetaInfoDescription;
00069   class MetaInfoInterface;
00070   class MetaInfoRegistry;
00071   class Modification;
00072   class PeptideHit;
00073   class Precursor;
00074   class DataProcessing;
00075   class ProteinHit;
00076   class ProteinIdentification;
00077   class Sample;
00078   class SampleTreatment;
00079   class Software;
00080   class SourceFile;
00081   class SpectrumSettings;
00082   class Tagging;
00083   class DocumentIdentifier;
00084   class Product;
00085 
00101   class OPENMS_GUI_DLLAPI MetaDataBrowser :
00102     public QDialog
00103   {
00104     Q_OBJECT
00105 
00106 public:
00107 
00109     MetaDataBrowser(bool editable = FALSE, QWidget * parent = 0, bool modal = FALSE);
00110 
00112     template <class PeakType>
00113     void add(MSExperiment<PeakType> & exp)
00114     {
00115       add(static_cast<ExperimentalSettings &>(exp));
00116       treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
00117     }
00118 
00120     template <class PeakType>
00121     void add(MSSpectrum<PeakType> & spectrum)
00122     {
00123       //spectrum settings
00124       add(static_cast<SpectrumSettings &>(spectrum));
00125 
00126       //MetaInfoDescriptions
00127       for (Size i = 0; i < spectrum.getFloatDataArrays().size(); ++i)
00128       {
00129         add(spectrum.getFloatDataArrays()[i]);
00130       }
00131       for (Size i = 0; i < spectrum.getIntegerDataArrays().size(); ++i)
00132       {
00133         add(spectrum.getIntegerDataArrays()[i]);
00134       }
00135       for (Size i = 0; i < spectrum.getStringDataArrays().size(); ++i)
00136       {
00137         add(spectrum.getStringDataArrays()[i]);
00138       }
00139 
00140       add(static_cast<MetaInfoInterface &>(spectrum));
00141 
00142       treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
00143     }
00144 
00146     template <class FeatureType>
00147     void add(FeatureMap<FeatureType> & map)
00148     {
00149       //identifier
00150       add(static_cast<DocumentIdentifier &>(map));
00151 
00152       //protein ids
00153       for (Size i = 0; i < map.getProteinIdentifications().size(); ++i)
00154       {
00155         add(map.getProteinIdentifications()[i]);
00156       }
00157 
00158       //unassigned peptide ids
00159       for (Size i = 0; i < map.getUnassignedPeptideIdentifications().size(); ++i)
00160       {
00161         add(map.getUnassignedPeptideIdentifications()[i]);
00162       }
00163 
00164       treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
00165     }
00166 
00168     void add(Feature & feature);
00170     void add(ConsensusFeature & feature);
00171 
00173     void add(ConsensusMap & map);
00174 
00180     template <class MetaDataType>
00181     void add(MetaDataType & meta_data_object)
00182     {
00183       visualize_(meta_data_object);
00184       treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first());
00185     }
00186 
00188     bool isEditable();
00189 
00191     friend class ProteinIdentificationVisualizer;
00192     friend class PeptideIdentificationVisualizer;
00193 
00194 public slots:
00195 
00197     void setStatus(std::string status);
00198 
00199 protected slots:
00200 
00202     void showDetails_();
00203 
00205     void saveAll_();
00206 
00207 protected:
00208 
00210 
00211     void visualize_(ExperimentalSettings & meta, QTreeWidgetItem * parent = 0);
00212     void visualize_(SpectrumSettings & meta, QTreeWidgetItem * parent = 0);
00213     void visualize_(MetaInfoInterface & meta, QTreeWidgetItem * parent = 0);
00214     void visualize_(Sample & meta, QTreeWidgetItem * parent = 0);
00215     void visualize_(HPLC & meta, QTreeWidgetItem * parent = 0);
00216     void visualize_(Digestion & meta, QTreeWidgetItem * parent = 0);
00217     void visualize_(Modification & meta, QTreeWidgetItem * parent = 0);
00218     void visualize_(Tagging & meta, QTreeWidgetItem * parent = 0);
00219     void visualize_(Gradient & meta, QTreeWidgetItem * parent = 0);
00220     void visualize_(Software & meta, QTreeWidgetItem * parent = 0);
00221     void visualize_(ScanWindow & meta, QTreeWidgetItem * parent = 0);
00222     void visualize_(SourceFile & meta, QTreeWidgetItem * parent = 0);
00223     void visualize_(ContactPerson & meta, QTreeWidgetItem * parent = 0);
00224     void visualize_(Instrument & meta, QTreeWidgetItem * parent = 0);
00225     void visualize_(IonSource & meta, QTreeWidgetItem * parent = 0);
00226     void visualize_(IonDetector & meta, QTreeWidgetItem * parent = 0);
00227     void visualize_(MassAnalyzer & meta, QTreeWidgetItem * parent = 0);
00228     void visualize_(DataProcessing & meta, QTreeWidgetItem * parent = 0);
00229     void visualize_(ProteinIdentification & meta, QTreeWidgetItem * parent = 0);
00230     void visualize_(ProteinHit & meta, QTreeWidgetItem * parent = 0);
00231     void visualize_(PeptideHit & meta, QTreeWidgetItem * parent = 0);
00232     void visualize_(Acquisition & meta, QTreeWidgetItem * parent = 0);
00233     void visualize_(AcquisitionInfo & meta, QTreeWidgetItem * parent = 0);
00234     void visualize_(MetaInfoDescription & meta, QTreeWidgetItem * parent = 0);
00235     void visualize_(Precursor & meta, QTreeWidgetItem * parent = 0);
00236     void visualize_(Product & meta, QTreeWidgetItem * parent = 0);
00237     void visualize_(InstrumentSettings & meta, QTreeWidgetItem * parent = 0);
00238     void visualize_(PeptideIdentification & meta, QTreeWidgetItem * parent = 0);
00239     void visualize_(DocumentIdentifier & meta, QTreeWidgetItem * parent = 0);
00241 
00243     template <typename ContainerType>
00244     void visualizeAll_(ContainerType & container, QTreeWidgetItem * parent)
00245     {
00246       for (typename ContainerType::iterator it = container.begin(); it != container.end(); ++it)
00247       {
00248         visualize_(*it, parent);
00249       }
00250     }
00251 
00253     void connectVisualizer_(BaseVisualizerGUI * ptr);
00254 
00256     void filterHits_(DoubleReal threshold, bool higher_better, int tree_item_id);
00258     void showAllHits_(int tree_item_id);
00259 
00261     std::string status_list_;
00262 
00264     bool editable_;
00265 
00267     QStackedWidget * ws_;
00269     QPushButton * saveallbutton_;
00271     QPushButton * closebutton_;
00273     QPushButton * cancelbutton_;
00275     QPushButton * undobutton_;
00276 
00278     QTreeWidget * treeview_;
00279   };
00280 }
00281 #endif

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:41 using doxygen 1.7.1