libpappsomspp
Library for mass spectrometry
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 "../../processing/uimonitor/uimonitorinterface.h"
36
37namespace pappso
38{
39/**
40 * @todo use msrunreader as input and writes all peaks into an mzXML output
41 * stream
42 */
44{
45 public:
46 /**
47 * Default constructor
48 */
49 MzxmlOutput(UiMonitorInterface &monitor, QIODevice *p_output_device);
50
51 /**
52 * Destructor
53 */
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
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:
87 };
88
89
90 private:
92 QXmlStreamWriter *mpa_outputStream;
93 bool m_isReadAhead = false;
94 bool m_ms1IsMasked = false;
95};
96} // namespace pappso
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
Definition msrunreader.h:63
UiMonitorInterface & m_monitor
Definition mzxmloutput.h:91
QXmlStreamWriter * mpa_outputStream
Definition mzxmloutput.h:92
Class representing a fully specified mass spectrum.
interface to collect spectrums from the MsRunReader class
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39