Loading...
Searching...
No Matches
massspectrumwidget.h
Go to the documentation of this file.
/**
* \file pappsomspp/widget/spectrumwidget/massspectrumwidget.h
* \date 22/12/2017
* \author Olivier Langella
* \brief plot a sectrum and annotate with peptide
*/
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms++ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
*implementation
******************************************************************************/
#pragma once
#include "../../core/massspectrum/qualifiedmassspectrum.h"
#include "../../core/peptide/peptide.h"
#include "../../core/peptide/peptidefragmentionlistbase.h"
#include "../../core/peptide/peptidenaturalisotopeaverage.h"
#include "../../core/psm/peptideisotopespectrummatch.h"
#include "../graphicdevicewidget.h"
#include "qcpspectrum.h"
namespace pappso
{
class PMSPP_LIB_DECL MassSpectrumWidget : public GraphicDeviceWidget
{
Q_OBJECT
public:
MassSpectrumWidget(QWidget *parent = 0);
~MassSpectrumWidget();
void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum);
void setMsLevel(unsigned int ms_level);
void setMassSpectrumCstSPtr(const MassSpectrumCstSPtr &spectrum);
void setPeptideSp(const PeptideSp &peptide_sp);
void plot();
void rescale();
void setPeptideCharge(unsigned int parent_ion_charge);
void setMaximumIsotopeNumber(unsigned int max_isotope_number);
void setMaximumIsotopeRank(unsigned int max_isotope_rank);
// void setIsolationWindow(PrecisionPtr precision);
void setIonList(const std::list<Enums::PeptideIon> &ion_list);
void setMs1Precision(PrecisionPtr precision);
void setMs2Precision(PrecisionPtr precision);
bool savePdf(const QString &fileName, int width = 0, int height = 0);
void toQPaintDevice(QPaintDevice *device, const QSize &size) override;
void highlightPrecursorPeaks();
// void setIsotopeMassList(std::vector<pappso::PeptideNaturalIsotopeAverageSp>
// & isotope_mass_list);
QJsonObject getJsonPsmIsotope() const;
signals:
void mzChanged(double mz) const;
void peakChanged(pappso::DataPointCstSPtr peak_match) const;
void ionChanged(pappso::PeakIonIsotopeMatchCstSPtr ion) const;
protected:
friend class QCPSpectrum;
void mzChangeEvent(pappso_double mz) const;
void peakChangeEvent(const DataPoint *p_peak_match);
private:
void peptideAnnotate();
void setVisibleMassDelta(bool visible);
void clearData();
void computeIsotopeMassList();
private:
unsigned int _tag_nmost_intense = 10;
unsigned int _max_isotope_number = 0;
unsigned int _max_isotope_rank = 1;
MassSpectrumCstSPtr _spectrum_sp;
PrecisionPtr _p_ms1_precision = PrecisionFactory::getDaltonInstance(0.1);
PrecisionPtr _p_ms2_precision = PrecisionFactory::getDaltonInstance(0.5);
unsigned int _peptide_charge = 3;
unsigned int _ms_level;
PeptideSp _peptide_sp;
std::list<Enums::PeptideIon> _ion_list;
std::list<PeakIonIsotopeMatch> _peak_ion_isotope_match_list;
/** @brief list of isotope precursors
*/
std::vector<pappso::PeptideNaturalIsotopeAverageSp> _isotope_mass_list;
QCPSpectrum *_custom_plot = nullptr;
bool _is_visible_mass_delta;
const DataPoint *_p_mouse_peak = nullptr;
};
} // namespace pappso
GraphicDeviceWidget::GraphicDeviceWidget
GraphicDeviceWidget(QWidget *parent)
Definition graphicdevicewidget.cpp:35
pappso::MassSpectrumWidget::toQPaintDevice
void toQPaintDevice(QPaintDevice *device, const QSize &size) override
Definition massspectrumwidget.cpp:75
pappso::MassSpectrumWidget::_max_isotope_number
unsigned int _max_isotope_number
Definition massspectrumwidget.h:97
pappso::MassSpectrumWidget::setIonList
void setIonList(const std::list< Enums::PeptideIon > &ion_list)
Definition massspectrumwidget.cpp:135
pappso::MassSpectrumWidget::savePdf
bool savePdf(const QString &fileName, int width=0, int height=0)
Definition massspectrumwidget.cpp:60
pappso::MassSpectrumWidget::_isotope_mass_list
std::vector< pappso::PeptideNaturalIsotopeAverageSp > _isotope_mass_list
list of isotope precursors
Definition massspectrumwidget.h:111
pappso::MassSpectrumWidget::setQualifiedMassSpectrum
void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum)
Definition massspectrumwidget.cpp:254
pappso::MassSpectrumWidget::_p_mouse_peak
const DataPoint * _p_mouse_peak
Definition massspectrumwidget.h:116
pappso::MassSpectrumWidget::peakChanged
void peakChanged(pappso::DataPointCstSPtr peak_match) const
pappso::MassSpectrumWidget::setMs1Precision
void setMs1Precision(PrecisionPtr precision)
Definition massspectrumwidget.cpp:159
pappso::MassSpectrumWidget::setMassSpectrumCstSPtr
void setMassSpectrumCstSPtr(const MassSpectrumCstSPtr &spectrum)
Definition massspectrumwidget.cpp:228
pappso::MassSpectrumWidget::_peptide_sp
PeptideSp _peptide_sp
Definition massspectrumwidget.h:104
pappso::MassSpectrumWidget::setMs2Precision
void setMs2Precision(PrecisionPtr precision)
Definition massspectrumwidget.cpp:166
pappso::MassSpectrumWidget::_peak_ion_isotope_match_list
std::list< PeakIonIsotopeMatch > _peak_ion_isotope_match_list
Definition massspectrumwidget.h:107
pappso::MassSpectrumWidget::getJsonPsmIsotope
QJsonObject getJsonPsmIsotope() const
Definition massspectrumwidget.cpp:463
pappso::MassSpectrumWidget::setPeptideCharge
void setPeptideCharge(unsigned int parent_ion_charge)
Definition massspectrumwidget.cpp:130
pappso::MassSpectrumWidget::_peptide_charge
unsigned int _peptide_charge
Definition massspectrumwidget.h:102
pappso::MassSpectrumWidget::_max_isotope_rank
unsigned int _max_isotope_rank
Definition massspectrumwidget.h:98
pappso::MassSpectrumWidget::plot
void plot()
Definition massspectrumwidget.cpp:265
pappso::MassSpectrumWidget::setMaximumIsotopeRank
void setMaximumIsotopeRank(unsigned int max_isotope_rank)
Definition massspectrumwidget.cpp:180
pappso::MassSpectrumWidget::_is_visible_mass_delta
bool _is_visible_mass_delta
Definition massspectrumwidget.h:114
pappso::MassSpectrumWidget::_spectrum_sp
MassSpectrumCstSPtr _spectrum_sp
Definition massspectrumwidget.h:99
pappso::MassSpectrumWidget::_ion_list
std::list< Enums::PeptideIon > _ion_list
Definition massspectrumwidget.h:105
pappso::MassSpectrumWidget::_p_ms1_precision
PrecisionPtr _p_ms1_precision
Definition massspectrumwidget.h:100
pappso::MassSpectrumWidget::mzChanged
void mzChanged(double mz) const
pappso::MassSpectrumWidget::_p_ms2_precision
PrecisionPtr _p_ms2_precision
Definition massspectrumwidget.h:101
pappso::MassSpectrumWidget::_ms_level
unsigned int _ms_level
Definition massspectrumwidget.h:103
pappso::MassSpectrumWidget::setMsLevel
void setMsLevel(unsigned int ms_level)
Definition massspectrumwidget.cpp:141
pappso::MassSpectrumWidget::computeIsotopeMassList
void computeIsotopeMassList()
Definition massspectrumwidget.cpp:405
pappso::MassSpectrumWidget::QCPSpectrum
friend class QCPSpectrum
Definition massspectrumwidget.h:85
pappso::MassSpectrumWidget::MassSpectrumWidget
MassSpectrumWidget(QWidget *parent=0)
Definition massspectrumwidget.cpp:41
pappso::MassSpectrumWidget::setPeptideSp
void setPeptideSp(const PeptideSp &peptide_sp)
Definition massspectrumwidget.cpp:218
pappso::MassSpectrumWidget::mzChangeEvent
void mzChangeEvent(pappso_double mz) const
Definition massspectrumwidget.cpp:360
pappso::MassSpectrumWidget::ionChanged
void ionChanged(pappso::PeakIonIsotopeMatchCstSPtr ion) const
pappso::MassSpectrumWidget::setVisibleMassDelta
void setVisibleMassDelta(bool visible)
Definition massspectrumwidget.cpp:87
pappso::MassSpectrumWidget::peptideAnnotate
void peptideAnnotate()
Definition massspectrumwidget.cpp:185
pappso::MassSpectrumWidget::clearData
void clearData()
Definition massspectrumwidget.cpp:119
pappso::MassSpectrumWidget::peakChangeEvent
void peakChangeEvent(const DataPoint *p_peak_match)
Definition massspectrumwidget.cpp:366
pappso::MassSpectrumWidget::highlightPrecursorPeaks
void highlightPrecursorPeaks()
Definition massspectrumwidget.cpp:449
pappso::MassSpectrumWidget::rescale
void rescale()
Definition massspectrumwidget.cpp:238
pappso::MassSpectrumWidget::setMaximumIsotopeNumber
void setMaximumIsotopeNumber(unsigned int max_isotope_number)
Definition massspectrumwidget.cpp:174
pappso::MassSpectrumWidget::_custom_plot
QCPSpectrum * _custom_plot
Definition massspectrumwidget.h:113
pappso::MassSpectrumWidget::_tag_nmost_intense
unsigned int _tag_nmost_intense
Definition massspectrumwidget.h:96
pappso::PrecisionFactory::getDaltonInstance
static PrecisionPtr getDaltonInstance(pappso_double value)
get a Dalton precision pointer
Definition precision.cpp:136
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition qualifiedmassspectrum.h:99
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
graphicdevicewidget.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition aamodification.h:48
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition types.h:60
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition massspectrum.h:54
pappso::PeakIonIsotopeMatchCstSPtr
std::shared_ptr< const PeakIonIsotopeMatch > PeakIonIsotopeMatchCstSPtr
Definition peakionisotopematch.h:34
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
pappso::DataPointCstSPtr
std::shared_ptr< const DataPoint > DataPointCstSPtr
Definition datapoint.h:18
peptide.h
peptidefragmentionlistbase.h
peptideisotopespectrummatch.h
peptidenaturalisotopeaverage.h
qcpspectrum.h
qualifiedmassspectrum.h
pappso::DataPoint
Definition datapoint.h:22