pappso::QualifiedMassSpectrum Class Reference

Class representing a fully specified mass spectrum. More...

`#include <qualifiedmassspectrum.h>`

## Public Member Functions

| QualifiedMassSpectrum ()
| Construct an uninitialized QualifiedMassSpectrum. More...
| QualifiedMassSpectrum (const MassSpectrumId &id)
| Construct a QualifiedMassSpectrum using a MassSpectrumId;. More...
| QualifiedMassSpectrum (MassSpectrumSPtr mass_spectrum_SPtr)
| QualifiedMassSpectrum (const QualifiedMassSpectrum &other)
| Construct a QualifiedMassSpectrum as a copy of `other`. More...
| ~QualifiedMassSpectrum ()
| Destruct this QualifiedMassSpectrum. More...
QualifiedMassSpectrum & | operator= (const QualifiedMassSpectrum &other)
const QualifiedMassSpectrum & | cloneMassSpectrumSPtr ()
| clone the mass spectrum contained in Qualified Mass Spectrum More...
QualifiedMassSpectrumSPtr | makeQualifiedMassSpectrumSPtr () const
QualifiedMassSpectrumCstSPtr | makeQualifiedMassSpectrumCstSPtr () const
void | setMassSpectrumSPtr (MassSpectrumSPtr massSpectrum)
| Set the MassSpectrumSPtr. More...
MassSpectrumSPtr | getMassSpectrumSPtr () const
| Get the MassSpectrumSPtr. More...
MassSpectrumCstSPtr | getMassSpectrumCstSPtr () const
| Get the MassSpectrumCstSPtr. More...
void | setMassSpectrumId (const MassSpectrumId &iD)
| Set the MassSpectrumId. More...
const MassSpectrumId & | getMassSpectrumId () const
| Get the MassSpectrumId. More...
void | setEmptyMassSpectrum (bool is_empty_mass_spectrum)
bool | isEmptyMassSpectrum () const
void | setMsLevel (uint ms_level)
| Set the mass spectrum level. More...
uint | getMsLevel () const
| Get the mass spectrum level. More...
void | setRtInSeconds (pappso_double rt)
| Set the retention time in seconds. More...
pappso_double | getRtInSeconds () const
| Get the retention time in seconds. More...
pappso_double | getRtInMinutes () const
| Get the retention time in minutes. More...
void | setDtInMilliSeconds (pappso_double rt)
| Set the drift time in milliseconds. More...
pappso_double | getDtInMilliSeconds () const
| Get the drift time in milliseconds. More...
pappso_double | getPrecursorMz (bool *ok=nullptr) const
| Get the precursor m/z ratio. More...
QString | getPrecursorDataMzValuesAsString (const std::vector< PrecursorIonData > &precursor_ion_data_vector, const QString &separator="\n") const
QString | getPrecursorDataMzValuesAsString (const QString &separator="\n") const
QString | getMzSortedPrecursorDataMzValuesAsString (const QString &separator="\n") const
uint | getPrecursorCharge (bool *ok=nullptr) const
| Get the precursor charge. More...
QString | getPrecursorDataChargeValuesAsString (const std::vector< PrecursorIonData > &precursor_ion_data_vector, const QString &separator="\n") const
QString | getPrecursorDataChargeValuesAsString (const QString &separator="\n") const
QString | getMzSortedPrecursorDataChargeValuesAsString (const QString &separator="\n") const
pappso_double | getPrecursorIntensity (bool *ok=nullptr) const
| Get the intensity of the precursor ion. More...
void | setPrecursorSpectrumIndex (std::size_t precursor_scan_num)
| Set the scan number of the precursor ion. More...
std::size_t | getPrecursorSpectrumIndex () const
| Get the scan number of the precursor ion. More...
void | setPrecursorNativeId (const QString &native_id)
| Set the scan native id of the precursor ion. More...
const QString & | getPrecursorNativeId () const
void | appendPrecursorIonData (const PrecursorIonData &precursor_ion_data)
const std::vector< PrecursorIonData > & | getPrecursorIonData () const
std::vector< PrecursorIonData > | getPrecursorIonDataSortedWithMz () const
void | setParameterValue (QualifiedMassSpectrumParameter parameter, const QVariant &value)
const QVariant | getParameterValue (QualifiedMassSpectrumParameter parameter) const
std::size_t | size () const
QString | toString () const

## Protected Attributes

MassSpectrumSPtr | msp_massSpectrum = nullptr
| Shared pointer to the mass spectrum. More...
MassSpectrumId | m_massSpectrumId
| Id of the mass spectrum. More...
bool | m_isEmptyMassSpectrum = false
unsigned int | m_msLevel = 0
| Mass spectrometry level of this mass spectrum. More...
pappso_double | m_rt = -1
| Retention time (in seconds) at which this mass spectrum was acquired. More...
pappso_double | m_dt = -1
| Drift time (in milliseconds) at which this mass spectrum was acquired. More...
std::size_t | m_precursorSpectrumIndex
| Index of the spectrum of the precusor ion that was fragmented to yield. More...
QString | m_precursorNativeId
| Native XML id of the spectrum relative to the mz data native file. More...
std::vector< PrecursorIonData > | m_precursorIonData
std::map< QualifiedMassSpectrumParameter, QVariant > | m_paramsMap
| map containing any parameter value for this spectrum More...

