ProteoWizard
RegionTIC.hpp
Go to the documentation of this file.
1 //
2 // $Id: RegionTIC.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 _REGIONTIC_HPP_
25 #define _REGIONTIC_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  std::pair<double,double> mzRange;
47  Config(const std::string& args);
48 
49  bool operator==(const Config &rhs)
50  {
51  return mzRange == rhs.mzRange &&
52  delim_equal(rhs);
53  }
54  };
55 
56  RegionTIC(const MSDataCache& cache, const Config& config);
57 
58  /// \name MSDataAnalyzer interface
59  //@{
60  virtual void open(const DataInfo& dataInfo);
61 
62  virtual UpdateRequest updateRequested(const DataInfo& dataInfo,
63  const SpectrumIdentity& spectrumIdentity) const;
64 
65  virtual void update(const DataInfo& dataInfo,
66  const Spectrum& spectrum);
67 
68  virtual void close(const DataInfo& dataInfo);
69  //@}
70 
71  private:
73  boost::shared_ptr<RegionAnalyzer> regionAnalyzer_;
75 };
76 
77 
78 template<>
80 {
81  static const char* id() {return "tic";}
82  static const char* description() {return "write total ion counts for an m/z range";}
83 #define TIC_MZRANGE_ARG "mz"
84  static const char* argsFormat() {return "[" TIC_MZRANGE_ARG "=<mzLow>[,<mzHigh>]] [" TABULARCONFIG_DELIMITER_OPTIONS_STR "]";}
85  static std::vector<std::string> argsUsage()
86  {
87  std::vector<std::string> usage;
88  usage.push_back(TIC_MZRANGE_ARG": set mz range");
89  usage.push_back(TABULARCONFIG_DELIMITER_USAGE_STR);
90  return usage;
91  }
92 };
93 
94 
95 } // namespace analysis
96 } // namespace pwiz
97 
98 
99 #endif // _REGIONTIC_HPP_
100 
const MSDataCache & cache_
Definition: RegionTIC.hpp:72
simple memory cache for common MSData info
Definition: MSDataCache.hpp:74
static std::vector< std::string > argsUsage()
Definition: RegionTIC.hpp:85
#define TABULARCONFIG_DELIMITER_USAGE_STR
writes data samples from a single rectangular region
Definition: RegionTIC.hpp:40
bool operator==(const Config &rhs)
Definition: RegionTIC.hpp:49
#define PWIZ_API_DECL
Definition: Export.hpp:32
This auxilliary class should be specialized for MSDataAnalyzers whose instantiation is controlled by ...
boost::shared_ptr< RegionAnalyzer > regionAnalyzer_
Definition: RegionTIC.hpp:73
Identifying information for a spectrum.
Definition: MSData.hpp:469
#define TABULARCONFIG_DELIMITER_OPTIONS_STR
information about the data to be analyzed
std::pair< double, double > mzRange
Definition: RegionTIC.hpp:46
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
Definition: MSData.hpp:504
#define TIC_MZRANGE_ARG
Definition: RegionTIC.hpp:83
Interface for MSData analyzers.