OpenMS  2.4.0
openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/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-2018.
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/OPENSWATHALGO/OpenSwathAlgoConfig.h>
42 
43 namespace OpenSwath
44 {
66  struct OPENSWATHALGO_DLLAPI OSBinaryDataArray
68  {
70  //DataProcessingPtr dataProcessingPtr;
71 
73  std::vector<double> data;
74 
76  std::string description;
77  };
79  typedef boost::shared_ptr<BinaryDataArray> BinaryDataArrayPtr;
80 
82  struct OPENSWATHALGO_DLLAPI OSChromatogramMeta
83  {
85  std::size_t index;
87  std::string id;
89  index()
90  {
91  }
92 
93  };
95  typedef boost::shared_ptr<ChromatogramMeta> ChromatogramMetaPtr;
96 
98  struct OPENSWATHALGO_DLLAPI OSChromatogram
99  {
100 private:
102  std::size_t defaultArrayLength;
103 
105  //DataProcessingPtr dataProcessingPtr;
107  //Precursor precursor;
109  //Product product;
110 
112  std::vector<BinaryDataArrayPtr> binaryDataArrayPtrs;
113 public:
114 
116  defaultArrayLength(2),
117  binaryDataArrayPtrs(defaultArrayLength)
118  {
119  initvec();
120  }
121 
122 private:
123 
124  void initvec()
125  {
126  for (std::size_t i = 0; i < defaultArrayLength; ++i)
127  {
129  binaryDataArrayPtrs[i] = empty;
130  }
131  }
132 
133 public:
136  {
137  return binaryDataArrayPtrs[0];
138  }
139 
141  {
142  binaryDataArrayPtrs[0] = data;
143  }
144 
147  {
148  return binaryDataArrayPtrs[1];
149  }
150 
152  {
153  binaryDataArrayPtrs[1] = data;
154  }
155 
157  const std::vector<BinaryDataArrayPtr> & getDataArrays() const
158  {
159  return binaryDataArrayPtrs;
160  }
161 
163  std::vector<BinaryDataArrayPtr> & getDataArrays()
164  {
165  return binaryDataArrayPtrs;
166  }
167 
168  };
170  typedef boost::shared_ptr<Chromatogram> ChromatogramPtr;
171 
173  struct OPENSWATHALGO_DLLAPI OSSpectrumMeta
174  {
176  size_t index;
177 
179  std::string id;
180 
181  double RT;
182 
183  int ms_level;
184 
186  index(0)
187  {
188  }
189 
191  struct RTLess :
192  public std::binary_function<OSSpectrumMeta, OSSpectrumMeta, bool>
193  {
194  inline bool operator()(const OSSpectrumMeta& a, const OSSpectrumMeta& b) const
195  {
196  return a.RT < b.RT;
197  }
198  };
199 
200  };
202  typedef boost::shared_ptr<SpectrumMeta> SpectrumMetaPtr;
203 
205  struct OPENSWATHALGO_DLLAPI OSSpectrum
206  {
207 private:
209  std::size_t defaultArrayLength;
210 
212  std::vector<BinaryDataArrayPtr> binaryDataArrayPtrs;
213 public:
215  defaultArrayLength(2),
216  binaryDataArrayPtrs(defaultArrayLength)
217  {
218  initvec();
219  }
220 
221 private:
222 
223  void initvec()
224  {
225  for (std::size_t i = 0; i < defaultArrayLength; ++i)
226  {
228  binaryDataArrayPtrs[i] = empty;
229  }
230  }
231 
232 public:
233 
236  {
237  return binaryDataArrayPtrs[0];
238  }
239 
241  {
242  binaryDataArrayPtrs[0] = data;
243  }
244 
247  {
248  return binaryDataArrayPtrs[1];
249  }
250 
252  {
253  binaryDataArrayPtrs[1] = data;
254  }
255 
257  const std::vector<BinaryDataArrayPtr> & getDataArrays() const
258  {
259  return binaryDataArrayPtrs;
260  }
261 
263  std::vector<BinaryDataArrayPtr> & getDataArrays()
264  {
265  return binaryDataArrayPtrs;
266  }
267 
268  };
270  typedef boost::shared_ptr<Spectrum> SpectrumPtr;
271 } //end Namespace OpenSwath
272 
void setTimeArray(BinaryDataArrayPtr data)
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:140
std::size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:102
BinaryDataArrayPtr getTimeArray()
get time array (may be null)
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:135
Identifying information for a spectrum.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:173
OSChromatogramMeta ChromatogramMeta
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:94
void initvec()
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:124
std::string id
a unique identifier for this chromatogram.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:87
OSBinaryDataArray BinaryDataArray
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:78
boost::shared_ptr< ChromatogramMeta > ChromatogramMetaPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:95
int ms_level
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:183
bool operator()(const OSSpectrumMeta &a, const OSSpectrumMeta &b) const
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:194
std::size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:209
const std::vector< BinaryDataArrayPtr > & getDataArrays() const
non-mutable access to the underlying data arrays
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:157
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:246
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:270
OSChromatogram Chromatogram
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:169
void setMZArray(BinaryDataArrayPtr data)
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:240
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:212
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:205
boost::shared_ptr< SpectrumMeta > SpectrumMetaPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:202
BinaryDataArrayPtr getMZArray() const
get m/z array (may be null)
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:235
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:79
OSChromatogram()
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:115
std::size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:85
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
this attribute can optionally reference the &#39;id&#39; of the appropriate dataProcessing.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:112
Comparator for the retention time.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:191
void setIntensityArray(BinaryDataArrayPtr data)
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:251
std::vector< BinaryDataArrayPtr > & getDataArrays()
mutable access to the underlying data arrays
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:263
std::vector< BinaryDataArrayPtr > & getDataArrays()
mutable access to the underlying data arrays
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:163
double RT
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:181
BinaryDataArrayPtr getIntensityArray()
get intensity array (may be null)
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:146
Definition: MRMScoring.h:50
void initvec()
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:223
void setIntensityArray(BinaryDataArrayPtr data)
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:151
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:170
OSSpectrumMeta SpectrumMeta
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:201
OSSpectrum Spectrum
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:269
A single chromatogram.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:98
OSSpectrumMeta()
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:185
Identifying information for a chromatogram.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:82
std::vector< double > data
this optional attribute may reference the &#39;id&#39; attribute of the appropriate dataProcessing.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:73
OSSpectrum()
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:214
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:176
std::string id
a unique identifier for this spectrum.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:179
const std::vector< BinaryDataArrayPtr > & getDataArrays() const
non-mutable access to the underlying data arrays
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:257
OSChromatogramMeta()
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:88
The datastructures used by the OpenSwath interfaces.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:67
std::string description
(optional) data description for non-standard arrays.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:76