![]() |
OpenMS
|
A basic LC-MS feature. More...
#include <OpenMS/KERNEL/BaseFeature.h>
Classes | |
| struct | QualityLess |
| Compare by quality. More... | |
Public Member Functions | |
| WidthType | getWidth () const |
| Non-mutable access to the features width (full width at half max, FWHM) | |
| void | setWidth (WidthType fwhm) |
| Set the width of the feature (FWHM) | |
| const ChargeType & | getCharge () const |
| Non-mutable access to charge state. | |
| void | setCharge (const ChargeType &ch) |
| Set charge state. | |
| BaseFeature & | operator= (const BaseFeature &rhs)=default |
| Assignment operator. | |
| BaseFeature & | operator= (BaseFeature &&rhs) &=default |
| Move Assignment operator. | |
| bool | operator== (const BaseFeature &rhs) const |
| Equality operator. | |
| bool | operator!= (const BaseFeature &rhs) const |
| Inequality operator. | |
| AnnotationState | getAnnotationState () const |
| state of peptide identifications attached to this feature. If one ID has multiple hits, the output depends on the top-hit only | |
Constructors and Destructor | |
Default constructor | |
| BaseFeature () | |
| BaseFeature (const BaseFeature &feature)=default | |
| Copy constructor. | |
| BaseFeature (BaseFeature &&feature) noexcept | |
| BaseFeature (const BaseFeature &rhs, UInt64 map_index) | |
| Copy constructor with a new map_index. | |
| BaseFeature (const Peak2D &point) | |
| Constructor from raw data point. | |
| BaseFeature (const RichPeak2D &point) | |
| Constructor from raw data point with meta information. | |
| BaseFeature (const FeatureHandle &fh) | |
| Constructor from a featurehandle. | |
| ~BaseFeature () override | |
| Destructor. | |
Quality methods | |
Non-mutable access to the overall quality | |
| QualityType | getQuality () const |
| void | setQuality (QualityType q) |
| Set the overall quality. | |
Functions for dealing with identifications in legacy format | |
returns a const reference to the PeptideIdentification vector | |
| const PeptideIdentificationList & | getPeptideIdentifications () const |
| PeptideIdentificationList & | getPeptideIdentifications () |
| returns a mutable reference to the PeptideIdentification vector | |
| void | setPeptideIdentifications (const PeptideIdentificationList &peptides) |
| sets the PeptideIdentification vector | |
| void | sortPeptideIdentifications () |
| Sorts the peptide identifications of this feature by the score of their best hit. | |
Functions for dealing with identifications in new format | |
has a primary ID (peptide, RNA, compound) been assigned? | |
| bool | hasPrimaryID () const |
| const IdentificationData::IdentifiedMolecule & | getPrimaryID () const |
| Return the primary ID (peptide, RNA, compound) assigned to this feature. | |
| void | clearPrimaryID () |
| clear any primary ID that was assigned | |
| void | setPrimaryID (const IdentificationData::IdentifiedMolecule &id) |
| set the primary ID (peptide, RNA, compound) for this feature | |
| const std::set< IdentificationData::ObservationMatchRef > & | getIDMatches () const |
| immutable access to the set of matches (e.g. PSMs) with IDs for this feature | |
| std::set< IdentificationData::ObservationMatchRef > & | getIDMatches () |
| mutable access to the set of matches (e.g. PSMs) with IDs for this feature | |
| void | addIDMatch (IdentificationData::ObservationMatchRef ref) |
| add an ID match (e.g. PSM) for this feature | |
| void | updateIDReferences (const IdentificationData::RefTranslator &trans) |
| Update ID references (primary ID, matches) for this feature. | |
Public Member Functions inherited from RichPeak2D | |
| RichPeak2D () | |
| Default constructor. | |
| RichPeak2D (const RichPeak2D &p)=default | |
| Copy constructor. | |
| RichPeak2D (const Peak2D &p) | |
| Constructor from Peak2D. | |
| RichPeak2D (const PositionType &pos, const IntensityType in) | |
| Member constructor. | |
| RichPeak2D (RichPeak2D &&p)=default | |
| Move constructor. | |
| ~RichPeak2D () override | |
| Destructor. | |
| RichPeak2D & | operator= (const RichPeak2D &rhs)=default |
| Assignment operator. | |
| RichPeak2D & | operator= (RichPeak2D &&rhs) &=default |
| Move Assignment operator. | |
| RichPeak2D & | operator= (const Peak2D &rhs) |
| Assignment operator. | |
| bool | operator== (const RichPeak2D &rhs) const |
| Equality operator. | |
| bool | operator!= (const RichPeak2D &rhs) const |
| Equality operator. | |
Public Member Functions inherited from Peak2D | |
| bool | operator== (const Peak2D &rhs) const =default |
| Equality operator. | |
| bool | operator!= (const Peak2D &rhs) const |
| Equality operator. | |
| Peak2D ()=default | |
| Peak2D (const PositionType &pos, const IntensityType in) | |
| Member constructor. | |
| Peak2D (const Peak2D &p)=default | |
| Copy constructor. | |
| Peak2D (Peak2D &&) noexcept=default | |
| Move constructor. | |
| Peak2D & | operator= (const Peak2D &rhs)=default |
| Assignment operator. | |
| Peak2D & | operator= (Peak2D &&) noexcept=default |
| Move assignment operator. | |
| ~Peak2D () noexcept=default | |
| Destructor. | |
| IntensityType | getIntensity () const |
| void | setIntensity (IntensityType intensity) |
| Sets data point intensity (height) | |
| PositionType const & | getPosition () const |
| Non-mutable access to the position. | |
| PositionType & | getPosition () |
| Mutable access to the position. | |
| void | setPosition (const PositionType &position) |
| Mutable access to the position. | |
| CoordinateType | getMZ () const |
| Returns the m/z coordinate (index 1) | |
| void | setMZ (CoordinateType coordinate) |
| Mutable access to the m/z coordinate (index 1) | |
| CoordinateType | getRT () const |
| Returns the RT coordinate (index 0) | |
| void | setRT (CoordinateType coordinate) |
| Mutable access to the RT coordinate (index 0) | |
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. | |
Public Member Functions inherited from UniqueIdInterface | |
| UniqueIdInterface () | |
| Default constructor - the unique id will be invalid | |
| UniqueIdInterface (const UniqueIdInterface &rhs)=default | |
| Copy constructor - copies the unique id. | |
| UniqueIdInterface (UniqueIdInterface &&rhs)=default | |
| Move constructor. | |
| UniqueIdInterface & | operator= (UniqueIdInterface const &rhs)=default |
| Assignment operator - copies the unique id. | |
| UniqueIdInterface & | operator= (UniqueIdInterface &&) &=default |
| Move Assignment operator - copies the unique id. | |
| virtual | ~UniqueIdInterface ()=default |
| Destructor. | |
| bool | operator== (UniqueIdInterface const &rhs) const |
| Equality comparison operator - the unique ids must be equal (!) | |
| UInt64 | getUniqueId () const |
| Non-mutable access to unique id - returns the unique id. | |
| Size | clearUniqueId () |
| Clear the unique id. The new unique id will be invalid. Returns 1 if the unique id was changed, 0 otherwise. | |
| void | swap (UniqueIdInterface &from) |
| Size | hasValidUniqueId () const |
| Returns whether the unique id is valid. Returns 1 if the unique id is valid, 0 otherwise. | |
| Size | hasInvalidUniqueId () const |
| Returns whether the unique id is invalid. Returns 1 if the unique id is invalid, 0 otherwise. | |
| Size | setUniqueId () |
| Assigns a new, valid unique id. Always returns 1. | |
| Size | ensureUniqueId () |
| Assigns a valid unique id, but only if the present one is invalid. Returns 1 if the unique id was changed, 0 otherwise. | |
| void | setUniqueId (UInt64 rhs) |
| Assigns the given unique id. | |
| void | setUniqueId (const std::string &rhs) |
| Mutable access to unique id. | |
Protected Attributes | |
| QualityType | quality_ |
| Overall quality measure of the feature. | |
| ChargeType | charge_ |
| Charge of the peptide represented by this feature. The default value is 0, which represents an unknown charge state. | |
| WidthType | width_ |
| Width (FWHM) for the feature. The default value is 0.0, a feature finding algorithm can compute this form the model. | |
| PeptideIdentificationList | peptides_ |
| PeptideIdentifications belonging to the feature. | |
| std::optional< IdentificationData::IdentifiedMolecule > | primary_id_ |
| primary ID (peptide, RNA, compound) assigned to this feature | |
| std::set< IdentificationData::ObservationMatchRef > | id_matches_ |
| set of observation matches (e.g. PSMs) with IDs for this feature | |
Protected Attributes inherited from Peak2D | |
| PositionType | position_ {} |
| The data point position. | |
| IntensityType | intensity_ {} |
| The data point intensity. | |
Protected Attributes inherited from MetaInfoInterface | |
| MetaInfo * | meta_ = nullptr |
| Pointer to the MetaInfo object. | |
Protected Attributes inherited from UniqueIdInterface | |
| UInt64 | unique_id_ |
| the unique id | |
Type definitions | |
Type of quality values | |
| enum class | AnnotationState { FEATURE_ID_NONE , FEATURE_ID_SINGLE , FEATURE_ID_MULTIPLE_SAME , FEATURE_ID_MULTIPLE_DIVERGENT , SIZE_OF_ANNOTATIONSTATE } |
| state of identification, use getAnnotationState() to query it More... | |
| typedef float | QualityType |
| typedef Int | ChargeType |
| Type of charge values. | |
| typedef float | WidthType |
| Type of feature width/FWHM (RT) | |
| static const std::string | NamesOfAnnotationState [static_cast< size_t >(AnnotationState::SIZE_OF_ANNOTATIONSTATE)] |
Additional Inherited Members | |
Public Types inherited from Peak2D | |
| using | IntensityType = float |
| Intensity type. | |
| using | CoordinateType = double |
| Coordinate type (of the position) | |
| using | PositionType = DPosition< 2 > |
| Position type. | |
| enum | DimensionDescription { RT = 0 , MZ = 1 , DIMENSION = 2 } |
| This enum maps the symbolic names of the dimensions to numbers. More... | |
Public Types inherited from MetaInfoInterface | |
| using | MetaInfoConstIterator = MetaInfo::const_iterator |
| Const iterator type for iterating over meta info entries. | |
Public Types inherited from UniqueIdInterface | |
| enum | { INVALID = 0 } |
| This is the invalid unique id (cast it to a UInt64 if you like) More... | |
Static Public Member Functions inherited from Peak2D | |
| static char const * | shortDimensionName (UInt const dim) |
| Short name of the dimension (abbreviated form) | |
| static char const * | shortDimensionNameRT () |
| Short name of the dimension (abbreviated form) | |
| static char const * | shortDimensionNameMZ () |
| Short name of the dimension (abbreviated form) | |
| static char const * | fullDimensionName (UInt const dim) |
| Full name of the dimension (self-explanatory form) | |
| static char const * | fullDimensionNameRT () |
| Full name of the dimension (self-explanatory form) | |
| static char const * | fullDimensionNameMZ () |
| Full name of the dimension (self-explanatory form) | |
| static char const * | shortDimensionUnit (UInt const dim) |
| Unit of measurement (abbreviated form) | |
| static char const * | shortDimensionUnitRT () |
| Unit of measurement (abbreviated form) | |
| static char const * | shortDimensionUnitMZ () |
| Unit of measurement (abbreviated form) | |
| static char const * | fullDimensionUnit (UInt const dim) |
| Unit of measurement (self-explanatory form) | |
| static char const * | fullDimensionUnitRT () |
| Unit of measurement (self-explanatory form) | |
| static char const * | fullDimensionUnitMZ () |
| Unit of measurement (self-explanatory form) | |
Static Public Member Functions inherited from MetaInfoInterface | |
| static MetaInfoRegistry & | metaRegistry () |
| Returns a reference to the MetaInfoRegistry. | |
Static Public Member Functions inherited from UniqueIdInterface | |
| static bool | isValid (UInt64 unique_id) |
| Returns true if the unique_id is valid, false otherwise. | |
Protected Member Functions inherited from MetaInfoInterface | |
| void | createIfNotExists_ () |
| Creates the MetaInfo object if it does not exist. | |
Static Protected Attributes inherited from Peak2D | |
| static char const *const | dimension_name_short_ [DIMENSION] |
| Short name of the dimension (abbreviated form) | |
| static char const *const | dimension_name_full_ [DIMENSION] |
| Full name of the dimension (self-explanatory form) | |
| static char const *const | dimension_unit_short_ [DIMENSION] |
| Unit of measurement (abbreviated form) | |
| static char const *const | dimension_unit_full_ [DIMENSION] |
| Unit of measurement (self-explanatory form) | |
A basic LC-MS feature.
This class represents a "minimal" feature, defined by a position in RT and m/z, intensity, charge, quality, and annotated peptides. Most classes dealing with features will use the subclasses Feature or ConsensusFeature directly. However, algorithms that rely on very general characteristics of features can use this class to provide a unified solution for both "normal" features and consensus features.
| typedef Int ChargeType |
Type of charge values.
| typedef float QualityType |
| typedef float WidthType |
Type of feature width/FWHM (RT)
|
strong |
state of identification, use getAnnotationState() to query it
| Enumerator | |
|---|---|
| FEATURE_ID_NONE | |
| FEATURE_ID_SINGLE | |
| FEATURE_ID_MULTIPLE_SAME | |
| FEATURE_ID_MULTIPLE_DIVERGENT | |
| SIZE_OF_ANNOTATIONSTATE | |
| BaseFeature | ( | ) |
|
default |
Copy constructor.
|
inlinenoexcept |
Move constructor Note: can't be "noexcept = default" because of missing noexcept on some standard containers so we need to explicitly define it noexcept and provide an implementation.
| BaseFeature | ( | const BaseFeature & | rhs, |
| UInt64 | map_index | ||
| ) |
Copy constructor with a new map_index.
|
explicit |
Constructor from raw data point.
|
explicit |
Constructor from raw data point with meta information.
|
explicit |
Constructor from a featurehandle.
|
override |
Destructor.
| void addIDMatch | ( | IdentificationData::ObservationMatchRef | ref | ) |
add an ID match (e.g. PSM) for this feature
| void clearPrimaryID | ( | ) |
clear any primary ID that was assigned
| AnnotationState getAnnotationState | ( | ) | const |
state of peptide identifications attached to this feature. If one ID has multiple hits, the output depends on the top-hit only
| const ChargeType & getCharge | ( | ) | const |
Non-mutable access to charge state.
Referenced by MQEvidence::exportRowFromFeature_(), and MQMsms::exportRowFromFeature_().
| std::set< IdentificationData::ObservationMatchRef > & getIDMatches | ( | ) |
mutable access to the set of matches (e.g. PSMs) with IDs for this feature
| const std::set< IdentificationData::ObservationMatchRef > & getIDMatches | ( | ) | const |
immutable access to the set of matches (e.g. PSMs) with IDs for this feature
| PeptideIdentificationList & getPeptideIdentifications | ( | ) |
returns a mutable reference to the PeptideIdentification vector
| const PeptideIdentificationList & getPeptideIdentifications | ( | ) | const |
Referenced by MQEvidence::exportRowFromFeature_(), MQMsms::exportRowFromFeature_(), MQExporterHelper::hasPeptideIdentifications_(), MQExporterHelper::hasValidPepID_(), MQExporterHelper::MQCommonOutputs::MQCommonOutputs(), and FeatureFinderIdentificationAlgorithm::FeatureFilterPeptides::operator()().
| const IdentificationData::IdentifiedMolecule & getPrimaryID | ( | ) | const |
Return the primary ID (peptide, RNA, compound) assigned to this feature.
| Exception::MissingInformation | if no ID was assigned |
| QualityType getQuality | ( | ) | const |
| WidthType getWidth | ( | ) | const |
Non-mutable access to the features width (full width at half max, FWHM)
Referenced by MQEvidence::exportRowFromFeature_().
| bool hasPrimaryID | ( | ) | const |
| bool operator!= | ( | const BaseFeature & | rhs | ) | const |
Inequality operator.
|
default |
Move Assignment operator.
|
default |
Assignment operator.
| bool operator== | ( | const BaseFeature & | rhs | ) | const |
Equality operator.
| void setCharge | ( | const ChargeType & | ch | ) |
Set charge state.
Referenced by MsInspectFile::load(), and SpecArrayFile::load().
| void setPeptideIdentifications | ( | const PeptideIdentificationList & | peptides | ) |
sets the PeptideIdentification vector
| void setPrimaryID | ( | const IdentificationData::IdentifiedMolecule & | id | ) |
set the primary ID (peptide, RNA, compound) for this feature
| void setQuality | ( | QualityType | q | ) |
Set the overall quality.
| void sortPeptideIdentifications | ( | ) |
Sorts the peptide identifications of this feature by the score of their best hit.
First the hits of every identification are sorted with PeptideIdentification::sort(), so afterwards the best hit of each identification is its first hit. Then the identifications are ordered best first: the identification whose first hit has the best score ends up at index 0. Identifications without hits are placed after all identifications with hits. Identifications whose first hits score equally, and identifications without hits among themselves, keep their relative order (the sort is stable).
| void updateIDReferences | ( | const IdentificationData::RefTranslator & | trans | ) |
Update ID references (primary ID, matches) for this feature.
This is needed e.g. after the IdentificationData instance containing the referenced data has been copied.
|
protected |
Charge of the peptide represented by this feature. The default value is 0, which represents an unknown charge state.
|
protected |
set of observation matches (e.g. PSMs) with IDs for this feature
|
static |
|
protected |
PeptideIdentifications belonging to the feature.
|
protected |
primary ID (peptide, RNA, compound) assigned to this feature
|
protected |
Overall quality measure of the feature.