## Detailed Description

Class representing a fully specified mass spectrum.

The member data that qualify the MassSpectrum `msp_massSpectrum` member allow to unambiguously characterize the mass spectrum.

See also
  MassSpectrum

Definition at line 84 of file qualifiedmassspectrum.h.

## Constructor & Destructor Documentation

## QualifiedMassSpectrum() [1/4]

pappso::QualifiedMassSpectrum::QualifiedMassSpectrum | ( |  | ) |

Construct an uninitialized QualifiedMassSpectrum.

Definition at line 39 of file qualifiedmassspectrum.cpp.

{
}

## QualifiedMassSpectrum() [2/4]

pappso::QualifiedMassSpectrum::QualifiedMassSpectrum | ( | const MassSpectrumId & | id | ) |

Construct a QualifiedMassSpectrum using a MassSpectrumId;.

Definition at line 45 of file qualifiedmassspectrum.cpp.

: m_massSpectrumId(id)
{
}
pappso::QualifiedMassSpectrum::m_massSpectrumId
MassSpectrumId m_massSpectrumId
Id of the mass spectrum.
Definition: qualifiedmassspectrum.h:166

## QualifiedMassSpectrum() [3/4]

pappso::QualifiedMassSpectrum::QualifiedMassSpectrum | ( | MassSpectrumSPtr | mass_spectrum_SPtr | ) |

Definition at line 51 of file qualifiedmassspectrum.cpp.

: msp_massSpectrum{mass_spectrum_SPtr}
{
}
pappso::QualifiedMassSpectrum::msp_massSpectrum
MassSpectrumSPtr msp_massSpectrum
Shared pointer to the mass spectrum.
Definition: qualifiedmassspectrum.h:163

## QualifiedMassSpectrum() [4/4]

pappso::QualifiedMassSpectrum::QualifiedMassSpectrum | ( | const QualifiedMassSpectrum & | other | ) |

Construct a QualifiedMassSpectrum as a copy of `other`.

Definition at line 59 of file qualifiedmassspectrum.cpp.

: msp_massSpectrum(other.msp_massSpectrum),
m_massSpectrumId(other.m_massSpectrumId),
m_isEmptyMassSpectrum(other.m_isEmptyMassSpectrum),
m_msLevel(other.m_msLevel),
m_rt(other.m_rt),
m_dt(other.m_dt),
m_precursorSpectrumIndex(other.m_precursorSpectrumIndex),
m_precursorNativeId(other.m_precursorNativeId),
m_precursorIonData(other.m_precursorIonData),
m_paramsMap(other.m_paramsMap)
{
// qDebug();
}
pappso::QualifiedMassSpectrum::m_isEmptyMassSpectrum
bool m_isEmptyMassSpectrum
Definition: qualifiedmassspectrum.h:168
pappso::QualifiedMassSpectrum::m_precursorIonData
std::vector< PrecursorIonData > m_precursorIonData
Definition: qualifiedmassspectrum.h:190
pappso::QualifiedMassSpectrum::m_precursorSpectrumIndex
std::size_t m_precursorSpectrumIndex
Index of the spectrum of the precusor ion that was fragmented to yield.
Definition: qualifiedmassspectrum.h:181
pappso::QualifiedMassSpectrum::m_msLevel
unsigned int m_msLevel
Mass spectrometry level of this mass spectrum.
Definition: qualifiedmassspectrum.h:171
pappso::QualifiedMassSpectrum::m_rt
pappso_double m_rt
Retention time (in seconds) at which this mass spectrum was acquired.
Definition: qualifiedmassspectrum.h:174
pappso::QualifiedMassSpectrum::m_dt
pappso_double m_dt
Drift time (in milliseconds) at which this mass spectrum was acquired.
Definition: qualifiedmassspectrum.h:177
pappso::QualifiedMassSpectrum::m_paramsMap
std::map< QualifiedMassSpectrumParameter, QVariant > m_paramsMap
map containing any parameter value for this spectrum
Definition: qualifiedmassspectrum.h:193
pappso::QualifiedMassSpectrum::m_precursorNativeId
QString m_precursorNativeId
Native XML id of the spectrum relative to the mz data native file.
Definition: qualifiedmassspectrum.h:185

## ~QualifiedMassSpectrum()

pappso::QualifiedMassSpectrum::~QualifiedMassSpectrum | ( |  | ) |

Destruct this QualifiedMassSpectrum.

Definition at line 76 of file qualifiedmassspectrum.cpp.

{
// qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << " ()";
}

## Member Function Documentation

## appendPrecursorIonData()

void pappso::QualifiedMassSpectrum::appendPrecursorIonData | ( | const PrecursorIonData & | precursor_ion_data | ) |

Definition at line 430 of file qualifiedmassspectrum.cpp.

