OpenMS  2.7.0
Classes | List of all members
BaseFeature Class Reference

A basic LC-MS feature. More...

#include <OpenMS/KERNEL/BaseFeature.h>

Inheritance diagram for BaseFeature:
[legend]
Collaboration diagram for BaseFeature:
[legend]

Classes

struct  QualityLess
 Compare by quality. More...
 

Public Member Functions

Constructors and Destructor
 BaseFeature ()
 Default constructor. More...
 
 BaseFeature (const BaseFeature &feature)=default
 Copy constructor. More...
 
 BaseFeature (BaseFeature &&feature)=default
 Move constructor. More...
 
 BaseFeature (const BaseFeature &rhs, UInt64 map_index)
 Copy constructor with a new map_index. More...
 
 BaseFeature (const Peak2D &point)
 Constructor from raw data point. More...
 
 BaseFeature (const RichPeak2D &point)
 Constructor from raw data point with meta information. More...
 
 BaseFeature (const FeatureHandle &fh)
 Constructor from a featurehandle. More...
 
 ~BaseFeature () override
 Destructor. More...
 
- Public Member Functions inherited from RichPeak2D
 RichPeak2D ()
 Default constructor. More...
 
 RichPeak2D (const RichPeak2D &p)=default
 Copy constructor. More...
 
 RichPeak2D (const Peak2D &p)
 Constructor from Peak2D. More...
 
 RichPeak2D (const PositionType &pos, const IntensityType in)
 Member constructor. More...
 
 RichPeak2D (RichPeak2D &&p)=default
 Move constructor. More...
 
 ~RichPeak2D () override
 Destructor. More...
 
RichPeak2Doperator= (const RichPeak2D &rhs)=default
 Assignment operator. More...
 
RichPeak2Doperator= (RichPeak2D &&rhs) &=default
 Move Assignment operator. More...
 
RichPeak2Doperator= (const Peak2D &rhs)
 Assignment operator. More...
 
bool operator== (const RichPeak2D &rhs) const
 Equality operator. More...
 
bool operator!= (const RichPeak2D &rhs) const
 Equality operator. More...
 
- Public Member Functions inherited from Peak2D
Peak2Doperator= (const Peak2D &rhs)=default
 Assignment operator. More...
 
Peak2Doperator= (Peak2D &&) &=default
 Move assignment operator. More...
 
bool operator== (const Peak2D &rhs) const
 Equality operator. More...
 
bool operator!= (const Peak2D &rhs) const
 Equality operator. More...
 
 Peak2D ()
 
 Peak2D (const PositionType &pos, const IntensityType in)
 Member constructor. More...
 
 Peak2D (const Peak2D &p)=default
 Copy constructor. More...
 
 Peak2D (Peak2D &&)=default
 Move constructor. More...
 
 ~Peak2D ()
 Destructor. More...
 
IntensityType getIntensity () const
 
void setIntensity (IntensityType intensity)
 Non-mutable access to the data point intensity (height) More...
 
PositionType const & getPosition () const
 Non-mutable access to the position. More...
 
PositionTypegetPosition ()
 Mutable access to the position. More...
 
void setPosition (const PositionType &position)
 Mutable access to the position. More...
 
CoordinateType getMZ () const
 Returns the m/z coordinate (index 1) More...
 
void setMZ (CoordinateType coordinate)
 Mutable access to the m/z coordinate (index 1) More...
 
CoordinateType getRT () const
 Returns the RT coordinate (index 0) More...
 
void setRT (CoordinateType coordinate)
 Mutable access to the RT coordinate (index 0) More...
 
- Public Member Functions inherited from MetaInfoInterface
 MetaInfoInterface ()
 Constructor. More...
 
 MetaInfoInterface (const MetaInfoInterface &rhs)
 Copy constructor. More...
 
 MetaInfoInterface (MetaInfoInterface &&) noexcept
 Move constructor. More...
 
 ~MetaInfoInterface ()
 Destructor. More...
 
MetaInfoInterfaceoperator= (const MetaInfoInterface &rhs)
 Assignment operator. More...
 
MetaInfoInterfaceoperator= (MetaInfoInterface &&) noexcept
 Move assignment operator. More...
 
bool operator== (const MetaInfoInterface &rhs) const
 Equality operator. More...
 
