78 using Iterator = ContainerType::iterator;
142 return data_.front();
146 return data_.front();
160 return data_.begin();
164 return data_.begin();
168 return data_.cbegin();
186 return data_.rbegin();
190 return data_.crbegin();
198 return data_.crend();
203 return data_.empty();
207 return data_.erase(where);
216 return data_.emplace_back(mb);
218 template<
class...
Args>
221 data_.emplace_back(args...);
231 return data_.insert(where, first, last);
236 return data_.resize(new_size);
240 return data_.reserve(new_size);
250 data_.swap(mb.data_);
251 std::swap(retention_time_, mb.retention_time_);
252 std::swap(drift_time_unit_, mb.drift_time_unit_);
264 return retention_time_;
270 retention_time_ = rt;
278 return drift_time_unit_;
315 template<
class Predicate>
318 auto value_2_index_wrapper = [
this, &lambda](
const PeakType& value1,
const PeakType& value2) {
320 const Size index1 = (&value1) - (&this->front());
321 const Size index2 = (&value2) - (&this->front());
323 assert(index1 < this->size());
324 assert(index2 < this->size());
325 return lambda(index1, index2);
327 return std::is_sorted(this->begin(), this->end(), value_2_index_wrapper);
541 double retention_time_ = -1;
547 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:51
The representation of a 1D ion mobilogram.
Definition: Mobilogram.h:55
ConstIterator const_iterator
Definition: Mobilogram.h:83
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:80
void pop_back()
Definition: Mobilogram.h:224
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:248
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:184
ConstReverseIterator crbegin() const
Definition: Mobilogram.h:188
ConstIterator MBBegin(ConstIterator begin, CoordinateType mb, ConstIterator end) const
Binary search for peak range begin.
size_t size() const noexcept
Definition: Mobilogram.h:243
bool empty() const noexcept
Definition: Mobilogram.h:201
ContainerType::const_reverse_iterator ConstReverseIterator
Non-mutable reverse iterator.
Definition: Mobilogram.h:88
Mobilogram()=default
Constructor.
const MobilityPeak1D & front() const noexcept
Definition: Mobilogram.h:144
ConstIterator begin() const noexcept
Definition: Mobilogram.h:162
ConstIterator cbegin() const noexcept
Definition: Mobilogram.h:166
MobilityPeak1D & front() noexcept
Definition: Mobilogram.h:140
MobilityPeak1D & emplace_back(MobilityPeak1D mb)
Definition: Mobilogram.h:214
String getDriftTimeUnitAsString() const
returns the ion mobility drift time unit as string
ReverseIterator rend() noexcept
Definition: Mobilogram.h:192
const MobilityPeak1D & operator[](Size i) const noexcept
Definition: Mobilogram.h:134
Iterator begin() noexcept
Definition: Mobilogram.h:158
PeakType::CoordinateType CoordinateType
Coordinate (mobility) type.
Definition: Mobilogram.h:68
void resize(size_t new_size)
Definition: Mobilogram.h:234
bool isSorted() const
Checks if all peaks are sorted with respect to ascending mobility.
MobilityPeak1D & operator[](Size i) noexcept
Definition: Mobilogram.h:130
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:229
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:149
void reserve(size_t new_size)
Definition: Mobilogram.h:238
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:268
ContainerType::reverse_iterator ReverseIterator
Mutable reverse iterator.
Definition: Mobilogram.h:85
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:179
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: Mobilogram.h:82
ConstIterator erase(ConstIterator where) noexcept
Definition: Mobilogram.h:205
ConstReverseIterator const_reverse_iterator
Definition: Mobilogram.h:89
ConstIterator PosBegin(ConstIterator begin, CoordinateType mb, ConstIterator end) const
Binary search for peak range begin.
ReverseIterator reverse_iterator
Definition: Mobilogram.h:86
std::vector< PeakType > ContainerType
Mobilogram base type.
Definition: Mobilogram.h:70
double getRT() const noexcept
Definition: Mobilogram.h:262
ConstIterator end() const noexcept
Definition: Mobilogram.h:175
bool isSorted(const Predicate &lambda) const
Definition: Mobilogram.h:316
void emplace_back(Args &&... args)
Definition: Mobilogram.h:219
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:196
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:210
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:276
Mobilogram(const Mobilogram &source)=default
Copy constructor.
Iterator MBBegin(CoordinateType mb)
Binary search for peak range begin.
Iterator end() noexcept
Definition: Mobilogram.h:171
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:153
double CoordinateType
Coordinate type (of the position)
Definition: Peak2D.h:64
Definition: RangeManager.h:898
Handles the management of a multidimensional range, e.g. RangeMZ and RangeIntensity for spectra.
Definition: RangeManager.h:566
A more convenient string class.
Definition: String.h:60
int Int
Signed integer type.
Definition: Types.h:102
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
custom arguments to allow for looping calls
Definition: WizardHelper.h:73
static String & reverse(String &this_s)
Definition: StringUtilsSimple.h:355
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
DriftTimeUnit
Drift time unit for ion mobility.
Definition: IMTypes.h:49
Comparator for the RT of the mobilogram.
Definition: Mobilogram.h:58
bool operator()(const Mobilogram &a, const Mobilogram &b) const