Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
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-2017.
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 #ifndef OPENMS_INTERFACES_DATASTRUCTURES_H
36 #define OPENMS_INTERFACES_DATASTRUCTURES_H
37 
38 #include <string>
39 #include <vector>
40 #include <boost/shared_ptr.hpp>
41 
42 #include <OpenMS/config.h>
43 
44 namespace OpenMS
45 {
46 namespace Interfaces
47 {
48 
72  struct OPENMS_DLLAPI BinaryDataArray
74  {
76  //DataProcessingPtr dataProcessingPtr;
77 
79  std::vector<double> data;
80  };
81  typedef boost::shared_ptr<BinaryDataArray> BinaryDataArrayPtr;
82 
84  struct OPENMS_DLLAPI ChromatogramMeta
85  {
87  std::size_t index;
89  std::string id;
93 
95  index()
96  {
97  }
98 
99  };
100  typedef boost::shared_ptr<ChromatogramMeta> ChromatogramMetaPtr;
101 
103  struct OPENMS_DLLAPI Chromatogram
104  {
106  std::size_t defaultArrayLength;
107 
108 private:
110  std::vector<BinaryDataArrayPtr> binaryDataArrayPtrs;
111 
112 public:
114  defaultArrayLength(2),
115  binaryDataArrayPtrs(defaultArrayLength)
116  {
117  initvec();
118  }
119 
120 private:
121 
122  void initvec()
123  {
124  for (std::size_t i = 0; i < defaultArrayLength; ++i)
125  {
126  BinaryDataArrayPtr empty(new BinaryDataArray);
127  binaryDataArrayPtrs[i] = empty;
128  }
129  }
130 
131 public:
133  BinaryDataArrayPtr getTimeArray() const
134  {
135  return binaryDataArrayPtrs[0];
136  }
137 
139  void setTimeArray(BinaryDataArrayPtr data)
140  {
141  binaryDataArrayPtrs[0] = data;
142  }
143 
145  BinaryDataArrayPtr getIntensityArray() const
146  {
147  return binaryDataArrayPtrs[1];
148  }
149 
151  void setIntensityArray(BinaryDataArrayPtr data)
152  {
153  binaryDataArrayPtrs[1] = data;
154  }
155 
156  };
157  typedef boost::shared_ptr<Chromatogram> ChromatogramPtr;
158 
160  struct OPENMS_DLLAPI SpectrumMeta
161  {
163  size_t index;
164 
166  std::string id;
167 
169  double RT;
170 
172  int ms_level;
173 
175  index(0)
176  {
177  }
178 
179  };
180  typedef boost::shared_ptr<SpectrumMeta> SpectrumMetaPtr;
181 
183  struct OPENMS_DLLAPI Spectrum
184  {
186  std::size_t defaultArrayLength;
187 
188 private:
190  std::vector<BinaryDataArrayPtr> binaryDataArrayPtrs;
191 
192 public:
194  defaultArrayLength(2),
195  binaryDataArrayPtrs(defaultArrayLength)
196  {
197  initvec();
198  }
199 
200 private:
201 
202  void initvec()
203  {
204  for (std::size_t i = 0; i < defaultArrayLength; ++i)
205  {
206  BinaryDataArrayPtr empty(new BinaryDataArray);
207  binaryDataArrayPtrs[i] = empty;
208  }
209  }
210 
211 public:
213  BinaryDataArrayPtr getMZArray() const
214  {
215  return binaryDataArrayPtrs[0];
216  }
217 
219  void setMZArray(BinaryDataArrayPtr data)
220  {
221  binaryDataArrayPtrs[0] = data;
222  }
223 
225  BinaryDataArrayPtr getIntensityArray() const
226  {
227  return binaryDataArrayPtrs[1];
228  }
229 
231  void setIntensityArray(BinaryDataArrayPtr data)
232  {
233  binaryDataArrayPtrs[1] = data;
234  }
235 
236  };
237  typedef boost::shared_ptr<Spectrum> SpectrumPtr;
238 
239 } //end namespace Interfaces
240 } //end namespace OpenMS
241 #endif
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:237
Spectrum()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:193
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:157
std::string id
a unique identifier for this chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:89
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:81
std::size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:87
BinaryDataArrayPtr getMZArray() const
get m/z array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:213
BinaryDataArrayPtr getTimeArray() const
get time array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:133
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Chromatogram()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:113
std::size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:186
Identifying information for a spectrum.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:160
A single chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:103
double product_isolation_target
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:92
void setIntensityArray(BinaryDataArrayPtr data)
set intensity array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:231
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:145
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:163
std::size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:106
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:183
double precursor_isolation_target
precursor and product m/z
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:91
void setMZArray(BinaryDataArrayPtr data)
set mz array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:219
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:190
void initvec()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:202
boost::shared_ptr< ChromatogramMeta > ChromatogramMetaPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:100
boost::shared_ptr< SpectrumMeta > SpectrumMetaPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:180
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:110
ChromatogramMeta()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:94
SpectrumMeta()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:174
std::vector< double > data
this optional attribute may reference the &#39;id&#39; attribute of the appropriate dataProcessing.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:79
std::string id
a unique identifier for this spectrum.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:166
double RT
retention time information
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:169
void setIntensityArray(BinaryDataArrayPtr data)
set intensity array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:151
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:225
Identifying information for a chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:84
int ms_level
ms level
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:172
void setTimeArray(BinaryDataArrayPtr data)
set time array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:139
void initvec()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:122

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:21:59 using doxygen 1.8.13