34 #include "../../pappsomspp/exception/exceptionnotfound.h"
38 qRegisterMetaType<pappso::MsRunReaderSPtr>(
"pappso::MsRunReaderSPtr");
56 [maybe_unused]] std::size_t size)
73 unsigned int ms_level)
const
91 unsigned int ms_level,
bool want_peak_list)
118 unsigned int ms_level = qspectrum.
getMsLevel();
143 unsigned long total = 0;
176 QStringList native_id_list =
178 if(native_id_list.size() < 2)
184 std::size_t scan_number = native_id_list.back().toULong();
188 qDebug() <<
"scan number " << scan_number <<
"=>"
195 std::size_t scan_number)
const
205 QObject::tr(
"scan number %1 not found").arg(scan_number));
208 std::size_t index = it->second;
214 QObject::tr(
"scan number %1 found multiple times").arg(scan_number));
225 : mcsp_msRunId(other.mcsp_msRunId)
265 .arg(error.
qwhat()));
271 .arg(error.
qwhat()));
std::size_t getSpectrumIndex() const
const QString & getNativeId() const
provides a multimap to find quickly spectrum index from scan number
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum) override
std::size_t getSpectrumIndexFromScanNumber(std::size_t scan_number) const
std::multimap< std::size_t, std::size_t > m_mmap_scan2index
virtual ~MsRunReaderScanNumberMultiMap()
MsRunReaderScanNumberMultiMap()
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
MsRunIdCstSPtr mcsp_msRunId
MsRunReaderScanNumberMultiMap * mpa_multiMapScanNumber
virtual bool hasScanNumbers() const
tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided func...
virtual std::size_t scanNumber2SpectrumIndex(std::size_t scan_number)
if possible, converts a scan number into a spectrum index This is a convenient function to help trans...
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler)=0
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
MsRunReader(MsRunIdCstSPtr &ms_run_id)
const MsRunIdCstSPtr & getMsRunId() const
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum) override
unsigned long getTotalCount() const
virtual void loadingEnded() override
std::vector< unsigned long > m_countMsLevelSpectrum
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
unsigned long getMsLevelCount(unsigned int ms_level) const
virtual const QString & qwhat() const
Class representing a fully specified mass spectrum.
uint getMsLevel() const
Get the mass spectrum level.
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
virtual bool shouldStop()
virtual bool isReadAhead() const
tells if we want to read ahead spectrum
virtual bool needPeakList() const =0
tells if we need the peak list (if we want the binary data) for each spectrum
virtual void loadingEnded()
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 setReadAhead(bool is_read_ahead) final
use threads to read a spectrum by batch of batch_size
virtual void setNeedMsLevelPeakList(unsigned int ms_level, bool want_peak_list) final
tells if we need the peak list given
std::vector< bool > m_needPeakListByMsLevel
virtual void spectrumListHasSize(std::size_t size)
int msRunReaderSPtrMetaTypeId
base interface to read MSrun files
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::shared_ptr< const MsRunId > MsRunIdCstSPtr