ProteoWizard
SpectrumList_Agilent.hpp
Go to the documentation of this file.
1 //
2 // $Id: SpectrumList_Agilent.hpp 9810 2016-06-13 21:41:53Z pcbrefugee $
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  virtual double driftTimeToCCS(double driftTime, double mz, int charge) const;
66  virtual double ccsToDriftTime(double ccs, double mz, int charge) const;
67 
68 #ifdef PWIZ_READER_AGILENT
69  SpectrumList_Agilent(const MSData& msd, MassHunterDataPtr rawfile, const Reader::Config& config);
70 
71  private:
72 
73  const MSData& msd_;
74  MassHunterDataPtr rawfile_;
75  Reader::Config config_;
76  mutable size_t size_;
77  mutable boost::mutex readMutex;
78  mutable int lastFrameIndex_;
79  mutable pwiz::vendor_api::Agilent::FramePtr lastFrame_;
80  mutable int lastRowNumber_;
81  mutable ScanRecordPtr lastScanRecord_;
82 
83  mutable util::once_flag_proxy indexInitialized_;
84 
85  struct IndexEntry : public SpectrumIdentity
86  {
87  int rowNumber; // continguous 0-based index (not equal to SpectrumIdentity::index since some scan types are skipped)
88  int scanId; // unique but not contiguous
89  int frameIndex; // 0-based in pwiz but 1-based in MIDAC
90  int driftBinIndex; // 0-based
91  };
92 
93  mutable vector<IndexEntry> index_;
94  mutable map<string, size_t> idToIndexMap_;
95  mutable boost::container::flat_map<double, size_t> scanTimeToFrameMap_;
96 
97  void createIndex() const;
98 #endif // PWIZ_READER_AGILENT
99 };
100 
101 
102 } // detail
103 } // msdata
104 } // pwiz
105 
106 #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
double mz(double neutralMass, int protonDelta, int electronDelta=0, int neutronDelta=0)
Definition: Ion.hpp:78
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