ProteoWizard
SpectrumList_Bruker.hpp
Go to the documentation of this file.
1 //
2 // $Id: SpectrumList_Bruker.hpp 6478 2014-07-08 20:01:38Z chambm $
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_BRUKER_HPP_
24 #define _SPECTRUMLIST_BRUKER_HPP_
25 
33 #include "Reader_Bruker_Detail.hpp"
34 
35 
36 namespace pwiz {
37 namespace msdata {
38 namespace detail {
39 
40 using boost::shared_ptr;
41 
42 //
43 // SpectrumList_Bruker
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, const pwiz::util::IntegerSet& msLevelsToCentroid) const;
55  virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel, const pwiz::util::IntegerSet& msLevelsToCentroid) const;
56 
57 #ifdef PWIZ_READER_BRUKER
59  const string& rootpath,
61  CompassDataPtr compassDataPtr);
62 
63  MSSpectrumPtr getMSSpectrumPtr(size_t index, vendor_api::Bruker::DetailLevel detailLevel) const;
64 
65  private:
66 
67  struct ParameterCache
68  {
69  string get(const string& parameterName, MSSpectrumParameterList& parameters);
70  size_t size() { return parameterIndexByName_.size(); }
71 
72  private:
73  void update(MSSpectrumParameterList& parameters);
74  map<string, size_t> parameterIndexByName_;
75  map<string, string> parameterAlternativeNameMap_;
76  };
77 
78  MSData& msd_;
79  bfs::path rootpath_;
81  mutable CompassDataPtr compassDataPtr_;
82  mutable map<int, ParameterCache> parameterCacheByMsLevel_;
83  size_t size_;
84  vector<bfs::path> sourcePaths_;
85 
86  struct IndexEntry : public SpectrumIdentity
87  {
88  int source;
89  int collection; // -1 for an MS spectrum
90  int scan;
91  };
92 
93  vector<IndexEntry> index_;
94 
95  // idToIndexMap_["scan=<#>" or "file=<sourceFile::id>"] == index
96  map<string, size_t> idToIndexMap_;
97 
98  void fillSourceList();
99  void createIndex();
100  //string findPrecursorID(int precursorMsLevel, size_t index) const;
101 #endif // PWIZ_READER_BRUKER
102 };
103 
104 } // detail
105 } // msdata
106 } // pwiz
107 
108 #endif // _SPECTRUMLIST_BRUKER_HPP_
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< CompassData > CompassDataPtr
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: MSData.hpp:569
#define PWIZ_API_DECL
Definition: Export.hpp:32
PWIZ_API_DECL Reader_Bruker_Format format(const std::string &path)
returns Bruker format of 'path' if it is a Bruker directory; otherwise returns empty string ...
Identifying information for a spectrum.
Definition: MSData.hpp:469
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845