Loading...
Searching...
No Matches
qcpspectrum.h
Go to the documentation of this file.
/**
* \file pappsomspp/widget/spectrumwidget/qcpspectrum.h
* \date 31/12/2017
* \author Olivier Langella
* \brief Custom plot derivative to plot a spectrum
*/
/*******************************************************************************
* 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 <qcustomplot.h>
#include "pappsomspp/core/psm/peakionisotopematch.h"
#include "pappsomspp/core/types.h"
namespace pappso
{
class MassSpectrumWidget;
class QCPSpectrum : public QCustomPlot
{
Q_OBJECT
protected:
friend class MassSpectrumWidget;
QCPSpectrum(MassSpectrumWidget *parent, bool visible);
~QCPSpectrum();
protected:
void clearData();
void rescale();
void setSpectrumP(const MassSpectrum *spectrum);
void addMassDelta(const PeakIonIsotopeMatch &peak_ion_match);
void
addMs1IsotopePattern(const std::vector<pappso::PeptideNaturalIsotopeAverageSp>
&isotope_mass_list,
pappso_double intensity);
void addPeakIonIsotopeMatch(const PeakIonIsotopeMatch &peak_ion_match);
void highlightPrecursorPeaks(double precursor_mz,
int charge,
PrecisionPtr ms2_precision);
virtual void mouseMoveEvent(QMouseEvent *event) override;
virtual void mousePressEvent(QMouseEvent *event) override;
virtual void mouseReleaseEvent(QMouseEvent *event) override;
virtual void keyPressEvent(QKeyEvent *event) override;
virtual void keyReleaseEvent(QKeyEvent *event) override;
private:
void getNearestPeakBetween(pappso_double mz,
pappso_double mouse_mz_range) const;
void getMostIntensePeakBetween(pappso_double mz,
pappso_double mouse_mz_range) const;
private:
Q_SLOT void setMzRangeChanged(QCPRange range);
private:
MassSpectrumWidget *_parent;
const MassSpectrum *_p_spectrum = nullptr;
QCPRange _mz_range;
QCPRange _intensity_range;
QCPRange _mass_delta_range;
QCPBars *_p_peak_bars;
QCPBars *_p_peak_bars_isotope;
QCPBars *mp_peak_bars_precursor;
std::map<Enums::PeptideIon, QCPBars *> _map_ion_type_bars;
QCPAxisRect *_p_delta_axis_rect;
QCPGraph *_p_delta_graph;
double _bar_width = 0.5;
bool _click = false;
bool _control_key = false;
pappso::pappso_double _old_x;
pappso::pappso_double _old_y;
};
} // namespace pappso
pappso::MassSpectrumWidget
Definition massspectrumwidget.h:48
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition massspectrum.h:70
pappso::PeakIonIsotopeMatch
Definition peakionisotopematch.h:47
pappso::QCPSpectrum::_p_delta_graph
QCPGraph * _p_delta_graph
Definition qcpspectrum.h:92
pappso::QCPSpectrum::highlightPrecursorPeaks
void highlightPrecursorPeaks(double precursor_mz, int charge, PrecisionPtr ms2_precision)
Definition qcpspectrum.cpp:480
pappso::QCPSpectrum::_mz_range
QCPRange _mz_range
Definition qcpspectrum.h:84
pappso::QCPSpectrum::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event) override
Definition qcpspectrum.cpp:267
pappso::QCPSpectrum::_p_delta_axis_rect
QCPAxisRect * _p_delta_axis_rect
Definition qcpspectrum.h:91
pappso::QCPSpectrum::_p_peak_bars
QCPBars * _p_peak_bars
Definition qcpspectrum.h:87
pappso::QCPSpectrum::_parent
MassSpectrumWidget * _parent
Definition qcpspectrum.h:82
pappso::QCPSpectrum::_mass_delta_range
QCPRange _mass_delta_range
Definition qcpspectrum.h:86
pappso::QCPSpectrum::addPeakIonIsotopeMatch
void addPeakIonIsotopeMatch(const PeakIonIsotopeMatch &peak_ion_match)
Definition qcpspectrum.cpp:459
pappso::QCPSpectrum::QCPSpectrum
QCPSpectrum(MassSpectrumWidget *parent, bool visible)
Definition qcpspectrum.cpp:37
pappso::QCPSpectrum::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *event) override
Definition qcpspectrum.cpp:306
pappso::QCPSpectrum::MassSpectrumWidget
friend class MassSpectrumWidget
Definition qcpspectrum.h:49
pappso::QCPSpectrum::_intensity_range
QCPRange _intensity_range
Definition qcpspectrum.h:85
pappso::QCPSpectrum::addMassDelta
void addMassDelta(const PeakIonIsotopeMatch &peak_ion_match)
Definition qcpspectrum.cpp:440
pappso::QCPSpectrum::getNearestPeakBetween
void getNearestPeakBetween(pappso_double mz, pappso_double mouse_mz_range) const
Definition qcpspectrum.cpp:377
pappso::QCPSpectrum::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *event) override
Definition qcpspectrum.cpp:315
pappso::QCPSpectrum::_old_x
pappso::pappso_double _old_x
Definition qcpspectrum.h:96
pappso::QCPSpectrum::getMostIntensePeakBetween
void getMostIntensePeakBetween(pappso_double mz, pappso_double mouse_mz_range) const
Definition qcpspectrum.cpp:409
pappso::QCPSpectrum::mp_peak_bars_precursor
QCPBars * mp_peak_bars_precursor
Definition qcpspectrum.h:89
pappso::QCPSpectrum::rescale
void rescale()
Definition qcpspectrum.cpp:182
pappso::QCPSpectrum::_control_key
bool _control_key
Definition qcpspectrum.h:95
pappso::QCPSpectrum::setSpectrumP
void setSpectrumP(const MassSpectrum *spectrum)
Definition qcpspectrum.cpp:151
pappso::QCPSpectrum::clearData
void clearData()
Definition qcpspectrum.cpp:234
pappso::QCPSpectrum::_map_ion_type_bars
std::map< Enums::PeptideIon, QCPBars * > _map_ion_type_bars
Definition qcpspectrum.h:90
pappso::QCPSpectrum::addMs1IsotopePattern
void addMs1IsotopePattern(const std::vector< pappso::PeptideNaturalIsotopeAverageSp > &isotope_mass_list, pappso_double intensity)
Definition qcpspectrum.cpp:466
pappso::QCPSpectrum::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *event) override
Definition qcpspectrum.cpp:277
pappso::QCPSpectrum::~QCPSpectrum
~QCPSpectrum()
Definition qcpspectrum.cpp:146
pappso::QCPSpectrum::_p_peak_bars_isotope
QCPBars * _p_peak_bars_isotope
Definition qcpspectrum.h:88
pappso::QCPSpectrum::_p_spectrum
const MassSpectrum * _p_spectrum
Definition qcpspectrum.h:83
pappso::QCPSpectrum::_bar_width
double _bar_width
Definition qcpspectrum.h:93
pappso::QCPSpectrum::mousePressEvent
virtual void mousePressEvent(QMouseEvent *event) override
Definition qcpspectrum.cpp:287
pappso::QCPSpectrum::setMzRangeChanged
Q_SLOT void setMzRangeChanged(QCPRange range)
Definition qcpspectrum.cpp:210
pappso::QCPSpectrum::_click
bool _click
Definition qcpspectrum.h:94
pappso::QCPSpectrum::_old_y
pappso::pappso_double _old_y
Definition qcpspectrum.h:97
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition types.h:60
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
peakionisotopematch.h
types.h