OpenMS  2.7.0
openms/include/OpenMS/INTERFACES/DataStructures.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2021.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Hannes Roest $
32 // $Authors: Darren Kessner, Hannes Roest, Witold Wolski$
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <string>
38 #include <vector>
39 #include <boost/shared_ptr.hpp>
40 
41 #include <OpenMS/config.h>
42 
43 namespace OpenMS
44 {
45 namespace Interfaces
46 {
47 
72  struct OPENMS_DLLAPI BinaryDataArray
73  {
75  //DataProcessingPtr dataProcessingPtr;
76 
78  std::vector<double> data;
79  };
80  typedef boost::shared_ptr<BinaryDataArray> BinaryDataArrayPtr;
81 
83  struct OPENMS_DLLAPI ChromatogramMeta
84  {
86  std::size_t index;
88  std::string id;
92 
94  index()
95  {
96  }
97 
98  };
99  typedef boost::shared_ptr<ChromatogramMeta> ChromatogramMetaPtr;
100 
102  struct OPENMS_DLLAPI Chromatogram
103  {
105  std::size_t defaultArrayLength;
106 
107 private:
109  std::vector<BinaryDataArrayPtr> binaryDataArrayPtrs;
110 
111 public:
113  defaultArrayLength(2),
114  binaryDataArrayPtrs(defaultArrayLength)
115  {
116  initvec();
117  }
118 
119 private:
120 
121  void initvec()
122  {
123  for (std::size_t i = 0; i < defaultArrayLength; ++i)
124  {
126  binaryDataArrayPtrs[i] = empty;
127  }
128  }
129 
130 public:
133  {
134  return binaryDataArrayPtrs[0];
135  }
136 
139  {
140  binaryDataArrayPtrs[0] = data;
141  }
142 
145  {
146  return binaryDataArrayPtrs[1];
147  }
148 
151  {
152  binaryDataArrayPtrs[1] = data;
153  }
154 
155  };
156  typedef boost::shared_ptr<Chromatogram> ChromatogramPtr;
157 
159  struct OPENMS_DLLAPI SpectrumMeta
160  {
162  size_t index;
163 
165  std::string id;
166 
168  double RT;
169 
171  int ms_level;
172 
174  index(0)
175  {
176  }
177 
178  };
179  typedef boost::shared_ptr<SpectrumMeta> SpectrumMetaPtr;
180 
182  struct OPENMS_DLLAPI Spectrum
183  {
185  std::size_t defaultArrayLength;
186 
187 private:
189  std::vector<BinaryDataArrayPtr> binaryDataArrayPtrs;
190 
191 public:
193  defaultArrayLength(2),
194  binaryDataArrayPtrs(defaultArrayLength)
195  {
196  initvec();
197  }
198 
199 private:
200 
201  void initvec()
202  {
203  for (std::size_t i = 0; i < defaultArrayLength; ++i)
204  {
206  binaryDataArrayPtrs[i] = empty;
207  }
208  }
209 
210 public:
213  {
214  return binaryDataArrayPtrs[0];
215  }
216 
219  {
220  binaryDataArrayPtrs[0] = data;
221  }
222 
225  {
226  return binaryDataArrayPtrs[1];
227  }
228 
231  {
232  binaryDataArrayPtrs[1] = data;
233  }
234 
235  };
236  typedef boost::shared_ptr<Spectrum> SpectrumPtr;
237 
238 } //end namespace Interfaces
239 } //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:78
boost::shared_ptr< ChromatogramMeta > ChromatogramMetaPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:99
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:156
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:80
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:236
boost::shared_ptr< SpectrumMeta > SpectrumMetaPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:179
The datastructures used by the OpenSwath interfaces.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:73
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Identifying information for a chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:84
double precursor_isolation_target
precursor and product m/z
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:90
std::size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:86
ChromatogramMeta()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:93
std::string id
a unique identifier for this chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:88
double product_isolation_target
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:91
A single chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:103
void setIntensityArray(BinaryDataArrayPtr data)
set intensity array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:150
std::size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:105
void setTimeArray(BinaryDataArrayPtr data)
set time array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:138
Chromatogram()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:112
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:109
BinaryDataArrayPtr getTimeArray() const
get time array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:132
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:144
void initvec()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:121
Identifying information for a spectrum.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:160
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:162
int ms_level
ms level
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:171
SpectrumMeta()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:173
double RT
retention time information
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:168
std::string id
a unique identifier for this spectrum.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:165
The structure that captures the generation of a peak list (including the underlying acquisitions)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:183
void setIntensityArray(BinaryDataArrayPtr data)
set intensity array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:230
Spectrum()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:192
std::size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:185
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:189
BinaryDataArrayPtr getMZArray() const
get m/z array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:212
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:224
void initvec()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:201
void setMZArray(BinaryDataArrayPtr data)
set mz array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:218