ProteoWizard
SpectrumList_Bruker.hpp
Go to the documentation of this file.
1 //
2 // $Id: SpectrumList_Bruker.hpp 6979 2014-12-09 16:15:35Z 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 #include <boost/container/flat_map.hpp>
35 
36 
37 namespace pwiz {
38 namespace msdata {
39 namespace detail {
40 
41 using boost::shared_ptr;
42 
43 //
44 // SpectrumList_Bruker
45 //
47 {
48  public:
49 
50  virtual size_t size() const;
51  virtual const SpectrumIdentity& spectrumIdentity(size_t index) const;
52  virtual size_t find(const string& id) const;
53  virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const;
54  virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const;
55  virtual SpectrumPtr spectrum(size_t index, bool getBinaryData, const pwiz::util::IntegerSet& msLevelsToCentroid) const;
56  virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel, const pwiz::util::IntegerSet& msLevelsToCentroid) const;
57 
58 #ifdef PWIZ_READER_BRUKER
60  const string& rootpath,
62  CompassDataPtr compassDataPtr);
63 
64  MSSpectrumPtr getMSSpectrumPtr(size_t index, vendor_api::Bruker::DetailLevel detailLevel) const;
65 
66  private:
67 
68  MSData& msd_;
69  bfs::path rootpath_;
71  mutable CompassDataPtr compassDataPtr_;
72  size_t size_;
73  vector<bfs::path> sourcePaths_;
74 
75  struct IndexEntry : public SpectrumIdentity
76  {
77  int source;
78  int collection; // -1 for an MS spectrum
79  int scan;
80  };
81 
82  vector<IndexEntry> index_;
83 
84  // idToIndexMap_["scan=<#>" or "file=<sourceFile::id>"] == index
85  boost::container::flat_map<string, size_t> idToIndexMap_;
86 
87  void fillSourceList();
88  void createIndex();
89  //string findPrecursorID(int precursorMsLevel, size_t index) const;
90 #endif // PWIZ_READER_BRUKER
91 };
92 
93 } // detail
94 } // msdata
95 } // pwiz
96 
97 #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 &#39;path&#39; 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