ProteoWizard
RegionSIC.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 _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  bool operator==(const Config &rhs)
54  {
55  return mzCenter==rhs.mzCenter &&
56  radius == rhs.radius &&
57  radiusUnits == rhs.radiusUnits &&
58  delim_equal(rhs);
59  }
60  };
61 
62  RegionSIC(const MSDataCache& cache, const Config& config);
63 
64  /// \name MSDataAnalyzer interface
65  //@{
66  virtual void open(const DataInfo& dataInfo);
67 
68  virtual UpdateRequest updateRequested(const DataInfo& dataInfo,
69  const SpectrumIdentity& spectrumIdentity) const;
70 
71  virtual void update(const DataInfo& dataInfo,
72  const Spectrum& spectrum);
73 
74  virtual void close(const DataInfo& dataInfo);
75  //@}
76 
77  private:
79  boost::shared_ptr<RegionAnalyzer> regionAnalyzer_;
81 };
82 
83 
84 template<>
86 {
87  static const char* id() {return "sic";}
88  static const char* description() {return "write selected ion chromatogram for an m/z and radius";}
89 #define SIC_MZCENTER_ARG "mzCenter"
90 #define SIC_RADIUS_ARG "radius"
91 #define SIC_RADIUSUNITS_ARG "radiusUnits"
92  static const char* argsFormat() {return SIC_MZCENTER_ARG "=<mz> " SIC_RADIUS_ARG"=<radius> " SIC_RADIUSUNITS_ARG "=<amu|ppm> [" TABULARCONFIG_DELIMITER_OPTIONS_STR "]";}
93  static std::vector<std::string> argsUsage()
94  {
95  std::vector<std::string> usage;
96  usage.push_back(SIC_MZCENTER_ARG": set mz value");
97  usage.push_back(SIC_RADIUS_ARG": set radius value");
98  usage.push_back(SIC_RADIUSUNITS_ARG": set units for radius value (must be amu or ppm)");
99  usage.push_back(TABULARCONFIG_DELIMITER_USAGE_STR);
100  return usage;
101  }
102 };
103 
104 
105 } // namespace analysis
106 } // namespace pwiz
107 
108 
109 #endif // _REGIONSIC_HPP_
110 
MSDataAnalyzer.hpp
pwiz::analysis::analyzer_strings
This auxilliary class should be specialized for MSDataAnalyzers whose instantiation is controlled by ...
Definition: MSDataAnalyzer.hpp:115
pwiz::msdata::SpectrumIdentity
Identifying information for a spectrum.
Definition: MSData.hpp:470
MSDataCache.hpp
pwiz::msdata::Spectrum
The structure that captures the generation of a peak list (including the underlying acquisitions)
Definition: MSData.hpp:505
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::analysis::TabularConfig
Definition: TabularConfig.hpp:38
TABULARCONFIG_DELIMITER_USAGE_STR
#define TABULARCONFIG_DELIMITER_USAGE_STR
Definition: TabularConfig.hpp:31
pwiz::analysis::RegionSIC
writes data samples from a single rectangular region
Definition: RegionSIC.hpp:40
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
RegionAnalyzer.hpp
pwiz::analysis::RegionSIC::config_
Config config_
Definition: RegionSIC.hpp:80
pwiz::analysis::RegionSIC::Config::mzCenter
double mzCenter
Definition: RegionSIC.hpp:46
TabularConfig.hpp
SIC_MZCENTER_ARG
#define SIC_MZCENTER_ARG
Definition: RegionSIC.hpp:89
Export.hpp
pwiz::analysis::RegionSIC::Config::RadiusUnits_Unknown
@ RadiusUnits_Unknown
Definition: RegionSIC.hpp:48
pwiz::analysis::analyzer_strings< RegionSIC >::argsUsage
static std::vector< std::string > argsUsage()
Definition: RegionSIC.hpp:93
pwiz::analysis::RegionSIC::cache_
const MSDataCache & cache_
Definition: RegionSIC.hpp:78
pwiz::analysis::RegionSIC::Config::operator==
bool operator==(const Config &rhs)
Definition: RegionSIC.hpp:53
pwiz::analysis::analyzer_strings< RegionSIC >::argsFormat
static const char * argsFormat()
Definition: RegionSIC.hpp:92
SIC_RADIUS_ARG
#define SIC_RADIUS_ARG
Definition: RegionSIC.hpp:90
pwiz::analysis::analyzer_strings< RegionSIC >::description
static const char * description()
Definition: RegionSIC.hpp:88
pwiz::analysis::MSDataCache
simple memory cache for common MSData info
Definition: MSDataCache.hpp:74
pwiz::analysis::RegionSIC::Config::radiusUnits
RadiusUnits radiusUnits
Definition: RegionSIC.hpp:49
pwiz::analysis::RegionSIC::Config
Definition: RegionSIC.hpp:44
TABULARCONFIG_DELIMITER_OPTIONS_STR
#define TABULARCONFIG_DELIMITER_OPTIONS_STR
Definition: TabularConfig.hpp:30
SIC_RADIUSUNITS_ARG
#define SIC_RADIUSUNITS_ARG
Definition: RegionSIC.hpp:91
pwiz::analysis::MSDataAnalyzer
Interface for MSData analyzers.
Definition: MSDataAnalyzer.hpp:60
pwiz::analysis::RegionSIC::Config::RadiusUnits
RadiusUnits
Definition: RegionSIC.hpp:48
pwiz::analysis::analyzer_strings< RegionSIC >::id
static const char * id()
Definition: RegionSIC.hpp:87
pwiz::analysis::RegionSIC::Config::radius
double radius
Definition: RegionSIC.hpp:47
pwiz::analysis::RegionSIC::regionAnalyzer_
boost::shared_ptr< RegionAnalyzer > regionAnalyzer_
Definition: RegionSIC.hpp:79