bool operator!= (const MetaInfoInterface &rhs) const
 Equality operator. More...
 
const DataValuegetMetaValue (const String &name, const DataValue &default_value=DataValue::EMPTY) const
 Returns the value corresponding to a string, or a default value (default: DataValue::EMPTY) if not found. More...
 
const DataValuegetMetaValue (UInt index, const DataValue &default_value=DataValue::EMPTY) const
 Returns the value corresponding to an index, or a default value (default: DataValue::EMPTY) if not found. More...
 
bool metaValueExists (const String &name) const
 Returns whether an entry with the given name exists. More...
 
bool metaValueExists (UInt index) const
 Returns whether an entry with the given index exists. More...
 
void setMetaValue (const String &name, const DataValue &value)
 Sets the DataValue corresponding to a name. More...
 
void setMetaValue (UInt index, const DataValue &value)
 Sets the DataValue corresponding to an index. More...
 
void removeMetaValue (const String &name)
 Removes the DataValue corresponding to name if it exists. More...
 
void removeMetaValue (UInt index)
 Removes the DataValue corresponding to index if it exists. More...
 
void addMetaValues (const MetaInfoInterface &from)
 function to copy all meta values from one object to this one More...
 
void getKeys (std::vector< String > &keys) const
 Fills the given vector with a list of all keys for which a value is set. More...
 
void getKeys (std::vector< UInt > &keys) const
 Fills the given vector with a list of all keys for which a value is set. More...
 
bool isMetaEmpty () const
 Returns if the MetaInfo is empty. More...
 
void clearMetaInfo ()
 Removes all meta values. More...
 
- Public Member Functions inherited from UniqueIdInterface
 UniqueIdInterface ()
 Default constructor - the unique id will be invalid More...
 
 UniqueIdInterface (const UniqueIdInterface &rhs)=default
 Copy constructor - copies the unique id. More...
 
 UniqueIdInterface (UniqueIdInterface &&rhs)=default
 Move constructor. More...
 
UniqueIdInterfaceoperator= (UniqueIdInterface const &rhs)=default
 Assignment operator - copies the unique id. More...
 
UniqueIdInterfaceoperator= (UniqueIdInterface &&) &=default
 Move Assignment operator - copies the unique id. More...
 
virtual ~UniqueIdInterface ()=default
 Destructor. More...
 
bool operator== (UniqueIdInterface const &rhs) const
 Equality comparison operator - the unique ids must be equal (!) More...
 
UInt64 getUniqueId () const
 Non-mutable access to unique id - returns the unique id. More...
 
Size clearUniqueId ()
 Clear the unique id. The new unique id will be invalid. Returns 1 if the unique id was changed, 0 otherwise. More...
 
void swap (UniqueIdInterface &from)
 
Size hasValidUniqueId () const
 Returns whether the unique id is valid. Returns 1 if the unique id is valid, 0 otherwise. More...
 
Size hasInvalidUniqueId () const
 Returns whether the unique id is invalid. Returns 1 if the unique id is invalid, 0 otherwise. More...
 
Size setUniqueId ()
 Assigns a new, valid unique id. Always returns 1. More...
 
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. More...
 
void setUniqueId (UInt64 rhs)
 Assigns the given unique id. More...
 
void setUniqueId (const String &rhs)
 Mutable access to unique id. More...
 

Type definitions

enum  AnnotationState {
  FEATURE_ID_NONE , FEATURE_ID_SINGLE , FEATURE_ID_MULTIPLE_SAME , FEATURE_ID_MULTIPLE_DIVERGENT ,
  SIZE_OF_ANNOTATIONSTATE
}
 state of identification, use getIDState() to query it More...
 
typedef float QualityType
 Type of quality values. More...
 
typedef Int ChargeType
 Type of charge values. More...
 
typedef float WidthType
 Type of feature width/FWHM (RT) More...
 
static const std::string NamesOfAnnotationState [SIZE_OF_ANNOTATIONSTATE]
 

Quality methods

QualityType quality_
 Overall quality measure of the feature. More...
 
ChargeType charge_
 Charge of the peptide represented by this feature. The default value is 0, which represents an unknown charge state. More...
 
WidthType width_
 Width (FWHM) for the feature. The default value is 0.0, a feature finding algorithm can compute this form the model. More...
 
