52 using Iterator = ContainerType::iterator;
116 return data_.front();
120 return data_.front();
134 return data_.begin();
138 return data_.begin();
142 return data_.cbegin();
160 return data_.rbegin();
164 return data_.crbegin();
172 return data_.crend();
177 return data_.empty();
181 return data_.erase(where);
190 return data_.emplace_back(mb);
192 template<
class...
Args>
195 data_.emplace_back(args...);
205 return data_.insert(where, first, last);
210 return data_.resize(new_size);
214 return data_.reserve(new_size);
224 data_.swap(mb.data_);
225 std::swap(retention_time_, mb.retention_time_);
226 std::swap(drift_time_unit_, mb.drift_time_unit_);
238 return retention_time_;
244 retention_time_ = rt;
252 return drift_time_unit_;
289 template<
class Predicate>
292 auto value_2_index_wrapper = [
this, &lambda](
const PeakType& value1,
const PeakType& value2) {
294 const Size index1 = (&value1) - (&this->front());
295 const Size index2 = (&value2) - (&this->front());
297 assert(index1 < this->size());
298 assert(index2 < this->size());
299 return lambda(index1, index2);
301 return std::is_sorted(this->begin(), this->end(), value_2_index_wrapper);
516 double retention_time_ = -1;
522 OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const
Mobilogram& mb);
A 1-dimensional raw data mobility point or peak. The unit (ms, 1/K_0, etc) is implicit.
Definition: MobilityPeak1D.h:25
The representation of a 1D ion mobilogram.
Definition: Mobilogram.h:29
ConstIterator const_iterator
Definition: Mobilogram.h:57
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:54
void pop_back()
Definition: Mobilogram.h:198
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:222
ConstIterator PosEnd(ConstIterator begin, CoordinateType mb, ConstIterator end) const
Binary search for peak range end (returns the past-the-end iterator)
void setDriftTimeUnit(DriftTimeUnit dt) noexcept
Sets the ion mobility drift time unit.
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:158
ConstReverseIterator crbegin() const
Definition: Mobilogram.h:162
ConstIterator MBBegin(ConstIterator begin, CoordinateType mb, ConstIterator end) const
Binary search for peak range begin.
size_t size() const noexcept
Definition: Mobilogram.h:217
bool empty() const noexcept
Definition: Mobilogram.h:175
ContainerType::const_reverse_iterator ConstReverseIterator
Non-mutable reverse iterator.
Definition: Mobilogram.h:62
Mobilogram()=default
Constructor.
const MobilityPeak1D & front() const noexcept
Definition: Mobilogram.h:118
ConstIterator begin() const noexcept
Definition: Mobilogram.h:136
ConstIterator cbegin() const noexcept
Definition: Mobilogram.h:140
MobilityPeak1D & front() noexcept
Definition: Mobilogram.h:114
MobilityPeak1D & emplace_back(MobilityPeak1D mb)
Definition: Mobilogram.h:188
String getDriftTimeUnitAsString() const
returns the ion mobility drift time unit as string
ReverseIterator rend() noexcept
Definition: Mobilogram.h:166
const MobilityPeak1D & operator[](Size i) const noexcept
Definition: Mobilogram.h:108
Iterator begin() noexcept
Definition: Mobilogram.h:132
PeakType::CoordinateType CoordinateType
Coordinate (mobility) type.
Definition: Mobilogram.h:42
void resize(size_t new_size)
Definition: Mobilogram.h:208
bool isSorted() const
Checks if all peaks are sorted with respect to ascending mobility.
MobilityPeak1D & operator[](Size i) noexcept
Definition: Mobilogram.h:104
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:203
ConstIterator PosEnd(CoordinateType mb) const
Binary search for peak range end (returns the past-the-end iterator)
Mobilogram(Mobilogram &&) noexcept=default
Move constructor.
MobilityPeak1D & back() noexcept
Definition: Mobilogram.h:123
void reserve(size_t new_size)
Definition: Mobilogram.h:212
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:242
ContainerType::reverse_iterator ReverseIterator
Mutable reverse iterator.
Definition: Mobilogram.h:59
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.
ConstIterator cend() const noexcept
Definition: Mobilogram.h:153
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: Mobilogram.h:56
ConstIterator erase(ConstIterator where) noexcept
Definition: Mobilogram.h:179
ConstReverseIterator const_reverse_iterator
Definition: Mobilogram.h:63
ConstIterator PosBegin(ConstIterator begin, CoordinateType mb, ConstIterator end) const
Binary search for peak range begin.
ReverseIterator reverse_iterator
Definition: Mobilogram.h:60
std::vector< PeakType > ContainerType
Mobilogram base type.
Definition: Mobilogram.h:44
double getRT() const noexcept
Definition: Mobilogram.h:236
ConstIterator end() const noexcept
Definition: Mobilogram.h:149
bool isSorted(const Predicate &lambda) const
Definition: Mobilogram.h:290
void emplace_back(Args &&... args)
Definition: Mobilogram.h:193
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:170
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 +/- ...
void push_back(MobilityPeak1D mb)
Definition: Mobilogram.h:184
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:250
Mobilogram(const Mobilogram &source)=default
Copy constructor.
Iterator MBBegin(CoordinateType mb)
Binary search for peak range begin.
Iterator end() noexcept
Definition: Mobilogram.h:145
Iterator PosBegin(Iterator begin, CoordinateType mb, Iterator end)
Binary search for peak range begin.
void updateRanges() override
const MobilityPeak1D & back() const noexcept
Definition: Mobilogram.h:127
double CoordinateType
Coordinate type (of the position)
Definition: Peak2D.h:38
Definition: RangeManager.h:867
Handles the management of a multidimensional range, e.g. RangeMZ and RangeIntensity for spectra.
Definition: RangeManager.h:546
A more convenient string class.
Definition: String.h:34
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)
custom arguments to allow for looping calls
Definition: WizardHelper.h:47
static String & reverse(String &this_s)
Definition: StringUtilsSimple.h:330
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:32
bool operator()(const Mobilogram &a, const Mobilogram &b) const