Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
MzMLHandlerHelper.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: Hannes Roest $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_FORMAT_HANDLERS_MZMLHANDLERHELPER_H
36 #define OPENMS_FORMAT_HANDLERS_MZMLHANDLERHELPER_H
37 
41 
42 #include <vector>
43 
44 namespace OpenMS
45 {
46  namespace Internal
47  {
48 
49  class OPENMS_DLLAPI MzMLHandlerHelper
50  {
51 
53  static void warning(int mode, const String & msg, UInt line = 0, UInt column = 0);
54 
55  public:
56 
58  struct BinaryData
59  {
61  enum {PRE_NONE, PRE_32, PRE_64} precision;
63  bool compression; // zlib compression
64  enum {DT_NONE, DT_FLOAT, DT_INT, DT_STRING} data_type;
65  std::vector<float> floats_32;
66  std::vector<double> floats_64;
67  std::vector<Int32> ints_32;
68  std::vector<Int64> ints_64;
69  std::vector<String> decoded_char;
72 
75  base64(),
76  precision(PRE_NONE),
77  size(0),
78  compression(false),
79  data_type(DT_NONE),
80  floats_32(),
81  floats_64(),
82  ints_32(),
83  ints_64(),
84  decoded_char(),
85  meta(),
86  np_compression()
87  {
88  }
89 
90  };
91 
95  static String getCompressionTerm_(const PeakFileOptions& opt, MSNumpressCoder::NumpressConfig np_compression, String indent = "", bool use_numpress = false);
96 
100  static void writeFooter_(std::ostream& os, const PeakFileOptions& options_,
101  std::vector< std::pair<std::string, long> > & spectra_offsets,
102  std::vector< std::pair<std::string, long> > & chromatograms_offsets
103  );
104 
111  static void decodeBase64Arrays(std::vector<BinaryData> & data_, bool skipXMLCheck = false);
112 
113  static void computeDataProperties_(std::vector<BinaryData>& data_, bool& precision_64, SignedSize& index, String index_name);
114 
115  static bool handleBinaryDataArrayCVParam(std::vector<BinaryData>& data_,
116  const String& accession, const String& value, const String& name);
117  };
118 
119 
120  } // namespace Internal
121 } // namespace OpenMS
122 
123 #endif // OPENMS_FORMAT_HANDLERS_MZMLHANDLERHELPER_H
124 
A more convenient string class.
Definition: String.h:57
std::vector< float > floats_32
Definition: MzMLHandlerHelper.h:65
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
std::vector< Int32 > ints_32
Definition: MzMLHandlerHelper.h:67
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:135
Binary data representation.
Definition: MzMLHandlerHelper.h:58
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Description of the meta data arrays of MSSpectrum.
Definition: MetaInfoDescription.h:49
Configuration class for MSNumpress.
Definition: MSNumpressCoder.h:69
NumpressCompression
Definition: MSNumpressCoder.h:60
Size size
Definition: MzMLHandlerHelper.h:62
std::vector< double > floats_64
Definition: MzMLHandlerHelper.h:66
BinaryData()
Constructor.
Definition: MzMLHandlerHelper.h:74
MetaInfoDescription meta
Definition: MzMLHandlerHelper.h:70
std::vector< String > decoded_char
Definition: MzMLHandlerHelper.h:69
MSNumpressCoder::NumpressCompression np_compression
Definition: MzMLHandlerHelper.h:71
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
bool compression
Definition: MzMLHandlerHelper.h:63
std::vector< Int64 > ints_64
Definition: MzMLHandlerHelper.h:68
Options for loading files containing peak data.
Definition: PeakFileOptions.h:48
String base64
Definition: MzMLHandlerHelper.h:60
Definition: MzMLHandlerHelper.h:49

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