libpappsomspp
Library for mass spectrometry
msrunxicextractor.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/xicextractor/private/msrunxicextractorpwiz.h
3  * \date 07/05/2018
4  * \author Olivier Langella
5  * \brief simple proteowizard based XIC extractor
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 #pragma once
32 
33 #include "../msrunxicextractorinterface.h"
34 
35 class MsRunXicExtractorFactory;
36 
37 namespace pappso
38 {
39 
40 
42 {
44 
45  public:
47  virtual ~MsRunXicExtractor();
48 
49  virtual void
51  std::vector<XicCoordSPtr> &xic_coord_list) override;
52 
53  protected:
54  MsRunXicExtractor(MsRunReaderSPtr &msrun_reader);
55 
56  virtual void
57  getXicFromPwizMSDataFile(std::vector<Xic *> &xic_list,
58  const std::vector<MzRange> &mass_range_list,
59  pappso::pappso_double rt_begin,
60  pappso::pappso_double rt_end);
61 
62 
63  protected:
65  {
66  std::size_t spectrum_index;
67  double rt;
68  };
69 
70  /** @brief class to read retention time points of MsRun
71  */
73  {
74  private:
75  std::vector<MsRunXicExtractorPoints> &m_msrun_points;
76 
77  public:
79  std::vector<MsRunXicExtractorPoints> &msrun_points)
80  : m_msrun_points(msrun_points){};
81 
82  virtual void
84  {
85  if(spectrum.getMsLevel() == 1)
86  {
87  m_msrun_points.push_back(
88  {spectrum.getMassSpectrumId().getSpectrumIndex(),
89  spectrum.getRtInSeconds()});
90  }
91  }
92  virtual bool
93  needPeakList() const override
94  {
95  return false;
96  }
97  virtual void
98  loadingEnded() override
99  {
100  }
101  };
102 
103 
104  protected:
105  std::vector<MsRunXicExtractorPoints> m_msrun_points;
106 
107  private:
108  void extractOneXicCoord(XicCoord &xic_coord);
109 };
110 
111 
112 } // namespace pappso
class to read retention time points of MsRun
virtual bool needPeakList() const override
tells if we need the peak list (if we want the binary data) for each spectrum
MsRunXicExtractorReadPoints(std::vector< MsRunXicExtractorPoints > &msrun_points)
virtual void setQualifiedMassSpectrum(const QualifiedMassSpectrum &spectrum) override
std::vector< MsRunXicExtractorPoints > & m_msrun_points
virtual void extractXicCoordSPtrList(UiMonitorInterface &monitor, std::vector< XicCoordSPtr > &xic_coord_list) override
extract a list of XIC given a list of xic coordinates to extract
virtual void getXicFromPwizMSDataFile(std::vector< Xic * > &xic_list, const std::vector< MzRange > &mass_range_list, pappso::pappso_double rt_begin, pappso::pappso_double rt_end)
MsRunXicExtractor(const MsRunXicExtractor &other)
void extractOneXicCoord(XicCoord &xic_coord)
std::vector< MsRunXicExtractorPoints > m_msrun_points
Class representing a fully specified mass spectrum.
uint getMsLevel() const
Get the mass spectrum level.
const MassSpectrumId & getMassSpectrumId() const
Get the MassSpectrumId.
pappso_double getRtInSeconds() const
Get the retention time in seconds.
interface to collect spectrums from the MsRunReader class
Definition: msrunreader.h:56
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
std::shared_ptr< MsRunReader > MsRunReaderSPtr
Definition: msrunreader.h:166
double pappso_double
A type definition for doubles.
Definition: types.h:48
coordinates of the XIC to extract and the resulting XIC after extraction
Definition: xiccoord.h:54