{
m_precursorIonData.push_back(precursor_ion_data);
}

References m_precursorIonData.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::TimsData::getQualifiedMs2MassSpectrumByPrecursorId(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), and pappso::TimsData::rawReaderSpectrumCollectionByMsLevel().

## cloneMassSpectrumSPtr()

const QualifiedMassSpectrum & pappso::QualifiedMassSpectrum::cloneMassSpectrumSPtr | ( |  | ) |

clone the mass spectrum contained in Qualified Mass Spectrum

Definition at line 101 of file qualifiedmassspectrum.cpp.

{
this->msp_massSpectrum =
std::make_shared<MassSpectrum>(*this->msp_massSpectrum.get());
return *this;
}

References msp_massSpectrum.

## getDtInMilliSeconds()

pappso_double pappso::QualifiedMassSpectrum::getDtInMilliSeconds | ( |  | ) | const

Get the drift time in milliseconds.

Definition at line 230 of file qualifiedmassspectrum.cpp.

{
return m_dt;
}

References m_dt.

## getMassSpectrumCstSPtr()

MassSpectrumCstSPtr pappso::QualifiedMassSpectrum::getMassSpectrumCstSPtr | ( |  | ) | const

Get the MassSpectrumCstSPtr.

Definition at line 141 of file qualifiedmassspectrum.cpp.

{
return msp_massSpectrum;
}

References msp_massSpectrum.

Referenced by pappso::PwizMsRunReader::massSpectrumCstSPtr(), pappso::XyMsRunReader::massSpectrumCstSPtr(), pappso::MassSpectrumWidget::setQualifiedMassSpectrum(), pappso::MgfOutput::write(), and pappso::MzxmlOutput::writeQualifiedMassSpectrum().

## getMassSpectrumId()

const MassSpectrumId & pappso::QualifiedMassSpectrum::getMassSpectrumId | ( |  | ) | const

Get the MassSpectrumId.

Definition at line 157 of file qualifiedmassspectrum.cpp.

{
return m_massSpectrumId;
}

References m_massSpectrumId.

Referenced by pappso::MzxmlOutput::getScanNumber(), pappso::TimsMsRunReaderMs2::newXicCoordSPtrFromQualifiedMassSpectrum(), pappso::MsRunReaderScanNumberMultiMap::setQualifiedMassSpectrum(), pappso::MsRunReaderRetentionTimeLine::setQualifiedMassSpectrum(), pappso::MsRunXicExtractor::MsRunXicExtractorReadPoints::setQualifiedMassSpectrum(), and pappso::MgfOutput::write().

## getMassSpectrumSPtr()

MassSpectrumSPtr pappso::QualifiedMassSpectrum::getMassSpectrumSPtr | ( |  | ) | const

Get the MassSpectrumSPtr.

Definition at line 133 of file qualifiedmassspectrum.cpp.

{
return msp_massSpectrum;
}

References msp_massSpectrum.

Referenced by pappso::TimsMsRunReaderMs2::massSpectrumCstSPtr(), pappso::TimsMsRunReaderMs2Selected::massSpectrumCstSPtr(), pappso::PwizMsRunReader::massSpectrumSPtr(), pappso::TimsMsRunReaderMs2::massSpectrumSPtr(), pappso::TimsMsRunReaderMs2Selected::massSpectrumSPtr(), pappso::XyMsRunReader::massSpectrumSPtr(), and pappso::MsRunReaderTicChromatogram::setQualifiedMassSpectrum().

## getMsLevel()

unsigned int pappso::QualifiedMassSpectrum::getMsLevel | ( |  | ) | const

Get the mass spectrum level.

Definition at line 187 of file qualifiedmassspectrum.cpp.

{
return m_msLevel;
}

References m_msLevel.

Referenced by pappso::PwizMsRunReader::readSpectrumCollectionByMsLevel(), pappso::XyMsRunReader::readSpectrumCollectionByMsLevel(), pappso::MsRunReaderTicChromatogram::setQualifiedMassSpectrum(), pappso::MassSpectrumWidget::setQualifiedMassSpectrum(), pappso::MsRunSimpleStatistics::setQualifiedMassSpectrum(), pappso::MsRunXicExtractor::MsRunXicExtractorReadPoints::setQualifiedMassSpectrum(), and pappso::MzxmlOutput::writeQualifiedMassSpectrum().

## getMzSortedPrecursorDataChargeValuesAsString()

QString pappso::QualifiedMassSpectrum::getMzSortedPrecursorDataChargeValuesAsString | ( | const QString & | separator = `"\n"` | ) | const

Definition at line 366 of file qualifiedmassspectrum.cpp.

