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

`#include <massspectrumid.h>`

## Public Member Functions

| MassSpectrumId ()
| MassSpectrumId (const MsRunIdCstSPtr &msrun_id)
| MassSpectrumId (const MsRunIdCstSPtr &msrun_id, std::size_t spectrum_index)
| MassSpectrumId (const MassSpectrumId &other)
| ~MassSpectrumId ()
MassSpectrumId & | operator= (const MassSpectrumId &other)
void | setMsRunId (MsRunIdCstSPtr other)
const MsRunIdCstSPtr & | getMsRunIdCstSPtr () const
void | setNativeId (const QString &native_id)
const QString & | getNativeId () const
std::size_t | extractScanNumberFromNativeId (bool *is_ok) const
| try to find scan id in the native id string
void | setSpectrumIndex (std::size_t index)
std::size_t | getSpectrumIndex () const
bool | operator== (const MassSpectrumId &other) const
bool | isValid () const
QString | toString () const

## Private Attributes

MsRunIdCstSPtr | mcsp_msRunId = nullptr
QString | m_nativeId
std::size_t | m_spectrumIndex = std::numeric_limits<std::size_t>::max()

## Detailed Description

Definition at line 40 of file massspectrumid.h.

## Constructor & Destructor Documentation

## MassSpectrumId() [1/4]

pappso::MassSpectrumId::MassSpectrumId | ( |  | ) |

Definition at line 33 of file massspectrumid.cpp.

{
}

Referenced by MassSpectrumId(), operator=(), and operator==().

## MassSpectrumId() [2/4]

pappso::MassSpectrumId::MassSpectrumId | ( | const MsRunIdCstSPtr & | msrun_id | ) |

Definition at line 38 of file massspectrumid.cpp.

: mcsp_msRunId(msRunId)
{
}
pappso::MassSpectrumId::mcsp_msRunId
MsRunIdCstSPtr mcsp_msRunId
Definition massspectrumid.h:76

References mcsp_msRunId.

## MassSpectrumId() [3/4]

pappso::MassSpectrumId::MassSpectrumId | ( | const MsRunIdCstSPtr & | msrun_id,
|  | std::size_t | spectrum_index )

Definition at line 43 of file massspectrumid.cpp.

: mcsp_msRunId(msRunId), m_nativeId(""), m_spectrumIndex(spectrum_index)
{
}
pappso::MassSpectrumId::m_spectrumIndex
std::size_t m_spectrumIndex
Definition massspectrumid.h:90
pappso::MassSpectrumId::m_nativeId
QString m_nativeId
Definition massspectrumid.h:85

References m_nativeId, m_spectrumIndex, and mcsp_msRunId.

## MassSpectrumId() [4/4]

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

Definition at line 49 of file massspectrumid.cpp.

: mcsp_msRunId(other.mcsp_msRunId),
m_nativeId(other.m_nativeId),
m_spectrumIndex(other.m_spectrumIndex)
{
}

References MassSpectrumId(), m_nativeId, m_spectrumIndex, and mcsp_msRunId.

## ~MassSpectrumId()

pappso::MassSpectrumId::~MassSpectrumId | ( |  | ) |

Definition at line 57 of file massspectrumid.cpp.

{
}

## Member Function Documentation

## extractScanNumberFromNativeId()

std::size_t pappso::MassSpectrumId::extractScanNumberFromNativeId | ( | bool * | is_ok | ) | const

try to find scan id in the native id string

Parameters

  is_ok | true if scan number is found

Returns
  integer of the scan number

Definition at line 145 of file massspectrumid.cpp.

{
*is_ok = false;
QRegularExpression regexp_scan("scan=([0-9]+)");
QRegularExpressionMatch match = regexp_scan.match(m_nativeId);
if(match.hasMatch())
{
return match.captured(0).toInt(is_ok);
}
return 0;
}

References m_nativeId.

Referenced by pappso::cbor::psm::PsmCborUtils::prepareCborScanWithSpectrum().

## getMsRunIdCstSPtr()

const MsRunIdCstSPtr & pappso::MassSpectrumId::getMsRunIdCstSPtr | ( |  | ) | const

Definition at line 85 of file massspectrumid.cpp.

{
return mcsp_msRunId;
};

References mcsp_msRunId.

Referenced by pappso::MgfOutput::write().

## getNativeId()

const QString & pappso::MassSpectrumId::getNativeId | ( |  | ) | const

Definition at line 99 of file massspectrumid.cpp.

{
return m_nativeId;
}

References m_nativeId.

Referenced by pappso::MzxmlOutput::getScanNumber(), pappso::cbor::psm::PsmCborUtils::prepareCborScanWithSpectrum(), pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::readSpectrum(), pappso::masschroq::PrecursorParser::setQualifiedMassSpectrum(), pappso::MsRunQualifiedSpectrumLoader::setQualifiedMassSpectrum(), pappso::MsRunReaderRetentionTimeLine::setQualifiedMassSpectrum(), and pappso::MsRunReaderScanNumberMultiMap::setQualifiedMassSpectrum().

## getSpectrumIndex()

std::size_t pappso::MassSpectrumId::getSpectrumIndex | ( |  | ) | const

Definition at line 113 of file massspectrumid.cpp.

{
return m_spectrumIndex;
}

References m_spectrumIndex.

