Loading...
Searching...
No Matches
pappso::QualifiedMassSpectrum Class Reference

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

`#include <qualifiedmassspectrum.h>`

## Public Member Functions

| QualifiedMassSpectrum ()
| Construct an uninitialized QualifiedMassSpectrum.
| QualifiedMassSpectrum (const MassSpectrumId &id)
| Construct a QualifiedMassSpectrum using a MassSpectrumId;.
| QualifiedMassSpectrum (MassSpectrumSPtr mass_spectrum_SPtr)
| QualifiedMassSpectrum (const QualifiedMassSpectrum &other)
| Construct a QualifiedMassSpectrum as a copy of `other`.
| ~QualifiedMassSpectrum ()
| Destruct this QualifiedMassSpectrum.
QualifiedMassSpectrum & | operator= (const QualifiedMassSpectrum &other)
const QualifiedMassSpectrum & | cloneMassSpectrumSPtr ()
| clone the mass spectrum contained in Qualified Mass Spectrum
QualifiedMassSpectrumSPtr | makeQualifiedMassSpectrumSPtr () const
QualifiedMassSpectrumCstSPtr | makeQualifiedMassSpectrumCstSPtr () const
void | setMassSpectrumSPtr (MassSpectrumSPtr massSpectrum)
| Set the MassSpectrumSPtr.
MassSpectrumSPtr | getMassSpectrumSPtr () const
| Get the MassSpectrumSPtr.
MassSpectrumCstSPtr | getMassSpectrumCstSPtr () const
| Get the MassSpectrumCstSPtr.
void | setMassSpectrumId (const MassSpectrumId &iD)
| Set the MassSpectrumId.
const MassSpectrumId & | getMassSpectrumId () const
| Get the MassSpectrumId.
MassSpectrumId & | getMassSpectrumId ()
void | setEmptyMassSpectrum (bool is_empty_mass_spectrum)
bool | isEmptyMassSpectrum () const
void | setMsLevel (uint ms_level)
| Set the mass spectrum level.
uint | getMsLevel () const
| Get the mass spectrum level.
void | setRtInSeconds (pappso_double rt)
| Set the retention time in seconds.
pappso_double | getRtInSeconds () const
| Get the retention time in seconds.
pappso_double | getRtInMinutes () const
| Get the retention time in minutes.
void | setDtInMilliSeconds (pappso_double rt)
| Set the drift time in milliseconds.
pappso_double | getDtInMilliSeconds () const
| Get the drift time in milliseconds.
pappso_double | getPrecursorMz (bool *ok=nullptr) const
| get precursor mz
double | getPrecursorMass (bool *ok_p=nullptr) const
| get precursor mass given the charge stats and precursor mz
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 precursor charge
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 precursor intensity
void | setPrecursorSpectrumIndex (std::size_t precursor_scan_num)
| Set the scan number of the precursor ion.
std::size_t | getPrecursorSpectrumIndex () const
| Get the scan number of the precursor ion.
void | setPrecursorNativeId (const QString &native_id)
| Set the scan native id of the precursor ion.
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 (bool with_data=false) const

## Protected Attributes

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

## 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 98 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:201

## 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:198

## 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:203
pappso::QualifiedMassSpectrum::m_precursorIonData
std::vector< PrecursorIonData > m_precursorIonData
Definition qualifiedmassspectrum.h:224
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:216
pappso::QualifiedMassSpectrum::m_msLevel
unsigned int m_msLevel
Mass spectrometry level of this mass spectrum.
Definition qualifiedmassspectrum.h:206
pappso::QualifiedMassSpectrum::m_rt
pappso_double m_rt
Retention time (in seconds) at which this mass spectrum was acquired.
Definition qualifiedmassspectrum.h:209
pappso::QualifiedMassSpectrum::m_dt
pappso_double m_dt
Drift time (in milliseconds) at which this mass spectrum was acquired.
Definition qualifiedmassspectrum.h:212
pappso::QualifiedMassSpectrum::m_paramsMap
std::map< QualifiedMassSpectrumParameter, QVariant > m_paramsMap
map containing any parameter value for this spectrum
Definition qualifiedmassspectrum.h:227
pappso::QualifiedMassSpectrum::m_precursorNativeId
QString m_precursorNativeId
Native XML id of the spectrum relative to the mz data native file.
Definition qualifiedmassspectrum.h:220

## ~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 456 of file qualifiedmassspectrum.cpp.

{
m_precursorIonData.push_back(precursor_ion_data);
}

References m_precursorIonData.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## 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 235 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::specglob::PeptideModel::PeptideModel(), pappso::specglob::ExperimentalSpectrum::createSymetricPeakList(), pappso::specglob::ExperimentalSpectrum::findMz(), pappso::BafAsciiMsRunReader::massSpectrumCstSPtr(), pappso::PwizMsRunReader::massSpectrumCstSPtr(), pappso::XyMsRunReader::massSpectrumCstSPtr(), pappso::MassSpectrumWidget::setQualifiedMassSpectrum(), pappso::MgfOutput::write(), and pappso::MzxmlOutput::writeQualifiedMassSpectrum().

