pappso::MassSpectrumWidget Class Reference

`#include <massspectrumwidget.h>`

Inheritance diagram for pappso::MassSpectrumWidget:

## Signals

void | mzChanged (double mz) const
void | peakChanged (pappso::DataPointCstSPtr peak_match) const
void | ionChanged (pappso::PeakIonIsotopeMatchCstSPtr ion) const

## Public Member Functions

| 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 | 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 ()
Public Member Functions inherited from GraphicDeviceWidget
| GraphicDeviceWidget (QWidget *parent)
virtual | ~GraphicDeviceWidget ()
virtual void | toSvgFile (const QString &filename, const QString &title, const QString &description, const QSize &size) final

## Protected Member Functions

void | mzChangeEvent (pappso_double mz) const
void | peakChangeEvent (const DataPoint *p_peak_match)

## Private Member Functions

void | peptideAnnotate ()
void | setVisibleMassDelta (bool visible)
void | clearData ()
void | computeIsotopeMassList ()

## Private Attributes

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
std::vector< pappso::PeptideNaturalIsotopeAverageSp > | _isotope_mass_list
| list of isotope precursors More...
QCPSpectrum * | _custom_plot = nullptr
bool | _is_visible_mass_delta
const DataPoint * | _p_mouse_peak = nullptr

## Friends

class | QCPSpectrum

## Detailed Description

Definition at line 47 of file massspectrumwidget.h.

## Constructor & Destructor Documentation

## MassSpectrumWidget()

MassSpectrumWidget::MassSpectrumWidget | ( | QWidget * | parent = `0` | ) |

Definition at line 40 of file massspectrumwidget.cpp.

: GraphicDeviceWidget(parent)
{
qDebug();
_ms_level = 1;
_ion_list = PeptideFragmentIonListBase::getCIDionList();
_custom_plot = nullptr;
this->setLayout(new QHBoxLayout(this));
this->layout()->setMargin(0);
setVisibleMassDelta(false);
qDebug();
}
GraphicDeviceWidget::GraphicDeviceWidget
GraphicDeviceWidget(QWidget *parent)
Definition: graphicdevicewidget.cpp:35
pappso::MassSpectrumWidget::_ms_level
unsigned int _ms_level
Definition: massspectrumwidget.h:100
pappso::MassSpectrumWidget::setVisibleMassDelta
void setVisibleMassDelta(bool visible)
Definition: massspectrumwidget.cpp:87
pappso::MassSpectrumWidget::_custom_plot
QCPSpectrum * _custom_plot
Definition: massspectrumwidget.h:110
pappso::MassSpectrumWidget::_ion_list
std::list< PeptideIon > _ion_list
Definition: massspectrumwidget.h:102
pappso::PeptideFragmentIonListBase::getCIDionList
static std::list< PeptideIon > getCIDionList()
Definition: peptidefragmentionlistbase.cpp:41

References _custom_plot, _ion_list, _ms_level, pappso::PeptideFragmentIonListBase::getCIDionList(), and setVisibleMassDelta().

## ~MassSpectrumWidget()

MassSpectrumWidget::~MassSpectrumWidget | ( |  | ) |

Definition at line 55 of file massspectrumwidget.cpp.

{
}

## Member Function Documentation

## clearData()

void MassSpectrumWidget::clearData | ( |  | ) |

private

Definition at line 119 of file massspectrumwidget.cpp.

{
qDebug();
_custom_plot->clearData();
qDebug();
_custom_plot->clearItems();
_custom_plot->setSpectrumP(_spectrum_sp.get());
qDebug();
}
pappso::MassSpectrumWidget::_spectrum_sp
MassSpectrumCstSPtr _spectrum_sp
Definition: massspectrumwidget.h:96
pappso::QCPSpectrum::setSpectrumP
void setSpectrumP(const MassSpectrum *spectrum)
Definition: qcpspectrum.cpp:159
pappso::QCPSpectrum::clearData
void clearData()
Definition: qcpspectrum.cpp:244

