57 const std::map<QString, std::size_t> *nativeId2SpectrumIndexMap)
69 bool ms_run_to_read =
false;
79 ms_run_to_read =
true;
121 std::size_t spectrum_list_size = 0;
135 qDebug() <<
"spectrum count=" << spectrum_list_size;
147 std::size_t index_count = 0;
154 qDebug() <<
"The operation was cancelled. Breaking the loop.";
172 qDebug() <<
"Loading ended";
182 bool want_binary_data)
185 qDebug() << index_count <<
" " << want_binary_data;
225 ion_data.
mz = precursor.isolationWindow.getTargetMz();
226 for(
auto &selected_ion : precursor.selectedIonList)
228 ion_data.
charge = selected_ion.getChargeState();
231 ion_data.
intensity = selected_ion.getIntensity(&is_ok);
232 ion_data.
mz = selected_ion.getMz();
250 cbor_spectrum.
decodeTrace(*(mass_spectrum_sp.get()));
256 qDebug() <<
"spectrum_id.getNativeId()=" << spectrum_id.
getNativeId();
258 qDebug() <<
"mslevel=" << qualified_mass_spectrum.
getMsLevel();
267 std::numeric_limits<std::size_t>::max())
270 QObject::tr(
"ERROR in %1 spectrum index not initialised").arg(__FUNCTION__));
273 qualified_mass_spectrum);
365 QObject::tr(
"ERROR reading spectrum index %1 :\%2").arg(index_count).arg(error.
qwhat()));
369std::map<QString, pappso::cbor::mzcbor::CvParam>
372 std::map<QString, CvParam> cv_params;
void setNativeId(const QString &native_id)
std::size_t getSpectrumIndex() const
void setSpectrumIndex(std::size_t index)
const QString & getNativeId() const
virtual const QString & qwhat() const
Class representing a fully specified mass spectrum.
uint getMsLevel() const
Get the mass spectrum level.
void setPrecursorNativeId(const QString &native_id)
Set the scan native id of the precursor ion.
void appendPrecursorIonData(const PrecursorIonData &precursor_ion_data)
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
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.
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
CborStreamReader * mpa_cborReader
std::map< QString, CvParam > getCvParamsMap()
read the array containing cvParams to give accessions and values
void setMsRunId(const MsRunIdCstSPtr &msrun_id)
virtual ~MzcborSpectrumCollectionReader()
SpectrumCollectionHandlerInterface & m_SpectrumCollectionHandlerInterface
void readSpectrum(std::size_t index_count, bool want_binary_data)
read each spectrum in the targeted msrun (msrunId)
MzcborSpectrumCollectionReader(const MsRunReadConfig &config, SpectrumCollectionHandlerInterface &handler)
void setNativeId2SpectrumIndexMapPtr(const std::map< QString, std::size_t > *nativeId2SpectrumIndexMap)
MsRunIdCstSPtr mcsp_msRunId
void readSpectrumListAndLeave()
only the spectrum list of targeted msrun, then stop parsing
const std::map< QString, std::size_t > * mp_nativeId2SpectrumIndexMap
std::map< QString, CvParam > readScan()
virtual void readMsrun() override
read only the targeted msrun
const MsRunReadConfig & m_msRunReadConfig
read mzcbor for spectrum collection handler
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
PSI spectrum object for mzML/mzCBOR.
std::vector< Precursor > precursorList
void fromCbor(CborStreamReader &reader, bool want_binary_data)
fill the structure reading data from a CBOR stream
double getRtInSeconds() const
void decodeTrace(pappso::Trace &trace) const
std::vector< BinaryDataArray > binaryDataArrayList
std::size_t defaultArrayLength