libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
mzxmloutput.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/msrun/output/mzxmloutput.h
3
* \date 23/11/2019
4
* \author Olivier Langella
5
* \brief write msrun peaks into mzxml output stream
6
*/
7
8
/*******************************************************************************
9
* Copyright (c) 2019 Olivier Langella <Olivier.Langella@u-psud.fr>.
10
*
11
* This file is part of the PAPPSOms++ library.
12
*
13
* PAPPSOms++ is free software: you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation, either version 3 of the License, or
16
* (at your option) any later version.
17
*
18
* PAPPSOms++ is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
22
*
23
* You should have received a copy of the GNU General Public License
24
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25
*
26
* Contributors:
27
* Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
28
*implementation
29
******************************************************************************/
30
31
#pragma once
32
33
#include "
../msrunreader.h
"
34
#include <QXmlStreamWriter>
35
#include "
pappsomspp/core/processing/uimonitor/uimonitorinterface.h
"
36
37
namespace
pappso
38
{
39
/**
40
* @todo use msrunreader as input and writes all peaks into an mzXML output
41
* stream
42
*/
43
class
PMSPP_LIB_DECL
MzxmlOutput
44
{
45
public
:
46
/**
47
* Default constructor
48
*/
49
MzxmlOutput
(
UiMonitorInterface
&monitor, QIODevice *p_output_device);
50
51
/**
52
* Destructor
53
*/
54
~MzxmlOutput
();
55
56
void
write
(
MsRunReader
*p_msrunreader);
57
void
write
(
const
MsRunReadConfig
&read_config,
MsRunReader
*p_msrunreader);
58
void
close
();
59
60
void
maskMs1
(
bool
mask_ms1);
61
62
void
setReadAhead
(
bool
read_ahead);
63
64
private
:
65
void
writeHeader
(
MsRunReader
*p_msrunreader);
66
67
void
writeQualifiedMassSpectrum
(
const
QualifiedMassSpectrum
&spectrum);
68
69
70
std::size_t
getScanNumber
(
const
QualifiedMassSpectrum
&spectrum)
const
;
71
std::size_t
72
getPrecursorScanNumber
(
const
QualifiedMassSpectrum
&spectrum)
const
;
73
std::size_t
getScanNumberFromNativeId
(
const
QString &native_id)
const
;
74
75
76
class
Translater
:
public
SpectrumCollectionHandlerInterface
77
{
78
public
:
79
Translater
(
MzxmlOutput
*p_mzxml_output);
80
virtual
~Translater
();
81
virtual
void
82
setQualifiedMassSpectrum
(
const
QualifiedMassSpectrum
&spectrum)
override
;
83
virtual
bool
needPeakList
()
const override
;
84
85
private
:
86
MzxmlOutput
*
mp_output
;
87
};
88
89
90
private
:
91
UiMonitorInterface
&
m_monitor
;
92
QXmlStreamWriter *
mpa_outputStream
;
93
bool
m_isReadAhead
=
false
;
94
bool
m_ms1IsMasked
=
false
;
95
};
96
}
// namespace pappso
pappso::MsRunReadConfig
Definition
msrunreadconfig.h:62
pappso::MsRunReader
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
Definition
msrunreader.h:64
pappso::MzxmlOutput::Translater::Translater
Translater(MzxmlOutput *p_mzxml_output)
Definition
mzxmloutput.cpp:52
pappso::MzxmlOutput::Translater::mp_output
MzxmlOutput * mp_output
Definition
mzxmloutput.h:86
pappso::MzxmlOutput::Translater::needPeakList
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
Definition
mzxmloutput.cpp:68
pappso::MzxmlOutput::Translater::setQualifiedMassSpectrum
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum) override
Definition
mzxmloutput.cpp:60
pappso::MzxmlOutput::setReadAhead
void setReadAhead(bool read_ahead)
Definition
mzxmloutput.cpp:91
pappso::MzxmlOutput::getScanNumberFromNativeId
std::size_t getScanNumberFromNativeId(const QString &native_id) const
Definition
mzxmloutput.cpp:253
pappso::MzxmlOutput::MzxmlOutput
MzxmlOutput(UiMonitorInterface &monitor, QIODevice *p_output_device)
Definition
mzxmloutput.cpp:74
pappso::MzxmlOutput::write
void write(MsRunReader *p_msrunreader)
Definition
mzxmloutput.cpp:96
pappso::MzxmlOutput::m_ms1IsMasked
bool m_ms1IsMasked
Definition
mzxmloutput.h:94
pappso::MzxmlOutput::close
void close()
Definition
mzxmloutput.cpp:246
pappso::MzxmlOutput::m_monitor
UiMonitorInterface & m_monitor
Definition
mzxmloutput.h:91
pappso::MzxmlOutput::m_isReadAhead
bool m_isReadAhead
Definition
mzxmloutput.h:93
pappso::MzxmlOutput::getScanNumber
std::size_t getScanNumber(const QualifiedMassSpectrum &spectrum) const
Definition
mzxmloutput.cpp:267
pappso::MzxmlOutput::mpa_outputStream
QXmlStreamWriter * mpa_outputStream
Definition
mzxmloutput.h:92
pappso::MzxmlOutput::writeQualifiedMassSpectrum
void writeQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum)
Definition
mzxmloutput.cpp:290
pappso::MzxmlOutput::maskMs1
void maskMs1(bool mask_ms1)
Definition
mzxmloutput.cpp:409
pappso::MzxmlOutput::getPrecursorScanNumber
std::size_t getPrecursorScanNumber(const QualifiedMassSpectrum &spectrum) const
Definition
mzxmloutput.cpp:278
pappso::MzxmlOutput::writeHeader
void writeHeader(MsRunReader *p_msrunreader)
Definition
mzxmloutput.cpp:146
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition
qualifiedmassspectrum.h:98
pappso::SpectrumCollectionHandlerInterface
interface to collect spectrums from the MsRunReader class
Definition
spectrumcollectionhandlerinterface.h:52
pappso::UiMonitorInterface
Definition
uimonitorinterface.h:50
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
msrunreader.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
uimonitorinterface.h
pappsomspp
core
msrun
output
mzxmloutput.h
Generated on
for libpappsomspp by
1.17.0