References _custom_plot, _spectrum_sp, pappso::QCPSpectrum::clearData(), and pappso::QCPSpectrum::setSpectrumP().

Referenced by peptideAnnotate(), and setMassSpectrumCstSPtr().

## computeIsotopeMassList()

void MassSpectrumWidget::computeIsotopeMassList | ( |  | ) |

private

Definition at line 411 of file massspectrumwidget.cpp.

{
qDebug() << "_p_ms1_precision->toString()=" << _p_ms1_precision->toString();
_isotope_mass_list.resize(0);
// compute isotope masses :
if(_peptide_sp != nullptr)
{
pappso::PeptideNaturalIsotopeList isotope_list(_peptide_sp);
std::map<unsigned int, pappso::pappso_double> map_isotope_number =
isotope_list.getIntensityRatioPerIsotopeNumber();
for(unsigned int i = 0; i < map_isotope_number.size(); i++)
{
unsigned int asked_rank = 0;
unsigned int given_rank = 0;
bool more_rank = true;
while(more_rank)
{
asked_rank++;
pappso::PeptideNaturalIsotopeAverage isotopeAverageMono(
isotope_list, asked_rank, i, _peptide_charge, _p_ms1_precision);
given_rank = isotopeAverageMono.getIsotopeRank();
if(given_rank < asked_rank)
{
more_rank = false;
}
else if(isotopeAverageMono.getIntensityRatio() == 0)
{
more_rank = false;
}
else
{
// isotopeAverageMono.makePeptideNaturalIsotopeAverageSp();
_isotope_mass_list.push_back(
isotopeAverageMono.makePeptideNaturalIsotopeAverageSp());
}
}
}
}
}
pappso::MassSpectrumWidget::_isotope_mass_list
std::vector< pappso::PeptideNaturalIsotopeAverageSp > _isotope_mass_list
list of isotope precursors
Definition: massspectrumwidget.h:108
pappso::MassSpectrumWidget::_peptide_sp
PeptideSp _peptide_sp
Definition: massspectrumwidget.h:101
pappso::MassSpectrumWidget::_peptide_charge
unsigned int _peptide_charge
Definition: massspectrumwidget.h:99
pappso::MassSpectrumWidget::_p_ms1_precision
PrecisionPtr _p_ms1_precision
Definition: massspectrumwidget.h:97
pappso::PeptideNaturalIsotopeAverage
Definition: peptidenaturalisotopeaverage.h:43
pappso::PeptideNaturalIsotopeList
Definition: peptidenaturalisotopelist.h:49
pappso::PrecisionBase::toString
virtual QString toString() const =0

References _isotope_mass_list, _p_ms1_precision, _peptide_charge, _peptide_sp, pappso::PeptideNaturalIsotopeAverage::getIntensityRatio(), pappso::PeptideNaturalIsotopeList::getIntensityRatioPerIsotopeNumber(), pappso::PeptideNaturalIsotopeAverage::getIsotopeRank(), pappso::PeptideNaturalIsotopeAverage::makePeptideNaturalIsotopeAverageSp(), and pappso::PrecisionBase::toString().

Referenced by peptideAnnotate().

## highlightPrecursorPeaks()

void pappso::MassSpectrumWidget::highlightPrecursorPeaks | ( |  | ) |

Definition at line 454 of file massspectrumwidget.cpp.

{
if(_ms_level > 1)
{
pappso_double precursor_mz_1 = _peptide_sp->getMz(1);
_custom_plot->highlightPrecursorPeaks(
precursor_mz_1, 1, _p_ms2_precision);
pappso_double precursor_mz_charge = _peptide_sp->getMz(_peptide_charge);
_custom_plot->highlightPrecursorPeaks(
precursor_mz_charge, _peptide_charge, _p_ms2_precision);
}
}
pappso::MassSpectrumWidget::_p_ms2_precision
PrecisionPtr _p_ms2_precision
Definition: massspectrumwidget.h:98
pappso::QCPSpectrum::highlightPrecursorPeaks
void highlightPrecursorPeaks(double precursor_mz, int charge, PrecisionPtr ms2_precision)
Definition: qcpspectrum.cpp:471
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:48

