OpenMS
IMTypes.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Chris Bielow $
6 // $Authors: Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <OpenMS/OpenMSConfig.h>
13 
14 #include <string>
15 
16 namespace OpenMS
17 {
18  class MSExperiment;
19  class MSSpectrum;
20 
22  enum class DriftTimeUnit
23  {
24  NONE,
25  MILLISECOND,
26  VSSC,
29  };
30 
32  OPENMS_DLLAPI extern const std::string NamesOfDriftTimeUnit[(size_t) DriftTimeUnit::SIZE_OF_DRIFTTIMEUNIT];
33 
36  OPENMS_DLLAPI DriftTimeUnit toDriftTimeUnit(const std::string& dtu_string);
37 
40  OPENMS_DLLAPI const std::string& toString(const DriftTimeUnit value);
41 
43  enum class IMFormat
44  {
45  NONE,
46  CONCATENATED,
48  MIXED,
50  };
52  OPENMS_DLLAPI extern const std::string NamesOfIMFormat[(size_t) IMFormat::SIZE_OF_IMFORMAT];
53 
56  OPENMS_DLLAPI IMFormat toIMFormat(const std::string& IM_format);
59  OPENMS_DLLAPI const std::string& toString(const IMFormat value);
60 
61  class OPENMS_DLLAPI IMTypes
62  {
63  public:
65  inline static constexpr double DRIFTTIME_NOT_SET = -1.0;
66 
72 
81  static IMFormat determineIMFormat(const MSSpectrum& spec);
82 
89  static DIM_UNIT fromIMUnit(const DriftTimeUnit from);
90  };
91 
92 };
93 
Definition: IMTypes.h:62
static IMFormat determineIMFormat(const MSExperiment &exp)
static DIM_UNIT fromIMUnit(const DriftTimeUnit from)
static IMFormat determineIMFormat(const MSSpectrum &spec)
Checks for existence of a single driftTime (using spec.getDriftTime()) or an ion-mobility float data ...
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:45
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
IMFormat
Different ways to represent ion mobility data in a spectrum.
Definition: IMTypes.h:44
@ MIXED
an MSExperiment contains both CONCATENATED and MULTIPLE_SPECTRA
@ CONCATENATED
ion mobility frame is stacked in a single spectrum (i.e. has an IM float data array)
@ NONE
no ion mobility
@ MULTIPLE_SPECTRA
ion mobility is recorded as multiple spectra per frame (i.e. has one IM annotation per spectrum)
DriftTimeUnit toDriftTimeUnit(const std::string &dtu_string)
DriftTimeUnit
Drift time unit for ion mobility.
Definition: IMTypes.h:23
@ MILLISECOND
milliseconds
@ VSSC
volt-second per square centimeter (i.e. 1/K_0)
@ FAIMS_COMPENSATION_VOLTAGE
compensation voltage
const std::string NamesOfIMFormat[(size_t) IMFormat::SIZE_OF_IMFORMAT]
Names of IMFormat.
const std::string NamesOfDriftTimeUnit[(size_t) DriftTimeUnit::SIZE_OF_DRIFTTIMEUNIT]
Names of IM Units. Should be usable as axis annotation.
const std::string & toString(const DriftTimeUnit value)
IMFormat toIMFormat(const std::string &IM_format)
DIM_UNIT
Definition: CommonEnums.h:20