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 highlightPrecursorPeaks();
72  // void setIsotopeMassList(std::vector<pappso::PeptideNaturalIsotopeAverageSp>
73  // & isotope_mass_list);
74 
75 
76  signals:
77  void mzChanged(double mz) const;
78  void peakChanged(pappso::DataPointCstSPtr peak_match) const;
80 
81  protected:
82  friend class QCPSpectrum;
83  void mzChangeEvent(pappso_double mz) const;
84  void peakChangeEvent(const DataPoint *p_peak_match);
85 
86  private:
87  void peptideAnnotate();
88  void setVisibleMassDelta(bool visible);
89  void clearData();
90  void computeIsotopeMassList();
91 
92  private:
93  unsigned int _tag_nmost_intense = 10;
94  unsigned int _max_isotope_number = 0;
95  unsigned int _max_isotope_rank = 1;
99  unsigned int _peptide_charge = 3;
100  unsigned int _ms_level;
102  std::list<PeptideIon> _ion_list;
103 
104  std::list<PeakIonIsotopeMatch> _peak_ion_isotope_match_list;
105 
106  /** @brief list of isotope precursors
107  */
108  std::vector<pappso::PeptideNaturalIsotopeAverageSp> _isotope_mass_list;
109 
110  QCPSpectrum *_custom_plot = nullptr;
112 
113  const DataPoint *_p_mouse_peak = nullptr;
114 };
115 
116 
117 } // namespace pappso
std::vector< pappso::PeptideNaturalIsotopeAverageSp > _isotope_mass_list
list of isotope precursors
void peakChanged(pappso::DataPointCstSPtr peak_match) const
std::list< PeakIonIsotopeMatch > _peak_ion_isotope_match_list
MassSpectrumCstSPtr _spectrum_sp
void mzChanged(double mz) const
void ionChanged(pappso::PeakIonIsotopeMatchCstSPtr ion) const
std::list< PeptideIon > _ion_list
static PrecisionPtr getDaltonInstance(pappso_double value)
get a Dalton precision pointer
Definition: precision.cpp:130
Class representing a fully specified mass spectrum.
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
std::shared_ptr< const Peptide > PeptideSp
double pappso_double
A type definition for doubles.
Definition: types.h:49
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition: massspectrum.h:55
std::shared_ptr< const PeakIonIsotopeMatch > PeakIonIsotopeMatchCstSPtr
std::shared_ptr< const DataPoint > DataPointCstSPtr
Definition: datapoint.h:17