## ionChanged

void pappso::MassSpectrumWidget::ionChanged | ( | pappso::PeakIonIsotopeMatchCstSPtr | ion | ) | const

signal

Referenced by peakChangeEvent().

## mzChanged

void pappso::MassSpectrumWidget::mzChanged | ( | double | mz | ) | const

signal

Referenced by mzChangeEvent().

## mzChangeEvent()

void MassSpectrumWidget::mzChangeEvent | ( | pappso_double | mz | ) | const

protected

Definition at line 365 of file massspectrumwidget.cpp.

{
emit mzChanged(mz);
}
pappso::MassSpectrumWidget::mzChanged
void mzChanged(double mz) const

References pappso::mz, and mzChanged().

Referenced by pappso::QCPSpectrum::mouseMoveEvent().

## peakChanged

void pappso::MassSpectrumWidget::peakChanged | ( | pappso::DataPointCstSPtr | peak_match | ) | const

signal

Referenced by peakChangeEvent().

## peakChangeEvent()

void MassSpectrumWidget::peakChangeEvent | ( | const DataPoint * | p_peak_match | ) |

protected

Definition at line 371 of file massspectrumwidget.cpp.

{
qDebug() << "p_peak_match=" << p_peak_match;
if(_p_mouse_peak != p_peak_match)
{
_p_mouse_peak = p_peak_match;
DataPointCstSPtr peak_shp;
// emit peakChanged(peak_shp);
if(_p_mouse_peak != nullptr)
{
qDebug() << "_p_mouse_peak->x=" << _p_mouse_peak->x;
peak_shp = _p_mouse_peak->makeDataPointCstSPtr();
emit peakChanged(peak_shp);
// try to find matched ion (if it exists)
bool found = false;
for(const PeakIonIsotopeMatch &peak_ion_match :
_peak_ion_isotope_match_list)
{
if(peak_ion_match.getPeak().x == _p_mouse_peak->x)
{
// found
emit ionChanged(std::make_shared<const PeakIonIsotopeMatch>(
PeakIonIsotopeMatch(peak_ion_match)));
found = true;
}
}
if(!found)
{
emit ionChanged(std::shared_ptr<const PeakIonIsotopeMatch>());
}
}
else
{
qDebug() << "no peak";
emit peakChanged(peak_shp);
}
}
}
pappso::MassSpectrumWidget::_p_mouse_peak
const DataPoint * _p_mouse_peak
Definition: massspectrumwidget.h:113
pappso::MassSpectrumWidget::peakChanged
void peakChanged(pappso::DataPointCstSPtr peak_match) const
pappso::MassSpectrumWidget::_peak_ion_isotope_match_list
std::list< PeakIonIsotopeMatch > _peak_ion_isotope_match_list
Definition: massspectrumwidget.h:104
pappso::MassSpectrumWidget::ionChanged
void ionChanged(pappso::PeakIonIsotopeMatchCstSPtr ion) const
pappso::PeakIonIsotopeMatch
Definition: peakionisotopematch.h:37
pappso::DataPointCstSPtr
std::shared_ptr< const DataPoint > DataPointCstSPtr
Definition: datapoint.h:16
pappso::DataPoint::x
pappso_double x
Definition: datapoint.h:22
pappso::DataPoint::makeDataPointCstSPtr
DataPointCstSPtr makeDataPointCstSPtr() const
Definition: datapoint.cpp:70

References _p_mouse_peak, _peak_ion_isotope_match_list, ionChanged(), pappso::DataPoint::makeDataPointCstSPtr(), peakChanged(), and pappso::DataPoint::x.

Referenced by pappso::QCPSpectrum::getMostIntensePeakBetween(), and pappso::QCPSpectrum::getNearestPeakBetween().

