libpappsomspp
Library for mass spectrometry
msrunxicextractorinterface.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/xicextractor/msrunxicextractor.h
3  * \date 07/05/2018
4  * \author Olivier Langella
5  * \brief base interface to build XICs on an MsRun file
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  ******************************************************************************/
27 
28 #pragma once
29 
30 
31 #include "../msrun/msrunreader.h"
32 #include <memory>
33 #include <vector>
34 #include <limits>
35 #include <iterator>
36 #include "../mzrange.h"
37 #include "../xic/xic.h"
38 #include "../processing/uimonitor/uimonitorinterface.h"
39 
40 
41 namespace pappso
42 {
43 
44 class MsRunXicExtractorInterface;
45 typedef std::shared_ptr<MsRunXicExtractorInterface>
47 
49 {
50 
51  public:
52  /** @brief set the XIC extraction method
53  */
54  void setXicExtractMethod(XicExtractMethod method); // sum or max
55 
56  /** @brief set the retention time range in seconds around the target rt
57  *
58  * only the interesting part of the xic will be extracted, form the rt target
59  * - range_in_seconds to rt target + range in seconds by default, all the LC
60  * run time is extracted
61  *
62  * @param range_in_seconds range in seconds
63  */
64  void setRetentionTimeAroundTarget(double range_in_seconds);
65 
66 
67  /** @brief extract a list of XIC given a list of xic coordinates to extract
68  *
69  * XicCoord is a vessel containing the xic to fill and coordinates of this XIC
70  * in the MS run
71  *
72  * @param monitor process monitoring
73  * @param xic_coord_list list of xic coordinates to extract. The order of xic
74  * coordinates may change.
75  */
76  virtual void
77  extractXicCoordSPtrList(UiMonitorInterface &monitor,
78  std::vector<XicCoordSPtr> &xic_coord_list) final;
79 
80 
81  /** @brief multithreaded XIC extraction
82  *
83  * divide xic_coord_list and run extractXicCoordSPtrList separated threads
84  *
85  * @param monitor process monitoring
86  * @param xic_coord_list list of xic coordinates to extract. The order of xic
87  * coordinates may change.
88  */
89  virtual void extractXicCoordSPtrListParallelized(
90  UiMonitorInterface &monitor,
91  std::vector<XicCoordSPtr> &xic_coord_list) final;
92 
93  const MsRunIdCstSPtr &getMsRunId() const;
94 
95  /** @brief get the msrunreader currently used for XIC extraction
96  */
97  const MsRunReaderSPtr &getMsRunReaderSPtr() const;
98 
99  /** @brief filter interface to apply just after XIC extration on each trace
100  */
101  void
102  setPostExtractionTraceFilterCstSPtr(pappso::FilterInterfaceCstSPtr &filter);
103 
104 
105  protected:
106  /** @brief constructor is private, use the MsRunXicExtractorFactory
107  */
110  virtual ~MsRunXicExtractorInterface();
111 
112  /** @brief possible post extraction process, eventually trace filters
113  */
114  virtual void postExtractionProcess(UiMonitorInterface &monitor,
115  std::vector<XicCoordSPtr>::iterator it_xic_coord_list_begin,
116  std::vector<XicCoordSPtr>::iterator it_xic_coord_list_end);
117 
119  UiMonitorInterface &monitor,
120  std::vector<XicCoordSPtr>::iterator it_xic_coord_list_begin,
121  std::vector<XicCoordSPtr>::iterator it_xic_coord_list_end) = 0;
122 
123 
124  protected:
127  double m_retentionTimeAroundTarget = std::numeric_limits<double>::max();
128  pappso::FilterInterfaceCstSPtr mcsp_postExtractionTraceFilter = nullptr;
129 };
130 
131 
132 } // namespace pappso
virtual void protectedExtractXicCoordSPtrList(UiMonitorInterface &monitor, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_begin, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_end)=0
#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< MsRunReader > MsRunReaderSPtr
Definition: msrunreader.h:185
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition: msrunid.h:44
std::shared_ptr< const FilterInterface > FilterInterfaceCstSPtr
std::shared_ptr< MsRunXicExtractorInterface > MsRunXicExtractorInterfaceSp
XicExtractMethod
Definition: types.h:201
@ max
maximum of intensities