![]() |
OpenMS
|
The representation of a chromatogram. More...
#include <OpenMS/KERNEL/MSChromatogram.h>
Classes | |
| struct | MZLess |
| Comparator for the precursor m/z time. More... | |
Public Types | |
Base type definitions | |
Peak type | |
| typedef ChromatogramPeak | PeakType |
| typedef PeakType::CoordinateType | CoordinateType |
| Coordinate (RT) type. | |
| typedef std::vector< PeakType > | ContainerType |
| Chromatogram base type. | |
| typedef RangeManager< RangeRT, RangeIntensity > | RangeManagerType |
| RangeManager. | |
| typedef OpenMS::DataArrays::FloatDataArray | FloatDataArray |
| Float data array vector type. | |
| typedef std::vector< FloatDataArray > | FloatDataArrays |
| typedef OpenMS::DataArrays::StringDataArray | StringDataArray |
| std::string data array vector type | |
| typedef std::vector< StringDataArray > | StringDataArrays |
| typedef OpenMS::DataArrays::IntegerDataArray | IntegerDataArray |
| Integer data array vector type. | |
| typedef std::vector< IntegerDataArray > | IntegerDataArrays |
Peak container iterator type definitions | |
| typedef ContainerType::iterator | Iterator |
| Mutable iterator. | |
| typedef ContainerType::const_iterator | ConstIterator |
| Non-mutable iterator. | |
| typedef ContainerType::reverse_iterator | ReverseIterator |
| Mutable reverse iterator. | |
| typedef ContainerType::const_reverse_iterator | ConstReverseIterator |
| Non-mutable reverse iterator. | |
Public Types inherited from RangeManagerContainer< RangeRT, RangeIntensity > | |
| using | ThisRangeType = typename RangeManager< RangeBases... >::ThisRangeType |
Public Types inherited from RangeManager< RangeBases... > | |
| using | ThisRangeType = RangeManager< RangeBases... > |
Public Types inherited from ChromatogramSettings | |
| enum class | ChromatogramType { MASS_CHROMATOGRAM = 0 , TOTAL_ION_CURRENT_CHROMATOGRAM , SELECTED_ION_CURRENT_CHROMATOGRAM , BASEPEAK_CHROMATOGRAM , SELECTED_ION_MONITORING_CHROMATOGRAM , SELECTED_REACTION_MONITORING_CHROMATOGRAM , ELECTROMAGNETIC_RADIATION_CHROMATOGRAM , ABSORPTION_CHROMATOGRAM , EMISSION_CHROMATOGRAM , SIZE_OF_CHROMATOGRAM_TYPE } |
Public Types inherited from MetaInfoInterface | |
| using | MetaInfoConstIterator = MetaInfo::const_iterator |
| Const iterator type for iterating over meta info entries. | |
Public Member Functions | |
| double | getMZ () const |
| returns the mz of the product entry, makes sense especially for MRM scans | |
| void | mergePeaks (MSChromatogram &other, bool add_meta=false) |
| Adds all the chromatogram peaks from another MSChromatogram and updates the metadata to indicate a merge. | |
Export methods from std::vector | |
| MSChromatogram ()=default | |
| Constructor. | |
| MSChromatogram (const MSChromatogram &)=default | |
| Copy constructor. | |
| MSChromatogram (MSChromatogram &&)=default | |
| Move constructor. | |
| ~MSChromatogram ()=default | |
| Destructor. | |
| MSChromatogram & | operator= (const MSChromatogram &source) |
| Assignment operator. | |
| MSChromatogram & | operator= (MSChromatogram &&) &=default |
| Move assignment operator. | |
| bool | operator== (const MSChromatogram &rhs) const |
| Equality operator. | |
| bool | operator!= (const MSChromatogram &rhs) const |
| Equality operator. | |
| void | updateRanges () override |
Accessors for meta information | |
Returns the name | |
| const std::string & | getName () const |
| void | setName (const std::string &name) |
| Sets the name. | |
Peak data array methods | |
These methods are used to annotate each peak in a chromatogram with meta information. It is an intermediate way between storing the information in the peak's MetaInfoInterface and deriving a new peak type with members for this information. These statements should help you chose which approach to use
| |
| const FloatDataArrays & | getFloatDataArrays () const |
| FloatDataArrays & | getFloatDataArrays () |
| Returns a mutable reference to the float meta data arrays. | |
| void | setFloatDataArrays (const FloatDataArrays &fda) |
| Sets the float meta data arrays. | |
| const StringDataArrays & | getStringDataArrays () const |
| Returns a const reference to the string meta data arrays. | |
| StringDataArrays & | getStringDataArrays () |
| Returns a mutable reference to the string meta data arrays. | |
| void | setStringDataArrays (const StringDataArrays &sda) |
| Sets the string meta data arrays. | |
| const IntegerDataArrays & | getIntegerDataArrays () const |
| Returns a const reference to the integer meta data arrays. | |
| IntegerDataArrays & | getIntegerDataArrays () |
| Returns a mutable reference to the integer meta data arrays. | |
| void | setIntegerDataArrays (const IntegerDataArrays &ida) |
| Sets the integer meta data arrays. | |
Sorting peaks | |
| void | sortByIntensity (bool reverse=false) |
| Lexicographically sorts the peaks by their intensity. | |
| void | sortByPosition () |
| Lexicographically sorts the peaks by their position. | |
| bool | isSorted () const |
| Checks if all peaks are sorted with respect to ascending RT. | |
| template<class Predicate > | |
| void | sort (const Predicate &lambda) |
| Stably sorts the peaks (and all parallel data arrays) by a user-defined predicate. | |
Searching a peak or peak range | |
| Size | findNearest (CoordinateType rt) const |
| Binary search for the peak nearest to a specific RT. | |
| Iterator | RTBegin (CoordinateType rt) |
| Binary search for peak range begin. | |
| Iterator | RTBegin (Iterator begin, CoordinateType rt, Iterator end) |
| Binary search for peak range begin. | |
| Iterator | RTEnd (CoordinateType rt) |
| Binary search for peak range end (returns the past-the-end iterator) | |
| Iterator | RTEnd (Iterator begin, CoordinateType rt, Iterator end) |
| Binary search for peak range end (returns the past-the-end iterator) | |
| ConstIterator | RTBegin (CoordinateType rt) const |
| Binary search for peak range begin. | |
| ConstIterator | RTBegin (ConstIterator begin, CoordinateType rt, ConstIterator end) const |
| Binary search for peak range begin. | |
| ConstIterator | RTEnd (CoordinateType rt) const |
| Binary search for peak range end (returns the past-the-end iterator) | |
| ConstIterator | RTEnd (ConstIterator begin, CoordinateType rt, ConstIterator end) const |
| Binary search for peak range end (returns the past-the-end iterator) | |
| Iterator | PosBegin (CoordinateType rt) |
| Binary search for peak range begin. | |
| Iterator | PosBegin (Iterator begin, CoordinateType rt, Iterator end) |
| Binary search for peak range begin. | |
| ConstIterator | PosBegin (CoordinateType rt) const |
| Binary search for peak range begin. | |
| ConstIterator | PosBegin (ConstIterator begin, CoordinateType rt, ConstIterator end) const |
| Binary search for peak range begin. | |
| Iterator | PosEnd (CoordinateType rt) |
| Binary search for peak range end (returns the past-the-end iterator) | |
| Iterator | PosEnd (Iterator begin, CoordinateType rt, Iterator end) |
| Binary search for peak range end (returns the past-the-end iterator) | |
| ConstIterator | PosEnd (CoordinateType rt) const |
| Binary search for peak range end (returns the past-the-end iterator) | |
| ConstIterator | PosEnd (ConstIterator begin, CoordinateType rt, ConstIterator end) const |
| Binary search for peak range end (returns the past-the-end iterator) | |
| void | clear (bool clear_meta_data) |
| Clears all data and meta data. | |
| MSChromatogram & | select (const std::vector< Size > &indices) |
Subset the chromatogram by selecting only indices in indices, in that order. | |
| MSChromatogram & | selectUnchecked (const std::vector< Size > &indices) |
| Like select(), but without the per-index range check. | |
Public Member Functions inherited from RangeManagerContainer< RangeRT, RangeIntensity > | |
| virtual | ~RangeManagerContainer ()=default |
| D'tor. | |
| const ThisRangeType & | getRange () const |
| get range of current data (call updateRanges() before to ensure the range is accurate) | |
| ThisRangeType & | getRange () |
| get mutable range, provided for efficiency reasons (avoid updateRanges(), if only minor changes were made) | |
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 | |
| 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. | |
| 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 | |
| RangeBase & | getRangeForDim (MSDim dim) |
obtain a range dimension at runtime using dim | |
| HasRangeType | hasRange () const |
| is any/some/all dimension in this range populated? | |
| bool | containsAll (const RangeManager< RangeBasesOther... > &rhs) const |
| void | clearRanges () |
| Resets all ranges. | |
| ThisRangeType & | clear (const DIM_UNIT range) |
| void | printRange (std::ostream &out) const |
| print each dimension (base classes) to a stream | |
Public Member Functions inherited from ChromatogramSettings | |
| ChromatogramSettings () | |
| Constructor. | |
| ChromatogramSettings (const ChromatogramSettings &)=default | |
| Copy constructor. | |
| ChromatogramSettings (ChromatogramSettings &&)=default | |
| Move constructor. | |
| virtual | ~ChromatogramSettings () |
| Destructor. | |
| ChromatogramSettings & | operator= (const ChromatogramSettings &)=default |
| ChromatogramSettings & | operator= (ChromatogramSettings &&) &=default |
| Move assignment operator. | |
| bool | operator== (const ChromatogramSettings &rhs) const |
| Equality operator. | |
| bool | operator!= (const ChromatogramSettings &rhs) const |
| Equality operator. | |
| const std::string & | getNativeID () const |
| returns the native identifier for the spectrum, used by the acquisition software. | |
| void | setNativeID (const std::string &native_id) |
| sets the native identifier for the spectrum, used by the acquisition software. | |
| const std::string & | getComment () const |
| returns the free-text comment | |
| void | setComment (const std::string &comment) |
| sets the free-text comment | |
| const InstrumentSettings & | getInstrumentSettings () const |
| returns a const reference to the instrument settings of the current spectrum | |
| InstrumentSettings & | getInstrumentSettings () |
| returns a mutable reference to the instrument settings of the current spectrum | |
| void | setInstrumentSettings (const InstrumentSettings &instrument_settings) |
| sets the instrument settings of the current spectrum | |
| const AcquisitionInfo & | getAcquisitionInfo () const |
| returns a const reference to the acquisition info | |
| AcquisitionInfo & | getAcquisitionInfo () |
| returns a mutable reference to the acquisition info | |
| void | setAcquisitionInfo (const AcquisitionInfo &acquisition_info) |
| sets the acquisition info | |
| const SourceFile & | getSourceFile () const |
| returns a const reference to the source file | |
| SourceFile & | getSourceFile () |
| returns a mutable reference to the source file | |
| void | setSourceFile (const SourceFile &source_file) |
| sets the source file | |
| const Precursor & | getPrecursor () const |
| returns a const reference to the precursors | |
| Precursor & | getPrecursor () |
| returns a mutable reference to the precursors | |
| void | setPrecursor (const Precursor &precursor) |
| sets the precursors | |
| const Product & | getProduct () const |
| returns a const reference to the products | |
| Product & | getProduct () |
| returns a mutable reference to the products | |
| void | setProduct (const Product &product) |
| sets the products | |
| ChromatogramType | getChromatogramType () const |
| returns the chromatogram type, e.g. a SRM chromatogram | |
| void | setChromatogramType (ChromatogramType type) |
| sets the chromatogram type | |
| void | setDataProcessing (const std::vector< DataProcessingPtr > &data_processing) |
| sets the description of the applied processing | |
| std::vector< DataProcessingPtr > & | getDataProcessing () |
| returns a mutable reference to the description of the applied processing | |
| const std::vector< std::shared_ptr< const DataProcessing > > | getDataProcessing () const |
| returns a const reference to the description of the applied processing | |
Public Member Functions inherited from MetaInfoInterface | |
| MetaInfoInterface ()=default | |
| Constructor. | |
| MetaInfoInterface (const MetaInfoInterface &rhs) | |
| Copy constructor. | |
| MetaInfoInterface (MetaInfoInterface &&) noexcept | |
| Move constructor. | |
| ~MetaInfoInterface () | |
| Destructor. | |
| MetaInfoInterface & | operator= (const MetaInfoInterface &rhs) |
| Assignment operator. | |
| MetaInfoInterface & | operator= (MetaInfoInterface &&) noexcept |
| Move assignment operator. | |
| void | swap (MetaInfoInterface &rhs) |
| Swap contents. | |
| bool | operator== (const MetaInfoInterface &rhs) const |
| Equality operator. | |
| bool | operator!= (const MetaInfoInterface &rhs) const |
| Equality operator. | |
| const DataValue & | getMetaValue (const std::string &name) const |
| Returns the value corresponding to a string, or DataValue::EMPTY if not found. | |
| DataValue | getMetaValue (const std::string &name, const DataValue &default_value) const |
| Returns the value corresponding to a string, or a default value (e.g.: DataValue::EMPTY) if not found | |
| const DataValue & | getMetaValue (UInt index) const |
| Returns the value corresponding to the index, or DataValue::EMPTY if not found. | |
| DataValue | getMetaValue (UInt index, const DataValue &default_value) const |
| Returns the value corresponding to the index, or a default value (e.g.: DataValue::EMPTY) if not found | |
| bool | metaValueExists (const std::string &name) const |
| Returns whether an entry with the given name exists. | |
| bool | metaValueExists (UInt index) const |
| Returns whether an entry with the given index exists. | |
| void | setMetaValue (const std::string &name, const DataValue &value) |
| Sets the DataValue corresponding to a name. | |
| void | setMetaValue (UInt index, const DataValue &value) |
| Sets the DataValue corresponding to an index. | |
| void | removeMetaValue (const std::string &name) |
Removes the DataValue corresponding to name if it exists. | |
| void | removeMetaValue (UInt index) |
Removes the DataValue corresponding to index if it exists. | |
| void | addMetaValues (const MetaInfoInterface &from) |
| void | getKeys (std::vector< std::string > &keys) const |
| Fills the given vector with a list of all keys for which a value is set. | |
| void | getKeys (std::vector< UInt > &keys) const |
| Fills the given vector with a list of all keys for which a value is set. | |
| bool | isMetaEmpty () const |
| Returns if the MetaInfo is empty. | |
| void | clearMetaInfo () |
| Removes all meta values. | |
| MetaInfoConstIterator | metaBegin () const |
| Returns a const iterator to the beginning of the meta info entries. | |
| MetaInfoConstIterator | metaEnd () const |
| Returns a const iterator to the end of the meta info entries. | |
| Size | metaSize () const |
| Returns the number of meta info entries. | |
Protected Member Functions | |
| void | checkDataArraySizes_ () const |
| Throws Exception::Precondition if any non-empty data array's size differs from the peak count. | |
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 | |
| void | for_each_base_ (Visitor &&visitor) const |
| .. and a const version | |
Protected Member Functions inherited from MetaInfoInterface | |
| void | createIfNotExists_ () |
| Creates the MetaInfo object if it does not exist. | |
Protected Attributes | |
| std::string | name_ |
| Name. | |
| FloatDataArrays | float_data_arrays_ |
| Float data arrays. | |
| StringDataArrays | string_data_arrays_ |
| std::string data arrays | |
| IntegerDataArrays | integer_data_arrays_ |
| Integer data arrays. | |
Protected Attributes inherited from ChromatogramSettings | |
| std::string | native_id_ |
| std::string | comment_ |
| InstrumentSettings | instrument_settings_ |
| SourceFile | source_file_ |
| AcquisitionInfo | acquisition_info_ |
| Precursor | precursor_ |
| Product | product_ |
| std::vector< DataProcessingPtr > | data_processing_ |
| ChromatogramType | type_ |
Protected Attributes inherited from MetaInfoInterface | |
| MetaInfo * | meta_ = nullptr |
| Pointer to the MetaInfo object. | |
Additional Inherited Members | |
Static Public Member Functions inherited from MetaInfoInterface | |
| static MetaInfoRegistry & | metaRegistry () |
| Returns a reference to the MetaInfoRegistry. | |
Static Public Attributes inherited from ChromatogramSettings | |
| static const char *const | ChromatogramNames [static_cast< size_t >(ChromatogramType::SIZE_OF_CHROMATOGRAM_TYPE)+1] |
| Names of chromatogram types corresponding to enum ChromatogramType. | |
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) | |
The representation of a chromatogram.
| typedef ContainerType::const_iterator ConstIterator |
Non-mutable iterator.
| typedef ContainerType::const_reverse_iterator ConstReverseIterator |
Non-mutable reverse iterator.
| typedef std::vector<PeakType> ContainerType |
Chromatogram base type.
Coordinate (RT) type.
Float data array vector type.
| typedef std::vector<FloatDataArray> FloatDataArrays |
Integer data array vector type.
| typedef std::vector<IntegerDataArray> IntegerDataArrays |
| typedef ContainerType::iterator Iterator |
Mutable iterator.
| typedef ChromatogramPeak PeakType |
| typedef ContainerType::reverse_iterator ReverseIterator |
Mutable reverse iterator.
std::string data array vector type
| typedef std::vector<StringDataArray> StringDataArrays |
|
default |
Constructor.
|
default |
Copy constructor.
|
default |
Move constructor.
|
default |
Destructor.
|
protected |
Throws Exception::Precondition if any non-empty data array's size differs from the peak count.
Shared by sort() and select() so that permuting the peaks can never mis-associate a parallel data array or index one out of bounds.
| Exception::Precondition | if a non-empty float, string or integer data array's size differs from the number of peaks. |
| void clear | ( | bool | clear_meta_data | ) |
Clears all data and meta data.
Will delete (clear) all peaks contained in the chromatogram as well as any associated data arrays (FloatDataArrays, IntegerDataArrays, StringDataArrays) and the ranges by default – those arrays are parallel to the peaks, so retaining them would leave the chromatogram inconsistent. If clear_meta_data is true, then also the descriptive meta data (ChromatogramSettings, name) will be deleted.
| [in] | clear_meta_data | If true, all meta data is cleared in addition to the data. |
| Size findNearest | ( | CoordinateType | rt | ) | const |
Binary search for the peak nearest to a specific RT.
| [in] | rt | The searched for mass-to-charge ratio searched |
| Exception::Precondition | is thrown if the chromatogram is empty (not only in debug mode) |
| FloatDataArrays & getFloatDataArrays | ( | ) |
Returns a mutable reference to the float meta data arrays.
| const FloatDataArrays & getFloatDataArrays | ( | ) | const |
Returns a const reference to the float meta data arrays
Referenced by DataFilters::passes().
| IntegerDataArrays & getIntegerDataArrays | ( | ) |
Returns a mutable reference to the integer meta data arrays.
| const IntegerDataArrays & getIntegerDataArrays | ( | ) | const |
Returns a const reference to the integer meta data arrays.
Referenced by DataFilters::passes().
| double getMZ | ( | ) | const |
returns the mz of the product entry, makes sense especially for MRM scans
| const std::string & getName | ( | ) | const |
| StringDataArrays & getStringDataArrays | ( | ) |
Returns a mutable reference to the string meta data arrays.
| const StringDataArrays & getStringDataArrays | ( | ) | const |
Returns a const reference to the string meta data arrays.
| bool isSorted | ( | ) | const |
Checks if all peaks are sorted with respect to ascending RT.
| void mergePeaks | ( | MSChromatogram & | other, |
| bool | add_meta = false |
||
| ) |
Adds all the chromatogram peaks from another MSChromatogram and updates the metadata to indicate a merge.
MZ of the destination MSChromatogram remains unchanged.
| [in,out] | other | A reference to the MSChromatogram to take ChromatogramPeaks from |
| [in] | add_meta | If true, a metavalue "merged_chromatogram_mzs" is added with the m/z of other |
|
inline |
Equality operator.
References OpenMS::Internal::operator==().
| MSChromatogram & operator= | ( | const MSChromatogram & | source | ) |
Assignment operator.
|
default |
Move assignment operator.
| bool operator== | ( | const MSChromatogram & | rhs | ) | const |
Equality operator.
| ConstIterator PosBegin | ( | ConstIterator | begin, |
| CoordinateType | rt, | ||
| ConstIterator | end | ||
| ) | const |
Binary search for peak range begin.
Alias for RTBegin()
| Iterator PosBegin | ( | CoordinateType | rt | ) |
Binary search for peak range begin.
Alias for RTBegin()
| ConstIterator PosBegin | ( | CoordinateType | rt | ) | const |
Binary search for peak range begin.
Alias for RTBegin()
| Iterator PosBegin | ( | Iterator | begin, |
| CoordinateType | rt, | ||
| Iterator | end | ||
| ) |
Binary search for peak range begin.
Alias for RTBegin()
| ConstIterator PosEnd | ( | ConstIterator | begin, |
| CoordinateType | rt, | ||
| ConstIterator | end | ||
| ) | const |
Binary search for peak range end (returns the past-the-end iterator)
Alias for RTEnd()
| Iterator PosEnd | ( | CoordinateType | rt | ) |
Binary search for peak range end (returns the past-the-end iterator)
Alias for RTEnd()
| ConstIterator PosEnd | ( | CoordinateType | rt | ) | const |
Binary search for peak range end (returns the past-the-end iterator)
Alias for RTEnd()
| Iterator PosEnd | ( | Iterator | begin, |
| CoordinateType | rt, | ||
| Iterator | end | ||
| ) |
Binary search for peak range end (returns the past-the-end iterator)
Alias for RTEnd()
| ConstIterator RTBegin | ( | ConstIterator | begin, |
| CoordinateType | rt, | ||
| ConstIterator | end | ||
| ) | const |
Binary search for peak range begin.
| Iterator RTBegin | ( | CoordinateType | rt | ) |
Binary search for peak range begin.
| ConstIterator RTBegin | ( | CoordinateType | rt | ) | const |
Binary search for peak range begin.
| Iterator RTBegin | ( | Iterator | begin, |
| CoordinateType | rt, | ||
| Iterator | end | ||
| ) |
Binary search for peak range begin.
| ConstIterator RTEnd | ( | ConstIterator | begin, |
| CoordinateType | rt, | ||
| ConstIterator | end | ||
| ) | const |
Binary search for peak range end (returns the past-the-end iterator)
| Iterator RTEnd | ( | CoordinateType | rt | ) |
Binary search for peak range end (returns the past-the-end iterator)
| ConstIterator RTEnd | ( | CoordinateType | rt | ) | const |
Binary search for peak range end (returns the past-the-end iterator)
| Iterator RTEnd | ( | Iterator | begin, |
| CoordinateType | rt, | ||
| Iterator | end | ||
| ) |
Binary search for peak range end (returns the past-the-end iterator)
| MSChromatogram & select | ( | const std::vector< Size > & | indices | ) |
Subset the chromatogram by selecting only indices in indices, in that order.
Every index is bounds-checked before anything is modified, so an out-of-range index is rejected with the chromatogram left unchanged. This is the safe, default entry point. Callers whose indices are in range by construction can use selectUnchecked() to skip the check.
| [in] | indices | Indices to keep, in the retained order. Must all be < size(); see selectUnchecked() for the duplicate-index restriction that applies to both overloads. |
| Exception::Precondition | if an index is out of range, or if a non-empty data array's size differs from the number of peaks. |
| MSChromatogram & selectUnchecked | ( | const std::vector< Size > & | indices | ) |
Like select(), but without the per-index range check.
For hot paths whose indices are in range by construction (e.g. a sort permutation). The data-array size consistency is still checked, as it is cheap and guards a separate out-of-bounds.
indices must be duplicate-free. Repeating an index is undefined behaviour: entries are moved, so a second reference would read a moved-from value. A debug build asserts uniqueness via OPENMS_PRECONDITION; release builds do not pay for the check.| [in] | indices | Indices to keep, in the retained order. Every index must be < size() and unique. |
| Exception::Precondition | if a non-empty data array's size differs from the number of peaks. |
|
inline |
Sets the float meta data arrays.
|
inline |
Sets the integer meta data arrays.
| void setName | ( | const std::string & | name | ) |
Sets the name.
|
inline |
Sets the string meta data arrays.
|
inline |
Stably sorts the peaks (and all parallel data arrays) by a user-defined predicate.
You can pass any lambda with signature bool(Size index_1, Size index_2) which, given two indices into the MSChromatogram (either peaks or data arrays), returns a strict weak ordering. Capture the MSChromatogram in the lambda and operate on it based on the indices. The sort is stable, so peaks with equivalent keys keep their relative order.
| Predicate | Callable with signature bool(Size, Size) expressing a strict weak ordering. |
| [in] | lambda | The comparison predicate. |
| Exception::Precondition | if a non-empty data array's size differs from the number of peaks. This is checked up front, before lambda is ever invoked, so the chromatogram is left unchanged. |
| void sortByIntensity | ( | bool | reverse = false | ) |
Lexicographically sorts the peaks by their intensity.
Sorts the peaks according to ascending intensity. Meta data arrays will be sorted accordingly.
Referenced by MRMTransitionGroupPicker::pickTransitionGroup().
| void sortByPosition | ( | ) |
Lexicographically sorts the peaks by their position.
The chromatogram is sorted with respect to position. Meta data arrays will be sorted accordingly.
|
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< RangeRT, RangeIntensity >.
|
protected |
Float data arrays.
|
protected |
Integer data arrays.
|
protected |
Name.
|
protected |
std::string data arrays