libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
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 "
pappsomspp/core/pappsoexception.h
"
32
#include "
pappsomspp/core/msrun/private/timsmsrunreaderms2.h
"
33
34
35
pappso::masschroq::MsRun::MsRun
(
pappso::MsRunReaderSPtr
msrun_reader)
36
:
msp_msRunReader
(msrun_reader)
37
{
38
39
pappso::TimsMsRunReaderMs2
*tims2_reader =
40
dynamic_cast<
pappso::TimsMsRunReaderMs2
*
>
(
msp_msRunReader
.get());
41
if
(tims2_reader !=
nullptr
)
42
{
43
m_hasTimsTofMobilityIndex
=
true
;
44
}
45
46
m_retentionTimeLine
=
msp_msRunReader
.get()->
getRetentionTimeLine
();
47
mpa_precursorParser
=
new
PrecursorParser
(
msp_msRunReader
);
48
49
pappso::MsRunReadConfig
config;
50
config.
setNeedPeakList
(
false
);
51
config.
setMsLevels
({2});
52
qDebug();
53
// msrunA01.get()->readSpectrumCollection(spectrum_list_reader);
54
msp_msRunReader
.get()->readSpectrumCollection2(config, *
mpa_precursorParser
);
55
}
56
57
pappso::masschroq::MsRun::~MsRun
()
58
{
59
delete
mpa_precursorParser
;
60
}
61
62
const
pappso::MsRunReaderSPtr
&
63
pappso::masschroq::MsRun::getMsRunReaderSPtr
()
const
64
{
65
return
msp_msRunReader
;
66
}
67
68
pappso::MsRunReaderSPtr
&
69
pappso::masschroq::MsRun::getMsRunReaderSPtr
()
70
{
71
return
msp_msRunReader
;
72
}
73
74
75
const
pappso::masschroq::PrecursorSp
&
76
pappso::masschroq::MsRun::getPrecursorSPtrByScanNumber
(std::size_t scan_number)
const
77
{
78
std::size_t spectrum_index =
msp_msRunReader
.get()->scanNumber2SpectrumIndex(scan_number);
79
return
mpa_precursorParser
->getPrecursorSPtrBySpectrumIndex(spectrum_index);
80
}
81
const
pappso::masschroq::PrecursorSp
&
82
pappso::masschroq::MsRun::getPrecursorSPtrBySpectrumIndex
(std::size_t spectrum_index)
const
83
{
84
return
mpa_precursorParser
->getPrecursorSPtrBySpectrumIndex(spectrum_index);
85
}
86
87
const
std::vector<double> &
88
pappso::masschroq::MsRun::getRetentionTimeLine
()
const
89
{
90
return
m_retentionTimeLine
;
91
}
92
93
bool
94
pappso::masschroq::MsRun::hasTimsTofMobilityIndex
()
const
95
{
96
return
m_hasTimsTofMobilityIndex
;
97
}
pappso::MsRunReadConfig
Definition
msrunreadconfig.h:62
pappso::MsRunReadConfig::setNeedPeakList
void setNeedPeakList(bool need_peak_list)
Definition
msrunreadconfig.cpp:173
pappso::MsRunReadConfig::setMsLevels
void setMsLevels(std::vector< std::size_t > ms_levels)
Definition
msrunreadconfig.cpp:89
pappso::TimsMsRunReaderMs2
Definition
timsmsrunreaderms2.h:39
pappso::masschroq::MsRun::MsRun
MsRun(pappso::MsRunReaderSPtr msrun_reader)
Definition
msrun.cpp:35
pappso::masschroq::MsRun::getMsRunReaderSPtr
const pappso::MsRunReaderSPtr & getMsRunReaderSPtr() const
Definition
msrun.cpp:63
pappso::masschroq::MsRun::hasTimsTofMobilityIndex
bool hasTimsTofMobilityIndex() const
Definition
msrun.cpp:94
pappso::masschroq::MsRun::mpa_precursorParser
PrecursorParser * mpa_precursorParser
Definition
msrun.h:83
pappso::masschroq::MsRun::getPrecursorSPtrBySpectrumIndex
const PrecursorSp & getPrecursorSPtrBySpectrumIndex(std::size_t spectrum_index) const
Definition
msrun.cpp:82
pappso::masschroq::MsRun::m_retentionTimeLine
std::vector< double > m_retentionTimeLine
Definition
msrun.h:85
pappso::masschroq::MsRun::getPrecursorSPtrByScanNumber
const PrecursorSp & getPrecursorSPtrByScanNumber(std::size_t scan_number) const
Definition
msrun.cpp:76
pappso::masschroq::MsRun::~MsRun
virtual ~MsRun()
Definition
msrun.cpp:57
pappso::masschroq::MsRun::m_hasTimsTofMobilityIndex
bool m_hasTimsTofMobilityIndex
Definition
msrun.h:87
pappso::masschroq::MsRun::msp_msRunReader
pappso::MsRunReaderSPtr msp_msRunReader
Definition
msrun.h:75
pappso::masschroq::MsRun::getRetentionTimeLine
const std::vector< double > & getRetentionTimeLine() const
Definition
msrun.cpp:88
pappso::masschroq::PrecursorParser
Definition
precursorparser.h:41
msrun.h
pappso::masschroq::PrecursorSp
std::shared_ptr< Precursor > PrecursorSp
Definition
precursor.h:39
pappso::MsRunReaderSPtr
std::shared_ptr< MsRunReader > MsRunReaderSPtr
Definition
msrunreader.h:57
pappsoexception.h
timsmsrunreaderms2.h
pappsomspp
core
masschroq
msrun.cpp
Generated on
for libpappsomspp by
1.17.0