libpappsomspp
Library for mass spectrometry
msrun.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/masschroq/core/msrun.cpp
3 * \date 24/09/2024
4 * \author Olivier Langella
5 * \brief msrun model in masschroqlite
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2024 Olivier Langella
10 *<Olivier.Langella@universite-paris-saclay.fr>.
11 *
12 * This file is part of MassChroQ.
13 *
14 * MassChroQ is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * MassChroQ is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with MassChroQ. If not, see <http://www.gnu.org/licenses/>.
26 *
27 ******************************************************************************/
28
29
30#include "msrun.h"
31#include "../pappsoexception.h"
32#include "../msrun/private/timsmsrunreaderms2.h"
33
34
35pappso::masschroq::MsRun::MsRun(pappso::MsRunReaderSPtr msrun_reader) : msp_msRunReader(msrun_reader)
36{
37
38 pappso::TimsMsRunReaderMs2 *tims2_reader =
39 dynamic_cast<pappso::TimsMsRunReaderMs2 *>(msp_msRunReader.get());
40 if(tims2_reader != nullptr)
41 {
43 }
44
45 m_retentionTimeLine = msp_msRunReader.get()->getRetentionTimeLine();
47
49 config.setNeedPeakList(false);
50 config.setMsLevels({2});
51 qDebug();
52 // msrunA01.get()->readSpectrumCollection(spectrum_list_reader);
53 msp_msRunReader.get()->readSpectrumCollection2(config, *mpa_precursorParser);
54}
55
57{
58 delete mpa_precursorParser;
59}
60
63{
64 return msp_msRunReader;
65}
66
69{
70 return msp_msRunReader;
71}
72
73
76{
77 return mpa_precursorParser->getPrecursorSPtrByScanNumber(scan_number);
78}
81{
82 return mpa_precursorParser->getPrecursorSPtrBySpectrumIndex(spectrum_index);
83}
84
85const std::vector<double> &
87{
88 return m_retentionTimeLine;
89}
90
91bool
93{
94 return m_hasTimsTofMobilityIndex;
95}
void setNeedPeakList(bool need_peak_list)
void setMsLevels(std::vector< std::size_t > ms_levels)
MsRun(pappso::MsRunReaderSPtr msrun_reader)
Definition: msrun.cpp:35
const pappso::MsRunReaderSPtr & getMsRunReaderSPtr() const
Definition: msrun.cpp:62
bool hasTimsTofMobilityIndex() const
Definition: msrun.cpp:92
PrecursorParser * mpa_precursorParser
Definition: msrun.h:83
const PrecursorSp & getPrecursorSPtrBySpectrumIndex(std::size_t spectrum_index) const
Definition: msrun.cpp:80
std::vector< double > m_retentionTimeLine
Definition: msrun.h:85
const PrecursorSp & getPrecursorSPtrByScanNumber(std::size_t scan_number) const
Definition: msrun.cpp:75
bool m_hasTimsTofMobilityIndex
Definition: msrun.h:87
pappso::MsRunReaderSPtr msp_msRunReader
Definition: msrun.h:75
const std::vector< double > & getRetentionTimeLine() const
Definition: msrun.cpp:86
std::shared_ptr< Precursor > PrecursorSp
Definition: precursor.h:39
std::shared_ptr< MsRunReader > MsRunReaderSPtr
Definition: msrunreader.h:57