Referenced by pappso::MzxmlOutput::getScanNumber(), pappso::TimsMsRunReaderMs2::newXicCoordSPtrFromQualifiedMassSpectrum(), pappso::cbor::psm::PsmCborUtils::prepareCborScanWithSpectrum(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::readSpectrum(), pappso::masschroq::PrecursorParser::setQualifiedMassSpectrum(), pappso::MsRunReaderScanNumberMultiMap::setQualifiedMassSpectrum(), pappso::MsRunXicExtractor::MsRunXicExtractorReadPoints::setQualifiedMassSpectrum(), and pappso::MgfOutput::write().

## isValid()

bool pappso::MassSpectrumId::isValid | ( |  | ) | const

Definition at line 126 of file massspectrumid.cpp.

{
return mcsp_msRunId->isValid() && m_spectrumIndex != std::numeric_limits<std::size_t>::max();
}

References m_spectrumIndex, and mcsp_msRunId.

## operator=()

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

Definition at line 63 of file massspectrumid.cpp.

{
if(&other == this)
return *this;
mcsp_msRunId = other.mcsp_msRunId;
m_spectrumIndex = other.m_spectrumIndex;
m_nativeId = other.m_nativeId;
return *this;
}

References MassSpectrumId(), m_nativeId, m_spectrumIndex, and mcsp_msRunId.

## operator==()

bool pappso::MassSpectrumId::operator== | ( | const MassSpectrumId & | other | ) | const

Definition at line 120 of file massspectrumid.cpp.

{
return (mcsp_msRunId == other.mcsp_msRunId && m_spectrumIndex == other.m_spectrumIndex);
}

References MassSpectrumId(), m_spectrumIndex, and mcsp_msRunId.

## setMsRunId()

void pappso::MassSpectrumId::setMsRunId | ( | MsRunIdCstSPtr | other | ) |

Definition at line 77 of file massspectrumid.cpp.

{
mcsp_msRunId = other;
};

References mcsp_msRunId.

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

## setNativeId()

void pappso::MassSpectrumId::setNativeId | ( | const QString & | native_id | ) |

Definition at line 92 of file massspectrumid.cpp.

{
m_nativeId = native_id;
}

References m_nativeId.

Referenced by pappso::cbor::psm::CborScanMapBase::getCurrentQualifiedMassSpectrumSPtr(), pappso::cbor::psm::PsmFileReaderBase::getCurrentQualifiedMassSpectrumSPtr(), pappso::TimsDiaSlices::getMs1QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs1MassSpectrumBySpectrumDescr(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::MzcborMsRunReader::qualifiedMassSpectrum(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizMSData(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::readSpectrum(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), pappso::TimsMsRunReader::readSpectrumCollection2(), pappso::PwizMsRunReader::readSpectrumCollectionByMsLevel(), and pappso::PwizMsRunReader::readSpectrumCollectionWithMsrunReadConfig().

## setSpectrumIndex()

void pappso::MassSpectrumId::setSpectrumIndex | ( | std::size_t | index | ) |

Definition at line 106 of file massspectrumid.cpp.

{
m_spectrumIndex = index;
}

References m_spectrumIndex.

Referenced by pappso::cbor::psm::CborScanMapBase::getCurrentQualifiedMassSpectrumSPtr(), pappso::cbor::psm::PsmFileReaderBase::getCurrentQualifiedMassSpectrumSPtr(), pappso::TimsDiaSlices::getMs1QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex(), pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex(), pappso::TimsDdaPrecursors::getQualifiedMs1MassSpectrumBySpectrumDescr(), pappso::TimsDdaPrecursors::getQualifiedMs2MassSpectrumBySpectrumDescr(), pappso::MzcborMsRunReader::qualifiedMassSpectrum(), pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizMSData(), pappso::TimsDdaPrecursors::rawReaderSpectrumCollectionByMsLevel(), pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::readSpectrum(), pappso::TimsFramesMsRunReader::readSpectrumCollection2(), and pappso::TimsMsRunReader::readSpectrumCollection2().

## toString()

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

Definition at line 133 of file massspectrumid.cpp.

{
return QString(
"ms run id: %1 \n"
"native id: %2 \n"
"m_spectrumIndex: %3\n")
.arg(mcsp_msRunId != nullptr ? mcsp_msRunId->toString() : "nullptr")
.arg(m_nativeId)
.arg(m_spectrumIndex);
}

References m_nativeId, m_spectrumIndex, and mcsp_msRunId.

## Member Data Documentation

## m_nativeId

QString pappso::MassSpectrumId::m_nativeId

private

Definition at line 85 of file massspectrumid.h.

Referenced by MassSpectrumId(), MassSpectrumId(), extractScanNumberFromNativeId(), getNativeId(), operator=(), setNativeId(), and toString().

## m_spectrumIndex

std::size_t pappso::MassSpectrumId::m_spectrumIndex = std::numeric_limits<std::size_t>::max()

private

Definition at line 90 of file massspectrumid.h.

Referenced by MassSpectrumId(), MassSpectrumId(), getSpectrumIndex(), isValid(), operator=(), operator==(), setSpectrumIndex(), and toString().

## mcsp_msRunId

MsRunIdCstSPtr pappso::MassSpectrumId::mcsp_msRunId = nullptr

private

Definition at line 76 of file massspectrumid.h.

Referenced by MassSpectrumId(), MassSpectrumId(), MassSpectrumId(), getMsRunIdCstSPtr(), isValid(), operator=(), operator==(), setMsRunId(), and toString().

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

- pappsomspp/core/massspectrum/massspectrumid.h
- pappsomspp/core/massspectrum/massspectrumid.cpp