## peptideAnnotate()

void MassSpectrumWidget::peptideAnnotate | ( |  | ) |

private

Definition at line 185 of file massspectrumwidget.cpp.

{
qDebug() << " _max_isotope_number=" << _max_isotope_number;
clearData();
_peak_ion_isotope_match_list.clear();
if((_spectrum_sp == nullptr) || (_peptide_sp == nullptr))
{
}
else
{
if(_ms_level > 1)
{
PeptideIsotopeSpectrumMatch psm_match(*(_spectrum_sp.get()),
_peptide_sp,
_peptide_charge,
_p_ms2_precision,
_ion_list,
_max_isotope_number,
_max_isotope_rank);
_peak_ion_isotope_match_list = psm_match.getPeakIonIsotopeMatchList();
}
else
{
}
computeIsotopeMassList();
}
qDebug();
}
pappso::MassSpectrumWidget::_max_isotope_number
unsigned int _max_isotope_number
Definition: massspectrumwidget.h:94
pappso::MassSpectrumWidget::_max_isotope_rank
unsigned int _max_isotope_rank
Definition: massspectrumwidget.h:95
pappso::MassSpectrumWidget::computeIsotopeMassList
void computeIsotopeMassList()
Definition: massspectrumwidget.cpp:411
pappso::MassSpectrumWidget::clearData
void clearData()
Definition: massspectrumwidget.cpp:119
pappso::PeptideIsotopeSpectrumMatch
Definition: peptideisotopespectrummatch.h:40

References _ion_list, _max_isotope_number, _max_isotope_rank, _ms_level, _p_ms2_precision, _peak_ion_isotope_match_list, _peptide_charge, _peptide_sp, _spectrum_sp, clearData(), computeIsotopeMassList(), and pappso::PeptideIsotopeSpectrumMatch::getPeakIonIsotopeMatchList().

Referenced by plot().

## plot()

void MassSpectrumWidget::plot | ( |  | ) |

Definition at line 264 of file massspectrumwidget.cpp.

