ProteoWizard
SpectrumList_Thermo.hpp
Go to the documentation of this file.
1 //
2 // $Id: SpectrumList_Thermo.hpp 6585 2014-08-07 22:49:28Z chambm $
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 #include <boost/container/flat_map.hpp>
36 
37 
38 #ifdef PWIZ_READER_THERMO
39 #include "pwiz_aux/msrc/utility/vendor_api/thermo/RawFile.h"
41 #include <boost/thread.hpp>
42 using namespace pwiz::vendor_api::Thermo;
43 #endif // PWIZ_READER_THERMO
44 
45 
46 namespace pwiz {
47 namespace msdata {
48 namespace detail {
49 
50 
52 {
53  public:
54 
55  virtual size_t size() const;
56  virtual const SpectrumIdentity& spectrumIdentity(size_t index) const;
57  virtual size_t find(const string& id) const;
58  virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const;
59  virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const;
60  virtual SpectrumPtr spectrum(size_t index, bool getBinaryData, const pwiz::util::IntegerSet& msLevelsToCentroid) const;
61  virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel, const pwiz::util::IntegerSet& msLevelsToCentroid) const;
62 
63 #ifdef PWIZ_READER_THERMO
64  SpectrumList_Thermo(const MSData& msd, pwiz::vendor_api::Thermo::RawFilePtr rawfile, const Reader::Config& config);
65 
66  int numSpectraOfScanType(pwiz::vendor_api::Thermo::ScanType scanType) const;
67  int numSpectraOfMSOrder(pwiz::vendor_api::Thermo::MSOrder msOrder) const;
68 
69  private:
70 
71  const MSData& msd_;
72  pwiz::vendor_api::Thermo::RawFilePtr rawfile_;
73  const Reader::Config config_;
74  size_t size_;
75  vector<int> spectraByScanType;
76  vector<int> spectraByMSOrder;
77  mutable boost::recursive_mutex readMutex;
78 
79  struct IndexEntry : public SpectrumIdentity
80  {
81  ControllerType controllerType;
82  long controllerNumber;
83  long scan;
84 
85  pwiz::vendor_api::Thermo::ScanType scanType;
86  pwiz::vendor_api::Thermo::MSOrder msOrder;
87  double isolationMz;
88  };
89 
90  vector<IndexEntry> index_;
91  map<string, size_t> idToIndexMap_;
92 
93  void createIndex();
94  size_t findPrecursorSpectrumIndex(int precursorMsLevel, double precursorIsolationMz, size_t index) const;
95  pwiz::vendor_api::Thermo::ScanInfoPtr findPrecursorZoomScan(int precursorMsLevel, double precursorIsolationMz, size_t index) const;
96 #endif // PWIZ_READER_THERMO
97 };
98 
99 
100 } // detail
101 } // msdata
102 } // pwiz
103 
104 #endif // _SPECTRUMLIST_THERMO_
common functionality for base SpectrumList implementations
a virtual container of integers, accessible via an iterator interface, stored as union of intervals ...
Definition: IntegerSet.hpp:37
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: MSData.hpp:569
#define PWIZ_API_DECL
Definition: Export.hpp:32
Identifying information for a spectrum.
Definition: MSData.hpp:469
Reader configuration.
Definition: Reader.hpp:43
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845