ProteoWizard
SpectrumList_Agilent.hpp
Go to the documentation of this file.
1 //
2 // $Id$
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 hasIonMobility() const;
66  virtual bool canConvertIonMobilityAndCCS() const;
67  virtual double ionMobilityToCCS(double driftTime, double mz, int charge) const;
68  virtual double ccsToIonMobility(double ccs, double mz, int charge) const;
69 
70 #ifdef PWIZ_READER_AGILENT
71  SpectrumList_Agilent(const MSData& msd, MassHunterDataPtr rawfile, const Reader::Config& config);
72 
73  private:
74 
75  const MSData& msd_;
76  MassHunterDataPtr rawfile_;
77  Reader::Config config_;
78  mutable size_t size_;
79  mutable boost::mutex readMutex;
80  mutable int lastFrameIndex_;
81  mutable pwiz::vendor_api::Agilent::FramePtr lastFrame_;
82  mutable int lastRowNumber_;
83  mutable ScanRecordPtr lastScanRecord_;
84 
85  mutable util::once_flag_proxy indexInitialized_;
86 
87  struct IndexEntry : public SpectrumIdentity
88  {
89  int rowNumber; // continguous 0-based index (not equal to SpectrumIdentity::index since some scan types are skipped)
90  int scanId; // unique but not contiguous
91  int frameIndex; // 0-based in pwiz but 1-based in MIDAC
92  int driftBinIndex; // 0-based
93  };
94 
95  mutable vector<IndexEntry> index_;
96  mutable map<string, size_t> idToIndexMap_;
97  mutable boost::container::flat_map<double, size_t> scanTimeToFrameMap_;
98 
99  void createIndex() const;
100 #endif // PWIZ_READER_AGILENT
101 };
102 
103 
104 } // detail
105 } // msdata
106 } // pwiz
107 
108 #endif // _SPECTRUMLIST_AGILENT_
pwiz::msdata::Reader::Config
Reader configuration.
Definition: Reader.hpp:44
pwiz::util::once_flag_proxy
Definition: Once.hpp:34
pwiz::msdata::SpectrumIdentity
Identifying information for a spectrum.
Definition: MSData.hpp:470
pwiz
Definition: ChromatogramList_Filter.hpp:36
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
Container.hpp
Export.hpp
SpectrumList_3D.hpp
Once.hpp
SpectrumListBase.hpp
pwiz::msdata::detail::SpectrumList_Agilent
Definition: SpectrumList_Agilent.hpp:51
String.hpp
pwiz::msdata::SpectrumPtr
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: MSData.hpp:573
Stream.hpp
pwiz::chemistry::Ion::mz
double mz(double neutralMass, int protonDelta, int electronDelta=0, int neutronDelta=0)
Definition: Ion.hpp:78
pwiz::analysis::Spectrum3DPtr
boost::shared_ptr< Spectrum3D > Spectrum3DPtr
Definition: SpectrumList_3D.hpp:36
pwiz::msdata::MSData
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:849
pwiz::msdata::DetailLevel
DetailLevel
Definition: MSData.hpp:630
IntegerSet.hpp
Reader.hpp
pwiz::msdata::SpectrumListIonMobilityBase
Definition: SpectrumListBase.hpp:74
pwiz::util::IntegerSet
a virtual container of integers, accessible via an iterator interface, stored as union of intervals
Definition: IntegerSet.hpp:37