{
qDebug();
peptideAnnotate();
if(_ms_level == 1)
{
if(_spectrum_sp != nullptr)
{
if(_isotope_mass_list.size() > 0)
{
qDebug() << "_isotope_mass_list.size()="
<< _isotope_mass_list.size();
std::sort(_isotope_mass_list.begin(),
_isotope_mass_list.end(),
[](const PeptideNaturalIsotopeAverageSp &a,
const PeptideNaturalIsotopeAverageSp &b) {
return a.get()->getMz() < b.get()->getMz();
});
if(_isotope_mass_list.size() > 0)
{
PeptideNaturalIsotopeAverageSp precursor_peptide =
_isotope_mass_list.at(0);
qDebug() << "precursor_peptide.get()->getMz()="
<< precursor_peptide.get()->getMz();
MzRange precursor_mass(precursor_peptide.get()->getMz(),
_p_ms1_precision);
DataPoint monoisotope_peak;
monoisotope_peak.y = 0;
for(const DataPoint &peak : *(_spectrum_sp.get()))
{
if(precursor_mass.contains(peak.x))
{
if(peak.y > monoisotope_peak.y)
{
qDebug() << "SpectrumWidget::plot "
"(peak.intensity > "
"monoisotope_peak.intensity) ";
monoisotope_peak = peak;
}
}
}
if(monoisotope_peak.y > 0)
{
qDebug() << "addMs1IsotopePattern";
_custom_plot->addMs1IsotopePattern(_isotope_mass_list,
monoisotope_peak.y);
}
}
}
}
}
else
{
_peak_ion_isotope_match_list.sort(
[](const PeakIonIsotopeMatch &a, const PeakIonIsotopeMatch &b) {
return a.getPeak().y > b.getPeak().y;
});
unsigned int i = 0;
for(const PeakIonIsotopeMatch &peak_ion_match :
_peak_ion_isotope_match_list)
{
_custom_plot->addPeakIonIsotopeMatch(peak_ion_match);
_custom_plot->addMassDelta(peak_ion_match);
//_p_delta_graph->addData(peak_ion_match.getPeak().x,
// peak_ion_match.getPeak().y);
if(i < _tag_nmost_intense)
{
QCPItemText *text_label = new QCPItemText(_custom_plot);
text_label->setVisible(true);
//_custom_plot->addItem(text_label);
text_label->setPositionAlignment(Qt::AlignBottom |
Qt::AlignHCenter);
text_label->position->setType(QCPItemPosition::ptPlotCoords);
text_label->position->setCoords(
peak_ion_match.getPeak().x,
peak_ion_match.getPeak()
.y); // place position at center/top of axis rect
text_label->setFont(QFont(font().family(), 8));
text_label->setText(
peak_ion_match.getPeptideFragmentIonSp()
.get()
->getCompletePeptideIonName(peak_ion_match.getCharge()));
// text_label->setPen(QPen(PeptideFragmentIon::getPeptideIonColor(peak_ion_match.getPeptideIonType()),
// 1)); // show black border around text
text_label->setColor(
QColor(PeptideFragmentIon::getPeptideIonColor(
peak_ion_match.getPeptideIonType())));
}
i++;
}
}
_custom_plot->replot();
qDebug();
}
pappso::MassSpectrumWidget::peptideAnnotate
void peptideAnnotate()
Definition: massspectrumwidget.cpp:185
pappso::MassSpectrumWidget::_tag_nmost_intense
unsigned int _tag_nmost_intense
Definition: massspectrumwidget.h:93
pappso::MzRange
Definition: mzrange.h:46
pappso::PeptideFragmentIon::getPeptideIonColor
static const QColor getPeptideIonColor(PeptideIon ion_type)
Definition: peptidefragmention.cpp:204
pappso::QCPSpectrum::addPeakIonIsotopeMatch
void addPeakIonIsotopeMatch(const PeakIonIsotopeMatch &peak_ion_match)
Definition: qcpspectrum.cpp:448
pappso::QCPSpectrum::addMassDelta
void addMassDelta(const PeakIonIsotopeMatch &peak_ion_match)
Definition: qcpspectrum.cpp:427
pappso::QCPSpectrum::addMs1IsotopePattern
void addMs1IsotopePattern(const std::vector< pappso::PeptideNaturalIsotopeAverageSp > &isotope_mass_list, pappso_double intensity)
Definition: qcpspectrum.cpp:455
pappso::PeptideIonNter::a
@ a
pappso::PeptideIonNter::b
@ b
pappso::PeptideNaturalIsotopeAverageSp
std::shared_ptr< const PeptideNaturalIsotopeAverage > PeptideNaturalIsotopeAverageSp
Definition: peptidenaturalisotopeaverage.h:37
pappso::DataPoint
Definition: datapoint.h:21
pappso::DataPoint::y
pappso_double y
Definition: datapoint.h:23

References _custom_plot, _isotope_mass_list, _ms_level, _p_ms1_precision, _peak_ion_isotope_match_list, _spectrum_sp, _tag_nmost_intense, pappso::a, pappso::QCPSpectrum::addMassDelta(), pappso::QCPSpectrum::addMs1IsotopePattern(), pappso::QCPSpectrum::addPeakIonIsotopeMatch(), pappso::b, pappso::MzRange::contains(), pappso::PeptideFragmentIon::getPeptideIonColor(), peptideAnnotate(), pappso::y, and pappso::DataPoint::y.

## rescale()

void MassSpectrumWidget::rescale | ( |  | ) |

Definition at line 236 of file massspectrumwidget.cpp.

{
qDebug();
_custom_plot->rescale();
/*
if (_p_delta_axis_rect != nullptr) {
_p_delta_axis_rect->axis(QCPAxis::AxisType::atLeft)->rescale();
}
*/
_custom_plot->replot();
qDebug();
}
pappso::QCPSpectrum::rescale
void rescale()
Definition: qcpspectrum.cpp:190

