ProteoWizard
SpectrumList_Thermo.hpp
Go to the documentation of this file.
1 //
2 // $Id: SpectrumList_Thermo.hpp 3808 2012-07-24 20:31:10Z donmarsh $
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 _SPECTRUMLIST_THERMO_
25 #define _SPECTRUMLIST_THERMO_
26 
27 
35 
36 
37 #ifdef PWIZ_READER_THERMO
38 #include "pwiz_aux/msrc/utility/vendor_api/thermo/RawFile.h"
40 using namespace pwiz::vendor_api::Thermo;
41 #endif // PWIZ_READER_THERMO
42 
43 
44 namespace pwiz {
45 namespace msdata {
46 namespace detail {
47 
48 
50 {
51  public:
52 
53  virtual size_t size() const;
54  virtual const SpectrumIdentity& spectrumIdentity(size_t index) const;
55  virtual size_t find(const string& id) const;
56  virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const;
57  virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const;
58  virtual SpectrumPtr spectrum(size_t index, bool getBinaryData, const pwiz::util::IntegerSet& msLevelsToCentroid) const;
59  virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel, const pwiz::util::IntegerSet& msLevelsToCentroid) const;
60 
61 #ifdef PWIZ_READER_THERMO
62  SpectrumList_Thermo(const MSData& msd, pwiz::vendor_api::Thermo::RawFilePtr rawfile, const Reader::Config& config);
63 
64  int numSpectraOfScanType(pwiz::vendor_api::Thermo::ScanType scanType) const;
65  int numSpectraOfMSOrder(pwiz::vendor_api::Thermo::MSOrder msOrder) const;
66 
67  private:
68 
69  const MSData& msd_;
70  pwiz::vendor_api::Thermo::RawFilePtr rawfile_;
71  const Reader::Config config_;
72  size_t size_;
73  vector<int> spectraByScanType;
74  vector<int> spectraByMSOrder;
75 
76  struct IndexEntry : public SpectrumIdentity
77  {
78  ControllerType controllerType;
79  long controllerNumber;
80  long scan;
81 
82  pwiz::vendor_api::Thermo::ScanType scanType;
83  pwiz::vendor_api::Thermo::MSOrder msOrder;
84  double isolationMz;
85  };
86 
87  vector<IndexEntry> index_;
88  map<string, size_t> idToIndexMap_;
89 
90  void createIndex();
91  size_t findPrecursorSpectrumIndex(int precursorMsLevel, double precursorIsolationMz, size_t index) const;
92  pwiz::vendor_api::Thermo::ScanInfoPtr findPrecursorZoomScan(int precursorMsLevel, double precursorIsolationMz, size_t index) const;
93 #endif // PWIZ_READER_THERMO
94 };
95 
96 
97 } // detail
98 } // msdata
99 } // pwiz
100 
101 #endif // _SPECTRUMLIST_THERMO_