ProteoWizard
SpectrumList_Agilent.hpp
Go to the documentation of this file.
1 //
2 // $Id: SpectrumList_Agilent.hpp 6585 2014-08-07 22:49:28Z chambm $
3 //
4 //
5 // Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu>
6 //
7 // Copyright 2009 Vanderbilt University - Nashville, TN 37232
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 //
21 
22 
23 #ifndef _SPECTRUMLIST_AGILENT_
24 #define _SPECTRUMLIST_AGILENT_
25 
26 
35 
36 
37 #ifdef PWIZ_READER_AGILENT
38 #include "pwiz_aux/msrc/utility/vendor_api/Agilent/MassHunterData.hpp"
40 #include <boost/thread.hpp>
41 using namespace pwiz::vendor_api::Agilent;
42 #endif // PWIZ_READER_AGILENT
43 
44 
45 namespace pwiz {
46 namespace msdata {
47 namespace detail {
48 
49 using boost::shared_ptr;
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  virtual pwiz::analysis::Spectrum3DPtr spectrum3d(double scanStartTime, const boost::icl::interval_set<double>& driftTimeRanges) const;
64 
65 #ifdef PWIZ_READER_AGILENT
66  SpectrumList_Agilent(const MSData& msd, MassHunterDataPtr rawfile, const Reader::Config& config);
67 
68  private:
69 
70  const MSData& msd_;
71  MassHunterDataPtr rawfile_;
72  Reader::Config config_;
73  mutable size_t size_;
74  mutable boost::mutex readMutex;
75  mutable int lastFrameIndex_;
76  mutable pwiz::vendor_api::Agilent::FramePtr lastFrame_;
77  mutable int lastRowNumber_;
78  mutable ScanRecordPtr lastScanRecord_;
79 
80  mutable util::once_flag_proxy indexInitialized_;
81 
82  struct IndexEntry : public SpectrumIdentity
83  {
84  int rowNumber; // continguous 0-based index (not equal to SpectrumIdentity::index since some scan types are skipped)
85  int scanId; // unique but not contiguous
86  int frameIndex; // 0-based in pwiz but 1-based in MIDAC
87  int driftBinIndex; // 0-based
88  };
89 
90  mutable vector<IndexEntry> index_;
91  mutable map<string, size_t> idToIndexMap_;
92  mutable boost::container::flat_map<double, size_t> scanTimeToFrameMap_;
93 
94  void createIndex() const;
95 #endif // PWIZ_READER_AGILENT
96 };
97 
98 
99 } // detail
100 } // msdata
101 } // pwiz
102 
103 #endif // _SPECTRUMLIST_AGILENT_
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
boost::shared_ptr< Spectrum3D > Spectrum3DPtr
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