ProteoWizard
SpectrumList_Thermo.hpp
Go to the documentation of this file.
1//
2// $Id$
3//
4//
5// Original author: Darren Kessner <darren@proteowizard.org>
6//
7// Copyright 2008 Spielberg Family Center for Applied Proteomics
8// Cedars-Sinai Medical Center, Los Angeles, California 90048
9//
10// Licensed under the Apache License, Version 2.0 (the "License");
11// you may not use this file except in compliance with the License.
12// You may obtain a copy of the License at
13//
14// http://www.apache.org/licenses/LICENSE-2.0
15//
16// Unless required by applicable law or agreed to in writing, software
17// distributed under the License is distributed on an "AS IS" BASIS,
18// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19// See the License for the specific language governing permissions and
20// limitations under the License.
21//
22
23
24#ifndef _SPECTRUMLIST_THERMO_
25#define _SPECTRUMLIST_THERMO_
26
27
35#include <boost/container/flat_map.hpp>
36
37
38#ifdef PWIZ_READER_THERMO
39#include "pwiz_aux/msrc/utility/vendor_api/thermo/RawFile.h"
41#include <boost/thread.hpp>
42using namespace pwiz::vendor_api::Thermo;
43#endif // PWIZ_READER_THERMO
44
45
46namespace pwiz {
47namespace msdata {
48namespace detail {
49
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 virtual bool hasIonMobility() const;
63 virtual bool canConvertIonMobilityAndCCS() const;
64 virtual double ionMobilityToCCS(double ionMobility, double mz, int charge) const;
65 virtual double ccsToIonMobility(double ccs, double mz, int charge) const;
66
67#ifdef PWIZ_READER_THERMO
68 SpectrumList_Thermo(const MSData& msd, pwiz::vendor_api::Thermo::RawFilePtr rawfile, const Reader::Config& config);
69
70 int numSpectraOfScanType(pwiz::vendor_api::Thermo::ScanType scanType) const;
71 int numSpectraOfMSOrder(pwiz::vendor_api::Thermo::MSOrder msOrder) const;
72
73 private:
74
75 const MSData& msd_;
76 pwiz::vendor_api::Thermo::RawFilePtr rawfile_;
77 const Reader::Config config_;
78 size_t size_;
79 vector<int> spectraByScanType;
80 vector<int> spectraByMSOrder;
81 mutable boost::recursive_mutex readMutex;
82 map<long, vector<double> > fillIndex;
83
84 struct IndexEntry : public SpectrumIdentity
85 {
86 ControllerType controllerType;
87 long controllerNumber;
88 long scan;
89
90 pwiz::vendor_api::Thermo::ScanType scanType;
91 pwiz::vendor_api::Thermo::MSOrder msOrder;
92 double isolationMz;
93 };
94
95 vector<IndexEntry> index_;
96 map<string, size_t> idToIndexMap_;
97
98 void createIndex();
99
100 size_t findPrecursorSpectrumIndex(int precursorMsLevel, double precursorIsolationMz, size_t index) const;
101 pwiz::vendor_api::Thermo::ScanInfoPtr findPrecursorZoomScan(int precursorMsLevel, double precursorIsolationMz, size_t index) const;
102
103#endif // PWIZ_READER_THERMO
104};
105
106
107} // detail
108} // msdata
109} // pwiz
110
111#endif // _SPECTRUMLIST_THERMO_
#define PWIZ_API_DECL
Definition Export.hpp:32
virtual double ccsToIonMobility(double ccs, double mz, int charge) const
virtual double ionMobilityToCCS(double ionMobility, double mz, int charge) const
virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel, const pwiz::util::IntegerSet &msLevelsToCentroid) const
virtual size_t find(const string &id) const
find id in the spectrum index (returns size() on failure)
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData, const pwiz::util::IntegerSet &msLevelsToCentroid) const
virtual bool canConvertIonMobilityAndCCS() const
virtual size_t size() const
returns the number of spectra
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const
retrieve a spectrum by index
virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const
retrieve a spectrum by index
virtual const SpectrumIdentity & spectrumIdentity(size_t index) const
access to a spectrum index
a virtual container of integers, accessible via an iterator interface, stored as union of intervals
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