libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::MsRunReaderTicChromatogram Class Reference

calculate a TIC chromatogram More...

#include <spectrumcollectionhandlerinterface.h>

Inheritance diagram for pappso::MsRunReaderTicChromatogram:
pappso::SpectrumCollectionHandlerInterface

Public Member Functions

 MsRunReaderTicChromatogram ()
virtual ~MsRunReaderTicChromatogram ()
virtual void setQualifiedMassSpectrum (const QualifiedMassSpectrum &qualified_mass_spectrum) override
virtual bool needPeakList () const override
 tells if we need the peak list (if we want the binary data) for each spectrum
Trace getTicChromatogram () 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 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
virtual bool isReadAhead () const
 tells if we want to read ahead spectrum

Private Attributes

Trace m_ticChromTrace

Detailed Description

calculate a TIC chromatogram

Definition at line 142 of file spectrumcollectionhandlerinterface.h.

Constructor & Destructor Documentation

◆ MsRunReaderTicChromatogram()

pappso::MsRunReaderTicChromatogram::MsRunReaderTicChromatogram ( )

Definition at line 242 of file spectrumcollectionhandlerinterface.cpp.

243{
244}

◆ ~MsRunReaderTicChromatogram()

pappso::MsRunReaderTicChromatogram::~MsRunReaderTicChromatogram ( )
virtual

Definition at line 247 of file spectrumcollectionhandlerinterface.cpp.

248{
249}

Member Function Documentation

◆ getTicChromatogram()

Trace pappso::MsRunReaderTicChromatogram::getTicChromatogram ( ) const

Definition at line 299 of file spectrumcollectionhandlerinterface.cpp.

300{
301 // return m_ticChromMapTrace.toTrace();
302 return m_ticChromTrace;
303}

References m_ticChromTrace.

Referenced by pappso::MsRunReader::getTicChromatogram().

◆ needPeakList()

bool pappso::MsRunReaderTicChromatogram::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 253 of file spectrumcollectionhandlerinterface.cpp.

254{
255 return true;
256}

◆ setQualifiedMassSpectrum()

void pappso::MsRunReaderTicChromatogram::setQualifiedMassSpectrum ( const QualifiedMassSpectrum & qualified_mass_spectrum)
overridevirtual

Implements pappso::SpectrumCollectionHandlerInterface.

Definition at line 260 of file spectrumcollectionhandlerinterface.cpp.

262{
263 // In this specialized reader we want to compute the total ion current
264 // chromatogram that plot the sum of all the ion intensities in the spectra as
265 // a function of the retention time.
266
267 uint spectrum_ms_level = qualified_mass_spectrum.getMsLevel();
268
269 if(spectrum_ms_level != 1)
270 return;
271
272 double sumY = qualified_mass_spectrum.getMassSpectrumSPtr()->sumY();
273
274 if(!sumY)
275 return;
276
277 double rt = qualified_mass_spectrum.getRtInMinutes();
278
279 m_ticChromTrace.push_back({rt, sumY});
280 /*
281 using Pair = std::pair<double, double>;
282 using Map = std::map<double, double>;
283 using Iterator = Map::iterator;
284
285 std::pair<Iterator, bool> res = m_ticChromMapTrace.insert(Pair(rt, sumY));
286
287 if(!res.second)
288 {
289 // One other same rt value was seen already (like in ion mobility mass
290 // spectrometry, for example). Only increment the y value.
291
292 res.first->second += sumY;
293 }
294 */
295}
@ rt
Retention time.
Definition types.h:251
unsigned int uint
Definition types.h:67

References pappso::QualifiedMassSpectrum::getMassSpectrumSPtr(), pappso::QualifiedMassSpectrum::getMsLevel(), pappso::QualifiedMassSpectrum::getRtInMinutes(), and m_ticChromTrace.

Member Data Documentation

◆ m_ticChromTrace

Trace pappso::MsRunReaderTicChromatogram::m_ticChromTrace
private

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