![]() |
OpenMS
|
Helper for mzML file format. More...
#include <OpenMS/FORMAT/HANDLERS/MzMLHandlerHelper.h>
Classes | |
| struct | BinaryData |
| Representation for binary data in mzML. More... | |
Static Public Member Functions | |
| static std::string | getCompressionTerm_ (const PeakFileOptions &opt, MSNumpressCoder::NumpressConfig np_compression, const std::string &indent="", bool use_numpress=false, bool zstd_byte_shuffle=true) |
| Returns the appropriate compression term given the PeakFileOptions and the NumpressConfig. | |
| static void | encodeNumericArray (std::vector< float > &in, const PeakFileOptions &opt, std::string &out) |
Encode a numeric array as Base64 string, applying the compression selected in opt. | |
| static void | encodeNumericArray (std::vector< double > &in, const PeakFileOptions &opt, std::string &out) |
Encode a numeric array as Base64 string, applying the compression selected in opt. | |
| static void | encodeNumericArray (std::vector< Int32 > &in, const PeakFileOptions &opt, std::string &out) |
Encode a numeric array as Base64 string, applying the compression selected in opt. | |
| static void | encodeNumericArray (std::vector< Int64 > &in, const PeakFileOptions &opt, std::string &out) |
Encode a numeric array as Base64 string, applying the compression selected in opt. | |
| static void | encodeStringArray (const std::vector< std::string > &in, const PeakFileOptions &opt, std::string &out) |
Encode a string array (null-terminated strings) as Base64 string, applying the compression selected in opt. | |
| static void | encodeNumpressArray (const std::vector< double > &in, const PeakFileOptions &opt, const MSNumpressCoder::NumpressConfig &config, std::string &out) |
Numpress-encode an array and encode the result as Base64 string, applying the compression selected in opt. | |
| static void | encodeNumpressArray (const std::vector< float > &in, const PeakFileOptions &opt, const MSNumpressCoder::NumpressConfig &config, std::string &out) |
Numpress-encode an array and encode the result as Base64 string, applying the compression selected in opt. | |
| static void | writeFooter_ (std::ostream &os, const PeakFileOptions &options, const std::vector< std::pair< std::string, Int64 > > &spectra_offsets, const std::vector< std::pair< std::string, Int64 > > &chromatograms_offsets) |
| Write the indexed mzML footer the appropriate compression term given the PeakFileOptions and the NumpressConfig. | |
| static void | decodeBase64Arrays (std::vector< BinaryData > &data_, const bool skipXMLCheck=false) |
| Decode Base64 arrays and write into data_ array. | |
| static void | computeDataProperties_ (const std::vector< BinaryData > &data_, bool &precision_64, SignedSize &index, const std::string &index_name) |
| Identify a data array from a list. | |
| static bool | handleBinaryDataArrayCVParam (std::vector< BinaryData > &data_, const std::string &accession, const std::string &value, const std::string &name, const std::string &unit_accession) |
| Handle a given CV parameter found in a binaryDataArray tag. | |
Static Private Member Functions | |
| static void | warning (int mode, const std::string &msg, UInt line=0, UInt column=0) |
| Also display some warning message when appropriate (see XMLHandler) | |
Helper for mzML file format.
This class provides common structures and re-useable helper functions for parsing the mzML format. These are mainly used by MzMLHandler and MzMLSpectrumDecoder.
|
static |
Identify a data array from a list.
Given a specific array name, find it in the provided list and return its index and precision.
| [in] | data_ | The list of data arrays |
| [in] | precision_64 | Whether the identified array has 64 bit precision |
| [in] | index | The index of the identified array |
| [in] | index_name | The name of the array to be identified |
|
static |
|
static |
Encode a numeric array as Base64 string, applying the compression selected in opt.
If zstd compression is enabled in opt, the array is byte-shuffled and compressed with zstd (MS:1003781), otherwise it is zlib-compressed if requested (MS:1000574). The data is always stored in little-endian byte order.
| [in,out] | in | The data to encode (may be modified, i.e. endianized) |
| [in] | opt | The PeakFileOptions used for writing |
| [out] | out | The resulting Base64 string |
|
static |
Encode a numeric array as Base64 string, applying the compression selected in opt.
If zstd compression is enabled in opt, the array is byte-shuffled and compressed with zstd (MS:1003781), otherwise it is zlib-compressed if requested (MS:1000574). The data is always stored in little-endian byte order.
| [in,out] | in | The data to encode (may be modified, i.e. endianized) |
| [in] | opt | The PeakFileOptions used for writing |
| [out] | out | The resulting Base64 string |
|
static |
Encode a numeric array as Base64 string, applying the compression selected in opt.
If zstd compression is enabled in opt, the array is byte-shuffled and compressed with zstd (MS:1003781), otherwise it is zlib-compressed if requested (MS:1000574). The data is always stored in little-endian byte order.
| [in,out] | in | The data to encode (may be modified, i.e. endianized) |
| [in] | opt | The PeakFileOptions used for writing |
| [out] | out | The resulting Base64 string |
|
static |
Encode a numeric array as Base64 string, applying the compression selected in opt.
If zstd compression is enabled in opt, the array is byte-shuffled and compressed with zstd (MS:1003781), otherwise it is zlib-compressed if requested (MS:1000574). The data is always stored in little-endian byte order.
| [in,out] | in | The data to encode (may be modified, i.e. endianized) |
| [in] | opt | The PeakFileOptions used for writing |
| [out] | out | The resulting Base64 string |
|
static |
Numpress-encode an array and encode the result as Base64 string, applying the compression selected in opt.
If zstd compression is enabled in opt, the numpress output is compressed with zstd (MS:1003783 - MS:1003785), otherwise it is zlib-compressed if requested (MS:1002746 - MS:1002748).
| [in] | in | The data to encode |
| [in] | opt | The PeakFileOptions used for writing |
| [in] | config | The numpress configuration |
| [out] | out | The resulting Base64 string (empty if numpress encoding failed) |
|
static |
Numpress-encode an array and encode the result as Base64 string, applying the compression selected in opt.
If zstd compression is enabled in opt, the numpress output is compressed with zstd (MS:1003783 - MS:1003785), otherwise it is zlib-compressed if requested (MS:1002746 - MS:1002748).
| [in] | in | The data to encode |
| [in] | opt | The PeakFileOptions used for writing |
| [in] | config | The numpress configuration |
| [out] | out | The resulting Base64 string (empty if numpress encoding failed) |
|
static |
Encode a string array (null-terminated strings) as Base64 string, applying the compression selected in opt.
If zstd compression is enabled in opt, the data is compressed with zstd (MS:1003780), otherwise it is zlib-compressed if requested (MS:1000574).
| [in] | in | The strings to encode |
| [in] | opt | The PeakFileOptions used for writing |
| [out] | out | The resulting Base64 string |
|
static |
Returns the appropriate compression term given the PeakFileOptions and the NumpressConfig.
| [in] | opt | The PeakFileOptions used for writing (zlib or zstd compression) |
| [in] | np_compression | The numpress configuration of the array |
| [in] | indent | Indentation prepended to the term |
| [in] | use_numpress | Whether numpress compression is applied to the array |
| [in] | zstd_byte_shuffle | Whether the array is byte-shuffled before zstd compression (only used if zstd compression is enabled and numpress is not used) |
|
static |
Handle a given CV parameter found in a binaryDataArray tag.
Given a CV parameter, properly set the members of the last entry of data_, this will properly handle all terms describing precision, compression, name of the data and units.
| [in,out] | data_ | The list of data arrays, whose last entry will be changed |
| [in] | accession | The CV accession |
| [in] | value | The CV value |
| [in] | name | The CV name |
| [in] | unit_accession | The CV unit accession (if a unit tag is present) |
|
staticprivate |
Also display some warning message when appropriate (see XMLHandler)
|
static |
Write the indexed mzML footer the appropriate compression term given the PeakFileOptions and the NumpressConfig.
| [out] | os | The output stream |
| [in] | options | The PeakFileOptions used for writing |
| [in] | spectra_offsets | Binary offsets of <spectrum> tags |
| [in] | chromatograms_offsets | Binary offsets of <chromatogram> tags |