libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
mzcbormsrunreader.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/core/msrun/private/mzcbormsrunreader.cpp
3 * \date 21/11/2025
4 * \author Olivier Langella
5 * \brief MSrun file reader for mzcbor
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
10 *
11 * This file is part of the PAPPSOms++ library.
12 *
13 * PAPPSOms++ is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * PAPPSOms++ is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25 *
26 ******************************************************************************/
27
28
29#include "mzcbormsrunreader.h"
37
38namespace pappso
39{
41 : pappso::MsRunReader(msrun_id_csp)
42{
43 initialize();
44 qDebug();
45}
46
51
52
53const std::vector<qint64> &
59
60void
62{
63 qDebug();
64 m_cborFileInfo.setFile(mcsp_msRunId->getFileName());
65
66 if(!m_cborFileInfo.exists())
67 throw ExceptionNotFound(m_cborFileInfo.absoluteFilePath());
68
69
70 // build the index
72
73 QString str_index_file = m_cborFileInfo.absoluteFilePath();
74 QFileInfo mzcbor_index_fileinfo(str_index_file.append(".idx"));
75 if(mzcbor_index_fileinfo.exists())
76 {
77 qDebug() << "mzcbor_index_fileinfo.exists()";
78 QFile mzcbor_index_file(mzcbor_index_fileinfo.absoluteFilePath());
79 mzcbor_index_file.open(QIODevice::ReadOnly);
80
82 index_reader.readCbor(&mzcbor_index_file);
83 index_reader.close();
84 mzcbor_index_file.close();
85
86 qDebug();
87 std::vector<QString> run_id_list = index_reader.getRunIdList();
88 if(run_id_list.size() > 0)
89 {
90 std::size_t run_position = 0;
91 if(run_id_list.size() > 1)
92 {
93 std::size_t i_run = 0;
94 for(const QString &run_id : run_id_list)
95 {
96 if(run_id == getMsRunId().get()->getRunId())
97 {
98 run_position = i_run;
99 }
100 i_run++;
101 }
102 }
103
105 index_reader.getRunAndSpectrumOffsetList().at(run_position);
106
107
108 if(index_reader.getRunAndSpectrumTotalIonCountList().size() > run_position)
109 {
111 index_reader.getRunAndSpectrumTotalIonCountList().at(run_position);
112 }
113 if(index_reader.getRunAndSpectrumMsLevelList().size() > run_position)
114 {
115 m_spectrumMsLevelList = index_reader.getRunAndSpectrumMsLevelList().at(run_position);
116 }
117
118 if(index_reader.getRunAndSpectrumRtList().size() > run_position)
119 {
120 m_spectrumRtList = index_reader.getRunAndSpectrumRtList().at(run_position);
121 }
122 // qFatal() << m_spectrumTotalIonCountList.size();
123
124 std::size_t i = 0;
125 for(const QString &native_id : index_reader.getRunAndSpectrumIdList().at(run_position))
126 {
127 m_nativeId2SpectrumIndexMap.insert({native_id, i});
128 i++;
129 }
130 }
131 }
132
133 if(m_spectrumIndexPositionInFile.size() == 0)
134 {
135
136 pappso::UiMonitorVoid monitor;
137 pappso::cbor::mzcbor::MzcborBuildIndexReader mzcbor_build_index_reader(getMsRunId());
138 mzcbor_build_index_reader.readCbor(mpa_mzcborFileDevice, monitor);
139
140
141 qDebug();
142 mzcbor_build_index_reader.close();
143 // releaseDevice();
144 qDebug();
145
147 m_nativeId2SpectrumIndexMap = mzcbor_build_index_reader.getNativeId2SpectrumIndexMap();
148 }
149}
150
151bool
153{
154 if(m_nativeId2SpectrumIndexMap.size() > 0)
155 {
156 if(m_nativeId2SpectrumIndexMap.begin()->first.contains("scan="))
157 return true;
158 }
159 return false;
160}
161
162std::size_t
164{
165 if(m_scan2SpectrumIndexMap.size() == 0)
166 {
167 for(auto &index_pair : m_nativeId2SpectrumIndexMap)
168 {
169 QStringList native_id_list = index_pair.first.split("=");
170 if(native_id_list.size() < 2)
171 {
172 }
173 else
174 {
175 std::size_t scan_number = native_id_list.back().toULong();
177 std::pair<std::size_t, std::size_t>(scan_number, index_pair.second));
178 }
179 }
180 }
181
182 auto it = m_scan2SpectrumIndexMap.find(scan_number);
183
184 if(it == m_scan2SpectrumIndexMap.end())
185 {
186 throw ExceptionNotFound(QObject::tr("error reading file %1 : scan %2 not found")
187 .arg(mcsp_msRunId.get()->getFileName())
188 .arg(scan_number));
189 }
190 return it->second;
191}
192
193bool
194MzcborMsRunReader::accept(const QString &file_name [[maybe_unused]]) const
195{
196
198 QObject::tr("%1 %2 %3 not implemented").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
199}
200
201
202const OboPsiModTerm
204{
206 QObject::tr("%1 %2 %3 not implemented").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
207}
208
209bool
211{
212 if(mpa_mzcborFileDevice == nullptr)
213 {
214 mpa_mzcborFileDevice = new QFile(m_cborFileInfo.absoluteFilePath());
215 mpa_mzcborFileDevice->open(QIODevice::ReadOnly);
216 }
217 return true;
218}
219
220
221bool
223{
224 if(mpa_mzcborFileDevice != nullptr)
225 {
226 mpa_mzcborFileDevice->close();
228 mpa_mzcborFileDevice = nullptr;
229 }
230 return true;
231}
232
233
236 const pappso::QualifiedMassSpectrum &mass_spectrum, pappso::PrecisionPtr precision) const
237{
238
239 XicCoordSPtr xic_coord = std::make_shared<XicCoord>();
240
241 xic_coord.get()->rtTarget = mass_spectrum.getRtInSeconds();
242 xic_coord.get()->mzRange = MzRange(mass_spectrum.getPrecursorMz(), precision);
243 return xic_coord;
244}
245
248 pappso::PrecisionPtr precision) const
249{
250
251 pappso::cbor::mzcbor::Spectrum cbor_spectrum;
252
253 fillMzcborSpectrum(spectrum_index, cbor_spectrum, false);
254
255 XicCoordSPtr xic_coord = std::make_shared<XicCoord>();
256
257 xic_coord.get()->rtTarget = cbor_spectrum.getRtInSeconds();
258
259 bool get_mz = false;
260 if(cbor_spectrum.precursorList.size() > 0)
261 {
262
263 for(auto &precursor : cbor_spectrum.precursorList)
264 {
265 for(auto &ion : precursor.selectedIonList)
266 {
267 xic_coord.get()->mzRange = MzRange(ion.getMz(), precision);
268 get_mz = true;
269 }
270 }
271 if(!get_mz)
272 {
274 QObject::tr("precursor m/z not found for this spectrum index %1").arg(spectrum_index));
275 }
276 }
277 else
278 {
280 QObject::tr("no precursor found for this spectrum index %1").arg(spectrum_index));
281 }
282
283 return xic_coord;
284}
285
288{
289 return massSpectrumSPtr(spectrum_index);
290}
291
294{
295 MassSpectrumSPtr mass_spectrum_sp;
296 try
297 {
299 pappso::cbor::mzcbor::Spectrum cbor_spectrum;
300
301 fillMzcborSpectrum(spectrum_index, cbor_spectrum, true);
302 if(cbor_spectrum.binaryDataArrayList.size() == 2)
303 {
304 mass_spectrum_sp = std::make_shared<MassSpectrum>();
305 cbor_spectrum.decodeTrace(*(mass_spectrum_sp.get()));
306 }
307 else
308 {
310 QObject::tr("cbor_spectrum.binaryDataArrayList.size() != 2"));
311 }
312 }
313 catch(const pappso::PappsoException &pappso_error)
314 {
315 qDebug() << "Going to throw";
316
317 throw pappso::PappsoException(QObject::tr("Error reading data (massSpectrumSPtr) using the "
318 "mzcbor reader: %1")
319 .arg(pappso_error.what()));
320 }
321 return mass_spectrum_sp;
322}
323
326 bool want_binary_data) const
327{
328 qDebug();
329 try
330 {
331 pappso::cbor::mzcbor::Spectrum cbor_spectrum;
332
333 fillMzcborSpectrum(spectrum_index, cbor_spectrum, want_binary_data);
334 qDebug() << cbor_spectrum.index;
335 QualifiedMassSpectrum qualified_mass_spectrum;
336
337 MassSpectrumId spectrum_id(mcsp_msRunId, spectrum_index);
338 spectrum_id.setNativeId(cbor_spectrum.id);
339
340 spectrum_id.setSpectrumIndex(cbor_spectrum.index);
341
342 qualified_mass_spectrum.setMassSpectrumId(spectrum_id);
343 qualified_mass_spectrum.setRtInSeconds(cbor_spectrum.getRtInSeconds());
344 if(cbor_spectrum.precursorList.size() > 0)
345 {
346 qualified_mass_spectrum.setPrecursorNativeId(
347 cbor_spectrum.precursorList.at(0).spectrumRef);
348 qualified_mass_spectrum.setPrecursorSpectrumIndex(
349 m_nativeId2SpectrumIndexMap.at(cbor_spectrum.precursorList.at(0).spectrumRef));
350
351 for(auto &precursor : cbor_spectrum.precursorList)
352 {
353 for(auto &ion : precursor.selectedIonList)
354 {
355 PrecursorIonData precursor_ion_data;
356 precursor_ion_data.charge = ion.getChargeState();
357 bool is_ok;
358 precursor_ion_data.intensity = ion.getIntensity(&is_ok);
359 precursor_ion_data.mz = ion.getMz();
360 qualified_mass_spectrum.appendPrecursorIonData(precursor_ion_data);
361 }
362 }
363 }
364
365
366 qDebug();
367 qualified_mass_spectrum.setMsLevel(cbor_spectrum.getMsLevel());
368
369 qDebug();
370 qualified_mass_spectrum.setEmptyMassSpectrum(!cbor_spectrum.defaultArrayLength);
371 if(cbor_spectrum.binaryDataArrayList.size() == 2)
372 {
373 MassSpectrumSPtr mass_spectrum_sp = std::make_shared<MassSpectrum>();
374 cbor_spectrum.decodeTrace(*(mass_spectrum_sp.get()));
375 qualified_mass_spectrum.setMassSpectrumSPtr(mass_spectrum_sp);
376 }
377
378 qDebug() << "spectrum id=" << cbor_spectrum.id;
379
380 return qualified_mass_spectrum;
381 }
382
383 catch(const pappso::PappsoException &pappso_error)
384 {
385 qDebug() << "Going to throw";
386
388 QObject::tr("Error reading data (qualifiedMassSpectrum) using the "
389 "mzcbor reader: %1")
390 .arg(pappso_error.what()));
391 }
392}
393
394void
396{
397
399 QObject::tr("%1 %2 %3 not implemented").arg(__FILE__).arg(__FUNCTION__).arg(__LINE__));
400 MsRunReadConfig config;
401 std::vector<size_t> ms_levels;
402 for(std::size_t i = 1; i < 9; i++)
403 {
404 if(handler.needMsLevelPeakList(i))
405 {
406 ms_levels.push_back(i);
407 }
408 }
409 config.setMsLevels(ms_levels);
410 config.setNeedPeakList(handler.needPeakList());
411 // readSpectrumCollectionByMsLevel(reader_timeline, 1);
412
413 try
414 {
416 }
417 catch(const pappso::PappsoException &pappso_error)
418 {
419 qDebug() << "Going to throw";
420
422 QObject::tr("Error reading data (spectrum collection2) using the "
423 "mzcbor reader: %1")
424 .arg(pappso_error.what()));
425 }
426 catch(std::exception &error)
427 {
428 qDebug() << "Going to throw";
429
431 QObject::tr("Error reading data (spectrum collection) using the "
432 "mzcbor reader: %1")
433 .arg(error.what()));
434 }
435}
436
437void
440{
441 qDebug();
442 try
443 {
445 }
446 catch(const pappso::PappsoException &pappso_error)
447 {
448 qDebug() << "Going to throw";
449
451 QObject::tr("Error reading data (spectrum collection2) using the "
452 "mzcbor reader: %1")
453 .arg(pappso_error.what()));
454 }
455 catch(std::exception &error)
456 {
457 qDebug() << "Going to throw";
458
460 QObject::tr("Error reading data (spectrum collection2) using the "
461 "mzcbor reader: %1")
462 .arg(error.what()));
463 }
464}
465
466void
468 SpectrumCollectionHandlerInterface &handler, unsigned int ms_level)
469{
470 MsRunReadConfig config;
471 config.setMsLevels({ms_level});
472 config.setNeedPeakList(handler.needPeakList());
473 // readSpectrumCollectionByMsLevel(reader_timeline, 1);
474 readSpectrumCollection2(config, handler);
475}
476
477std::size_t
482
483std::size_t
485 const QString &spectrum_identifier)
486{
487 auto it = m_nativeId2SpectrumIndexMap.find(spectrum_identifier);
488 if(it == m_nativeId2SpectrumIndexMap.end())
489 {
491 QObject::tr("spectrum identifier %1 not found").arg(spectrum_identifier));
492 }
493 return it->second;
494}
495
496
497void
500{
501 // acquireDevice();
502 try
503 {
505 pappso::UiMonitorVoid monitor;
506 pappso::cbor::mzcbor::MzcborSpectrumCollectionReader mzcbor_spectrum_collection_reader(
507 config, handler);
508 mzcbor_spectrum_collection_reader.setMsRunId(getMsRunId());
509 mzcbor_spectrum_collection_reader.setNativeId2SpectrumIndexMapPtr(
511 mzcbor_spectrum_collection_reader.readCbor(mpa_mzcborFileDevice, monitor);
512
513
514 qDebug();
515 mzcbor_spectrum_collection_reader.close();
516 qDebug();
517 }
518 catch(const pappso::PappsoException &pappso_err)
519 {
521 QObject::tr("ERROR in MzcborMsRunReader::readSpectrumCollectionWithMsrunReadConfig:\n%1")
522 .arg(pappso_err.qwhat()));
523 }
524 // End of
525 // for(std::size_t iter = 0; iter < spectrum_list_size; iter++)
526
527 // Now let the loading handler know that the loading of the data has ended.
528 // The handler might need this "signal" to perform additional tasks or to
529 // cleanup cruft.
530}
531
532
533void
534MzcborMsRunReader::fillMzcborSpectrum(std::size_t spectrum_index,
536 bool want_binary_data) const
537{
538
539 if(spectrum_index >= m_spectrumIndexPositionInFile.size())
540 {
542 QObject::tr("spectrum index %1 not found").arg(spectrum_index));
543 }
544 if(mpa_mzcborFileDevice == nullptr)
545 {
546
548 QObject::tr("mzCBOR file device is not ready, use acquireDevice() before access"));
549 }
550 qDebug() << spectrum_index << " " << m_spectrumIndexPositionInFile[spectrum_index];
551
552
553 // qDebug() << spectrum_index << " " << m_spectrumIndexPositionInFile[spectrum_index-1];
554
555
556 if(mpa_mzcborFileDevice->seek(m_spectrumIndexPositionInFile[spectrum_index]))
557 {
559 cbor_stream_reader.setDevice(mpa_mzcborFileDevice);
560
561
562 try
563 {
564 spectrum.fromCbor(cbor_stream_reader, want_binary_data);
565 }
566 catch(const pappso::PappsoException &error)
567 {
568
569 throw pappso::PappsoException(QObject::tr("ERROR reading spectrum %1 cbor:\n%2")
570 .arg(spectrum_index)
571 .arg(error.qwhat()));
572 }
573 // cbor_stream_reader.leaveContainer();
574
575 if(spectrum.id.isEmpty())
576 {
578 QObject::tr("ERROR reading spectrum %1 cbor:\nspectrum not found").arg(spectrum_index));
579 }
580 }
581 else
582 {
584 QObject::tr("ERROR reading spectrum %1 cbor:\nseek failed").arg(spectrum_index));
585 }
586 // mzcbor_file.close();
587}
588
589
590Trace
592{
593 qDebug() << m_spectrumMsLevelList.size() << " " << m_spectrumTotalIonCountList.size();
594 Trace chromatogram;
595 if((m_spectrumTotalIonCountList.size() > 0) &&
597 {
598 for(std::size_t i = 0; i < m_spectrumTotalIonCountList.size(); i++)
599 {
600 if(m_spectrumMsLevelList.at(i) == 1)
601 {
602 chromatogram.push_back(
603 {m_spectrumRtList.at(i), (double)m_spectrumTotalIonCountList.at(i)});
604 }
605 }
606 }
607 else
608 {
610 }
611 return chromatogram;
612}
613std::vector<double>
615{
616 qDebug();
617 std::vector<double> time_line;
618 if((m_spectrumRtList.size() > 0) && (m_spectrumMsLevelList.size() == m_spectrumRtList.size()))
619 {
620 for(std::size_t i = 0; i < m_spectrumRtList.size(); i++)
621 {
622 if(m_spectrumMsLevelList.at(i) == 1)
623 {
624 time_line.push_back(m_spectrumRtList.at(i));
625 }
626 }
627 }
628 else
629 {
631 }
632 return time_line;
633}
634
635std::shared_ptr<pappso::cbor::mzcbor::Spectrum>
636MzcborMsRunReader::getMzcborSpectrumSp(std::size_t spectrum_index, bool want_binary_data) const
637{
638 std::shared_ptr<pappso::cbor::mzcbor::Spectrum> cbor_spectrum_sp =
639 std::make_shared<pappso::cbor::mzcbor::Spectrum>();
640
641 fillMzcborSpectrum(spectrum_index, *cbor_spectrum_sp, want_binary_data);
642
643 return cbor_spectrum_sp;
644}
645
646} // namespace pappso
void setNativeId(const QString &native_id)
void setSpectrumIndex(std::size_t index)
void setNeedPeakList(bool need_peak_list)
void setMsLevels(std::vector< std::size_t > ms_levels)
MsRunIdCstSPtr mcsp_msRunId
MsRunReader(const MsRunIdCstSPtr &ms_run_id)
virtual std::vector< double > getRetentionTimeLine()
retention timeline get retention times along the MSrun in seconds
virtual Trace getTicChromatogram()
get a TIC chromatogram
const MsRunIdCstSPtr & getMsRunId() const
virtual std::vector< double > getRetentionTimeLine() override
retention timeline get retention times along the MSrun in seconds
const std::vector< qint64 > & getSpectrumIndexPositionInFile() const
virtual pappso::XicCoordSPtr newXicCoordSPtrFromSpectrumIndex(std::size_t spectrum_index, pappso::PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum index
std::map< QString, std::size_t > m_nativeId2SpectrumIndexMap
virtual void readSpectrumCollection2(const MsRunReadConfig &config, SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
std::vector< qint64 > m_spectrumTotalIonCountList
virtual pappso::XicCoordSPtr newXicCoordSPtrFromQualifiedMassSpectrum(const pappso::QualifiedMassSpectrum &mass_spectrum, pappso::PrecisionPtr precision) const override
get a xic coordinate object from a given spectrum
virtual bool hasScanNumbers() const override
tells if spectra can be accessed using scan numbers by default, it returns false. Only overrided func...
void readSpectrumCollectionWithMsrunReadConfig(const MsRunReadConfig &config, SpectrumCollectionHandlerInterface &handler)
virtual const OboPsiModTerm getOboPsiModTermInstrumentModelName() const override
get OboPsiModTerm corresponding to the instrument model name child of : [Term] id: MS:1000031 name: i...
virtual Trace getTicChromatogram() override
get a TIC chromatogram
virtual bool releaseDevice() override
release data back end device if a the data back end is released, the developper has to use acquireDev...
virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler
std::vector< qint64 > m_spectrumIndexPositionInFile
virtual std::size_t spectrumStringIdentifier2SpectrumIndex(const QString &spectrum_identifier) override
if possible, get the spectrum index given a string identifier throw a not found exception if spectrum...
std::vector< double > m_spectrumRtList
virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override
virtual std::size_t scanNumber2SpectrumIndex(std::size_t scan_number) override
if possible, converts a scan number into a spectrum index This is a convenient function to help trans...
std::map< std::size_t, std::size_t > m_scan2SpectrumIndexMap
std::shared_ptr< pappso::cbor::mzcbor::Spectrum > getMzcborSpectrumSp(std::size_t spectrum_index, bool want_binary_data) const
get spectrum mzML element
virtual std::size_t spectrumListSize() const override
get the totat number of spectrum conained in the MSrun data file
MzcborMsRunReader(MsRunIdCstSPtr &msrun_id_csp)
virtual void fillMzcborSpectrum(std::size_t spectrum_index, pappso::cbor::mzcbor::Spectrum &spectrum, bool want_binary_data) const
virtual void readSpectrumCollectionByMsLevel(SpectrumCollectionHandlerInterface &handler, unsigned int ms_level) override
function to visit an MsRunReader and get each Spectrum in a spectrum collection handler by Ms Levels
virtual QualifiedMassSpectrum qualifiedMassSpectrum(std::size_t spectrum_index, bool want_binary_data=true) const override
get a QualifiedMassSpectrum class given its scan number
virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override
get a MassSpectrumSPtr class given its spectrum index
std::vector< std::uint8_t > m_spectrumMsLevelList
virtual bool acquireDevice() override
acquire data back end device
virtual bool accept(const QString &file_name) const override
tells if the reader is able to handle this file must be implemented by private MS run reader,...
virtual void initialize() override
const char * what() const noexcept override
virtual const QString & qwhat() const
Class representing a fully specified mass spectrum.
void setPrecursorNativeId(const QString &native_id)
Set the scan native id of the precursor ion.
void appendPrecursorIonData(const PrecursorIonData &precursor_ion_data)
void setMassSpectrumId(const MassSpectrumId &iD)
Set the MassSpectrumId.
void setMsLevel(uint ms_level)
Set the mass spectrum level.
void setPrecursorSpectrumIndex(std::size_t precursor_scan_num)
Set the scan number of the precursor ion.
pappso_double getPrecursorMz(bool *ok=nullptr) const
get precursor mz
void setMassSpectrumSPtr(MassSpectrumSPtr massSpectrum)
Set the MassSpectrumSPtr.
void setRtInSeconds(pappso_double rt)
Set the retention time in seconds.
pappso_double getRtInSeconds() const
Get the retention time in seconds.
void setEmptyMassSpectrum(bool is_empty_mass_spectrum)
interface to collect spectrums from the MsRunReader class
virtual bool needPeakList() const =0
tells if we need the peak list (if we want the binary data) for each spectrum
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
A simple container of DataPoint instances.
Definition trace.h:152
simple override of the raw QCborStreamReader This adds convenient functions to put CBOR data into C++...
const std::vector< qint64 > & getSpectrumIndexPositionInFile() const
virtual void readCbor(QFile *cborp, pappso::UiMonitorInterface &monitor) override
read mzCBOR file
const std::map< QString, std::size_t > & getNativeId2SpectrumIndexMap() const
const std::vector< std::vector< qint64 > > & getRunAndSpectrumTotalIonCountList() const
virtual void close()
convenient function to clean pointer before leaving
const std::vector< std::vector< std::uint8_t > > & getRunAndSpectrumMsLevelList() const
const std::vector< std::vector< qint64 > > & getRunAndSpectrumOffsetList() const
const std::vector< std::vector< QString > > & getRunAndSpectrumIdList() const
const std::vector< QString > & getRunIdList() const
const std::vector< std::vector< double > > & getRunAndSpectrumRtList() const
virtual void readCbor(QFile *cborp, pappso::UiMonitorInterface &monitor)
read mzCBOR file
virtual void close()
convenient function to clean pointer before leaving
void setNativeId2SpectrumIndexMapPtr(const std::map< QString, std::size_t > *nativeId2SpectrumIndexMap)
read mzcbor to build an index
read mzcbor index file
MSrun file reader for mzcbor.
read mzcbor for spectrum collection handler
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
std::shared_ptr< XicCoord > XicCoordSPtr
Definition xiccoord.h:44
double rtTarget
the targeted retention time to extract around intended in seconds, and related to one msrun....
Definition xiccoord.h:131
MzRange mzRange
the mass to extract
Definition xiccoord.h:125
std::vector< Precursor > precursorList
Definition spectrum.h:89
void fromCbor(CborStreamReader &reader, bool want_binary_data)
fill the structure reading data from a CBOR stream
Definition spectrum.cpp:43
void decodeTrace(pappso::Trace &trace) const
Definition spectrum.cpp:356
std::vector< BinaryDataArray > binaryDataArrayList
Definition spectrum.h:90