ProteoWizard
SpectrumList_Waters.hpp
Go to the documentation of this file.
1 //
2 // $Id: SpectrumList_Waters.hpp 9095 2015-11-01 01:14:24Z 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 
25 #include "Reader_Waters_Detail.hpp"
31 #include <boost/thread.hpp>
32 
33 
34 using boost::shared_ptr;
35 
36 
37 namespace pwiz {
38 namespace msdata {
39 namespace detail {
40 
41 
42 //
43 // SpectrumList_Waters
44 //
46 {
47  public:
48 
49  virtual size_t size() const;
50  virtual const SpectrumIdentity& spectrumIdentity(size_t index) const;
51  virtual size_t find(const string& id) const;
52  virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const;
53  virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const;
54  virtual SpectrumPtr spectrum(size_t index, bool getBinaryData, double lockmassMzPosScans, double lockmassMzNegScans, double lockmassTolerance) const;
55  virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel, double lockmassMzPosScans, double lockmassMzNegScans, double lockmassTolerance) const;
56 
57  virtual pwiz::analysis::Spectrum3DPtr spectrum3d(double scanStartTime, const boost::icl::interval_set<double>& driftTimeRanges) const;
58 
59 #ifdef PWIZ_READER_WATERS
60  SpectrumList_Waters(MSData& msd, RawDataPtr rawdata, const Reader::Config& config);
61 
62  private:
63 
64  MSData& msd_;
65  RawDataPtr rawdata_;
66  size_t size_;
67  Reader::Config config_;
68 
69  struct IndexEntry : public SpectrumIdentity
70  {
71  int function;
72  int process;
73  int scan;
74  int block; // block < 0 is not ion mobility
75  };
76 
77  mutable vector<IndexEntry> index_;
78  mutable map<string, size_t> idToIndexMap_;
79  mutable boost::container::flat_map<double, vector<pair<int, int> > > scanTimeToFunctionAndBlockMap_;
80 
81  void initializeCoefficients() const;
82  double calibrate(const double &mz) const;
83  mutable vector<double> calibrationCoefficients_;
84  mutable vector<double> imsCalibratedMasses_;
85  mutable vector<float> imsMasses_;
86  mutable vector<int> massIndices_;
87  mutable vector<float> imsIntensities_;
88  mutable boost::mutex readMutex;
89 
90  void createIndex();
91 #endif // PWIZ_READER_WATERS
92 };
93 
94 } // detail
95 } // msdata
96 } // pwiz
common functionality for base SpectrumList implementations
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