libpappsomspp
Library for mass spectrometry
massspectrumwidget.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/widget/spectrumwidget/massspectrumwidget.h
3  * \date 22/12/2017
4  * \author Olivier Langella
5  * \brief plot a sectrum and annotate with peptide
6  */
7 
8 
9 /*******************************************************************************
10  * Copyright (c) 2017 Olivier Langella <Olivier.Langella@u-psud.fr>.
11  *
12  * This file is part of the PAPPSOms++ library.
13  *
14  * PAPPSOms++ is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation, either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * PAPPSOms++ is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
26  *
27  * Contributors:
28  * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
29  *implementation
30  ******************************************************************************/
31 
32 
33 #pragma once
34 
35 
36 #include "../../massspectrum/qualifiedmassspectrum.h"
37 #include "../../peptide/peptide.h"
38 #include "../../peptide/peptidefragmentionlistbase.h"
39 #include "../../peptide/peptidenaturalisotopeaverage.h"
40 #include "../../psm/peptideisotopespectrummatch.h"
41 #include "../graphicdevicewidget.h"
42 #include "qcpspectrum.h"
43 
44 namespace pappso
45 {
46 
48 {
49  Q_OBJECT
50  public:
51  MassSpectrumWidget(QWidget *parent = 0);
53 
54  void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum);
55  void setMsLevel(unsigned int ms_level);
56  void setMassSpectrumCstSPtr(const MassSpectrumCstSPtr &spectrum);
57  void setPeptideSp(const PeptideSp &peptide_sp);
58  void plot();
59  void rescale();
60 
61  void setPeptideCharge(unsigned int parent_ion_charge);
62  void setMaximumIsotopeNumber(unsigned int max_isotope_number);
63  void setMaximumIsotopeRank(unsigned int max_isotope_rank);
64  // void setIsolationWindow(PrecisionPtr precision);
65  void setIonList(const std::list<PeptideIon> &ion_list);
66  void setMs1Precision(PrecisionPtr precision);
67  void setMs2Precision(PrecisionPtr precision);
68 
69  bool savePdf(const QString &fileName, int width = 0, int height = 0);
70  void toQPaintDevice(QPaintDevice *device, const QSize &size) override;
71  // void setIsotopeMassList(std::vector<pappso::PeptideNaturalIsotopeAverageSp>
72  // & isotope_mass_list);
73 
74 
75  signals:
76  void mzChanged(double mz) const;
77  void peakChanged(pappso::DataPointCstSPtr peak_match) const;
79 
80  protected:
81  friend class QCPSpectrum;
82  void mzChangeEvent(pappso_double mz) const;
83  void peakChangeEvent(const DataPoint *p_peak_match);
84 
85  private:
86  void peptideAnnotate();
87  void setVisibleMassDelta(bool visible);
88  void clearData();
89  void computeIsotopeMassList();
90 
91  private:
92  unsigned int _tag_nmost_intense = 10;
93  unsigned int _max_isotope_number = 0;
94  unsigned int _max_isotope_rank = 1;
98  unsigned int _peptide_charge = 3;
99  unsigned int _ms_level;
101  std::list<PeptideIon> _ion_list;
102 
103  std::list<PeakIonIsotopeMatch> _peak_ion_isotope_match_list;
104 
105  /** @brief list of isotope precursors
106  */
107  std::vector<pappso::PeptideNaturalIsotopeAverageSp> _isotope_mass_list;
108 
109  QCPSpectrum *_custom_plot = nullptr;
111 
112  const DataPoint *_p_mouse_peak = nullptr;
113 };
114 
115 
116 } // namespace pappso
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:48
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition: massspectrum.h:55
pappso::MassSpectrumWidget::ionChanged
void ionChanged(pappso::PeakIonIsotopeMatchCstSPtr ion) const
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:14
pappso::PeakIonIsotopeMatchCstSPtr
std::shared_ptr< const PeakIonIsotopeMatch > PeakIonIsotopeMatchCstSPtr
Definition: peakionisotopematch.h:33
pappso::MassSpectrumWidget::_isotope_mass_list
std::vector< pappso::PeptideNaturalIsotopeAverageSp > _isotope_mass_list
list of isotope precursors
Definition: massspectrumwidget.h:107
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
pappso::MassSpectrumWidget::_is_visible_mass_delta
bool _is_visible_mass_delta
Definition: massspectrumwidget.h:110
pappso::DataPoint
Definition: datapoint.h:21
pappso::MassSpectrumWidget
Definition: massspectrumwidget.h:48
pappso::QCPSpectrum
Definition: qcpspectrum.h:46
pappso::DataPointCstSPtr
std::shared_ptr< const DataPoint > DataPointCstSPtr
Definition: datapoint.h:16
pappso::PrecisionFactory::getDaltonInstance
static PrecisionPtr getDaltonInstance(pappso_double value)
Definition: precision.cpp:129
pappso::MassSpectrumWidget::_ion_list
std::list< PeptideIon > _ion_list
Definition: massspectrumwidget.h:101
qcpspectrum.h
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition: qualifiedmassspectrum.h:85
GraphicDeviceWidget
Definition: graphicdevicewidget.h:37
pappso::MassSpectrumWidget::_ms_level
unsigned int _ms_level
Definition: massspectrumwidget.h:99
pappso::PrecisionBase
Definition: precision.h:44
pappso::MassSpectrumWidget::_spectrum_sp
MassSpectrumCstSPtr _spectrum_sp
Definition: massspectrumwidget.h:95
pappso::MassSpectrumWidget::mzChanged
void mzChanged(double mz) const
pappso::MassSpectrumWidget::peakChanged
void peakChanged(pappso::DataPointCstSPtr peak_match) const
pappso::MassSpectrumWidget::_peptide_sp
PeptideSp _peptide_sp
Definition: massspectrumwidget.h:100
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition: aamodification.h:47
pappso::MassSpectrumWidget::_peak_ion_isotope_match_list
std::list< PeakIonIsotopeMatch > _peak_ion_isotope_match_list
Definition: massspectrumwidget.h:103