ProteoWizard
RegionSlice.hpp
Go to the documentation of this file.
1 //
2 // $Id: RegionSlice.hpp 7297 2015-03-12 05:30:33Z paragmallick $
3 //
4 //
5 // Original author: Darren Kessner <darren@proteowizard.org>
6 //
7 // Copyright 2008 Spielberg Family Center for Applied Proteomics
8 // Cedars-Sinai Medical Center, Los Angeles, California 90048
9 //
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 // http://www.apache.org/licenses/LICENSE-2.0
15 //
16 // Unless required by applicable law or agreed to in writing, software
17 // distributed under the License is distributed on an "AS IS" BASIS,
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 // See the License for the specific language governing permissions and
20 // limitations under the License.
21 //
22 
23 
24 #ifndef _REGIONSLICE_HPP_
25 #define _REGIONSLICE_HPP_
26 
27 
29 #include "MSDataAnalyzer.hpp"
30 #include "MSDataCache.hpp"
31 #include "RegionAnalyzer.hpp"
32 
33 
34 namespace pwiz {
35 namespace analysis {
36 
37 
38 /// writes data samples from a single rectangular region
40 {
41  public:
42 
44  {
45  Config(const std::string& args);
46  };
47 
48  RegionSlice(const MSDataCache& cache, const Config& config);
49 
50  /// \name MSDataAnalyzer interface
51  //@{
52  virtual void open(const DataInfo& dataInfo);
53 
54  virtual UpdateRequest updateRequested(const DataInfo& dataInfo,
55  const SpectrumIdentity& spectrumIdentity) const;
56 
57  virtual void update(const DataInfo& dataInfo,
58  const Spectrum& spectrum);
59 
60  virtual void close(const DataInfo& dataInfo);
61  //@}
62 
63  private:
65  boost::shared_ptr<RegionAnalyzer> regionAnalyzer_;
66 };
67 
68 
69 template<>
71 {
72  static const char* id() {return "slice";}
73 #define SLICE_INDEX_ARG "index"
74 #define SLICE_SCAN_ARG "sn"
75 #define SLICE_RETENTIONTIME_ARG "rt"
76 #define SLICE_MZRANGE_ARG "mz"
77  static const char* description() {return "write data from a rectangular region";}
78  static const char* argsFormat() {return "[" SLICE_MZRANGE_ARG "=<mzLow>[,<mzHigh>]] [" SLICE_RETENTIONTIME_ARG "=<rtLow>[,<rtHigh>]]] [" SLICE_INDEX_ARG "=<indexLow>[,<indexHigh>] | " SLICE_SCAN_ARG "=<scanLow>[,<scanHigh>]] [" TABULARCONFIG_DELIMITER_OPTIONS_STR "]";}
79  static std::vector<std::string> argsUsage()
80  {
81  std::vector<std::string> result;
82  result.push_back(SLICE_MZRANGE_ARG": set m/z range");
83  result.push_back(SLICE_RETENTIONTIME_ARG": set retention time range");
84  result.push_back(SLICE_INDEX_ARG": set spectrum index range");
85  result.push_back(SLICE_SCAN_ARG": set scan number range");
86  result.push_back(TABULARCONFIG_DELIMITER_USAGE_STR);
87  return result;
88  }
89 };
90 
91 
92 } // namespace analysis
93 } // namespace pwiz
94 
95 
96 #endif // _REGIONSLICE_HPP_
97 
simple memory cache for common MSData info
Definition: MSDataCache.hpp:74
const MSDataCache & cache_
Definition: RegionSlice.hpp:64
#define SLICE_INDEX_ARG
Definition: RegionSlice.hpp:73
boost::shared_ptr< RegionAnalyzer > regionAnalyzer_
Definition: RegionSlice.hpp:65
#define TABULARCONFIG_DELIMITER_USAGE_STR
#define SLICE_SCAN_ARG
Definition: RegionSlice.hpp:74
#define PWIZ_API_DECL
Definition: Export.hpp:32
writes data samples from a single rectangular region
Definition: RegionSlice.hpp:39
This auxilliary class should be specialized for MSDataAnalyzers whose instantiation is controlled by ...
static std::vector< std::string > argsUsage()
Definition: RegionSlice.hpp:79
Identifying information for a spectrum.
Definition: MSData.hpp:469
#define TABULARCONFIG_DELIMITER_OPTIONS_STR
#define SLICE_MZRANGE_ARG
Definition: RegionSlice.hpp:76
information about the data to be analyzed
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
Definition: MSData.hpp:504
Interface for MSData analyzers.
#define SLICE_RETENTIONTIME_ARG
Definition: RegionSlice.hpp:75