libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pwizmsrunreader.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/msrun/private/pwizmsrunreader.h
3 * \date 29/05/2018
4 * \author Olivier Langella
5 * \brief MSrun file reader base on proteowizard library
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2018 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
32#pragma once
33
34#include <pwiz/data/msdata/MSData.hpp>
35#include <pwiz/data/msdata/MSDataFile.hpp>
36
37#include "../../types.h"
40
41
42namespace pappso
43{
44
46{
47 friend class MsFileAccessor;
48
49 public:
50 PwizMsRunReader(MsRunIdCstSPtr &msrun_id_csp);
51 virtual ~PwizMsRunReader();
52
53 virtual MassSpectrumSPtr massSpectrumSPtr(std::size_t spectrum_index) override;
54 virtual MassSpectrumCstSPtr massSpectrumCstSPtr(std::size_t spectrum_index) override;
55
56 virtual QualifiedMassSpectrum qualifiedMassSpectrum(std::size_t spectrum_index,
57 bool want_binary_data = true) const override;
58
59 virtual void readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override;
60
61 virtual void readSpectrumCollection2(const MsRunReadConfig &config,
62 SpectrumCollectionHandlerInterface &handler) override;
63
65 newXicCoordSPtrFromSpectrumIndex(std::size_t spectrum_index,
66 pappso::PrecisionPtr precision) const override;
67
69 newXicCoordSPtrFromQualifiedMassSpectrum(const pappso::QualifiedMassSpectrum &mass_spectrum,
70 pappso::PrecisionPtr precision) const override;
71
72
73 virtual void readSpectrumCollectionByMsLevel(SpectrumCollectionHandlerInterface &handler,
74 unsigned int ms_level) override;
75
76
77 virtual std::size_t spectrumListSize() const override;
78
79 virtual bool hasScanNumbers() const override;
80
81 virtual bool releaseDevice() override;
82
83 virtual bool acquireDevice() override;
84
85
86 /** @brief get OboPsiModTerm corresponding to the nativeID format format of mz
87 * data
88 */
89 const OboPsiModTerm getOboPsiModTermNativeIDFormat() const;
90
91 virtual std::size_t
92 spectrumStringIdentifier2SpectrumIndex(const QString &spectrum_identifier) override;
93
94 protected:
95 virtual void
96 readSpectrumCollectionWithMsrunReadConfig(const MsRunReadConfig &config,
98
99 virtual void initialize() override;
100 virtual bool accept(const QString &file_name) const override;
101
102 bool processRetentionTime(pwiz::msdata::Spectrum *spectrum_p,
103 QualifiedMassSpectrum &qualified_mass_spectrum) const;
104 bool processDriftTime(pwiz::msdata::Spectrum *spectrum_p,
105 QualifiedMassSpectrum &qualified_mass_spectrum) const;
106
107 QualifiedMassSpectrum qualifiedMassSpectrumFromPwizMSData(std::size_t spectrum_index,
108 bool want_binary_data,
109 bool &ok) const;
110
112 qualifiedMassSpectrumFromPwizSpectrumPtr(const MassSpectrumId &massSpectrumId,
113 pwiz::msdata::Spectrum *spectrum_p,
114 bool want_binary_data,
115 bool &ok) const;
116
117 pwiz::msdata::SpectrumPtr getPwizSpectrumPtr(pwiz::msdata::SpectrumList *p_spectrum_list,
118 std::size_t spectrum_index,
119 bool want_binary_data) const;
120
121 static std::string setGlobalLocaleToEnglish();
122
123 static void setGlobalLocaleToCurrentOs(const std::string &environment_locale);
124
125 virtual const OboPsiModTerm getOboPsiModTermInstrumentModelName() const override;
126
127 protected:
128 static QMutex m_mutex;
129 pwiz::msdata::MSDataPtr msp_msData = nullptr;
130
131
132 private:
133 bool m_hasScanNumbers = false;
134};
135
136} // namespace pappso
137
138
139// Q_DECLARE_METATYPE(pappso::PwizMsRunReader);
140// extern int pwizMsRunReaderMetaTypeId;
base class to read MSrun the only way to build a MsRunReader object is to use the MsRunReaderFactory
Definition msrunreader.h:64
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
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
std::shared_ptr< XicCoord > XicCoordSPtr
Definition xiccoord.h:44