OpenMS  3.0.0
IMDataConverter.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-2022.
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: Eugen Netz $
32 // $Authors: Eugen Netz, Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <OpenMS/CONCEPT/Types.h>
39 #include <vector>
40 
41 namespace OpenMS
42 {
43  // forward declarations
44  namespace DataArrays
45  {
46  class FloatDataArray;
47  }
48  enum class DriftTimeUnit;
49 
54  class OPENMS_DLLAPI IMDataConverter
55  {
56  public:
69  static std::vector<PeakMap> splitByFAIMSCV(PeakMap&& exp);
70 
71 
85  static MSExperiment splitByIonMobility(MSSpectrum im_frame, UInt number_of_bins = -1);
86 
97  static MSExperiment splitByIonMobility(MSExperiment&& in, UInt number_of_bins = -1);
98 
116  static MSExperiment collapseFramesToSingle(const MSExperiment& in);
117 
137  static void setIMUnit(DataArrays::FloatDataArray& fda, const DriftTimeUnit unit);
138 
158  static bool getIMUnit(const DataArrays::FloatDataArray& fda, DriftTimeUnit& unit);
159  };
160 
161 } //end namespace OpenMS
OpenMS::MultiGradient
A gradient of multiple colors and arbitrary distances between colors.
Definition: MultiGradient.h:67
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:147
OpenMS::Matrix::resize
void resize(size_type i, size_type j, value_type value=value_type())
Definition: Matrix.h:243
Size
OpenMS::Internal::DIntervalBase::minX
CoordinateType minX() const
Accessor for min_ coordinate minimum.
Definition: DIntervalBase.h:294
Types.h
OpenMS::FeatureMap::Iterator
Base::iterator Iterator
Definition: FeatureMap.h:144
OpenMS::StringUtils::toQString
static QString toQString(const String &this_s)
Definition: StringUtils.h:201
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:57
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::MSExperiment::begin
Iterator begin()
Definition: MSExperiment.h:150
OpenMS::DRange< 1 >
OpenMS::String::trim
String & trim()
removes whitespaces (space, tab, line feed, carriage return) at the beginning and the end of the stri...
MzMLFile.h
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
FeatureXMLFile.h
OpenMS::ListUtils::contains
static bool contains(const std::vector< T > &container, const E &elem)
Checks whether the element elem is contained in the given container.
Definition: ListUtils.h:162
OpenMS::StringListUtils::toUpper
static void toUpper(StringList &sl)
Transforms all strings contained in the passed StringList to upper case.
MultiGradient.h
OpenMS::MultiGradient::getDefaultGradientLinearIntensityMode
static MultiGradient getDefaultGradientLinearIntensityMode()
Returns the default gradient for linear intensity mode.
OpenMS::DriftTimeUnit
DriftTimeUnit
Drift time unit for ion mobility.
Definition: IMTypes.h:45
OpenMS::Matrix::sizePair
std::pair< Size, Size > sizePair() const
Definition: Matrix.h:269
OpenMS::Internal::DIntervalBase::minY
CoordinateType minY() const
Accessor for max_ coordinate minimum.
Definition: DIntervalBase.h:300
OpenMS::MSExperiment::getMaxRT
CoordinateType getMaxRT() const
returns the maximal retention time value
OpenMS::Matrix::getValue
const_reference getValue(size_type const i, size_type const j) const
Definition: Matrix.h:165
OpenMS::IMDataConverter
This class converts PeakMaps and MSSpectra from/to different IM/FAIMS storage models.
Definition: IMDataConverter.h:54
OpenMS::MSExperiment::size
Size size() const
Definition: MSExperiment.h:120
OpenMS::MSExperiment::getPrecursorSpectrum
ConstIterator getPrecursorSpectrum(ConstIterator iterator) const
Returns the precursor spectrum of the scan pointed to by iterator.
OpenMS::Math::BilinearInterpolation
Provides access to bilinearly interpolated values (and derivatives) from discrete data points....
Definition: BilinearInterpolation.h:72
OpenMS::ConvexHull2D
A 2-dimensional hull representation in [counter]clockwise direction - depending on axis labelling.
Definition: ConvexHull2D.h:72
OpenMS::InPrecursorMZRange
Predicate that determines if a spectrum's precursor is within a certain m/z range.
Definition: RangeUtils.h:383
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::MSExperiment::Iterator
std::vector< SpectrumType >::iterator Iterator
Mutable iterator.
Definition: MSExperiment.h:104
OpenMS::MSExperiment::getMaxMZ
CoordinateType getMaxMZ() const
returns the maximal m/z value
OpenMS::MzMLFile::load
void load(const String &filename, PeakMap &map)
Loads a map from a MzML file. Spectra and chromatograms are sorted by default (this can be disabled u...
OpenMS::FeatureXMLFile::load
void load(const String &filename, FeatureMap &feature_map)
loads the file with name filename into map and calls updateRanges().
FeatureMap.h
RangeUtils.h
OpenMS::Math::BilinearInterpolation::getData
ContainerType & getData()
Returns the internal random access container storing the data.
Definition: BilinearInterpolation.h:510
OpenMS::DBoundingBox< 2 >
OpenMS::Math::BilinearInterpolation::setMapping_1
void setMapping_1(KeyType const &scale, KeyType const &inside_low, KeyType const &outside_low)
Specifies the mapping from "outside" to "inside" coordinates by the following data:
Definition: BilinearInterpolation.h:713
OpenMS::String::toQString
QString toQString() const
Conversion to Qt QString.
OpenMS::Math
Math namespace.
Definition: BilinearInterpolation.h:42
OpenMS::Math::BilinearInterpolation::addValue
void addValue(KeyType arg_pos_0, KeyType arg_pos_1, ValueType arg_value)
Performs bilinear resampling. The arg_value is split up and added to the data points around arg_pos....
Definition: BilinearInterpolation.h:316
OpenMS::String::toUpper
String & toUpper()
Converts the string to uppercase.
OpenMS::StringList
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
OpenMS::UInt
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
BilinearInterpolation.h
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:71
OpenMS::Internal::DIntervalBase::maxY
CoordinateType maxY() const
Accessor for max_ coordinate maximum.
Definition: DIntervalBase.h:312
OpenMS::Constants::h
const double h
Definition: Constants.h:162
LinearResampler.h
OPENMS_LOG_ERROR
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:98
OpenMS::PeakFileOptions::setRTRange
void setRTRange(const DRange< 1 > &range)
restricts the range of RT values for peaks to load
OpenMS::MSExperiment::end
Iterator end()
Definition: MSExperiment.h:160
OpenMS::MSExperiment::getSpectra
const std::vector< MSSpectrum > & getSpectra() const
returns the spectrum list
OpenMS::FeatureXMLFile
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:62
OpenMS::ConvexHull2D::getBoundingBox
DBoundingBox< 2 > getBoundingBox() const
returns the bounding box of the feature hull points
OpenMS::MSExperiment::updateRanges
void updateRanges() override
OpenMS::Internal::DIntervalBase::maxX
CoordinateType maxX() const
Accessor for min_ coordinate maximum.
Definition: DIntervalBase.h:306
OpenMS::PeakFileOptions::setMZRange
void setMZRange(const DRange< 1 > &range)
restricts the range of MZ values for peaks to load
OpenMS::MSExperiment::ConstIterator
std::vector< SpectrumType >::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSExperiment.h:106
OpenMS::MultiGradient::getDefaultGradientLogarithmicIntensityMode
static MultiGradient getDefaultGradientLogarithmicIntensityMode()
Returns the default gradient for logarithmic intensity mode.
OpenMS::PeakFileOptions::setMSLevels
void setMSLevels(const std::vector< Int > &levels)
sets the desired MS levels for peaks to load
OpenMS::Exception::ElementNotFound
Element could not be found exception.
Definition: Exception.h:674
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
OpenMS::MultiGradient::fromString
void fromString(const std::string &gradient)
Sets the gradient by string representation.
OpenMS::String::suffix
String suffix(SizeType length) const
returns the suffix of length length
OpenMS::MSExperiment::getMinMZ
CoordinateType getMinMZ() const
returns the minimal m/z value
OpenMS::DataArrays::FloatDataArray
Float data array class.
Definition: DataArrays.h:45
StandardTypes.h
OpenMS::MzMLFile::getOptions
PeakFileOptions & getOptions()
Mutable access to the options for loading/storing.
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
TOPPBase.h
OpenMS::MSExperiment::getMinRT
CoordinateType getMinRT() const
returns the minimal retention time value
OpenMS::Math::BilinearInterpolation::setMapping_0
void setMapping_0(KeyType const &scale, KeyType const &inside_low, KeyType const &outside_low)
Specifies the mapping from "outside" to "inside" coordinates by the following data:
Definition: BilinearInterpolation.h:670
OpenMS::MultiGradient::interpolatedColorAt
QColor interpolatedColorAt(double position) const
Returns the color as position.
StringListUtils.h