132 return data_.front();
136 return data_.front();
150 return data_.begin();
154 return data_.begin();
158 return data_.cbegin();
176 return data_.rbegin();
180 return data_.crbegin();
188 return data_.crend();
193 return data_.empty();
197 return data_.erase(where);
206 return data_.emplace_back(mb);
208 template<
class... Args>
211 data_.emplace_back(args...);
221 return data_.insert(where,
first, last);
226 return data_.resize(new_size);
230 return data_.reserve(new_size);
240 data_.swap(mb.data_);
241 std::swap(retention_time_, mb.retention_time_);
242 std::swap(drift_time_unit_, mb.drift_time_unit_);
252 return retention_time_;
258 retention_time_ = rt;
266 return drift_time_unit_;
301 float_data_arrays_ = fda;
313 string_data_arrays_ = sda;
325 integer_data_arrays_ = ida;
354 template<
class Predicate>
357 auto value_2_index_wrapper = [
this, &lambda](
const PeakType& value1,
const PeakType& value2) {
359 const Size index1 = (&value1) - (&this->front());
360 const Size index2 = (&value2) - (&this->front());
362 assert(index1 < this->size());
363 assert(index2 < this->size());
364 return lambda(index1, index2);
366 return std::is_sorted(this->begin(), this->end(), value_2_index_wrapper);
387 template<
class Predicate>
388 void sort(
const Predicate& lambda)
392 checkDataArraySizes_();
395 selectUnchecked(Internal::stableSortedIndices(this->size(), lambda));
654 void checkDataArraySizes_() const;
660 double retention_time_ = -1;
Float data array class.
Definition DataArrays.h:25
Integer data array class.
Definition DataArrays.h:75
std::string data array class
Definition DataArrays.h:125
A 1-dimensional raw data mobility point or peak. The unit (ms, 1/K_0, etc) is implicit.
Definition MobilityPeak1D.h:28
double CoordinateType
Coordinate type.
Definition MobilityPeak1D.h:39
The representation of a 1D ion mobilogram.
Definition Mobilogram.h:36
ConstIterator const_iterator
Definition Mobilogram.h:73
void setIntegerDataArrays(const IntegerDataArrays &ida)
Sets the integer meta data arrays.
Definition Mobilogram.h:323
Int findNearest(CoordinateType mb, CoordinateType tolerance_left, CoordinateType tolerance_right) const
Search for the peak nearest to a specific mobility given two +/- tolerance windows.
void clear() noexcept
Clears all data and ranges.
Iterator iterator
Definition Mobilogram.h:70
const MobilityPeak1D & front() const noexcept
Definition Mobilogram.h:134
void pop_back()
Definition Mobilogram.h:214
Iterator MBEnd(Iterator begin, CoordinateType mb, Iterator end)
Binary search for peak range end (returns the past-the-end iterator)
void swap(Mobilogram &mb) noexcept
Definition Mobilogram.h:238
ConstIterator PosEnd(ConstIterator begin, CoordinateType mb, ConstIterator end) const
Binary search for peak range end (returns the past-the-end iterator)
const IntegerDataArrays & getIntegerDataArrays() const
Returns a const reference to the integer meta data arrays.
MobilityPeak1D & emplace_back(MobilityPeak1D mb)
Definition Mobilogram.h:204
void setDriftTimeUnit(DriftTimeUnit dt) noexcept
Sets the ion mobility drift time unit.
MobilityPeak1D & operator[](Size i) noexcept
Definition Mobilogram.h:120
Iterator PosBegin(CoordinateType mb)
Binary search for peak range begin.
ConstIterator MBBegin(CoordinateType mb) const
Binary search for peak range begin.
Iterator PosEnd(Iterator begin, CoordinateType mb, Iterator end)
Binary search for peak range end (returns the past-the-end iterator)
ReverseIterator rbegin() noexcept
Definition Mobilogram.h:174
ConstReverseIterator crbegin() const
Definition Mobilogram.h:178
std::vector< StringDataArray > StringDataArrays
Definition Mobilogram.h:60
OpenMS::DataArrays::FloatDataArray FloatDataArray
Float data array vector type.
Definition Mobilogram.h:56
MobilityPeak1D & back() noexcept
Definition Mobilogram.h:139
ConstIterator MBBegin(ConstIterator begin, CoordinateType mb, ConstIterator end) const
Binary search for peak range begin.
size_t size() const noexcept
Definition Mobilogram.h:233
bool empty() const noexcept
Definition Mobilogram.h:191
ContainerType::const_reverse_iterator ConstReverseIterator
Non-mutable reverse iterator.
Definition Mobilogram.h:78
Mobilogram()=default
Constructor.
ConstIterator begin() const noexcept
Definition Mobilogram.h:152
ConstIterator cbegin() const noexcept
Definition Mobilogram.h:156
ReverseIterator rend() noexcept
Definition Mobilogram.h:182
Iterator begin() noexcept
Definition Mobilogram.h:148
PeakType::CoordinateType CoordinateType
Coordinate (mobility) type.
Definition Mobilogram.h:49
const StringDataArrays & getStringDataArrays() const
Returns a const reference to the string meta data arrays.
const MobilityPeak1D & back() const noexcept
Definition Mobilogram.h:143
void resize(size_t new_size)
Definition Mobilogram.h:224
const MobilityPeak1D & operator[](Size i) const noexcept
Definition Mobilogram.h:124
bool isSorted() const
Checks if all peaks are sorted with respect to ascending mobility.
ConstIterator MBEnd(CoordinateType mb) const
Binary search for peak range end (returns the past-the-end iterator)
Iterator insert(ConstIterator where, ConstIterator first, ConstIterator last)
Definition Mobilogram.h:219
ConstIterator PosEnd(CoordinateType mb) const
Binary search for peak range end (returns the past-the-end iterator)
Mobilogram(Mobilogram &&) noexcept=default
Move constructor.
void reserve(size_t new_size)
Definition Mobilogram.h:228
ConstIterator PosBegin(CoordinateType mb) const
Binary search for peak range begin.
Iterator MBEnd(CoordinateType mb)
Binary search for peak range end (returns the past-the-end iterator)
void sortByPosition()
Lexicographically sorts the peaks by their position (mobility).
void setRT(double rt) noexcept
Sets the retention time (in seconds)
Definition Mobilogram.h:256
ContainerType::reverse_iterator ReverseIterator
Mutable reverse iterator.
Definition Mobilogram.h:75
void sortByIntensity(bool reverse=false)
Lexicographically sorts the peaks by their intensity.
Size findNearest(CoordinateType mb) const
Binary search for the peak nearest to a specific mobility.
FloatDataArrays & getFloatDataArrays()
Returns a mutable reference to the float meta data arrays.
ConstIterator cend() const noexcept
Definition Mobilogram.h:169
void sort(const Predicate &lambda)
Stably sorts the peaks (and all parallel data arrays) by a user-defined predicate.
Definition Mobilogram.h:388
OpenMS::DataArrays::StringDataArray StringDataArray
std::string data array vector type
Definition Mobilogram.h:59
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition Mobilogram.h:72
ConstIterator erase(ConstIterator where) noexcept
Definition Mobilogram.h:195
ConstReverseIterator const_reverse_iterator
Definition Mobilogram.h:79
ConstIterator PosBegin(ConstIterator begin, CoordinateType mb, ConstIterator end) const
Binary search for peak range begin.
ReverseIterator reverse_iterator
Definition Mobilogram.h:76
std::vector< PeakType > ContainerType
Mobilogram base type.
Definition Mobilogram.h:51
double getRT() const noexcept
Returns the retention time (in seconds)
Definition Mobilogram.h:250
ConstIterator end() const noexcept
Definition Mobilogram.h:165
bool isSorted(const Predicate &lambda) const
Definition Mobilogram.h:355
IntegerDataArrays & getIntegerDataArrays()
Returns a mutable reference to the integer meta data arrays.
void emplace_back(Args &&... args)
Definition Mobilogram.h:209
ConstIterator MBEnd(ConstIterator begin, CoordinateType mb, ConstIterator end) const
Binary search for peak range end (returns the past-the-end iterator)
Iterator PosEnd(CoordinateType mb)
Binary search for peak range end (returns the past-the-end iterator)
ConstReverseIterator crend() const
Definition Mobilogram.h:186
void setStringDataArrays(const StringDataArrays &sda)
Sets the string meta data arrays.
Definition Mobilogram.h:311
Iterator MBBegin(Iterator begin, CoordinateType mb, Iterator end)
Binary search for peak range begin.
Int findHighestInWindow(CoordinateType mb, CoordinateType tolerance_left, CoordinateType tolerance_right) const
Search for the peak with highest intensity among the peaks near to a specific mobility given two +/- ...
const FloatDataArrays & getFloatDataArrays() const
MobilityPeak1D & front() noexcept
Definition Mobilogram.h:130
void push_back(MobilityPeak1D mb)
Definition Mobilogram.h:200
Int findNearest(CoordinateType mb, CoordinateType tolerance) const
Binary search for the peak nearest to a specific mobility given a +/- tolerance windows.
DriftTimeUnit getDriftTimeUnit() const noexcept
Returns the ion mobility drift time unit.
Definition Mobilogram.h:264
std::vector< FloatDataArray > FloatDataArrays
Definition Mobilogram.h:57
Mobilogram(const Mobilogram &source)=default
Copy constructor.
Iterator MBBegin(CoordinateType mb)
Binary search for peak range begin.
Iterator end() noexcept
Definition Mobilogram.h:161
Iterator PosBegin(Iterator begin, CoordinateType mb, Iterator end)
Binary search for peak range begin.
void updateRanges() override
OpenMS::DataArrays::IntegerDataArray IntegerDataArray
Integer data array vector type.
Definition Mobilogram.h:62
std::vector< IntegerDataArray > IntegerDataArrays
Definition Mobilogram.h:63
void setFloatDataArrays(const FloatDataArrays &fda)
Sets the float meta data arrays.
Definition Mobilogram.h:299
StringDataArrays & getStringDataArrays()
Returns a mutable reference to the string meta data arrays.
std::string getDriftTimeUnitAsString() const
returns the ion mobility drift time unit as string
Definition RangeManager.h:889
Handles the management of a multidimensional range, e.g. RangeMZ and RangeIntensity for spectra.
Definition RangeManager.h:568
OpenMS looks in the< code > OPENMS_THERMO_MANAGED_DIR</code > environment variable first
Definition common-cmake-parameters.doxygen:179
int Int
Signed integer type.
Definition Types.h:72
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
DriftTimeUnit
Drift time unit for ion mobility.
Definition IMTypes.h:23
Comparator for the RT of the mobilogram.
Definition Mobilogram.h:39
bool operator()(const Mobilogram &a, const Mobilogram &b) const