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  protected:
50  MsRunXicExtractor(MsRunReaderSPtr &msrun_reader);
51 
52  virtual void
53  getXicFromPwizMSDataFile(std::vector<Xic *> &xic_list,
54  const std::vector<MzRange> &mass_range_list,
55  pappso::pappso_double rt_begin,
56  pappso::pappso_double rt_end);
57 
59  UiMonitorInterface &monitor,
60  std::vector<XicCoordSPtr>::iterator it_xic_coord_list_begin,
61  std::vector<XicCoordSPtr>::iterator it_xic_coord_list_end) override;
62 
63 
64  protected:
66  {
67  std::size_t spectrum_index;
68  double rt;
69  };
70 
71  /** @brief class to read retention time points of MsRun
72  */
74  {
75  private:
76  std::vector<MsRunXicExtractorPoints> &m_msrun_points;
77 
78  public:
80  std::vector<MsRunXicExtractorPoints> &msrun_points)
81  : m_msrun_points(msrun_points){};
82 
83  virtual void
85  {
86  if(spectrum.getMsLevel() == 1)
87  {
88  m_msrun_points.push_back(
89  {spectrum.getMassSpectrumId().getSpectrumIndex(),
90  spectrum.getRtInSeconds()});
91  }
92  }
93  virtual bool
94  needPeakList() const override
95  {
96  return false;
97  }
98  virtual void
99  loadingEnded() override
100  {
101  }
102  };
103 
104 
105  protected:
106  std::vector<MsRunXicExtractorPoints> m_msrun_points;
107 
108  private:
109  void extractOneXicCoord(XicCoord &xic_coord);
110 };
111 
112 
113 } // 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 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
virtual void protectedExtractXicCoordSPtrList(UiMonitorInterface &monitor, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_begin, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_end) override
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:185
double pappso_double
A type definition for doubles.
Definition: types.h:49
coordinates of the XIC to extract and the resulting XIC after extraction
Definition: xiccoord.h:54