ProteoWizard
RegionTIC.hpp
Go to the documentation of this file.
1 //
2 // $Id$
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 
pwiz::analysis::analyzer_strings< RegionTIC >::description
static const char * description()
Definition: RegionTIC.hpp:82
MSDataAnalyzer.hpp
pwiz::analysis::analyzer_strings
This auxilliary class should be specialized for MSDataAnalyzers whose instantiation is controlled by ...
Definition: MSDataAnalyzer.hpp:116
pwiz::msdata::SpectrumIdentity
Identifying information for a spectrum.
Definition: MSData.hpp:471
MSDataCache.hpp
pwiz::msdata::Spectrum
The structure that captures the generation of a peak list (including the underlying acquisitions)
Definition: MSData.hpp:506
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::analysis::analyzer_strings::argsFormat
static const char * argsFormat()
format of args string
Definition: MSDataAnalyzer.hpp:124
pwiz::analysis::TabularConfig
Definition: TabularConfig.hpp:39
TABULARCONFIG_DELIMITER_USAGE_STR
#define TABULARCONFIG_DELIMITER_USAGE_STR
Definition: TabularConfig.hpp:31
pwiz::analysis::RegionTIC::Config::operator==
bool operator==(const Config &rhs)
Definition: RegionTIC.hpp:49
pwiz::analysis::RegionTIC::open
virtual void open(const DataInfo &dataInfo)
start analysis of the data
TIC_MZRANGE_ARG
#define TIC_MZRANGE_ARG
Definition: RegionTIC.hpp:83
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
RegionAnalyzer.hpp
pwiz::analysis::RegionTIC::RegionTIC
RegionTIC(const MSDataCache &cache, const Config &config)
TabularConfig.hpp
Export.hpp
pwiz::analysis::RegionTIC::updateRequested
virtual UpdateRequest updateRequested(const DataInfo &dataInfo, const SpectrumIdentity &spectrumIdentity) const
ask analyzer if it wants an update
pwiz::analysis::RegionTIC::update
virtual void update(const DataInfo &dataInfo, const Spectrum &spectrum)
analyze a single spectrum
pwiz::analysis::RegionTIC::close
virtual void close(const DataInfo &dataInfo)
end analysis of the data
pwiz::analysis::RegionTIC::Config::Config
Config(const std::string &args)
pwiz::analysis::RegionTIC::Config
Definition: RegionTIC.hpp:45
pwiz::analysis::RegionTIC::config_
Config config_
Definition: RegionTIC.hpp:74
pwiz::analysis::MSDataCache
simple memory cache for common MSData info
Definition: MSDataCache.hpp:77
pwiz::analysis::analyzer_strings< RegionTIC >::argsUsage
static std::vector< std::string > argsUsage()
Definition: RegionTIC.hpp:85
TABULARCONFIG_DELIMITER_OPTIONS_STR
#define TABULARCONFIG_DELIMITER_OPTIONS_STR
Definition: TabularConfig.hpp:30
pwiz::analysis::MSDataAnalyzer
Interface for MSData analyzers.
Definition: MSDataAnalyzer.hpp:61
pwiz::analysis::RegionTIC
writes data samples from a single rectangular region
Definition: RegionTIC.hpp:41
pwiz::analysis::analyzer_strings< RegionTIC >::id
static const char * id()
Definition: RegionTIC.hpp:81
pwiz::analysis::RegionTIC::Config::mzRange
std::pair< double, double > mzRange
Definition: RegionTIC.hpp:46
pwiz::analysis::MSDataAnalyzer::DataInfo
information about the data to be analyzed
Definition: MSDataAnalyzer.hpp:66
pwiz::analysis::RegionTIC::cache_
const MSDataCache & cache_
Definition: RegionTIC.hpp:72
pwiz::analysis::RegionTIC::regionAnalyzer_
boost::shared_ptr< RegionAnalyzer > regionAnalyzer_
Definition: RegionTIC.hpp:73