OpenMS
|
The representation of a 1D ion mobilogram. More...
#include <OpenMS/KERNEL/Mobilogram.h>
Classes | |
struct | RTLess |
Comparator for the RT of the mobilogram. More... | |
Public Types | |
Base type definitions | |
using | PeakType = MobilityPeak1D |
Peak type. More... | |
using | CoordinateType = PeakType::CoordinateType |
Coordinate (mobility) type. More... | |
using | ContainerType = std::vector< PeakType > |
Mobilogram base type. More... | |
using | RangeManagerContainerType = RangeManagerContainer< RangeMobility, RangeIntensity > |
RangeManager. More... | |
using | RangeManagerType = RangeManager< RangeMobility, RangeIntensity > |
Public Types inherited from RangeManagerContainer< RangeMobility, RangeIntensity > | |
using | ThisRangeType = typename RangeManager< RangeBases... >::ThisRangeType |
Public Types inherited from RangeManager< RangeBases... > | |
using | ThisRangeType = RangeManager< RangeBases... > |
Public Member Functions | |
Export methods for std::vector<MobilityPeak1D> | |
MobilityPeak1D & | operator[] (Size i) noexcept |
const MobilityPeak1D & | operator[] (Size i) const noexcept |
MobilityPeak1D & | front () noexcept |
const MobilityPeak1D & | front () const noexcept |
MobilityPeak1D & | back () noexcept |
const MobilityPeak1D & | back () const noexcept |
Iterator | begin () noexcept |
ConstIterator | begin () const noexcept |
ConstIterator | cbegin () const noexcept |
Iterator | end () noexcept |
ConstIterator | end () const noexcept |
ConstIterator | cend () const noexcept |
ReverseIterator | rbegin () noexcept |
ConstReverseIterator | crbegin () const |
ReverseIterator | rend () noexcept |
ConstReverseIterator | crend () const |
bool | empty () const noexcept |
ConstIterator | erase (ConstIterator where) noexcept |
void | push_back (MobilityPeak1D mb) |
MobilityPeak1D & | emplace_back (MobilityPeak1D mb) |
template<class... Args> | |
void | emplace_back (Args &&... args) |
void | pop_back () |
Iterator | insert (ConstIterator where, ConstIterator first, ConstIterator last) |
void | resize (size_t new_size) |
void | reserve (size_t new_size) |
size_t | size () const noexcept |
void | swap (Mobilogram &mb) noexcept |
void | updateRanges () override |
Accessors for meta information | |
Returns the retention time (in seconds) | |
double | getRT () const noexcept |
void | setRT (double rt) noexcept |
Sets the retention time (in seconds) More... | |
DriftTimeUnit | getDriftTimeUnit () const noexcept |
Returns the ion mobility drift time unit. More... | |
String | getDriftTimeUnitAsString () const |
returns the ion mobility drift time unit as string More... | |
void | setDriftTimeUnit (DriftTimeUnit dt) noexcept |
Sets the ion mobility drift time unit. More... | |
Sorting peaks | |
void | sortByIntensity (bool reverse=false) |
Lexicographically sorts the peaks by their intensity. More... | |
void | sortByPosition () |
Lexicographically sorts the peaks by their position (mobility). More... | |
bool | isSorted () const |
Checks if all peaks are sorted with respect to ascending mobility. More... | |
template<class Predicate > | |
bool | isSorted (const Predicate &lambda) const |
Public Member Functions inherited from RangeManagerContainer< RangeMobility, RangeIntensity > | |
virtual | ~RangeManagerContainer ()=default |
D'tor. More... | |
const ThisRangeType & | getRange () const |
get range of current data (call updateRanges() before to ensure the range is accurate) More... | |
ThisRangeType & | getRange () |
get mutable range, provided for efficiency reasons (avoid updateRanges(), if only minor changes were made) More... | |
Public Member Functions inherited from RangeManager< RangeBases... > | |
bool | operator== (const RangeManager &rhs) const |
bool | operator!= (const RangeManager &rhs) const |
bool | assignUnsafe (const RangeManager< RangeBasesOther... > &rhs) |
auto & | assign (const RangeManager< RangeBasesOther... > &rhs) |
bool | extendUnsafe (const RangeManager< RangeBasesOther... > &rhs) |
void | extend (const RangeManager< RangeBasesOther... > &rhs) |
void | scaleBy (const double factor) |
calls RangeBase::scale() for each dimension More... | |
void | minSpanIfSingular (const double min_span) |
If any dimension is a single point, e.g. min==max, then extend this dimension by min_span / 2 on either side. More... | |
bool | pushIntoUnsafe (const RangeManager< RangeBasesOther... > &rhs) |
void | pushInto (const RangeManager< RangeBasesOther... > &sandbox) |
bool | clampToUnsafe (const RangeManager< RangeBasesOther... > &rhs) |
void | clampTo (const RangeManager< RangeBasesOther... > &rhs) |
const RangeBase & | getRangeForDim (MSDim dim) const |
obtain a range dimension at runtime using dim More... | |
RangeBase & | getRangeForDim (MSDim dim) |
obtain a range dimension at runtime using dim More... | |
HasRangeType | hasRange () const |
is any/some/all dimension in this range populated? More... | |
bool | containsAll (const RangeManager< RangeBasesOther... > &rhs) const |
void | clearRanges () |
Resets all ranges. More... | |
ThisRangeType & | clear (const DIM_UNIT range) |
void | printRange (std::ostream &out) const |
print each dimension (base classes) to a stream More... | |
Peak container iterator type definitions | |
using | Iterator = ContainerType::iterator |
Mutable iterator. More... | |
using | iterator = Iterator |
using | ConstIterator = ContainerType::const_iterator |
Non-mutable iterator. More... | |
using | const_iterator = ConstIterator |
using | ReverseIterator = ContainerType::reverse_iterator |
Mutable reverse iterator. More... | |
using | reverse_iterator = ReverseIterator |
using | ConstReverseIterator = ContainerType::const_reverse_iterator |
Non-mutable reverse iterator. More... | |
using | const_reverse_iterator = ConstReverseIterator |
Mobilogram ()=default | |
Constructor. More... | |
Mobilogram (const Mobilogram &source)=default | |
Copy constructor. More... | |
Mobilogram (Mobilogram &&) noexcept=default | |
Move constructor. More... | |
Mobilogram & | operator= (const Mobilogram &source)=default |
Assignment operator. More... | |
Mobilogram & | operator= (Mobilogram &&) noexcept=default |
Move assignment operator. More... | |
~Mobilogram ()=default | |
Destructor. More... | |
bool | operator== (const Mobilogram &rhs) const |
Equality operator. More... | |
bool | operator!= (const Mobilogram &rhs) const |
Equality operator. More... | |
Searching a peak or peak range | |
std::vector< MobilityPeak1D > | data_ |
the actual peaks More... | |
double | retention_time_ = -1 |
Retention time. More... | |
DriftTimeUnit | drift_time_unit_ = DriftTimeUnit::NONE |
Drift time unit. More... | |
Size | findNearest (CoordinateType mb) const |
Binary search for the peak nearest to a specific mobility. More... | |
Int | findNearest (CoordinateType mb, CoordinateType tolerance) const |
Binary search for the peak nearest to a specific mobility given a +/- tolerance windows. More... | |
Int | findNearest (CoordinateType mb, CoordinateType tolerance_left, CoordinateType tolerance_right) const |
Search for the peak nearest to a specific mobility given two +/- tolerance windows. More... | |
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 +/- tolerance windows in Th. More... | |
Iterator | MBBegin (CoordinateType mb) |
Binary search for peak range begin. More... | |
Iterator | MBBegin (Iterator begin, CoordinateType mb, Iterator end) |
Binary search for peak range begin. More... | |
Iterator | MBEnd (CoordinateType mb) |
Binary search for peak range end (returns the past-the-end iterator) More... | |
Iterator | MBEnd (Iterator begin, CoordinateType mb, Iterator end) |
Binary search for peak range end (returns the past-the-end iterator) More... | |
ConstIterator | MBBegin (CoordinateType mb) const |
Binary search for peak range begin. More... | |
ConstIterator | MBBegin (ConstIterator begin, CoordinateType mb, ConstIterator end) const |
Binary search for peak range begin. More... | |
ConstIterator | MBEnd (CoordinateType mb) const |
Binary search for peak range end (returns the past-the-end iterator) More... | |
ConstIterator | MBEnd (ConstIterator begin, CoordinateType mb, ConstIterator end) const |
Binary search for peak range end (returns the past-the-end iterator) More... | |
Iterator | PosBegin (CoordinateType mb) |
Binary search for peak range begin. More... | |
Iterator | PosBegin (Iterator begin, CoordinateType mb, Iterator end) |
Binary search for peak range begin. More... | |
ConstIterator | PosBegin (CoordinateType mb) const |
Binary search for peak range begin. More... | |
ConstIterator | PosBegin (ConstIterator begin, CoordinateType mb, ConstIterator end) const |
Binary search for peak range begin. More... | |
Iterator | PosEnd (CoordinateType mb) |
Binary search for peak range end (returns the past-the-end iterator) More... | |
Iterator | PosEnd (Iterator begin, CoordinateType mb, Iterator end) |
Binary search for peak range end (returns the past-the-end iterator) More... | |
ConstIterator | PosEnd (CoordinateType mb) const |
Binary search for peak range end (returns the past-the-end iterator) More... | |
ConstIterator | PosEnd (ConstIterator begin, CoordinateType mb, ConstIterator end) const |
Binary search for peak range end (returns the past-the-end iterator) More... | |
void | clear () noexcept |
Clears all data and ranges. More... | |
ConstIterator | getBasePeak () const |
Iterator | getBasePeak () |
PeakType::IntensityType | calculateTIC () const |
compute the total ion count (sum of all peak intensities) More... | |
Additional Inherited Members | |
Protected Member Functions inherited from RangeManager< RangeBases... > | |
void | for_each_base_ (Visitor &&visitor) |
use fold expression to iterate over all RangeBases of RangeManager and apply a lambda (Visitor) for each one More... | |
void | for_each_base_ (Visitor &&visitor) const |
.. and a const version More... | |
Static Protected Member Functions inherited from RangeManager< RangeBases... > | |
static void | static_for_each_base_ (Visitor &&visitor) |
use fold expression to iterate over all RangeBases of RangeManager and apply a lambda (Visitor) for each one (for static members) More... | |
The representation of a 1D ion mobilogram.
It contains peak data of type MobilityPeak1D.
using const_iterator = ConstIterator |
using ConstIterator = ContainerType::const_iterator |
Non-mutable iterator.
using ConstReverseIterator = ContainerType::const_reverse_iterator |
Non-mutable reverse iterator.
using ContainerType = std::vector<PeakType> |
Mobilogram base type.
Coordinate (mobility) type.
using Iterator = ContainerType::iterator |
Mutable iterator.
using PeakType = MobilityPeak1D |
Peak type.
using reverse_iterator = ReverseIterator |
using ReverseIterator = ContainerType::reverse_iterator |
Mutable reverse iterator.
|
default |
Constructor.
|
default |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
default |
Destructor.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
PeakType::IntensityType calculateTIC | ( | ) | const |
compute the total ion count (sum of all peak intensities)
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
Clears all data and ranges.
Will delete (clear) all peaks contained in the mobilogram
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
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 +/- tolerance windows in Th.
mb | The target mobility value |
tolerance_left | The non-negative tolerance applied left of mb |
tolerance_right | The non-negative tolerance applied right of mb |
Size findNearest | ( | CoordinateType | mb | ) | const |
Binary search for the peak nearest to a specific mobility.
mb | The target mobility value |
Exception::Precondition | is thrown if the mobilogram is empty (not only in debug mode) |
Int findNearest | ( | CoordinateType | mb, |
CoordinateType | tolerance | ||
) | const |
Binary search for the peak nearest to a specific mobility given a +/- tolerance windows.
mb | The target mobility value |
tolerance | The non-negative tolerance applied to both sides of mb |
Int findNearest | ( | CoordinateType | mb, |
CoordinateType | tolerance_left, | ||
CoordinateType | tolerance_right | ||
) | const |
Search for the peak nearest to a specific mobility given two +/- tolerance windows.
mb | The target mobility value |
tolerance_left | The non-negative tolerance applied left of mb |
tolerance_right | The non-negative tolerance applied right of mb |
|
inlinenoexcept |
|
inlinenoexcept |
Iterator getBasePeak | ( | ) |
return the peak with the highest intensity. If the peak is not unique, the first peak in the container is returned. The function works correctly, even if the mobilogram is unsorted.
ConstIterator getBasePeak | ( | ) | const |
return the peak with the highest intensity. If the peak is not unique, the first peak in the container is returned. The function works correctly, even if the mobilogram is unsorted.
|
inlinenoexcept |
Returns the ion mobility drift time unit.
String getDriftTimeUnitAsString | ( | ) | const |
returns the ion mobility drift time unit as string
|
inlinenoexcept |
Referenced by DimRT::map().
|
inline |
bool isSorted | ( | ) | const |
Checks if all peaks are sorted with respect to ascending mobility.
|
inline |
Checks if container is sorted by a certain user-defined property. You can pass any lambda function with [](Size index_1, Size index_2) --> bool
which given two indices into Mobilogram (either for peaks or data arrays) returns a weak-ordering. (you need to capture the Mobilogram in the lambda and operate on it, based on the indices)
ConstIterator MBBegin | ( | ConstIterator | begin, |
CoordinateType | mb, | ||
ConstIterator | end | ||
) | const |
Binary search for peak range begin.
Iterator MBBegin | ( | CoordinateType | mb | ) |
Binary search for peak range begin.
ConstIterator MBBegin | ( | CoordinateType | mb | ) | const |
Binary search for peak range begin.
Iterator MBBegin | ( | Iterator | begin, |
CoordinateType | mb, | ||
Iterator | end | ||
) |
Binary search for peak range begin.
ConstIterator MBEnd | ( | ConstIterator | begin, |
CoordinateType | mb, | ||
ConstIterator | end | ||
) | const |
Binary search for peak range end (returns the past-the-end iterator)
Iterator MBEnd | ( | CoordinateType | mb | ) |
Binary search for peak range end (returns the past-the-end iterator)
ConstIterator MBEnd | ( | CoordinateType | mb | ) | const |
Binary search for peak range end (returns the past-the-end iterator)
Iterator MBEnd | ( | Iterator | begin, |
CoordinateType | mb, | ||
Iterator | end | ||
) |
Binary search for peak range end (returns the past-the-end iterator)
|
inline |
Equality operator.
References OpenMS::Internal::operator==().
|
default |
Assignment operator.
|
defaultnoexcept |
Move assignment operator.
bool operator== | ( | const Mobilogram & | rhs | ) | const |
Equality operator.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
ConstIterator PosBegin | ( | ConstIterator | begin, |
CoordinateType | mb, | ||
ConstIterator | end | ||
) | const |
Binary search for peak range begin.
Alias for MBBegin()
Iterator PosBegin | ( | CoordinateType | mb | ) |
Binary search for peak range begin.
Alias for MBBegin()
ConstIterator PosBegin | ( | CoordinateType | mb | ) | const |
Binary search for peak range begin.
Alias for MBBegin()
Iterator PosBegin | ( | Iterator | begin, |
CoordinateType | mb, | ||
Iterator | end | ||
) |
Binary search for peak range begin.
Alias for MBBegin()
ConstIterator PosEnd | ( | ConstIterator | begin, |
CoordinateType | mb, | ||
ConstIterator | end | ||
) | const |
Binary search for peak range end (returns the past-the-end iterator)
Alias for MBEnd()
Iterator PosEnd | ( | CoordinateType | mb | ) |
Binary search for peak range end (returns the past-the-end iterator)
Alias for MBEnd()
ConstIterator PosEnd | ( | CoordinateType | mb | ) | const |
Binary search for peak range end (returns the past-the-end iterator)
Alias for MBEnd()
Iterator PosEnd | ( | Iterator | begin, |
CoordinateType | mb, | ||
Iterator | end | ||
) |
Binary search for peak range end (returns the past-the-end iterator)
Alias for MBEnd()
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
noexcept |
Sets the ion mobility drift time unit.
|
inlinenoexcept |
Sets the retention time (in seconds)
|
inlinenoexcept |
void sortByIntensity | ( | bool | reverse = false | ) |
Lexicographically sorts the peaks by their intensity.
Sorts the peaks according to ascending intensity.
void sortByPosition | ( | ) |
Lexicographically sorts the peaks by their position (mobility).
The mobilogram is sorted with respect to position (mobility).
|
inlinenoexcept |
|
overridevirtual |
implement this function to reflect the underlying data of the derived class (e.g. an MSSpectrum) Usually, call clearRanges() internally and then populate the dimensions.
Implements RangeManagerContainer< RangeMobility, RangeIntensity >.
|
protected |
the actual peaks
|
protected |
Drift time unit.
|
protected |
Retention time.