ProteoWizard
RegionSlice.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 _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 
MSDataAnalyzer.hpp
SLICE_INDEX_ARG
#define SLICE_INDEX_ARG
Definition: RegionSlice.hpp:73
pwiz::analysis::RegionSlice::update
virtual void update(const DataInfo &dataInfo, const Spectrum &spectrum)
analyze a single spectrum
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
SLICE_RETENTIONTIME_ARG
#define SLICE_RETENTIONTIME_ARG
Definition: RegionSlice.hpp:75
pwiz::analysis::RegionSlice::RegionSlice
RegionSlice(const MSDataCache &cache, const Config &config)
pwiz::analysis::analyzer_strings< RegionSlice >::id
static const char * id()
Definition: RegionSlice.hpp:72
pwiz::analysis::RegionSlice::open
virtual void open(const DataInfo &dataInfo)
start analysis of the data
TABULARCONFIG_DELIMITER_USAGE_STR
#define TABULARCONFIG_DELIMITER_USAGE_STR
Definition: TabularConfig.hpp:31
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
RegionAnalyzer.hpp
Export.hpp
pwiz::analysis::RegionAnalyzer::Config
Definition: RegionAnalyzer.hpp:45
pwiz::analysis::analyzer_strings< RegionSlice >::argsFormat
static const char * argsFormat()
Definition: RegionSlice.hpp:78
pwiz::analysis::RegionSlice::Config
Definition: RegionSlice.hpp:44
pwiz::analysis::analyzer_strings< RegionSlice >::argsUsage
static std::vector< std::string > argsUsage()
Definition: RegionSlice.hpp:79
pwiz::analysis::RegionSlice::close
virtual void close(const DataInfo &dataInfo)
end analysis of the data
pwiz::analysis::RegionSlice::regionAnalyzer_
boost::shared_ptr< RegionAnalyzer > regionAnalyzer_
Definition: RegionSlice.hpp:65
pwiz::analysis::MSDataCache
simple memory cache for common MSData info
Definition: MSDataCache.hpp:77
SLICE_MZRANGE_ARG
#define SLICE_MZRANGE_ARG
Definition: RegionSlice.hpp:76
TABULARCONFIG_DELIMITER_OPTIONS_STR
#define TABULARCONFIG_DELIMITER_OPTIONS_STR
Definition: TabularConfig.hpp:30
pwiz::analysis::analyzer_strings::description
static const char * description()
description of the analyzer
Definition: MSDataAnalyzer.hpp:121
pwiz::analysis::MSDataAnalyzer
Interface for MSData analyzers.
Definition: MSDataAnalyzer.hpp:61
pwiz::analysis::RegionSlice::Config::Config
Config(const std::string &args)
pwiz::analysis::RegionSlice::updateRequested
virtual UpdateRequest updateRequested(const DataInfo &dataInfo, const SpectrumIdentity &spectrumIdentity) const
ask analyzer if it wants an update
SLICE_SCAN_ARG
#define SLICE_SCAN_ARG
Definition: RegionSlice.hpp:74
pwiz::analysis::MSDataAnalyzer::DataInfo
information about the data to be analyzed
Definition: MSDataAnalyzer.hpp:66
pwiz::analysis::RegionSlice::cache_
const MSDataCache & cache_
Definition: RegionSlice.hpp:64
pwiz::analysis::RegionSlice
writes data samples from a single rectangular region
Definition: RegionSlice.hpp:40