{
// Sort the PrecursorIonData instances by increasing mz values.
// Then craft the string using the mz values.
std::vector<PrecursorIonData> sorted_vector =
getPrecursorIonDataSortedWithMz();
return getPrecursorDataChargeValuesAsString(sorted_vector, separator);
}
pappso::QualifiedMassSpectrum::getPrecursorIonDataSortedWithMz
std::vector< PrecursorIonData > getPrecursorIonDataSortedWithMz() const
Definition: qualifiedmassspectrum.cpp:445
pappso::QualifiedMassSpectrum::getPrecursorDataChargeValuesAsString
QString getPrecursorDataChargeValuesAsString(const std::vector< PrecursorIonData > &precursor_ion_data_vector, const QString &separator="\n") const
Definition: qualifiedmassspectrum.cpp:334

References getPrecursorDataChargeValuesAsString(), and getPrecursorIonDataSortedWithMz().

## getMzSortedPrecursorDataMzValuesAsString()

QString pappso::QualifiedMassSpectrum::getMzSortedPrecursorDataMzValuesAsString | ( | const QString & | separator = `"\n"` | ) | const

Definition at line 301 of file qualifiedmassspectrum.cpp.

{
// Sort the PrecursorIonData instances by increasing mz values.
// Then craft the string using the mz values.
std::vector<PrecursorIonData> sorted_vector =
getPrecursorIonDataSortedWithMz();
return getPrecursorDataMzValuesAsString(sorted_vector, separator);
}
pappso::QualifiedMassSpectrum::getPrecursorDataMzValuesAsString
QString getPrecursorDataMzValuesAsString(const std::vector< PrecursorIonData > &precursor_ion_data_vector, const QString &separator="\n") const
Definition: qualifiedmassspectrum.cpp:258

References getPrecursorDataMzValuesAsString(), and getPrecursorIonDataSortedWithMz().

Referenced by toString().

## getParameterValue()

const QVariant pappso::QualifiedMassSpectrum::getParameterValue | ( | QualifiedMassSpectrumParameter | parameter | ) | const

Definition at line 476 of file qualifiedmassspectrum.cpp.

{
auto it = m_paramsMap.find(parameter);
if(it == m_paramsMap.end())
{
return QVariant();
}
else
{
return it->second;
}
}

References m_paramsMap.

## getPrecursorCharge()

unsigned int pappso::QualifiedMassSpectrum::getPrecursorCharge | ( | bool * | ok = `nullptr` | ) | const

Get the precursor charge.

Definition at line 316 of file qualifiedmassspectrum.cpp.

{
if(!m_precursorIonData.size())
{
return std::numeric_limits<unsigned int>::max();
if(ok_p != nullptr)
*ok_p = false;
}
if(ok_p != nullptr)
*ok_p = true;
return m_precursorIonData.front().charge;
}

References m_precursorIonData.

Referenced by pappso::MassSpectrumWidget::setQualifiedMassSpectrum(), pappso::MgfOutput::write(), and pappso::MzxmlOutput::writeQualifiedMassSpectrum().

## getPrecursorDataChargeValuesAsString() [1/2]

QString pappso::QualifiedMassSpectrum::getPrecursorDataChargeValuesAsString | ( | const QString & | separator = `"\n"` | ) | const

Definition at line 358 of file qualifiedmassspectrum.cpp.

{
return getPrecursorDataChargeValuesAsString(m_precursorIonData, separator);
}

References getPrecursorDataChargeValuesAsString(), and m_precursorIonData.

## getPrecursorDataChargeValuesAsString() [2/2]

QString pappso::QualifiedMassSpectrum::getPrecursorDataChargeValuesAsString | ( | const std::vector< PrecursorIonData > & | precursor_ion_data_vector,
|  | const QString & | separator = `"\n"`
| ) |  | const

Definition at line 334 of file qualifiedmassspectrum.cpp.

{
QString text;
// We do not want to use the separator if there is only one precursor in the
// vector.
if(precursor_ion_data_vector.size() == 1)
return QString("%1").arg(precursor_ion_data_vector.front().charge);
// If there are more than one precursor, then we should list them joined with
// the separator.
for(auto item : precursor_ion_data_vector)
{
text += QString("%1%2").arg(item.charge).arg(separator);
}
return text;
}

Referenced by getMzSortedPrecursorDataChargeValuesAsString(), and getPrecursorDataChargeValuesAsString().

## getPrecursorDataMzValuesAsString() [1/2]

QString pappso::QualifiedMassSpectrum::getPrecursorDataMzValuesAsString | ( | const QString & | separator = `"\n"` | ) | const

Definition at line 293 of file qualifiedmassspectrum.cpp.

{
return getPrecursorDataMzValuesAsString(m_precursorIonData, separator);
}

References getPrecursorDataMzValuesAsString(), and m_precursorIonData.

## getPrecursorDataMzValuesAsString() [2/2]

QString pappso::QualifiedMassSpectrum::getPrecursorDataMzValuesAsString | ( | const std::vector< PrecursorIonData > & | precursor_ion_data_vector,
|  | const QString & | separator = `"\n"`
| ) |  | const

Definition at line 258 of file qualifiedmassspectrum.cpp.

