32#include "../../pappsoexception.h"
33#include "../../peptide/peptidenaturalisotopelist.h"
40MassSpectrumWidget::MassSpectrumWidget(QWidget *parent)
49 this->setLayout(
new QHBoxLayout(
this));
51 this->layout()->setMargin(0);
81 painter.begin(device);
82 _custom_plot->toPainter(&painter, size.width(), size.height());
97 while(
auto item = this->layout()->takeAt(0))
99 delete item->widget();
108 _custom_plot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
143 qDebug() <<
"ms_level=" << ms_level;
161 qDebug() <<
"precision->toString()=" << precision->
toString();
168 qDebug() <<
"precision->toString()=" << precision->
toString();
278 qDebug() <<
"_isotope_mass_list.size()="
284 return a.get()->getMz() < b.get()->getMz();
291 qDebug() <<
"precursor_peptide.get()->getMz()="
292 << precursor_peptide.get()->getMz();
293 MzRange precursor_mass(precursor_peptide.get()->getMz(),
296 monoisotope_peak.
y = 0;
302 if(peak.y > monoisotope_peak.
y)
304 qDebug() <<
"SpectrumWidget::plot "
306 "monoisotope_peak.intensity) ";
307 monoisotope_peak = peak;
311 if(monoisotope_peak.
y > 0)
313 qDebug() <<
"addMs1IsotopePattern";
326 qDebug() <<
a.getPeak().y <<
" > ";
327 qDebug() <<
b.getPeak().y <<
" . ";
328 return (
a.getPeak().y >
b.getPeak().y);
344 QCPItemText *text_label =
new QCPItemText(
_custom_plot);
345 text_label->setVisible(
true);
347 text_label->setPositionAlignment(Qt::AlignBottom |
349 text_label->position->setType(QCPItemPosition::ptPlotCoords);
350 text_label->position->setCoords(
351 peak_ion_match.getPeak().x,
352 peak_ion_match.getPeak()
354 text_label->setFont(QFont(font().family(), 8));
356 peak_ion_match.getPeptideFragmentIonSp()
358 ->getCompletePeptideIonName(peak_ion_match.getCharge()));
361 text_label->setColor(
363 peak_ion_match.getPeptideIonType())));
382 qDebug() <<
"p_peak_match=" << p_peak_match;
401 emit
ionChanged(std::make_shared<const PeakIonIsotopeMatch>(
408 emit
ionChanged(std::shared_ptr<const PeakIonIsotopeMatch>());
413 qDebug() <<
"no peak";
428 std::map<unsigned int, pappso::pappso_double> map_isotope_number =
431 for(
unsigned int i = 0; i < map_isotope_number.size(); i++)
434 unsigned int asked_rank = 0;
435 unsigned int given_rank = 0;
436 bool more_rank =
true;
443 if(given_rank < asked_rank)
469 _custom_plot->highlightPrecursorPeaks(
470 precursor_mz_1, 1, _p_ms2_precision);
471 pappso_double precursor_mz_charge = _peptide_sp->getMz(_peptide_charge);
472 _custom_plot->highlightPrecursorPeaks(
473 precursor_mz_charge, _peptide_charge, _p_ms2_precision);
bool contains(pappso_double) const
static std::list< PeptideIon > getCIDionList()
static const QColor getPeptideIonColor(PeptideIon ion_type)
const std::list< PeakIonIsotopeMatch > & getPeakIonIsotopeMatchList() const
unsigned int getIsotopeRank() const
pappso_double getIntensityRatio() const
PeptideNaturalIsotopeAverageSp makePeptideNaturalIsotopeAverageSp() const
const std::map< unsigned int, pappso_double > getIntensityRatioPerIsotopeNumber() const
virtual QString toString() const =0
void addPeakIonIsotopeMatch(const PeakIonIsotopeMatch &peak_ion_match)
void addMassDelta(const PeakIonIsotopeMatch &peak_ion_match)
void setSpectrumP(const MassSpectrum *spectrum)
void addMs1IsotopePattern(const std::vector< pappso::PeptideNaturalIsotopeAverageSp > &isotope_mass_list, pappso_double intensity)
Class representing a fully specified mass spectrum.
uint getMsLevel() const
Get the mass spectrum level.
MassSpectrumCstSPtr getMassSpectrumCstSPtr() const
Get the MassSpectrumCstSPtr.
uint getPrecursorCharge(bool *ok=nullptr) const
Get the precursor charge.
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::shared_ptr< const Peptide > PeptideSp
double pappso_double
A type definition for doubles.
std::shared_ptr< const PeptideNaturalIsotopeAverage > PeptideNaturalIsotopeAverageSp
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
std::shared_ptr< const DataPoint > DataPointCstSPtr
DataPointCstSPtr makeDataPointCstSPtr() const