References _custom_plot, and pappso::QCPSpectrum::rescale().

## savePdf()

bool MassSpectrumWidget::savePdf | ( | const QString & | fileName,
|  | int | width = `0`,
|  | int | height = `0`
| ) |  |

Definition at line 60 of file massspectrumwidget.cpp.

{
if(_custom_plot != nullptr)
{
return _custom_plot->savePdf(fileName, width, height);
}
else
{
return false;
}
}

References _custom_plot.

## setIonList()

void MassSpectrumWidget::setIonList | ( | const std::list< PeptideIon > & | ion_list | ) |

Definition at line 135 of file massspectrumwidget.cpp.

{
_ion_list = ion_list;
}

References _ion_list.

## setMassSpectrumCstSPtr()

void MassSpectrumWidget::setMassSpectrumCstSPtr | ( | const MassSpectrumCstSPtr & | spectrum | ) |

Definition at line 226 of file massspectrumwidget.cpp.

{
qDebug();
_spectrum_sp = spectrum;
clearData();
qDebug();
}

References _spectrum_sp, and clearData().

Referenced by setQualifiedMassSpectrum().

## setMaximumIsotopeNumber()

void MassSpectrumWidget::setMaximumIsotopeNumber | ( | unsigned int | max_isotope_number | ) |

Definition at line 174 of file massspectrumwidget.cpp.

{
_max_isotope_number = max_isotope_number;
}

References _max_isotope_number.

## setMaximumIsotopeRank()

void MassSpectrumWidget::setMaximumIsotopeRank | ( | unsigned int | max_isotope_rank | ) |

Definition at line 180 of file massspectrumwidget.cpp.

{
_max_isotope_rank = max_isotope_rank;
}

References _max_isotope_rank.

## setMs1Precision()

void MassSpectrumWidget::setMs1Precision | ( | PrecisionPtr | precision | ) |

Definition at line 159 of file massspectrumwidget.cpp.

{
qDebug() << "precision->toString()=" << precision->toString();
_p_ms1_precision = precision;
//_precision._precision = precision._precision;
}

References _p_ms1_precision, and pappso::PrecisionBase::toString().

## setMs2Precision()

void MassSpectrumWidget::setMs2Precision | ( | PrecisionPtr | precision | ) |

Definition at line 166 of file massspectrumwidget.cpp.

{
qDebug() << "precision->toString()=" << precision->toString();
_p_ms2_precision = precision;
//_precision._precision = precision._precision;
}

References _p_ms2_precision, and pappso::PrecisionBase::toString().

## setMsLevel()

void MassSpectrumWidget::setMsLevel | ( | unsigned int | ms_level | ) |

Definition at line 141 of file massspectrumwidget.cpp.

{
qDebug() << "ms_level=" << ms_level;
_ms_level = ms_level;
if(_ms_level == 1)
{
setVisibleMassDelta(false);
}
else
{
setVisibleMassDelta(true);
}
//_precision._precision = precision._precision;
}

References _ms_level, and setVisibleMassDelta().

Referenced by setQualifiedMassSpectrum().

## setPeptideCharge()

void MassSpectrumWidget::setPeptideCharge | ( | unsigned int | parent_ion_charge | ) |

Definition at line 130 of file massspectrumwidget.cpp.

{
_peptide_charge = parent_ion_charge;
}

References _peptide_charge.

## setPeptideSp()

void MassSpectrumWidget::setPeptideSp | ( | const PeptideSp & | peptide_sp | ) |

Definition at line 216 of file massspectrumwidget.cpp.

{
qDebug();
_peptide_sp = peptide_sp;
// clearData();
qDebug();
}

References _peptide_sp.

## setQualifiedMassSpectrum()

void MassSpectrumWidget::setQualifiedMassSpectrum | ( | const QualifiedMassSpectrum & | spectrum | ) |

Definition at line 252 of file massspectrumwidget.cpp.

