ProteoWizard
RegionSlice.hpp
Go to the documentation of this file.
1 //
2 // $Id: RegionSlice.hpp 4168 2012-12-04 23:19:57Z pcbrefugee $
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