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
34namespace pwiz {
35namespace 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
69template<>
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
#define PWIZ_API_DECL
Definition Export.hpp:32
#define SLICE_RETENTIONTIME_ARG
#define SLICE_INDEX_ARG
#define SLICE_MZRANGE_ARG
#define SLICE_SCAN_ARG
#define TABULARCONFIG_DELIMITER_USAGE_STR
#define TABULARCONFIG_DELIMITER_OPTIONS_STR
Interface for MSData analyzers.
simple memory cache for common MSData info
writes data samples from a single rectangular region
boost::shared_ptr< RegionAnalyzer > regionAnalyzer_
RegionSlice(const MSDataCache &cache, const Config &config)
virtual void close(const DataInfo &dataInfo)
end analysis of the data
const MSDataCache & cache_
virtual void open(const DataInfo &dataInfo)
start analysis of the data
virtual UpdateRequest updateRequested(const DataInfo &dataInfo, const SpectrumIdentity &spectrumIdentity) const
ask analyzer if it wants an update
virtual void update(const DataInfo &dataInfo, const Spectrum &spectrum)
analyze a single spectrum
information about the data to be analyzed
Config(const std::string &args)
static std::vector< std::string > argsUsage()
This auxilliary class should be specialized for MSDataAnalyzers whose instantiation is controlled by ...
The structure that captures the generation of a peak list (including the underlying acquisitions)
Definition MSData.hpp:506
Identifying information for a spectrum.
Definition MSData.hpp:471