{
qDebug() << "spectrum.getPrecursorCharge()=" << spectrum.getPrecursorCharge();
setMsLevel(spectrum.getMsLevel());
setMassSpectrumCstSPtr(spectrum.getMassSpectrumCstSPtr());
qDebug();
}
pappso::MassSpectrumWidget::setMassSpectrumCstSPtr
void setMassSpectrumCstSPtr(const MassSpectrumCstSPtr &spectrum)
Definition: massspectrumwidget.cpp:226
pappso::MassSpectrumWidget::setMsLevel
void setMsLevel(unsigned int ms_level)
Definition: massspectrumwidget.cpp:141
pappso::QualifiedMassSpectrum::getMsLevel
uint getMsLevel() const
Get the mass spectrum level.
Definition: qualifiedmassspectrum.cpp:187
pappso::QualifiedMassSpectrum::getMassSpectrumCstSPtr
MassSpectrumCstSPtr getMassSpectrumCstSPtr() const
Get the MassSpectrumCstSPtr.
Definition: qualifiedmassspectrum.cpp:141
pappso::QualifiedMassSpectrum::getPrecursorCharge
uint getPrecursorCharge(bool *ok=nullptr) const
Get the precursor charge.
Definition: qualifiedmassspectrum.cpp:316

References pappso::QualifiedMassSpectrum::getMassSpectrumCstSPtr(), pappso::QualifiedMassSpectrum::getMsLevel(), pappso::QualifiedMassSpectrum::getPrecursorCharge(), setMassSpectrumCstSPtr(), and setMsLevel().

## setVisibleMassDelta()

void MassSpectrumWidget::setVisibleMassDelta | ( | bool | visible | ) |

private

Definition at line 87 of file massspectrumwidget.cpp.

{
qDebug();
if(_custom_plot != nullptr)
{
if(visible == _is_visible_mass_delta)
return;
delete _custom_plot;
}
_is_visible_mass_delta = visible;
while(auto item = this->layout()->takeAt(0))
{
delete item->widget();
}
qDebug();
_custom_plot = new QCPSpectrum(this, visible);
this->layout()->addWidget(_custom_plot);
qDebug();
_custom_plot->xAxis->setLabel("m/z");
_custom_plot->yAxis->setLabel("intensity");
qDebug();
_custom_plot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
_custom_plot->axisRect()->setRangeDrag(Qt::Horizontal);
_custom_plot->axisRect()->setRangeZoom(Qt::Horizontal);
qDebug();
// legend->setVisible(false);
// legend->setFont(QFont("Helvetica",9));
// set locale to english, so we get english decimal separator:
// setLocale(QLocale(QLocale::English, QLocale::UnitedKingdom));
qDebug();
}
pappso::MassSpectrumWidget::_is_visible_mass_delta
bool _is_visible_mass_delta
Definition: massspectrumwidget.h:111
pappso::MassSpectrumWidget::QCPSpectrum
friend class QCPSpectrum
Definition: massspectrumwidget.h:82

References _custom_plot, _is_visible_mass_delta, and QCPSpectrum.

Referenced by MassSpectrumWidget(), and setMsLevel().

## toQPaintDevice()

void MassSpectrumWidget::toQPaintDevice | ( | QPaintDevice * | device,
|  | const QSize & | size
| ) |  |

override virtual

Implements GraphicDeviceWidget.

Definition at line 75 of file massspectrumwidget.cpp.

{
if(_custom_plot != nullptr)
{
QCPPainter painter;
painter.begin(device);
_custom_plot->toPainter(&painter, size.width(), size.height());
painter.end();
}
}

References _custom_plot.

## Friends And Related Function Documentation

## QCPSpectrum

friend class QCPSpectrum

friend

Definition at line 82 of file massspectrumwidget.h.

Referenced by setVisibleMassDelta().

## Member Data Documentation

## _custom_plot

QCPSpectrum* pappso::MassSpectrumWidget::_custom_plot = nullptr

private

Definition at line 110 of file massspectrumwidget.h.

