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

provides a multimap to find quickly spectrum index from scan number More...

`#include <spectrumcollectionhandlerinterface.h>`

Inheritance diagram for pappso::MsRunReaderScanNumberMultiMap:

## Public Member Functions

| MsRunReaderScanNumberMultiMap ()
virtual | ~MsRunReaderScanNumberMultiMap ()
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
std::size_t | getSpectrumIndexFromScanNumber (std::size_t scan_number) 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

std::multimap< std::size_t, std::size_t > | m_mmap_scan2index

## Detailed Description

provides a multimap to find quickly spectrum index from scan number

Definition at line 131 of file spectrumcollectionhandlerinterface.h.

## Constructor & Destructor Documentation

## MsRunReaderScanNumberMultiMap()

pappso::MsRunReaderScanNumberMultiMap::MsRunReaderScanNumberMultiMap | ( |  | ) |

Definition at line 149 of file spectrumcollectionhandlerinterface.cpp.

{
// qDebug();
}

## ~MsRunReaderScanNumberMultiMap()

pappso::MsRunReaderScanNumberMultiMap::~MsRunReaderScanNumberMultiMap | ( |  | ) |

virtual

Definition at line 155 of file spectrumcollectionhandlerinterface.cpp.

{
// qDebug();
}

## Member Function Documentation

## getSpectrumIndexFromScanNumber()

std::size_t pappso::MsRunReaderScanNumberMultiMap::getSpectrumIndexFromScanNumber | ( | std::size_t | scan_number | ) | const

Definition at line 191 of file spectrumcollectionhandlerinterface.cpp.

{
qDebug() << m_mmap_scan2index.size();
auto it = m_mmap_scan2index.find(scan_number);
if(it == m_mmap_scan2index.end())
{
throw ExceptionNotFound(
QObject::tr("scan number %1 not found").arg(scan_number));
}
std::size_t index = it->second;
it++;
if((it != m_mmap_scan2index.end()) && (it->first == scan_number))
{
throw PappsoException(
QObject::tr("scan number %1 found multiple times").arg(scan_number));
}
return index;
}
pappso::MsRunReaderScanNumberMultiMap::m_mmap_scan2index
std::multimap< std::size_t, std::size_t > m_mmap_scan2index
Definition spectrumcollectionhandlerinterface.h:135

References m_mmap_scan2index.

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

## needPeakList()

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

{
return false;
}

## setQualifiedMassSpectrum()

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

override virtual

Implements pappso::SpectrumCollectionHandlerInterface.

Definition at line 168 of file spectrumcollectionhandlerinterface.cpp.

{
qDebug() << " " << qspectrum.getMassSpectrumId().getNativeId();
QStringList native_id_list =
qspectrum.getMassSpectrumId().getNativeId().split("=");
if(native_id_list.size() < 2)
{
return;
}
else
{
std::size_t scan_number = native_id_list.back().toULong();
m_mmap_scan2index.insert(std::pair<std::size_t, std::size_t>(
scan_number, qspectrum.getMassSpectrumId().getSpectrumIndex()));
qDebug() << "scan number " << scan_number << "=>"
<< qspectrum.getMassSpectrumId().getSpectrumIndex();
}
}

References pappso::QualifiedMassSpectrum::getMassSpectrumId(), pappso::MassSpectrumId::getNativeId(), pappso::MassSpectrumId::getSpectrumIndex(), and m_mmap_scan2index.

## Member Data Documentation

## m_mmap_scan2index

std::multimap<std::size_t, std::size_t> pappso::MsRunReaderScanNumberMultiMap::m_mmap_scan2index

private

Definition at line 135 of file spectrumcollectionhandlerinterface.h.

Referenced by getSpectrumIndexFromScanNumber(), and setQualifiedMassSpectrum().

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

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