58 const std::map<QString, std::size_t> *nativeId2SpectrumIndexMap)
70 bool ms_run_to_read =
false;
80 ms_run_to_read =
true;
122 std::size_t spectrum_list_size = 0;
136 qDebug() <<
"spectrum count=" << spectrum_list_size;
148 std::size_t index_count = 0;
155 qDebug() <<
"The operation was cancelled. Breaking the loop.";
173 qDebug() <<
"Loading ended";
183 bool want_binary_data)
186 qDebug() << index_count <<
" " << want_binary_data;
234 precursor.isolationWindow.getTargetMz());
237 auto it = precursor.isolationWindow.cvParamMap.find(
"MS:1000828");
239 if(it == precursor.isolationWindow.cvParamMap.end())
242 "isolation window lower offset MS:1000828 not found in cvParam map"));
246 it->second.valueDouble);
249 it = precursor.isolationWindow.cvParamMap.find(
"MS:1000829");
251 if(it == precursor.isolationWindow.cvParamMap.end())
254 "isolation window upper offset MS:1000829 not found in cvParam map"));
259 it->second.valueDouble);
271 ion_data.
mz = precursor.isolationWindow.getTargetMz();
272 for(
auto &selected_ion : precursor.selectedIonList)
274 ion_data.
charge = selected_ion.getChargeState();
277 ion_data.
intensity = selected_ion.getIntensity(&is_ok);
278 ion_data.
mz = selected_ion.getMz();
296 cbor_spectrum.
decodeTrace(*(mass_spectrum_sp.get()));
302 qDebug() <<
"spectrum_id.getNativeId()=" << spectrum_id.
getNativeId();
304 qDebug() <<
"mslevel=" << qualified_mass_spectrum.
getMsLevel();
313 std::numeric_limits<std::size_t>::max())
316 QObject::tr(
"ERROR in %1 spectrum index not initialised").arg(__FUNCTION__));
319 qualified_mass_spectrum);
411 QObject::tr(
"ERROR reading spectrum index %1 :\%2").arg(index_count).arg(error.
qwhat()));
415std::map<QString, pappso::cbor::mzcbor::CvParam>
418 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 setParameterValue(QualifiedMassSpectrumParameter parameter, const QVariant &value)
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
@ IsolationWindowTargetMz
Isolation m/z value isolation window target m/z (thomson).
@ IsolationWindowUpperOffset
isolation window upper offset (thomson)
@ IsolationWindowLowerOffset
isolation window lower offset (thomson)
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