Referenced by MassSpectrumWidget(), clearData(), plot(), rescale(), savePdf(), setVisibleMassDelta(), and toQPaintDevice().

## _ion_list

std::list<PeptideIon> pappso::MassSpectrumWidget::_ion_list

private

Definition at line 102 of file massspectrumwidget.h.

Referenced by MassSpectrumWidget(), peptideAnnotate(), and setIonList().

## _is_visible_mass_delta

bool pappso::MassSpectrumWidget::_is_visible_mass_delta

private

Definition at line 111 of file massspectrumwidget.h.

Referenced by setVisibleMassDelta().

## _isotope_mass_list

std::vector<pappso::PeptideNaturalIsotopeAverageSp> pappso::MassSpectrumWidget::_isotope_mass_list

private

list of isotope precursors

Definition at line 108 of file massspectrumwidget.h.

Referenced by computeIsotopeMassList(), and plot().

## _max_isotope_number

unsigned int pappso::MassSpectrumWidget::_max_isotope_number = 0

private

Definition at line 94 of file massspectrumwidget.h.

Referenced by peptideAnnotate(), and setMaximumIsotopeNumber().

## _max_isotope_rank

unsigned int pappso::MassSpectrumWidget::_max_isotope_rank = 1

private

Definition at line 95 of file massspectrumwidget.h.

Referenced by peptideAnnotate(), and setMaximumIsotopeRank().

## _ms_level

unsigned int pappso::MassSpectrumWidget::_ms_level

private

Definition at line 100 of file massspectrumwidget.h.

Referenced by MassSpectrumWidget(), peptideAnnotate(), plot(), and setMsLevel().

## _p_mouse_peak

const DataPoint* pappso::MassSpectrumWidget::_p_mouse_peak = nullptr

private

Definition at line 113 of file massspectrumwidget.h.

Referenced by peakChangeEvent().

## _p_ms1_precision

PrecisionPtr pappso::MassSpectrumWidget::_p_ms1_precision = PrecisionFactory::getDaltonInstance(0.1)

private

Definition at line 97 of file massspectrumwidget.h.

Referenced by computeIsotopeMassList(), plot(), and setMs1Precision().

## _p_ms2_precision

PrecisionPtr pappso::MassSpectrumWidget::_p_ms2_precision = PrecisionFactory::getDaltonInstance(0.5)

private

Definition at line 98 of file massspectrumwidget.h.

Referenced by peptideAnnotate(), and setMs2Precision().

## _peak_ion_isotope_match_list

std::list<PeakIonIsotopeMatch> pappso::MassSpectrumWidget::_peak_ion_isotope_match_list

private

Definition at line 104 of file massspectrumwidget.h.

Referenced by peakChangeEvent(), peptideAnnotate(), and plot().

## _peptide_charge

unsigned int pappso::MassSpectrumWidget::_peptide_charge = 3

private

Definition at line 99 of file massspectrumwidget.h.

Referenced by computeIsotopeMassList(), peptideAnnotate(), and setPeptideCharge().

## _peptide_sp

PeptideSp pappso::MassSpectrumWidget::_peptide_sp

private

Definition at line 101 of file massspectrumwidget.h.

Referenced by computeIsotopeMassList(), peptideAnnotate(), and setPeptideSp().

## _spectrum_sp

MassSpectrumCstSPtr pappso::MassSpectrumWidget::_spectrum_sp

private

Definition at line 96 of file massspectrumwidget.h.

Referenced by clearData(), peptideAnnotate(), plot(), and setMassSpectrumCstSPtr().

## _tag_nmost_intense

unsigned int pappso::MassSpectrumWidget::_tag_nmost_intense = 10

private

Definition at line 93 of file massspectrumwidget.h.

Referenced by plot().

The documentation for this class was generated from the following files:

- pappsomspp/widget/massspectrumwidget/massspectrumwidget.h
- pappsomspp/widget/massspectrumwidget/massspectrumwidget.cpp