{
QString text;
// We do not want to use the separator if there is only one precursor in the
// vector.
if(precursor_ion_data_vector.size() == 1)
return QString("%1").arg(precursor_ion_data_vector.front().mz, 0, 'f', 6);
// If there are more than one precursor, then we should list them joined with
// the separator.
using iterator = std::vector<pappso::PrecursorIonData>::const_iterator;
iterator begin_iterator = precursor_ion_data_vector.begin();
iterator pre_end_iterator = std::prev(precursor_ion_data_vector.end());
for(; begin_iterator != precursor_ion_data_vector.end(); ++begin_iterator)
{
if(begin_iterator == pre_end_iterator)
// No separator at the end of the string
text += QString("%1").arg(begin_iterator->mz, 0, 'f', 6);
else
text +=
QString("%1%2").arg(begin_iterator->mz, 0, 'f', 6).arg(separator);
}
return text;
}

Referenced by getMzSortedPrecursorDataMzValuesAsString(), and getPrecursorDataMzValuesAsString().

## getPrecursorIntensity()

pappso_double pappso::QualifiedMassSpectrum::getPrecursorIntensity | ( | bool * | ok = `nullptr` | ) | const

Get the intensity of the precursor ion.

Definition at line 381 of file qualifiedmassspectrum.cpp.

{
if(!m_precursorIonData.size())
{
return std::numeric_limits<double>::max();
if(ok_p != nullptr)
*ok_p = false;
}
if(ok_p != nullptr)
*ok_p = true;
return m_precursorIonData.front().intensity;
}

References m_precursorIonData.

Referenced by pappso::MsRunRetentionTime< T >::addPeptideAsSeamark(), pappso::MgfOutput::write(), and pappso::MzxmlOutput::writeQualifiedMassSpectrum().

## getPrecursorIonData()

const std::vector< PrecursorIonData > & pappso::QualifiedMassSpectrum::getPrecursorIonData | ( |  | ) | const

Definition at line 438 of file qualifiedmassspectrum.cpp.

{
return m_precursorIonData;
}

References m_precursorIonData.

Referenced by pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr().

## getPrecursorIonDataSortedWithMz()

std::vector< PrecursorIonData > pappso::QualifiedMassSpectrum::getPrecursorIonDataSortedWithMz | ( |  | ) | const

Definition at line 445 of file qualifiedmassspectrum.cpp.

{
std::vector<PrecursorIonData> new_vector;
new_vector.assign(m_precursorIonData.begin(), m_precursorIonData.end());
std::sort(new_vector.begin(),
new_vector.end(),
[](const PrecursorIonData &a, const PrecursorIonData &b) -> bool {
return a.mz < b.mz;
});
return new_vector;
}

References pappso::a, pappso::b, and m_precursorIonData.

Referenced by getMzSortedPrecursorDataChargeValuesAsString(), and getMzSortedPrecursorDataMzValuesAsString().

## getPrecursorMz()

pappso_double pappso::QualifiedMassSpectrum::getPrecursorMz | ( | bool * | ok = `nullptr` | ) | const

Get the precursor m/z ratio.

Definition at line 238 of file qualifiedmassspectrum.cpp.

{
if(!m_precursorIonData.size())
{
if(ok_p != nullptr)
*ok_p = false;
return std::numeric_limits<double>::max();
}
if(ok_p != nullptr)
*ok_p = true;
// qDebug() << "Returning precursor mz value: " <<
// m_precursorIonData.front().mz;
return m_precursorIonData.front().mz;
}

References m_precursorIonData.

Referenced by pappso::PwizMsRunReader::newXicCoordSPtrFromQualifiedMassSpectrum(), pappso::MgfOutput::write(), and pappso::MzxmlOutput::writeQualifiedMassSpectrum().

## getPrecursorNativeId()

const QString & pappso::QualifiedMassSpectrum::getPrecursorNativeId | ( |  | ) | const

Definition at line 423 of file qualifiedmassspectrum.cpp.

{
return m_precursorNativeId;
}

References m_precursorNativeId.

Referenced by pappso::MzxmlOutput::getPrecursorScanNumber(), and pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr().

## getPrecursorSpectrumIndex()

std::size_t pappso::QualifiedMassSpectrum::getPrecursorSpectrumIndex | ( |  | ) | const

Get the scan number of the precursor ion.

Definition at line 409 of file qualifiedmassspectrum.cpp.

{
return m_precursorSpectrumIndex;
}

References m_precursorSpectrumIndex.

Referenced by pappso::MzxmlOutput::getPrecursorScanNumber().

## getRtInMinutes()

pappso_double pappso::QualifiedMassSpectrum::getRtInMinutes | ( |  | ) | const

Get the retention time in minutes.

Definition at line 211 of file qualifiedmassspectrum.cpp.

{
return m_rt / 60;
}

References m_rt.

Referenced by pappso::MsRunReaderTicChromatogram::setQualifiedMassSpectrum(), and toString().

## getRtInSeconds()

pappso_double pappso::QualifiedMassSpectrum::getRtInSeconds | ( |  | ) | const

Get the retention time in seconds.

Definition at line 203 of file qualifiedmassspectrum.cpp.

{
return m_rt;
}

References m_rt.

