ProteoWizard
RegionSIC.hpp
Go to the documentation of this file.
1 //
2 // $Id: RegionSIC.hpp 4136 2012-11-21 21:17:24Z chambm $
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 _REGIONSIC_HPP_
25 #define _REGIONSIC_HPP_
26 
27 
29 #include "MSDataAnalyzer.hpp"
30 #include "MSDataCache.hpp"
31 #include "RegionAnalyzer.hpp"
32 #include "TabularConfig.hpp"
33 
34 
35 namespace pwiz {
36 namespace analysis {
37 
38 
39 /// writes data samples from a single rectangular region
41 {
42  public:
43 
45  {
46  double mzCenter;
47  double radius;
48  enum RadiusUnits {RadiusUnits_Unknown, RadiusUnits_amu, RadiusUnits_ppm};
50 
51  Config(const std::string& args);
52  };
53 
54  RegionSIC(const MSDataCache& cache, const Config& config);
55 
56  /// \name MSDataAnalyzer interface
57  //@{
58  virtual void open(const DataInfo& dataInfo);
59 
60  virtual UpdateRequest updateRequested(const DataInfo& dataInfo,
61  const SpectrumIdentity& spectrumIdentity) const;
62 
63  virtual void update(const DataInfo& dataInfo,
64  const Spectrum& spectrum);
65 
66  virtual void close(const DataInfo& dataInfo);
67  //@}
68 
69  private:
71  boost::shared_ptr<RegionAnalyzer> regionAnalyzer_;
73 };
74 
75 
76 template<>
78 {
79  static const char* id() {return "sic";}
80  static const char* description() {return "write selected ion chromatogram for an m/z and radius";}
81  static const char* argsFormat() {return "["TABULARCONFIG_DELIMITER_OPTIONS_STR"] mzCenter radius (\"amu\"|\"ppm\")";}
82  static std::vector<std::string> argsUsage() {return std::vector<std::string>(1, TABULARCONFIG_DELIMITER_USAGE_STR);}
83 };
84 
85 
86 } // namespace analysis
87 } // namespace pwiz
88 
89 
90 #endif // _REGIONSIC_HPP_
91