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

example of interface to count MS levels of all spectrum in an MSrun More...

`#include <spectrumcollectionhandlerinterface.h>`

Inheritance diagram for pappso::MsRunSimpleStatistics:

## Public Member Functions

virtual void | setQualifiedMassSpectrum (const QualifiedMassSpectrum &spectrum) override
virtual bool | needPeakList () const override
| tells if we need the peak list (if we want the binary data) for each spectrum
virtual void | loadingEnded () override
unsigned long | getMsLevelCount (unsigned int ms_level) const
unsigned long | getTotalCount () const
Public Member Functions inherited from pappso::SpectrumCollectionHandlerInterface
virtual bool | needMsLevelPeakList (unsigned int ms_level) const final
| tells if we need the peak list (if we want the binary data) for each spectrum, given an MS level
virtual void | setNeedMsLevelPeakList (unsigned int ms_level, bool want_peak_list) final
| tells if we need the peak list given
virtual bool | shouldStop ()
virtual void | spectrumListHasSize (std::size_t size)
virtual void | setReadAhead (bool is_read_ahead) final
| use threads to read a spectrum by batch of batch_size
virtual bool | isReadAhead () const
| tells if we want to read ahead spectrum

## Private Attributes

std::vector< unsigned long > | m_countMsLevelSpectrum

## Detailed Description

example of interface to count MS levels of all spectrum in an MSrun

Definition at line 112 of file spectrumcollectionhandlerinterface.h.

## Member Function Documentation

## getMsLevelCount()

unsigned long pappso::MsRunSimpleStatistics::getMsLevelCount | ( | unsigned int | ms_level | ) | const

Definition at line 127 of file spectrumcollectionhandlerinterface.cpp.

{
if(ms_level == 0)
return 0;
if(ms_level > m_countMsLevelSpectrum.size())
return 0;
return (m_countMsLevelSpectrum[ms_level - 1]);
}
pappso::MsRunSimpleStatistics::m_countMsLevelSpectrum
std::vector< unsigned long > m_countMsLevelSpectrum
Definition spectrumcollectionhandlerinterface.h:116

References m_countMsLevelSpectrum.

## getTotalCount()

unsigned long pappso::MsRunSimpleStatistics::getTotalCount | ( |  | ) | const

Definition at line 138 of file spectrumcollectionhandlerinterface.cpp.

{
unsigned long total = 0;
for(unsigned long count : m_countMsLevelSpectrum)
{
total += count;
}
return total;
}

References m_countMsLevelSpectrum.

## loadingEnded()

void pappso::MsRunSimpleStatistics::loadingEnded | ( |  | ) |

override virtual

Reimplemented from pappso::SpectrumCollectionHandlerInterface.

Definition at line 99 of file spectrumcollectionhandlerinterface.cpp.

{
// qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()"
//<< "The data loading process ended.";
}

## needPeakList()

bool pappso::MsRunSimpleStatistics::needPeakList | ( |  | ) | const

override virtual

tells if we need the peak list (if we want the binary data) for each spectrum

Implements pappso::SpectrumCollectionHandlerInterface.

Definition at line 92 of file spectrumcollectionhandlerinterface.cpp.

{
return false;
}

## setQualifiedMassSpectrum()

void pappso::MsRunSimpleStatistics::setQualifiedMassSpectrum | ( | const QualifiedMassSpectrum & | spectrum | ) |

override virtual

Implements pappso::SpectrumCollectionHandlerInterface.

Definition at line 107 of file spectrumcollectionhandlerinterface.cpp.

{
// The vector[0] contains the number of spectra at MS
// The vector[1] contains the number of spectra at MS^2
// The vector[2] contains the number of spectra at MS^3
// ...
unsigned int ms_level = qspectrum.getMsLevel();
if(ms_level == 0)
return;
if(ms_level > m_countMsLevelSpectrum.size())
{
m_countMsLevelSpectrum.resize(ms_level);
}
m_countMsLevelSpectrum[ms_level - 1]++;
}

References pappso::QualifiedMassSpectrum::getMsLevel(), and m_countMsLevelSpectrum.

## Member Data Documentation

## m_countMsLevelSpectrum

std::vector<unsigned long> pappso::MsRunSimpleStatistics::m_countMsLevelSpectrum

private

Definition at line 116 of file spectrumcollectionhandlerinterface.h.

Referenced by getMsLevelCount(), getTotalCount(), and setQualifiedMassSpectrum().

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

- pappsomspp/msrun/spectrumcollectionhandlerinterface.h
- pappsomspp/msrun/spectrumcollectionhandlerinterface.cpp