32 #include "../../pappsomspp/exception/exceptionnotfound.h"
36 qRegisterMetaType<pappso::MsRunReaderSPtr>(
"pappso::MsRunReaderSPtr");
54 [[maybe_unused]] std::size_t size)
71 unsigned int ms_level)
const
89 unsigned int ms_level,
bool want_peak_list)
121 unsigned int ms_level = qspectrum.
getMsLevel();
146 unsigned long total = 0;
179 QStringList native_id_list =
181 if(native_id_list.size() < 2)
187 std::size_t scan_number = native_id_list.back().toULong();
191 qDebug() <<
"scan number " << scan_number <<
"=>"
198 std::size_t scan_number)
const
208 QObject::tr(
"scan number %1 not found").arg(scan_number));
211 std::size_t index = it->second;
217 QObject::tr(
"scan number %1 found multiple times").arg(scan_number));
251 const std::vector<double> &
263 : mcsp_msRunId(other.mcsp_msRunId)
316 .arg(error.
qwhat()));
322 .arg(error.
qwhat()));
352 .arg(error.
qwhat()));
358 .arg(error.
qwhat()));
381 .arg(error.
qwhat()));
387 .arg(error.
qwhat()));
419 if(spectrum_ms_level != 1)
429 using Pair = std::pair<double, double>;
430 using Map = std::map<double, double>;
431 using Iterator = Map::iterator;
440 res.first->second += sumY;
std::size_t getSpectrumIndex() const
const QString & getNativeId() const
collect retention times along MS run
const std::vector< double > & getRetentionTimeLine() const
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum) override
virtual ~MsRunReaderRetentionTimeLine()
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
MsRunReaderRetentionTimeLine()
std::vector< double > m_retention_time_list
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()
calculate a TIC chromatogram
virtual ~MsRunReaderTicChromatogram()
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &qualified_mass_spectrum) override
MapTrace m_ticChromMapTrace
MsRunReaderTicChromatogram()
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
Trace getTicChromatogram() const
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...
void setMonoThread(bool is_mono_thread)
set only one is_mono_thread to true
virtual std::vector< double > getRetentionTimeLine()
retention timeline get retention times along the MSrun in seconds
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
bool isMonoThread() const
virtual Trace getTicChromatogram()
get a TIC chromatogram
MsRunReader(MsRunIdCstSPtr &ms_run_id)
virtual void readSpectrumCollectionByMsLevel(SpectrumCollectionHandlerInterface &handler, unsigned int ms_level)=0
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler by Ms Levels
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.
pappso_double getRtInMinutes() const
Get the retention time in minutes.
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
MassSpectrumSPtr getMassSpectrumSPtr() const
Get the MassSpectrumSPtr.
pappso_double getRtInSeconds() const
Get the retention time in seconds.
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)
A simple container of DataPoint instances.
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