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
54 massSpectrumSPtr(std::size_t spectrum_index) override;
56 massSpectrumCstSPtr(std::size_t spectrum_index) override;
57
59 qualifiedMassSpectrum(std::size_t spectrum_index,
60 bool want_binary_data = true) const override;
61
62 virtual void
63 readSpectrumCollection(SpectrumCollectionHandlerInterface &handler) override;
64
65 virtual void
66 readSpectrumCollection2(const MsRunReadConfig &config,
67 SpectrumCollectionHandlerInterface &handler) override;
68
69 virtual pappso::XicCoordSPtr newXicCoordSPtrFromSpectrumIndex(
70 std::size_t spectrum_index, pappso::PrecisionPtr precision) const override;
71
72 virtual pappso::XicCoordSPtr newXicCoordSPtrFromQualifiedMassSpectrum(
73 const pappso::QualifiedMassSpectrum &mass_spectrum,
74 pappso::PrecisionPtr precision) const override;
75
76
77 virtual void
78 readSpectrumCollectionByMsLevel(SpectrumCollectionHandlerInterface &handler,
79 unsigned int ms_level) override;
80
81
82 virtual std::size_t spectrumListSize() const override;
83
84 virtual bool hasScanNumbers() const override;
85
86 virtual bool releaseDevice() override;
87
88 virtual bool acquireDevice() override;
89
90
91 /** @brief get OboPsiModTerm corresponding to the nativeID format format of mz
92 * data
93 */
94 const OboPsiModTerm getOboPsiModTermNativeIDFormat() const;
95
96 protected:
97 virtual void readSpectrumCollectionWithMsrunReadConfig(
99
100 virtual void initialize() override;
101 virtual bool accept(const QString &file_name) const override;
102
103 bool
104 processRetentionTime(pwiz::msdata::Spectrum *spectrum_p,
105 QualifiedMassSpectrum &qualified_mass_spectrum) const;
106 bool processDriftTime(pwiz::msdata::Spectrum *spectrum_p,
107 QualifiedMassSpectrum &qualified_mass_spectrum) const;
108
109 QualifiedMassSpectrum qualifiedMassSpectrumFromPwizMSData(
110 std::size_t spectrum_index, bool want_binary_data, bool &ok) const;
111
113 qualifiedMassSpectrumFromPwizSpectrumPtr(const MassSpectrumId &massSpectrumId,
114 pwiz::msdata::Spectrum *spectrum_p,
115 bool want_binary_data,
116 bool &ok) const;
117
118 pwiz::msdata::SpectrumPtr
119 getPwizSpectrumPtr(pwiz::msdata::SpectrumList *p_spectrum_list,
120 std::size_t spectrum_index,
121 bool want_binary_data) const;
122
123 static std::string setGlobalLocaleToEnglish();
124
125 static void setGlobalLocaleToCurrentOs(const std::string &environment_locale);
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:63
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:43
This header contains all the type re-definitions and all the global variables definitions used in the...