OpenMS
openms/include/OpenMS/INTERFACES/DataStructures.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Roest $
6 // $Authors: Darren Kessner, Hannes Roest, Witold Wolski$
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <string>
12 #include <vector>
13 #include <boost/shared_ptr.hpp>
14 
15 #include <OpenMS/config.h>
16 
17 namespace OpenMS
18 {
19 namespace Interfaces
20 {
21 
46  struct OPENMS_DLLAPI BinaryDataArray
47  {
49  //DataProcessingPtr dataProcessingPtr;
50 
52  std::vector<double> data;
53  };
54  typedef boost::shared_ptr<BinaryDataArray> BinaryDataArrayPtr;
55 
57  struct OPENMS_DLLAPI ChromatogramMeta
58  {
60  std::size_t index;
62  std::string id;
66 
68  index()
69  {
70  }
71 
72  };
73  typedef boost::shared_ptr<ChromatogramMeta> ChromatogramMetaPtr;
74 
76  struct OPENMS_DLLAPI Chromatogram
77  {
79  std::size_t defaultArrayLength;
80 
81 private:
83  std::vector<BinaryDataArrayPtr> binaryDataArrayPtrs;
84 
85 public:
87  defaultArrayLength(2),
88  binaryDataArrayPtrs(defaultArrayLength)
89  {
90  initvec();
91  }
92 
93 private:
94 
95  void initvec()
96  {
97  for (std::size_t i = 0; i < defaultArrayLength; ++i)
98  {
100  binaryDataArrayPtrs[i] = empty;
101  }
102  }
103 
104 public:
107  {
108  return binaryDataArrayPtrs[0];
109  }
110 
113  {
114  binaryDataArrayPtrs[0] = data;
115  }
116 
119  {
120  return binaryDataArrayPtrs[1];
121  }
122 
125  {
126  binaryDataArrayPtrs[1] = data;
127  }
128 
129  };
130  typedef boost::shared_ptr<Chromatogram> ChromatogramPtr;
131 
133  struct OPENMS_DLLAPI SpectrumMeta
134  {
136  size_t index;
137 
139  std::string id;
140 
142  double RT;
143 
145  int ms_level;
146 
148  index(0)
149  {
150  }
151 
152  };
153  typedef boost::shared_ptr<SpectrumMeta> SpectrumMetaPtr;
154 
156  struct OPENMS_DLLAPI Spectrum
157  {
159  std::size_t defaultArrayLength;
160 
161 private:
163  std::vector<BinaryDataArrayPtr> binaryDataArrayPtrs;
164 
165 public:
167  defaultArrayLength(2),
168  binaryDataArrayPtrs(defaultArrayLength)
169  {
170  initvec();
171  }
172 
173 private:
174 
175  void initvec()
176  {
177  for (std::size_t i = 0; i < defaultArrayLength; ++i)
178  {
180  binaryDataArrayPtrs[i] = empty;
181  }
182  }
183 
184 public:
187  {
188  return binaryDataArrayPtrs[0];
189  }
190 
193  {
194  binaryDataArrayPtrs[0] = data;
195  }
196 
199  {
200  return binaryDataArrayPtrs[1];
201  }
202 
205  {
206  binaryDataArrayPtrs[1] = data;
207  }
208 
209  };
210  typedef boost::shared_ptr<Spectrum> SpectrumPtr;
211 
212 } //end namespace Interfaces
213 } //end namespace OpenMS
std::vector< double > data
this optional attribute may reference the 'id' attribute of the appropriate dataProcessing.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:52
boost::shared_ptr< ChromatogramMeta > ChromatogramMetaPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:73
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:130
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:54
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:210
boost::shared_ptr< SpectrumMeta > SpectrumMetaPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:153
The datastructures used by the OpenSwath interfaces.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:47
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Identifying information for a chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:58
double precursor_isolation_target
precursor and product m/z
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:64
std::size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:60
ChromatogramMeta()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:67
std::string id
a unique identifier for this chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:62
double product_isolation_target
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:65
A single chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:77
void setIntensityArray(BinaryDataArrayPtr data)
set intensity array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:124
std::size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:79
void setTimeArray(BinaryDataArrayPtr data)
set time array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:112
Chromatogram()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:86
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:83
BinaryDataArrayPtr getTimeArray() const
get time array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:106
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:118
void initvec()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:95
Identifying information for a spectrum.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:134
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:136
int ms_level
ms level
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:145
SpectrumMeta()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:147
double RT
retention time information
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:142
std::string id
a unique identifier for this spectrum.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:139
The structure that captures the generation of a peak list (including the underlying acquisitions)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:157
void setIntensityArray(BinaryDataArrayPtr data)
set intensity array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:204
Spectrum()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:166
std::size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:159
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:163
BinaryDataArrayPtr getMZArray() const
get m/z array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:186
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:198
void initvec()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:175
void setMZArray(BinaryDataArrayPtr data)
set mz array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:192