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
35namespace pwiz {
36namespace 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
78template<>
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
#define PWIZ_API_DECL
Definition Export.hpp:32
#define TIC_MZRANGE_ARG
Definition RegionTIC.hpp:83
#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
Definition RegionTIC.hpp:41
virtual void close(const DataInfo &dataInfo)
end analysis of the data
virtual void update(const DataInfo &dataInfo, const Spectrum &spectrum)
analyze a single spectrum
boost::shared_ptr< RegionAnalyzer > regionAnalyzer_
Definition RegionTIC.hpp:73
virtual UpdateRequest updateRequested(const DataInfo &dataInfo, const SpectrumIdentity &spectrumIdentity) const
ask analyzer if it wants an update
const MSDataCache & cache_
Definition RegionTIC.hpp:72
virtual void open(const DataInfo &dataInfo)
start analysis of the data
RegionTIC(const MSDataCache &cache, const Config &config)
information about the data to be analyzed
std::pair< double, double > mzRange
Definition RegionTIC.hpp:46
Config(const std::string &args)
bool operator==(const Config &rhs)
Definition RegionTIC.hpp:49
static std::vector< std::string > argsUsage()
Definition RegionTIC.hpp:85
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