Referenced by pappso::MsRunRetentionTime< T >::addPeptideAsSeamark(), pappso::PwizMsRunReader::newXicCoordSPtrFromQualifiedMassSpectrum(), pappso::PwizMsRunReader::qualifiedMassSpectrum(), pappso::MsRunReaderRetentionTimeLine::setQualifiedMassSpectrum(), pappso::MsRunXicExtractor::MsRunXicExtractorReadPoints::setQualifiedMassSpectrum(), pappso::MgfOutput::write(), and pappso::MzxmlOutput::writeQualifiedMassSpectrum().

## isEmptyMassSpectrum()

bool pappso::QualifiedMassSpectrum::isEmptyMassSpectrum | ( |  | ) | const

Definition at line 171 of file qualifiedmassspectrum.cpp.

{
return m_isEmptyMassSpectrum;
}

References m_isEmptyMassSpectrum.

## makeQualifiedMassSpectrumCstSPtr()

QualifiedMassSpectrumCstSPtr pappso::QualifiedMassSpectrum::makeQualifiedMassSpectrumCstSPtr | ( |  | ) | const

Definition at line 117 of file qualifiedmassspectrum.cpp.

{
return std::make_shared<const QualifiedMassSpectrum>(*this);
}

## makeQualifiedMassSpectrumSPtr()

QualifiedMassSpectrumSPtr pappso::QualifiedMassSpectrum::makeQualifiedMassSpectrumSPtr | ( |  | ) | const

Definition at line 110 of file qualifiedmassspectrum.cpp.

{
return std::make_shared<QualifiedMassSpectrum>(*this);
}

## operator=()

QualifiedMassSpectrum & pappso::QualifiedMassSpectrum::operator= | ( | const QualifiedMassSpectrum & | other | ) |

Definition at line 83 of file qualifiedmassspectrum.cpp.

{
msp_massSpectrum = other.msp_massSpectrum;
m_massSpectrumId = other.m_massSpectrumId;
m_isEmptyMassSpectrum = other.m_isEmptyMassSpectrum;
m_msLevel = other.m_msLevel;
m_rt = other.m_rt;
m_dt = other.m_dt;
m_precursorSpectrumIndex = other.m_precursorSpectrumIndex;
m_precursorNativeId = other.m_precursorNativeId;
m_precursorIonData = other.m_precursorIonData;
m_paramsMap = other.m_paramsMap;
return *this;
}

References m_dt, m_isEmptyMassSpectrum, m_massSpectrumId, m_msLevel, m_paramsMap, m_precursorIonData, m_precursorNativeId, m_precursorSpectrumIndex, m_rt, and msp_massSpectrum.

## setDtInMilliSeconds()

void pappso::QualifiedMassSpectrum::setDtInMilliSeconds | ( | pappso_double | rt | ) |

Set the drift time in milliseconds.

Definition at line 219 of file qualifiedmassspectrum.cpp.

{
if(std::isinf(dt_in_milli_seconds))
m_dt = -1;
else
m_dt = dt_in_milli_seconds;
}

References m_dt.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::PwizMsRunReader::processDriftTime(), and pappso::TimsData::rawReaderSpectrumCollectionByMsLevel().

## setEmptyMassSpectrum()

void pappso::QualifiedMassSpectrum::setEmptyMassSpectrum | ( | bool | is_empty_mass_spectrum | ) |

Definition at line 164 of file qualifiedmassspectrum.cpp.

{
m_isEmptyMassSpectrum = is_empty_mass_spectrum;
}

References m_isEmptyMassSpectrum.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::TimsData::getQualifiedMs1MassSpectrumByPrecursorId(), pappso::TimsData::getQualifiedMs2MassSpectrumByPrecursorId(), pappso::TimsData::rawReaderSpectrumCollectionByMsLevel(), and pappso::PwizMsRunReader::readSpectrumCollectionByMsLevel().

## setMassSpectrumId()

void pappso::QualifiedMassSpectrum::setMassSpectrumId | ( | const MassSpectrumId & | iD | ) |

Set the MassSpectrumId.

Definition at line 149 of file qualifiedmassspectrum.cpp.

{
m_massSpectrumId = iD;
}

References m_massSpectrumId.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::TimsData::getQualifiedMs1MassSpectrumByPrecursorId(), pappso::TimsData::getQualifiedMs2MassSpectrumByPrecursorId(), and pappso::TimsData::rawReaderSpectrumCollectionByMsLevel().

## setMassSpectrumSPtr()

void pappso::QualifiedMassSpectrum::setMassSpectrumSPtr | ( | MassSpectrumSPtr | massSpectrum | ) |

Set the MassSpectrumSPtr.

Definition at line 125 of file qualifiedmassspectrum.cpp.

{
msp_massSpectrum = massSpectrum;
}

References msp_massSpectrum.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::TimsData::getQualifiedMs1MassSpectrumByPrecursorId(), pappso::TimsData::getQualifiedMs2MassSpectrumByPrecursorId(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), pappso::XyMsRunReader::qualifiedMassSpectrumFromXyMSDataFile(), and pappso::TimsData::rawReaderSpectrumCollectionByMsLevel().

