libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
precursorparser.h
Go to the documentation of this file.
1
2/**
3 * \file pappsomspp/masschroq/input/precursorparser.h
4 * \date 25/09/2024
5 * \author Olivier Langella
6 * \brief read presurcors in ms run files for MassChroqLight
7 */
8
9/*******************************************************************************
10 * Copyright (c) 2024 Olivier Langella
11 *<Olivier.Langella@universite-paris-saclay.fr>.
12 *
13 * This file is part of MassChroQ.
14 *
15 * MassChroQ is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * MassChroQ is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with MassChroQ. If not, see <http://www.gnu.org/licenses/>.
27 *
28 ******************************************************************************/
29
30#pragma once
31
33#include "../precursor.h"
34namespace pappso::masschroq
35{
36
37/**
38 * @todo write docs
39 */
41{
42 public:
43 public:
45
46 virtual ~PrecursorParser();
47
48 virtual void setQualifiedMassSpectrum(
49 const pappso::QualifiedMassSpectrum &qspectrum) override;
50 virtual bool needPeakList() const override;
51 virtual bool isReadAhead() const override;
52
53 const PrecursorSp &
54 getPrecursorSPtrBySpectrumIndex(std::size_t spectrum_index) const;
55 const PrecursorSp &
56 getPrecursorSPtrByScanNumber(std::size_t spectrum_index) const;
57
58
59 private:
60 /// map precursor to its scan number as parsed in the xml file of this msrun
61 void mapScanNumberPrecursor(std::size_t scan_num, PrecursorSp precursor);
62
63 /** @brief map spectrum index to precursor
64 * new modern method to replace obsolete scan number
65 */
66 void mapSpectrumIndexToPrecursor(std::size_t spectrum_index,
67 PrecursorSp precursor);
68
69
70 private:
72
73 std::map<std::size_t, PrecursorSp> m_scanNumber2PrecursorMap;
74 std::map<std::size_t, PrecursorSp> m_spectrumIndex2PrecursorMap;
75};
76} // namespace mcql
Class representing a fully specified mass spectrum.
interface to collect spectrums from the MsRunReader class
const PrecursorSp & getPrecursorSPtrBySpectrumIndex(std::size_t spectrum_index) const
void mapSpectrumIndexToPrecursor(std::size_t spectrum_index, PrecursorSp precursor)
map spectrum index to precursor new modern method to replace obsolete scan number
std::map< std::size_t, PrecursorSp > m_scanNumber2PrecursorMap
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
void mapScanNumberPrecursor(std::size_t scan_num, PrecursorSp precursor)
map precursor to its scan number as parsed in the xml file of this msrun
std::map< std::size_t, PrecursorSp > m_spectrumIndex2PrecursorMap
virtual void setQualifiedMassSpectrum(const pappso::QualifiedMassSpectrum &qspectrum) override
virtual bool isReadAhead() const override
tells if we want to read ahead spectrum
const PrecursorSp & getPrecursorSPtrByScanNumber(std::size_t spectrum_index) const
PrecursorParser(pappso::MsRunReaderCstSPtr msrun_reader)
pappso::MsRunReaderCstSPtr msp_msrunReader
std::shared_ptr< Precursor > PrecursorSp
Definition precursor.h:39
std::shared_ptr< const MsRunReader > MsRunReaderCstSPtr
Definition msrunreader.h:58