| OpenMS 2.5.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-2020.
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
71 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;
90 double precursor_isolation_target;
91 double product_isolation_target;
92
93 ChromatogramMeta() :
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:
112 Chromatogram() :
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 {
125 BinaryDataArrayPtr empty(new BinaryDataArray);
126 binaryDataArrayPtrs[i] = empty;
127 }
128 }
129
130 public:
132 BinaryDataArrayPtr getTimeArray() const
133 {
134 return binaryDataArrayPtrs[0];
135 }
136
138 void setTimeArray(BinaryDataArrayPtr data)
139 {
140 binaryDataArrayPtrs[0] = data;
141 }
142
144 BinaryDataArrayPtr getIntensityArray() const
145 {
146 return binaryDataArrayPtrs[1];
147 }
148
150 void setIntensityArray(BinaryDataArrayPtr data)
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
173 SpectrumMeta() :
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:
192 Spectrum() :
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 {
205 BinaryDataArrayPtr empty(new BinaryDataArray);
206 binaryDataArrayPtrs[i] = empty;
207 }
208 }
209
210 public:
212 BinaryDataArrayPtr getMZArray() const
213 {
214 return binaryDataArrayPtrs[0];
215 }
216
218 void setMZArray(BinaryDataArrayPtr data)
219 {
220 binaryDataArrayPtrs[0] = data;
221 }
222
224 BinaryDataArrayPtr getIntensityArray() const
225 {
226 return binaryDataArrayPtrs[1];
227 }
228
230 void setIntensityArray(BinaryDataArrayPtr data)
231 {
232 binaryDataArrayPtrs[1] = data;
233 }
234
235 };
236 typedef boost::shared_ptr<Spectrum> SpectrumPtr;
237
238 } //end namespace Interfaces
239 } //end namespace OpenMS
OpenMS::Interfaces::Chromatogram::getIntensityArray
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:144
OpenMS::Interfaces::Spectrum::binaryDataArrayPtrs
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:189
OpenMS::Interfaces::Chromatogram::setTimeArray
void setTimeArray(BinaryDataArrayPtr data)
set time array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:138
OpenMS::Interfaces::ChromatogramMetaPtr
boost::shared_ptr< ChromatogramMeta > ChromatogramMetaPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:99
OpenMS::Interfaces::Chromatogram::initvec
void initvec()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:121
OpenMS::Interfaces::SpectrumMeta::RT
double RT
retention time information
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:168
OpenMS::Interfaces::SpectrumMeta::id
std::string id
a unique identifier for this spectrum.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:165
OpenMS::Interfaces::ChromatogramMeta::ChromatogramMeta
ChromatogramMeta()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:93
OpenMS::Interfaces::SpectrumMeta::index
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:162
OpenMS::Interfaces::ChromatogramMeta::precursor_isolation_target
double precursor_isolation_target
precursor and product m/z
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:90
OpenMS::Interfaces::SpectrumMeta
Identifying information for a spectrum.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:159
OpenMS::Interfaces::Spectrum::setMZArray
void setMZArray(BinaryDataArrayPtr data)
set mz array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:218
OpenMS::Interfaces::BinaryDataArray
The datastructures used by the OpenSwath interfaces.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:72
OpenMS::Interfaces::Chromatogram::binaryDataArrayPtrs
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:109
OpenMS::Interfaces::Chromatogram::Chromatogram
Chromatogram()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:112
OpenMS::Interfaces::Spectrum::initvec
void initvec()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:201
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::Interfaces::Chromatogram::setIntensityArray
void setIntensityArray(BinaryDataArrayPtr data)
set intensity array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:150
OpenMS::Interfaces::Chromatogram::defaultArrayLength
std::size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:105
OpenMS::Interfaces::SpectrumMetaPtr
boost::shared_ptr< SpectrumMeta > SpectrumMetaPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:179
OpenMS::Interfaces::BinaryDataArrayPtr
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:80
OpenMS::Interfaces::Spectrum::setIntensityArray
void setIntensityArray(BinaryDataArrayPtr data)
set intensity array
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:230
OpenMS::Interfaces::Chromatogram
A single chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:102
OpenMS::Interfaces::ChromatogramMeta::id
std::string id
a unique identifier for this chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:88
OpenMS::Interfaces::BinaryDataArray::data
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:78
OpenMS::Interfaces::Spectrum::defaultArrayLength
std::size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:185
OpenMS::Interfaces::Spectrum
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:182
OpenMS::Interfaces::ChromatogramMeta
Identifying information for a chromatogram.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:83
OpenSwath::BinaryDataArray
OSBinaryDataArray BinaryDataArray
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:78
OpenMS::Interfaces::Chromatogram::getTimeArray
BinaryDataArrayPtr getTimeArray() const
get time array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:132
OpenMS::Interfaces::Spectrum::getMZArray
BinaryDataArrayPtr getMZArray() const
get m/z array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:212
OpenMS::Interfaces::Spectrum::getIntensityArray
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:224
OpenMS::Interfaces::ChromatogramPtr
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:156
OpenMS::Interfaces::ChromatogramMeta::index
std::size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:86
OpenMS::Interfaces::ChromatogramMeta::product_isolation_target
double product_isolation_target
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:91
OpenMS::Interfaces::Spectrum::Spectrum
Spectrum()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:192
OpenMS::Interfaces::SpectrumPtr
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:236
OpenMS::Interfaces::SpectrumMeta::SpectrumMeta
SpectrumMeta()
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:173
OpenMS::Interfaces::SpectrumMeta::ms_level
int ms_level
ms level
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:171