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>
41using namespace pwiz::vendor_api::Agilent;
42#endif // PWIZ_READER_AGILENT
43
44
45namespace pwiz {
46namespace msdata {
47namespace detail {
48
49using 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_
#define PWIZ_API_DECL
Definition Export.hpp:32
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData, const pwiz::util::IntegerSet &msLevelsToCentroid) const
virtual bool canConvertIonMobilityAndCCS() const
virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const
retrieve a spectrum by index
virtual pwiz::analysis::Spectrum3DPtr spectrum3d(double scanStartTime, const boost::icl::interval_set< double > &driftTimeRanges) const
virtual size_t find(const string &id) const
find id in the spectrum index (returns size() on failure)
virtual size_t size() const
returns the number of spectra
virtual double ionMobilityToCCS(double driftTime, double mz, int charge) const
virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel, const pwiz::util::IntegerSet &msLevelsToCentroid) const
virtual const SpectrumIdentity & spectrumIdentity(size_t index) const
access to a spectrum index
virtual double ccsToIonMobility(double ccs, double mz, int charge) const
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const
retrieve a spectrum by index
a virtual container of integers, accessible via an iterator interface, stored as union of intervals
boost::shared_ptr< Spectrum3D > Spectrum3DPtr
boost::shared_ptr< Spectrum > SpectrumPtr
Definition MSData.hpp:573
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition MSData.hpp:850
Reader configuration.
Definition Reader.hpp:45
Identifying information for a spectrum.
Definition MSData.hpp:471