Loading...
Searching...
No Matches
mzcborspectrumcollectionreader.h
Go to the documentation of this file.
/**
* \file pappsomspp/core/processing/cbor/mzcbor/mzcborspectrumcollectionreader.h
* \date 22/11/2025
* \author Olivier Langella
* \brief read mzcbor for spectrum collection handler
*/
/*******************************************************************************
* Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of PAPPSOms-tools.
*
* PAPPSOms-tools is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms-tools is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "pappsomspp/core/processing/cbor/mzcbor/mzcborreaderbase.h"
#include "pappsomspp/core/msrun/spectrumcollectionhandlerinterface.h"
#include "pappsomspp/core/msrun/msrunreadconfig.h"
#include "pappsomspp/core/msrun/msrunid.h"
namespace pappso
{
namespace cbor
{
namespace mzcbor
{
/**
* @todo write docs
*/
class PMSPP_LIB_DECL MzcborSpectrumCollectionReader : public MzcborReaderBase
{
public:
/**
* Default constructor
*/
MzcborSpectrumCollectionReader(const MsRunReadConfig &config,
SpectrumCollectionHandlerInterface &handler);
/**
* Destructor
*/
virtual ~MzcborSpectrumCollectionReader();
void setMsRunId(const MsRunIdCstSPtr &msrun_id);
void
setNativeId2SpectrumIndexMapPtr(const std::map<QString, std::size_t> *nativeId2SpectrumIndexMap);
protected:
/** @brief read only the targeted msrun
*/
virtual void readMsrun() override;
/** @brief only the spectrum list of targeted msrun, then stop parsing
*/
void readSpectrumListAndLeave();
/** @brief read each spectrum in the targeted msrun (msrunId)
*/
void readSpectrum(std::size_t index_count, bool want_binary_data);
std::map<QString, CvParam> readScan();
private:
const MsRunReadConfig &m_msRunReadConfig;
SpectrumCollectionHandlerInterface &m_SpectrumCollectionHandlerInterface;
MsRunIdCstSPtr mcsp_msRunId;
QString m_xmlMzMlRunId;
const std::map<QString, std::size_t> *mp_nativeId2SpectrumIndexMap = nullptr;
};
} // namespace mzcbor
} // namespace cbor
} // namespace pappso
pappso::MsRunReadConfig
Definition msrunreadconfig.h:62
pappso::SpectrumCollectionHandlerInterface
interface to collect spectrums from the MsRunReader class
Definition spectrumcollectionhandlerinterface.h:52
pappso::cbor::mzcbor::MzcborReaderBase::MzcborReaderBase
MzcborReaderBase()
Definition mzcborreaderbase.cpp:31
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::setMsRunId
void setMsRunId(const MsRunIdCstSPtr &msrun_id)
Definition mzcborspectrumcollectionreader.cpp:49
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::m_SpectrumCollectionHandlerInterface
SpectrumCollectionHandlerInterface & m_SpectrumCollectionHandlerInterface
Definition mzcborspectrumcollectionreader.h:82
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::readSpectrum
void readSpectrum(std::size_t index_count, bool want_binary_data)
read each spectrum in the targeted msrun (msrunId)
Definition mzcborspectrumcollectionreader.cpp:181
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::MzcborSpectrumCollectionReader
MzcborSpectrumCollectionReader(const MsRunReadConfig &config, SpectrumCollectionHandlerInterface &handler)
Definition mzcborspectrumcollectionreader.cpp:36
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::setNativeId2SpectrumIndexMapPtr
void setNativeId2SpectrumIndexMapPtr(const std::map< QString, std::size_t > *nativeId2SpectrumIndexMap)
Definition mzcborspectrumcollectionreader.cpp:56
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::mcsp_msRunId
MsRunIdCstSPtr mcsp_msRunId
Definition mzcborspectrumcollectionreader.h:83
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::readSpectrumListAndLeave
void readSpectrumListAndLeave()
only the spectrum list of targeted msrun, then stop parsing
Definition mzcborspectrumcollectionreader.cpp:103
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::mp_nativeId2SpectrumIndexMap
const std::map< QString, std::size_t > * mp_nativeId2SpectrumIndexMap
Definition mzcborspectrumcollectionreader.h:86
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::m_xmlMzMlRunId
QString m_xmlMzMlRunId
Definition mzcborspectrumcollectionreader.h:84
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::readScan
std::map< QString, CvParam > readScan()
Definition mzcborspectrumcollectionreader.cpp:370
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::readMsrun
virtual void readMsrun() override
read only the targeted msrun
Definition mzcborspectrumcollectionreader.cpp:64
pappso::cbor::mzcbor::MzcborSpectrumCollectionReader::m_msRunReadConfig
const MsRunReadConfig & m_msRunReadConfig
Definition mzcborspectrumcollectionreader.h:81
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
msrunid.h
msrunreadconfig.h
mzcborreaderbase.h
read mzcbor stream or file
pappso::cbor::mzcbor
Definition binarydataarray.h:41
pappso::cbor
Definition cborstreamreader.cpp:35
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46
spectrumcollectionhandlerinterface.h
base interface to read MSrun files