## setMsLevel()

void pappso::QualifiedMassSpectrum::setMsLevel | ( | uint | ms_level | ) |

Set the mass spectrum level.

Definition at line 179 of file qualifiedmassspectrum.cpp.

{
m_msLevel = level;
}

References m_msLevel.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::TimsData::getQualifiedMs1MassSpectrumByPrecursorId(), pappso::TimsData::getQualifiedMs2MassSpectrumByPrecursorId(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), pappso::XyMsRunReader::qualifiedMassSpectrumFromXyMSDataFile(), and pappso::TimsData::rawReaderSpectrumCollectionByMsLevel().

## setParameterValue()

void pappso::QualifiedMassSpectrum::setParameterValue | ( | QualifiedMassSpectrumParameter | parameter,
|  | const QVariant & | value
| ) |  |

Definition at line 461 of file qualifiedmassspectrum.cpp.

{
auto ret = m_paramsMap.insert(
std::pair<QualifiedMassSpectrumParameter, QVariant>(parameter, value));
if(ret.second == false)
{
ret.first->second = value;
}
}

References m_paramsMap.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::TimsData::getQualifiedMs1MassSpectrumByPrecursorId(), pappso::TimsData::getQualifiedMs2MassSpectrumByPrecursorId(), and pappso::TimsData::rawReaderSpectrumCollectionByMsLevel().

## setPrecursorNativeId()

void pappso::QualifiedMassSpectrum::setPrecursorNativeId | ( | const QString & | native_id | ) |

Set the scan native id of the precursor ion.

Definition at line 417 of file qualifiedmassspectrum.cpp.

{
m_precursorNativeId = native_id;
}

References m_precursorNativeId.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::TimsData::getQualifiedMs2MassSpectrumByPrecursorId(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), and pappso::TimsData::rawReaderSpectrumCollectionByMsLevel().

## setPrecursorSpectrumIndex()

void pappso::QualifiedMassSpectrum::setPrecursorSpectrumIndex | ( | std::size_t | precursor_scan_num | ) |

Set the scan number of the precursor ion.

Definition at line 400 of file qualifiedmassspectrum.cpp.

{
m_precursorSpectrumIndex = precursor_spectrum_index;
}

References m_precursorSpectrumIndex.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::TimsData::getQualifiedMs1MassSpectrumByPrecursorId(), pappso::TimsData::getQualifiedMs2MassSpectrumByPrecursorId(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), and pappso::TimsData::rawReaderSpectrumCollectionByMsLevel().

## setRtInSeconds()

void pappso::QualifiedMassSpectrum::setRtInSeconds | ( | pappso_double | rt | ) |

Set the retention time in seconds.

Definition at line 195 of file qualifiedmassspectrum.cpp.

{
m_rt = rt_in_seconds;
}

References m_rt.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::TimsData::getQualifiedMs1MassSpectrumByPrecursorId(), pappso::TimsData::getQualifiedMs2MassSpectrumByPrecursorId(), pappso::PwizMsRunReader::processRetentionTime(), pappso::XyMsRunReader::qualifiedMassSpectrumFromXyMSDataFile(), and pappso::TimsData::rawReaderSpectrumCollectionByMsLevel().

## size()

std::size_t pappso::QualifiedMassSpectrum::size | ( |  | ) | const

Definition at line 492 of file qualifiedmassspectrum.cpp.

{
if(msp_massSpectrum == nullptr)
{
throw pappso::PappsoException(QObject::tr("msp_massSpectrum == nullptr"));
}
return msp_massSpectrum.get()->size();
}
pappso::PappsoException
Definition: pappsoexception.h:42

References msp_massSpectrum.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByRawIndex(), pappso::TimsData::rawReaderSpectrumCollectionByMsLevel(), and pappso::MzxmlOutput::writeQualifiedMassSpectrum().

## toString()

QString pappso::QualifiedMassSpectrum::toString | ( |  | ) | const

Definition at line 503 of file qualifiedmassspectrum.cpp.

{
QString text;
if(msp_massSpectrum != nullptr && msp_massSpectrum.get() != nullptr)
{
QString pointer_string =
QString("msp_massSpectrum.get(): %1 ")
.arg(Utils::pointerToString((void *)msp_massSpectrum.get()));
text += pointer_string;
}
else
text += QString("msp_massSpectrum is nullptr ");
// qDebug() << text;
QString precursor_mz_values_string;
if(m_precursorIonData.size())
precursor_mz_values_string += "Precursor mz values: ";
precursor_mz_values_string += getMzSortedPrecursorDataMzValuesAsString();
precursor_mz_values_string += "\n";
text +=
QString(
"; m_massSpectrumId : %1 \n"
"m_msLevel: %2 ; m_rt (min): %3 ; m_dt (ms): %4 ; prec. spec. "
"index: %5 ; %6")
.arg(m_massSpectrumId.toString())
.arg(m_msLevel)
.arg(getRtInMinutes(), 0, 'f', 2)
.arg(m_dt, 0, 'f', 5)
.arg(m_precursorSpectrumIndex != std::numeric_limits<std::size_t>::max()
? m_precursorSpectrumIndex
: -1)
.arg(precursor_mz_values_string);
return text;
}
pappso::MassSpectrumId::toString
QString toString() const
Definition: massspectrumid.cpp:135
pappso::QualifiedMassSpectrum::getRtInMinutes
pappso_double getRtInMinutes() const
Get the retention time in minutes.
Definition: qualifiedmassspectrum.cpp:211
pappso::QualifiedMassSpectrum::getMzSortedPrecursorDataMzValuesAsString
QString getMzSortedPrecursorDataMzValuesAsString(const QString &separator="\n") const
Definition: qualifiedmassspectrum.cpp:301
pappso::Utils::pointerToString
static QString pointerToString(const void *const pointer)
Definition: utils.cpp:235

