pappso::MsRunSlice Class Reference

`#include <msrunslice.h>`

## Public Member Functions

| MsRunSlice ()
| MsRunSlice (const MsRunSlice &other)
virtual | ~MsRunSlice ()
MsRunSliceSPtr | makeMsRunSliceSp () const
void | setSliceNumber (unsigned int slice_number)
unsigned int | getSliceNumber () const
void | clear ()
std::size_t | size () const
void | setSize (std::size_t size)
| set number of spectrum (mz/intensity) stored in this slice More...
void | appendToStream (QDataStream &stream, std::size_t ipos) const
const MassSpectrum & | getSpectrum (std::size_t i) const
MassSpectrum & | getSpectrum (std::size_t i)
void | setSpectrum (std::size_t i, const MassSpectrum &spectrum)
| set the mass spectrum for a given index (retention time) More...

## Private Attributes

unsigned int | m_sliceNumber = 0
std::vector< MassSpectrum > | m_spectrumList

## Detailed Description

Definition at line 42 of file msrunslice.h.

## Constructor & Destructor Documentation

## MsRunSlice() [1/2]

pappso::MsRunSlice::MsRunSlice | ( |  | ) |

Definition at line 40 of file msrunslice.cpp.

{
m_sliceNumber = 0;
}
pappso::MsRunSlice::m_sliceNumber
unsigned int m_sliceNumber
Definition: msrunslice.h:73

References m_sliceNumber.

## MsRunSlice() [2/2]

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

Definition at line 45 of file msrunslice.cpp.

{
m_sliceNumber = other.m_sliceNumber;
m_spectrumList = other.m_spectrumList;
}
pappso::MsRunSlice::m_spectrumList
std::vector< MassSpectrum > m_spectrumList
Definition: msrunslice.h:74

References m_sliceNumber, and m_spectrumList.

## ~MsRunSlice()

pappso::MsRunSlice::~MsRunSlice | ( |  | ) |

virtual

Definition at line 50 of file msrunslice.cpp.

{
}

## Member Function Documentation

## appendToStream()

void pappso::MsRunSlice::appendToStream | ( | QDataStream & | stream,
|  | std::size_t | ipos
| ) |  | const

Definition at line 144 of file msrunslice.cpp.

{
for(auto &&spectrum : m_spectrumList)
{
outstream << (quint32)ipos;
outstream << spectrum;
ipos++;
}
}

References m_spectrumList.

## clear()

void pappso::MsRunSlice::clear | ( |  | ) |

Definition at line 84 of file msrunslice.cpp.

{
m_spectrumList.clear();
m_sliceNumber = 0;
}

References m_sliceNumber, and m_spectrumList.

## getSliceNumber()

unsigned int pappso::MsRunSlice::getSliceNumber | ( |  | ) | const

Definition at line 67 of file msrunslice.cpp.

{
return m_sliceNumber;
}

References m_sliceNumber.

## getSpectrum() [1/2]

MassSpectrum & pappso::MsRunSlice::getSpectrum | ( | std::size_t | i | ) |

Definition at line 109 of file msrunslice.cpp.

{
try
{
return m_spectrumList.at(i);
}
catch(std::exception &error)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
throw pappso::ExceptionOutOfRange(
QObject::tr("unable to get spectrum %1 (size=%2) %3")
.arg(i)
.arg(m_spectrumList.size())
.arg(error.what()));
}
}
pappso::ExceptionOutOfRange
Definition: exceptionoutofrange.h:32

References m_spectrumList.

## getSpectrum() [2/2]

const MassSpectrum & pappso::MsRunSlice::getSpectrum | ( | std::size_t | i | ) | const

Definition at line 126 of file msrunslice.cpp.

{
try
{
return m_spectrumList.at(i);
}
catch(std::exception &error)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
throw pappso::ExceptionOutOfRange(
QObject::tr("unable to get spectrum %1 (size=%2) %3")
.arg(i)
.arg(m_spectrumList.size())
.arg(error.what()));
}
}

References m_spectrumList.

## makeMsRunSliceSp()

MsRunSliceSPtr pappso::MsRunSlice::makeMsRunSliceSp | ( |  | ) | const

Definition at line 55 of file msrunslice.cpp.

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

## setSize()

void pappso::MsRunSlice::setSize | ( | std::size_t | size | ) |

set number of spectrum (mz/intensity) stored in this slice

Definition at line 79 of file msrunslice.cpp.

{
m_spectrumList.resize(size);
}
pappso::MsRunSlice::size
std::size_t size() const
Definition: msrunslice.cpp:73

References m_spectrumList, and size().

Referenced by pappso::operator>>().

## setSliceNumber()

void pappso::MsRunSlice::setSliceNumber | ( | unsigned int | slice_number | ) |

Definition at line 61 of file msrunslice.cpp.

{
m_sliceNumber = slice_number;
}

References m_sliceNumber.

Referenced by pappso::operator>>().

## setSpectrum()

void pappso::MsRunSlice::setSpectrum | ( | std::size_t | i,
|  | const MassSpectrum & | spectrum
| ) |  |

set the mass spectrum for a given index (retention time)

Definition at line 91 of file msrunslice.cpp.

{
try
{
m_spectrumList[i] = spectrum;
}
catch(std::exception &error)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
throw pappso::ExceptionOutOfRange(
QObject::tr("unable to access spectrum %1 (size=%2) %3")
.arg(i)
.arg(m_spectrumList.size())
.arg(error.what()));
}
}

References m_spectrumList.

Referenced by pappso::operator>>().

## size()

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

Definition at line 73 of file msrunslice.cpp.

{
return m_spectrumList.size();
}

References m_spectrumList.

Referenced by pappso::operator>>(), and setSize().

## Member Data Documentation

## m_sliceNumber

unsigned int pappso::MsRunSlice::m_sliceNumber = 0

private

Definition at line 73 of file msrunslice.h.

Referenced by MsRunSlice(), clear(), getSliceNumber(), and setSliceNumber().

## m_spectrumList

std::vector<MassSpectrum> pappso::MsRunSlice::m_spectrumList

private

Definition at line 74 of file msrunslice.h.

Referenced by MsRunSlice(), appendToStream(), clear(), getSpectrum(), setSize(), setSpectrum(), and size().

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

- pappsomspp/xicextractor/private/msrunslice.h
- pappsomspp/xicextractor/private/msrunslice.cpp