ProteoWizard
RegionAnalyzer.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 _REGIONANANALYZER_HPP_
25#define _REGIONANANALYZER_HPP_
26
27
29#include "MSDataAnalyzer.hpp"
30#include "MSDataCache.hpp"
31#include "TabularConfig.hpp"
32#include <iostream>
33
34
35namespace pwiz {
36namespace analysis {
37
38
39/// analyzes a rectangular region of m/z-time space
41{
42 public:
43
45 {
46 std::pair<double,double> mzRange;
47 std::pair<size_t,size_t> indexRange;
48 std::pair<int,int> scanNumberRange;
49 std::pair<double,double> rtRange;
50 bool dumpRegionData; // if true, dump info to a stream or file
51 std::ostream* osDump; // if non-null, dump to this stream, else open a file
52 std::string filenameSuffix;
53
55 };
56
57 RegionAnalyzer(const Config& config, const MSDataCache& cache);
58
60 {
62 MZIntensityPair max; // sample point with highest intensity
63 MZIntensityPair peak; // interpolated peak
64
66 };
67
68 const std::vector<SpectrumStats>& spectrumStats() const;
69
71 {
72 size_t nonzeroCount; // # spectra with sumIntensity > 0
75
76 // intensity-weighted peak statistics
79 double sd_peak_mz; // standard deviation
80
81 // index of peak with highest intensity
82 size_t indexApex;
83
85 };
86
87 const Stats& stats() const;
88
89
90 /// \name MSDataAnalyzer interface
91 //@{
92 virtual void open(const DataInfo& dataInfo);
93
94 virtual UpdateRequest updateRequested(const DataInfo& dataInfo,
95 const SpectrumIdentity& spectrumIdentity) const;
96
97 virtual void update(const DataInfo& dataInfo,
98 const Spectrum& spectrum);
99
100 virtual void close(const DataInfo& dataInfo);
101 //@}
102
103 private:
104 struct Impl;
105 boost::shared_ptr<Impl> impl_;
108};
109
110
111} // namespace analysis
112} // namespace pwiz
113
114
115#endif //_REGIONANANALYZER_HPP_
116
#define PWIZ_API_DECL
Definition Export.hpp:32
Interface for MSData analyzers.
simple memory cache for common MSData info
analyzes a rectangular region of m/z-time space
virtual void open(const DataInfo &dataInfo)
start analysis of the data
RegionAnalyzer & operator=(RegionAnalyzer &)
boost::shared_ptr< Impl > impl_
virtual UpdateRequest updateRequested(const DataInfo &dataInfo, const SpectrumIdentity &spectrumIdentity) const
ask analyzer if it wants an update
RegionAnalyzer(RegionAnalyzer &)
virtual void update(const DataInfo &dataInfo, const Spectrum &spectrum)
analyze a single spectrum
const std::vector< SpectrumStats > & spectrumStats() const
RegionAnalyzer(const Config &config, const MSDataCache &cache)
const Stats & stats() const
virtual void close(const DataInfo &dataInfo)
end analysis of the data
information about the data to be analyzed
std::pair< double, double > mzRange
std::pair< double, double > rtRange
std::pair< size_t, size_t > indexRange
The data point type of a mass spectrum.
Definition MSData.hpp:423
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