References getMzSortedPrecursorDataMzValuesAsString(), getRtInMinutes(), m_dt, m_massSpectrumId, m_msLevel, m_precursorIonData, m_precursorSpectrumIndex, msp_massSpectrum, pappso::Utils::pointerToString(), and pappso::MassSpectrumId::toString().

## Member Data Documentation

## m_dt

pappso_double pappso::QualifiedMassSpectrum::m_dt = -1

protected

Drift time (in milliseconds) at which this mass spectrum was acquired.

Definition at line 177 of file qualifiedmassspectrum.h.

Referenced by getDtInMilliSeconds(), operator=(), setDtInMilliSeconds(), and toString().

## m_isEmptyMassSpectrum

bool pappso::QualifiedMassSpectrum::m_isEmptyMassSpectrum = false

protected

Definition at line 168 of file qualifiedmassspectrum.h.

Referenced by isEmptyMassSpectrum(), operator=(), and setEmptyMassSpectrum().

## m_massSpectrumId

MassSpectrumId pappso::QualifiedMassSpectrum::m_massSpectrumId

protected

Id of the mass spectrum.

Definition at line 166 of file qualifiedmassspectrum.h.

Referenced by getMassSpectrumId(), operator=(), setMassSpectrumId(), and toString().

## m_msLevel

unsigned int pappso::QualifiedMassSpectrum::m_msLevel = 0

protected

Mass spectrometry level of this mass spectrum.

Definition at line 171 of file qualifiedmassspectrum.h.

Referenced by getMsLevel(), operator=(), setMsLevel(), and toString().

## m_paramsMap

std::map<QualifiedMassSpectrumParameter, QVariant> pappso::QualifiedMassSpectrum::m_paramsMap

protected

map containing any parameter value for this spectrum

Definition at line 193 of file qualifiedmassspectrum.h.

Referenced by getParameterValue(), operator=(), and setParameterValue().

## m_precursorIonData

std::vector<PrecursorIonData> pappso::QualifiedMassSpectrum::m_precursorIonData

protected

vector of precursor ion data of the precursors that were fragmented to yield this mass spectrum.

Definition at line 190 of file qualifiedmassspectrum.h.

Referenced by appendPrecursorIonData(), getPrecursorCharge(), getPrecursorDataChargeValuesAsString(), getPrecursorDataMzValuesAsString(), getPrecursorIntensity(), getPrecursorIonData(), getPrecursorIonDataSortedWithMz(), getPrecursorMz(), operator=(), and toString().

## m_precursorNativeId

QString pappso::QualifiedMassSpectrum::m_precursorNativeId

protected

Native XML id of the spectrum relative to the mz data native file.

Definition at line 185 of file qualifiedmassspectrum.h.

Referenced by getPrecursorNativeId(), operator=(), and setPrecursorNativeId().

## m_precursorSpectrumIndex

std::size_t pappso::QualifiedMassSpectrum::m_precursorSpectrumIndex

protected

Initial value:
=
std::numeric_limits<std::size_t>::max()

Index of the spectrum of the precusor ion that was fragmented to yield.

Definition at line 181 of file qualifiedmassspectrum.h.

Referenced by getPrecursorSpectrumIndex(), operator=(), setPrecursorSpectrumIndex(), and toString().

## m_rt

pappso_double pappso::QualifiedMassSpectrum::m_rt = -1

protected

Retention time (in seconds) at which this mass spectrum was acquired.

Definition at line 174 of file qualifiedmassspectrum.h.

Referenced by getRtInMinutes(), getRtInSeconds(), operator=(), and setRtInSeconds().

## msp_massSpectrum

MassSpectrumSPtr pappso::QualifiedMassSpectrum::msp_massSpectrum = nullptr

protected

Shared pointer to the mass spectrum.

Definition at line 163 of file qualifiedmassspectrum.h.

Referenced by cloneMassSpectrumSPtr(), getMassSpectrumCstSPtr(), getMassSpectrumSPtr(), operator=(), setMassSpectrumSPtr(), size(), and toString().

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

- pappsomspp/massspectrum/qualifiedmassspectrum.h
- pappsomspp/massspectrum/qualifiedmassspectrum.cpp