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 "../../massspectrum/qualifiedmassspectrum.h"
#include "../../peptide/peptide.h"
#include "../../peptide/peptidefragmentionlistbase.h"
#include "../../peptide/peptidenaturalisotopeaverage.h"
#include "../../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<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);
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<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
Definition graphicdevicewidget.h:37
pappso::MassSpectrumWidget
Definition massspectrumwidget.h:48
pappso::MassSpectrumWidget::_isotope_mass_list
std::vector< pappso::PeptideNaturalIsotopeAverageSp > _isotope_mass_list
list of isotope precursors
Definition massspectrumwidget.h:108
pappso::MassSpectrumWidget::peakChanged
void peakChanged(pappso::DataPointCstSPtr peak_match) const
pappso::MassSpectrumWidget::_peptide_sp
PeptideSp _peptide_sp
Definition massspectrumwidget.h:101
pappso::MassSpectrumWidget::_peak_ion_isotope_match_list
std::list< PeakIonIsotopeMatch > _peak_ion_isotope_match_list
Definition massspectrumwidget.h:104
pappso::MassSpectrumWidget::_is_visible_mass_delta
bool _is_visible_mass_delta
Definition massspectrumwidget.h:111
pappso::MassSpectrumWidget::_spectrum_sp
MassSpectrumCstSPtr _spectrum_sp
Definition massspectrumwidget.h:96
pappso::MassSpectrumWidget::mzChanged
void mzChanged(double mz) const
pappso::MassSpectrumWidget::_ms_level
unsigned int _ms_level
Definition massspectrumwidget.h:100
pappso::MassSpectrumWidget::ionChanged
void ionChanged(pappso::PeakIonIsotopeMatchCstSPtr ion) const
pappso::MassSpectrumWidget::_ion_list
std::list< PeptideIon > _ion_list
Definition massspectrumwidget.h:102
pappso::PrecisionBase
Definition precision.h:44
pappso::QCPSpectrum
Definition qcpspectrum.h:46
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition qualifiedmassspectrum.h:93
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition exportinmportconfig.h:14
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:50
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition massspectrum.h:57
pappso::PeakIonIsotopeMatchCstSPtr
std::shared_ptr< const PeakIonIsotopeMatch > PeakIonIsotopeMatchCstSPtr
Definition peakionisotopematch.h:34
pappso::DataPointCstSPtr
std::shared_ptr< const DataPoint > DataPointCstSPtr
Definition datapoint.h:18
qcpspectrum.h
pappso::DataPoint
Definition datapoint.h:22