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