## getMassSpectrumId() [1/2]

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

Definition at line 163 of file qualifiedmassspectrum.cpp.

{
return m_massSpectrumId;
}

References m_massSpectrumId.

## getMassSpectrumId() [2/2]

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::specglob::ExperimentalSpectrum::createSymetricPeakList(), pappso::MzxmlOutput::getScanNumber(), pappso::TimsMsRunReaderMs2::newXicCoordSPtrFromQualifiedMassSpectrum(), pappso::TimsMsRunReader::readSpectrumCollection2(), pappso::MsRunQualifiedSpectrumLoader::setQualifiedMassSpectrum(), 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::BafAsciiMsRunReader::massSpectrumSPtr(), 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 192 of file qualifiedmassspectrum.cpp.

{
return m_msLevel;
}

References m_msLevel.

Referenced by pappso::BafAsciiMsRunReader::readSpectrumCollectionByMsLevel(), pappso::PwizMsRunReader::readSpectrumCollectionByMsLevel(), pappso::XyMsRunReader::readSpectrumCollectionByMsLevel(), pappso::PwizMsRunReader::readSpectrumCollectionWithMsrunReadConfig(), 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 393 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:471
pappso::QualifiedMassSpectrum::getPrecursorDataChargeValuesAsString
QString getPrecursorDataChargeValuesAsString(const std::vector< PrecursorIonData > &precursor_ion_data_vector, const QString &separator="\n") const
Definition qualifiedmassspectrum.cpp:361

References getPrecursorDataChargeValuesAsString(), and getPrecursorIonDataSortedWithMz().

## getMzSortedPrecursorDataMzValuesAsString()

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

Definition at line 329 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:286

References getPrecursorDataMzValuesAsString(), and getPrecursorIonDataSortedWithMz().

Referenced by toString().

## getParameterValue()

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

Definition at line 502 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 precursor charge

Get the precursor charge.

Parameters

  ok | pointer on boolean, false if precursor charge is not defined

Returns
  precursor charge

Definition at line 344 of file qualifiedmassspectrum.cpp.

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

References m_precursorIonData.

Referenced by pappso::specglob::ExperimentalSpectrum::createSymetricPeakList(), getPrecursorMass(), 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 385 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 361 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 321 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 286 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 precursor intensity

Get the intensity of the precursor ion.

Parameters

  ok | pointer on boolean, false if precursor intensity is not defined

Returns
  precursor intensity

Definition at line 408 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;
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 464 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 471 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;
}
pappso::PeptideIonNter::a
@ a
pappso::PeptideIonNter::b
@ b

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

Referenced by getMzSortedPrecursorDataChargeValuesAsString(), and getMzSortedPrecursorDataMzValuesAsString().

## getPrecursorMass()

double pappso::QualifiedMassSpectrum::getPrecursorMass | ( | bool * | ok_p = `nullptr` | ) | const

get precursor mass given the charge stats and precursor mz

Get the precursor mass ratio.

Parameters

  ok | pointer on boolean, false if precursor mz is not defined

Returns
  precursor mass (neutral mass without H+)

Definition at line 263 of file qualifiedmassspectrum.cpp.

{
if(ok_p != nullptr)
*ok_p = false;
bool ok_precmz = false;
double mz_prec = getPrecursorMz(&ok_precmz);
if(ok_precmz)
{
uint charge = getPrecursorCharge(&ok_precmz);
if(ok_precmz)
{
// compute precursor mass given the charge state
mz_prec = mz_prec * (double)charge;
mz_prec -= (MHPLUS * (double)charge);
if(ok_p != nullptr)
*ok_p = true;
return mz_prec;
}
}
return std::numeric_limits<double>::max();
}
pappso::QualifiedMassSpectrum::getPrecursorCharge
uint getPrecursorCharge(bool *ok=nullptr) const
get precursor charge
Definition qualifiedmassspectrum.cpp:344
pappso::QualifiedMassSpectrum::getPrecursorMz
pappso_double getPrecursorMz(bool *ok=nullptr) const
get precursor mz
Definition qualifiedmassspectrum.cpp:243
pappso::MHPLUS
const pappso_double MHPLUS(1.007276466879)
pappso::uint
unsigned int uint
Definition types.h:57

References getPrecursorCharge(), getPrecursorMz(), and pappso::MHPLUS().

Referenced by pappso::specglob::PeptideModel::PeptideModel().

## getPrecursorMz()

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

get precursor mz

Get the precursor m/z ratio.

Parameters

  ok | pointer on boolean, false if precursor mz is not defined

Returns
  precursor mz

Definition at line 243 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::specglob::ExperimentalSpectrum::createSymetricPeakList(), getPrecursorMass(), pappso::PwizMsRunReader::newXicCoordSPtrFromQualifiedMassSpectrum(), pappso::MgfOutput::write(), and pappso::MzxmlOutput::writeQualifiedMassSpectrum().

