Loading...
Searching...
No Matches
precursorparser.h
Go to the documentation of this file.
/**
* \file pappsomspp/masschroq/input/precursorparser.h
* \date 25/09/2024
* \author Olivier Langella
* \brief read presurcors in ms run files for MassChroqLight
*/
/*******************************************************************************
* Copyright (c) 2024 Olivier Langella
*<Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of MassChroQ.
*
* MassChroQ 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.
*
* MassChroQ 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 MassChroQ. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "pappsomspp/core/msrun/msrunreader.h"
#include "../precursor.h"
namespace pappso::masschroq
{
/**
* @todo write docs
*/
class PrecursorParser : public pappso::SpectrumCollectionHandlerInterface
{
public:
public:
PrecursorParser(pappso::MsRunReaderCstSPtr msrun_reader);
virtual ~PrecursorParser();
virtual void setQualifiedMassSpectrum(
const pappso::QualifiedMassSpectrum &qspectrum) override;
virtual bool needPeakList() const override;
virtual bool isReadAhead() const override;
const PrecursorSp &
getPrecursorSPtrBySpectrumIndex(std::size_t spectrum_index) const;
const PrecursorSp &
getPrecursorSPtrByScanNumber(std::size_t spectrum_index) const;
private:
/// map precursor to its scan number as parsed in the xml file of this msrun
void mapScanNumberPrecursor(std::size_t scan_num, PrecursorSp precursor);
/** @brief map spectrum index to precursor
* new modern method to replace obsolete scan number
*/
void mapSpectrumIndexToPrecursor(std::size_t spectrum_index,
PrecursorSp precursor);
private:
pappso::MsRunReaderCstSPtr msp_msrunReader;
std::map<std::size_t, PrecursorSp> m_scanNumber2PrecursorMap;
std::map<std::size_t, PrecursorSp> m_spectrumIndex2PrecursorMap;
};
} // namespace mcql
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition qualifiedmassspectrum.h:99
pappso::SpectrumCollectionHandlerInterface
interface to collect spectrums from the MsRunReader class
Definition spectrumcollectionhandlerinterface.h:52
pappso::masschroq::PrecursorParser::getPrecursorSPtrBySpectrumIndex
const PrecursorSp & getPrecursorSPtrBySpectrumIndex(std::size_t spectrum_index) const
Definition precursorparser.cpp:143
pappso::masschroq::PrecursorParser::mapSpectrumIndexToPrecursor
void mapSpectrumIndexToPrecursor(std::size_t spectrum_index, PrecursorSp precursor)
map spectrum index to precursor new modern method to replace obsolete scan number
Definition precursorparser.cpp:125
pappso::masschroq::PrecursorParser::m_scanNumber2PrecursorMap
std::map< std::size_t, PrecursorSp > m_scanNumber2PrecursorMap
Definition precursorparser.h:73
pappso::masschroq::PrecursorParser::needPeakList
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
Definition precursorparser.cpp:46
pappso::masschroq::PrecursorParser::mapScanNumberPrecursor
void mapScanNumberPrecursor(std::size_t scan_num, PrecursorSp precursor)
map precursor to its scan number as parsed in the xml file of this msrun
Definition precursorparser.cpp:111
pappso::masschroq::PrecursorParser::m_spectrumIndex2PrecursorMap
std::map< std::size_t, PrecursorSp > m_spectrumIndex2PrecursorMap
Definition precursorparser.h:74
pappso::masschroq::PrecursorParser::~PrecursorParser
virtual ~PrecursorParser()
Definition precursorparser.cpp:41
pappso::masschroq::PrecursorParser::setQualifiedMassSpectrum
virtual void setQualifiedMassSpectrum(const pappso::QualifiedMassSpectrum &qspectrum) override
Definition precursorparser.cpp:51
pappso::masschroq::PrecursorParser::isReadAhead
virtual bool isReadAhead() const override
tells if we want to read ahead spectrum
Definition precursorparser.cpp:105
pappso::masschroq::PrecursorParser::getPrecursorSPtrByScanNumber
const PrecursorSp & getPrecursorSPtrByScanNumber(std::size_t spectrum_index) const
Definition precursorparser.cpp:160
pappso::masschroq::PrecursorParser::PrecursorParser
PrecursorParser(pappso::MsRunReaderCstSPtr msrun_reader)
Definition precursorparser.cpp:35
pappso::masschroq::PrecursorParser::msp_msrunReader
pappso::MsRunReaderCstSPtr msp_msrunReader
Definition precursorparser.h:71
precursor.h
msrunreader.h
pappso::masschroq
Definition alignmentmethod.h:38
pappso::masschroq::PrecursorSp
std::shared_ptr< Precursor > PrecursorSp
Definition precursor.h:39
pappso::MsRunReaderCstSPtr
std::shared_ptr< const MsRunReader > MsRunReaderCstSPtr
Definition msrunreader.h:58