libpappsomspp
Library for mass spectrometry
pappso::MsRunSimpleStatistics Class Reference

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

#include <msrunreader.h>

Inheritance diagram for pappso::MsRunSimpleStatistics:
pappso::SpectrumCollectionHandlerInterface

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 More...
 
virtual void loadingEnded () override
 
unsigned long getMsLevelCount (unsigned int ms_level) const
 
unsigned long getTotalCount () const
 
- Public Member Functions inherited from pappso::SpectrumCollectionHandlerInterface
virtual void setQualifiedMassSpectrum (const QualifiedMassSpectrum &spectrum)=0
 
virtual bool needPeakList () const =0
 tells if we need the peak list (if we want the binary data) for each spectrum More...
 
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 More...
 
virtual void setNeedMsLevelPeakList (unsigned int ms_level, bool want_peak_list) final
 tells if we need the peak list given More...
 
virtual bool shouldStop ()
 
virtual void loadingEnded ()
 
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 More...
 
virtual bool isReadAhead () const
 tells if we want to read ahead spectrum More...
 

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 111 of file msrunreader.h.

Member Function Documentation

◆ getMsLevelCount()

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

Definition at line 132 of file msrunreader.cpp.

133{
134 if(ms_level == 0)
135 return 0;
136 if(ms_level > m_countMsLevelSpectrum.size())
137 return 0;
138 return (m_countMsLevelSpectrum[ms_level - 1]);
139}
std::vector< unsigned long > m_countMsLevelSpectrum
Definition: msrunreader.h:115

References m_countMsLevelSpectrum.

◆ getTotalCount()

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

Definition at line 143 of file msrunreader.cpp.

144{
145 unsigned long total = 0;
146 for(unsigned long count : m_countMsLevelSpectrum)
147 {
148 total += count;
149 }
150 return total;
151}

References m_countMsLevelSpectrum.

◆ loadingEnded()

void pappso::MsRunSimpleStatistics::loadingEnded ( )
overridevirtual

Reimplemented from pappso::SpectrumCollectionHandlerInterface.

Definition at line 104 of file msrunreader.cpp.

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

◆ needPeakList()

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

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

Implements pappso::SpectrumCollectionHandlerInterface.

Definition at line 97 of file msrunreader.cpp.

98{
99 return false;
100}

◆ setQualifiedMassSpectrum()

void pappso::MsRunSimpleStatistics::setQualifiedMassSpectrum ( const QualifiedMassSpectrum spectrum)
overridevirtual

Implements pappso::SpectrumCollectionHandlerInterface.

Definition at line 112 of file msrunreader.cpp.

114{
115 // The vector[0] contains the number of spectra at MS
116 // The vector[1] contains the number of spectra at MS^2
117 // The vector[2] contains the number of spectra at MS^3
118 // ...
119
120 unsigned int ms_level = qspectrum.getMsLevel();
121 if(ms_level == 0)
122 return;
123 if(ms_level > m_countMsLevelSpectrum.size())
124 {
125 m_countMsLevelSpectrum.resize(ms_level);
126 }
127 m_countMsLevelSpectrum[ms_level - 1]++;
128}

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

Member Data Documentation

◆ m_countMsLevelSpectrum

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

Definition at line 115 of file msrunreader.h.

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


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