## getPrecursorNativeId()

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

Definition at line 449 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 435 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 216 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 208 of file qualifiedmassspectrum.cpp.

{
return m_rt;
}

References m_rt.

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

## isEmptyMassSpectrum()

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

Definition at line 176 of file qualifiedmassspectrum.cpp.

{
return m_isEmptyMassSpectrum;
}

References m_isEmptyMassSpectrum.

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

## 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 224 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::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::PwizMsRunReader::processDriftTime(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## setEmptyMassSpectrum()

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

Definition at line 169 of file qualifiedmassspectrum.cpp.

{
m_isEmptyMassSpectrum = is_empty_mass_spectrum;
}

References m_isEmptyMassSpectrum.

Referenced by pappso::TimsDiaSlices::getMs1QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs1MassSpectrumBySpectrumDescr(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), pappso::TimsMsRunReader::readSpectrumCollection2(), pappso::PwizMsRunReader::readSpectrumCollectionByMsLevel(), and pappso::PwizMsRunReader::readSpectrumCollectionWithMsrunReadConfig().

## 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::TimsDiaSlices::getMs1QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs1MassSpectrumBySpectrumDescr(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::BafAsciiMsRunReader::qualifiedMassSpectrumFromBafAsciiMSDataFile(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## 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::TimsDiaSlices::getMs1QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs1MassSpectrumBySpectrumDescr(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::BafAsciiMsRunReader::qualifiedMassSpectrumFromBafAsciiMSDataFile(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), pappso::XyMsRunReader::qualifiedMassSpectrumFromXyMSDataFile(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), pappso::TimsMsRunReader::readSpectrumCollection2(), and pappso::BafAsciiMsRunReader::readSpectrumCollectionByMsLevel().

## setMsLevel()

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

Set the mass spectrum level.

Definition at line 184 of file qualifiedmassspectrum.cpp.

{
m_msLevel = level;
}

References m_msLevel.

Referenced by pappso::TimsDiaSlices::getMs1QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs1MassSpectrumBySpectrumDescr(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::BafAsciiMsRunReader::qualifiedMassSpectrumFromBafAsciiMSDataFile(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), pappso::XyMsRunReader::qualifiedMassSpectrumFromXyMSDataFile(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), pappso::TimsMsRunReader::readSpectrumCollection2(), and pappso::BafAsciiMsRunReader::readSpectrumCollectionByMsLevel().

## setParameterValue()

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

Definition at line 487 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::TimsDiaSlices::getMs1QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs1MassSpectrumBySpectrumDescr(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## setPrecursorNativeId()

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

Set the scan native id of the precursor ion.

Definition at line 443 of file qualifiedmassspectrum.cpp.

{
m_precursorNativeId = native_id;
}

References m_precursorNativeId.

Referenced by pappso::TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## setPrecursorSpectrumIndex()

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

Set the scan number of the precursor ion.

Definition at line 426 of file qualifiedmassspectrum.cpp.

{
m_precursorSpectrumIndex = precursor_spectrum_index;
}

References m_precursorSpectrumIndex.

Referenced by pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs1MassSpectrumBySpectrumDescr(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), and pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel().

## setRtInSeconds()

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

Set the retention time in seconds.

Definition at line 200 of file qualifiedmassspectrum.cpp.

{
m_rt = rt_in_seconds;
}

References m_rt.

Referenced by pappso::TimsDiaSlices::getMs1QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs1MassSpectrumBySpectrumDescr(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::PwizMsRunReader::processRetentionTime(), pappso::BafAsciiMsRunReader::qualifiedMassSpectrumFromBafAsciiMSDataFile(), pappso::XyMsRunReader::qualifiedMassSpectrumFromXyMSDataFile(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), pappso::TimsMsRunReader::readSpectrumCollection2(), and pappso::BafAsciiMsRunReader::readSpectrumCollectionByMsLevel().

## size()

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

Definition at line 518 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::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), and pappso::MzxmlOutput::writeQualifiedMassSpectrum().

## toString()

QString pappso::QualifiedMassSpectrum::toString | ( | bool | with_data = `false` | ) | const

Definition at line 529 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);
if(with_data)
{
text += msp_massSpectrum->toString();
}
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:216
pappso::QualifiedMassSpectrum::getMzSortedPrecursorDataMzValuesAsString
QString getMzSortedPrecursorDataMzValuesAsString(const QString &separator="\n") const
Definition qualifiedmassspectrum.cpp:329
pappso::Utils::pointerToString
static QString pointerToString(const void *const pointer)
Definition utils.cpp:295

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 212 of file qualifiedmassspectrum.h.

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

## m_isEmptyMassSpectrum

bool pappso::QualifiedMassSpectrum::m_isEmptyMassSpectrum = false

protected

Definition at line 203 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 201 of file qualifiedmassspectrum.h.

Referenced by getMassSpectrumId(), 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 206 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 227 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 224 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 220 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 216 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 209 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 198 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