std::vector< PeptideIdentificationpeptides_
 PeptideIdentifications belonging to the feature. More...
 
QualityType getQuality () const
 Non-mutable access to the overall quality. More...
 
void setQuality (QualityType q)
 Set the overall quality. More...
 
WidthType getWidth () const
 Non-mutable access to the features width (full width at half max, FWHM) More...
 
void setWidth (WidthType fwhm)
 Set the width of the feature (FWHM) More...
 
const ChargeTypegetCharge () const
 Non-mutable access to charge state. More...
 
void setCharge (const ChargeType &ch)
 Set charge state. More...
 
BaseFeatureoperator= (const BaseFeature &rhs)=default
 Assignment operator. More...
 
BaseFeatureoperator= (BaseFeature &&rhs) &=default
 Move Assignment operator. More...
 
bool operator== (const BaseFeature &rhs) const
 Equality operator. More...
 
bool operator!= (const BaseFeature &rhs) const
 Inequality operator. More...
 
const std::vector< PeptideIdentification > & getPeptideIdentifications () const
 returns a const reference to the PeptideIdentification vector More...
 
std::vector< PeptideIdentification > & getPeptideIdentifications ()
 returns a mutable reference to the PeptideIdentification vector More...
 
void setPeptideIdentifications (const std::vector< PeptideIdentification > &peptides)
 sets the PeptideIdentification vector More...
 
void sortPeptideIdentifications ()
 sorts PeptideIdentifications, assuming they have the same scoreType. More...
 
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 More...
 

Additional Inherited Members

- Public Types inherited from Peak2D
typedef float IntensityType
 Intensity type. More...
 
typedef double CoordinateType
 Coordinate type (of the position) More...
 
typedef DPosition< 2 > PositionType
 Position type. More...
 
enum  DimensionDescription { RT = 0 , MZ = 1 , DIMENSION = 2 }
 This enum maps the symbolic names of the dimensions to numbers. More...
 
- 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) More...
 
static char const * shortDimensionNameRT ()
 Short name of the dimension (abbreviated form) More...
 
static char const * shortDimensionNameMZ ()
 Short name of the dimension (abbreviated form) More...
 
static char const * fullDimensionName (UInt const dim)
 Full name of the dimension (self-explanatory form) More...
 
static char const * fullDimensionNameRT ()
 Full name of the dimension (self-explanatory form) More...
 
static char const * fullDimensionNameMZ ()
 Full name of the dimension (self-explanatory form) More...
 
static char const * shortDimensionUnit (UInt const dim)
 Unit of measurement (abbreviated form) More...
 
static char const * shortDimensionUnitRT ()
 Unit of measurement (abbreviated form) More...
 
static char const * shortDimensionUnitMZ ()
 Unit of measurement (abbreviated form) More...
 
static char const * fullDimensionUnit (UInt const dim)
 Unit of measurement (self-explanatory form) More...
 
static char const * fullDimensionUnitRT ()
 Unit of measurement (self-explanatory form) More...
 
static char const * fullDimensionUnitMZ ()
 Unit of measurement (self-explanatory form) More...
 
- Static Public Member Functions inherited from MetaInfoInterface
static MetaInfoRegistrymetaRegistry ()
 Returns a reference to the MetaInfoRegistry. More...
 
- Static Public Member Functions inherited from UniqueIdInterface
static bool isValid (UInt64 unique_id)
 Returns true if the unique_id is valid, false otherwise. More...
 
- Protected Member Functions inherited from MetaInfoInterface
void createIfNotExists_ ()
 Creates the MetaInfo object if it does not exist. More...
 
- Protected Attributes inherited from Peak2D
PositionType position_
 The data point position. More...
 
IntensityType intensity_
 The data point intensity. More...
 
- Protected Attributes inherited from MetaInfoInterface
MetaInfometa_
 Pointer to the MetaInfo object (0 by default) More...
 
- Protected Attributes inherited from UniqueIdInterface
UInt64 unique_id_
 the unique id More...
 
- Static Protected Attributes inherited from Peak2D
static char const *const dimension_name_short_ [DIMENSION]
 Short name of the dimension (abbreviated form) More...
 
static char const *const dimension_name_full_ [DIMENSION]
 Full name of the dimension (self-explanatory form) More...
 
static char const *const dimension_unit_short_ [DIMENSION]
 Unit of measurement (abbreviated form) More...
 
static char const *const dimension_unit_full_ [DIMENSION]
 Unit of measurement (self-explanatory form) More...
 

Detailed Description

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.

Member Typedef Documentation

◆ ChargeType

typedef Int ChargeType

Type of charge values.

◆ QualityType

typedef float QualityType

Type of quality values.

◆ WidthType

typedef float WidthType

Type of feature width/FWHM (RT)

Member Enumeration Documentation

◆ AnnotationState

state of identification, use getIDState() to query it

Enumerator
FEATURE_ID_NONE 
FEATURE_ID_SINGLE 
FEATURE_ID_MULTIPLE_SAME 
FEATURE_ID_MULTIPLE_DIVERGENT 
SIZE_OF_ANNOTATIONSTATE 

Constructor & Destructor Documentation

◆ BaseFeature() [1/7]

Default constructor.

◆ BaseFeature() [2/7]

BaseFeature ( const BaseFeature feature)
default

Copy constructor.

◆ BaseFeature() [3/7]

BaseFeature ( BaseFeature &&  feature)
default

Move constructor.

◆ BaseFeature() [4/7]

BaseFeature ( const BaseFeature rhs,
UInt64  map_index 
)

Copy constructor with a new map_index.

◆ BaseFeature() [5/7]

BaseFeature ( const Peak2D point)
explicit

Constructor from raw data point.

◆ BaseFeature() [6/7]

BaseFeature ( const RichPeak2D point)
explicit

Constructor from raw data point with meta information.

◆ BaseFeature() [7/7]

BaseFeature ( const FeatureHandle fh)
explicit

Constructor from a featurehandle.

◆ ~BaseFeature()

~BaseFeature ( )
override

Destructor.

Member Function Documentation

◆ getAnnotationState()

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

◆ getCharge()

const ChargeType& getCharge ( ) const

Non-mutable access to charge state.

Referenced by TOPPGNPSExport::main_().

◆ getPeptideIdentifications() [1/2]

std::vector<PeptideIdentification>& getPeptideIdentifications ( )

returns a mutable reference to the PeptideIdentification vector

◆ getPeptideIdentifications() [2/2]

const std::vector<PeptideIdentification>& getPeptideIdentifications ( ) const

◆ getQuality()

QualityType getQuality ( ) const

Non-mutable access to the overall quality.

Referenced by BaseFeature::QualityLess::operator()().

◆ getWidth()

WidthType getWidth ( ) const

Non-mutable access to the features width (full width at half max, FWHM)

◆ operator!=()

bool operator!= ( const BaseFeature rhs) const

Inequality operator.

◆ operator=() [1/2]

BaseFeature& operator= ( BaseFeature &&  rhs) &
default

Move Assignment operator.

◆ operator=() [2/2]

BaseFeature& operator= ( const BaseFeature rhs)
default

Assignment operator.

◆ operator==()

bool operator== ( const BaseFeature rhs) const

Equality operator.

◆ setCharge()

void setCharge ( const ChargeType ch)

◆ setPeptideIdentifications()

void setPeptideIdentifications ( const std::vector< PeptideIdentification > &  peptides)

sets the PeptideIdentification vector

◆ setQuality()

void setQuality ( QualityType  q)

Set the overall quality.

◆ setWidth()

void setWidth ( WidthType  fwhm)

Set the width of the feature (FWHM)

◆ sortPeptideIdentifications()

void sortPeptideIdentifications ( )

sorts PeptideIdentifications, assuming they have the same scoreType.

Member Data Documentation

◆ charge_

ChargeType charge_
protected

Charge of the peptide represented by this feature. The default value is 0, which represents an unknown charge state.

◆ NamesOfAnnotationState

const std::string NamesOfAnnotationState[SIZE_OF_ANNOTATIONSTATE]
static

◆ peptides_

std::vector<PeptideIdentification> peptides_
protected

PeptideIdentifications belonging to the feature.

◆ quality_

QualityType quality_
protected

Overall quality measure of the feature.

◆ width_

WidthType width_
protected

Width (FWHM) for the feature. The default value is 0.0, a feature finding algorithm can compute this form the model.