Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Classes | Public Member Functions | Private Attributes

ConsensusFeature Class Reference
[Kernel]

A 2-dimensional consensus feature. More...

#include <OpenMS/KERNEL/ConsensusFeature.h>

Inheritance diagram for ConsensusFeature:
BaseFeature RichPeak2D Peak2D MetaInfoInterface UniqueIdInterface

List of all members.

Classes

struct  MapsLess
 Compare by the sets of consensus elements (lexicographically). More...
struct  Ratio
 slim struct to feed the need for systematically storing of ratios ( More...
struct  SizeLess
 Compare by size(), the number of consensus elements. More...

Public Types

typedef std::set
< FeatureHandle,
FeatureHandle::IndexLess
HandleSetType
 Type definitions.

Public Member Functions

void computeConsensus ()
 Computes and updates the consensus position, intensity, and charge.
void computeMonoisotopicConsensus ()
 Computes and updates the consensus position, intensity, and charge.
void computeDechargeConsensus (const FeatureMap<> &fm, bool intensity_weighted_averaging=false)
 Computes the uncharged parent RT & mass, assuming the handles are charge variants.
void addRatio (const Ratio &r)
 Add a ratio.
void setRatios (std::vector< Ratio > &rs)
 Add a ratio vector.
std::vector< RatiogetRatios () const
 Get the ratio vector.
std::vector< Ratio > & getRatios ()
 Get the ratio vector.
Constructors and Destructor

 ConsensusFeature ()
 Default constructor.
 ConsensusFeature (const ConsensusFeature &rhs)
 Copy constructor.
 ConsensusFeature (const BaseFeature &feature)
 Constructor from basic feature.
 ConsensusFeature (UInt64 map_index, const Peak2D &element, UInt64 element_index)
 Constructor with map and element index for a singleton consensus feature.
 ConsensusFeature (UInt64 map_index, const BaseFeature &element)
 Constructor with map index for a singleton consensus feature.
ConsensusFeatureoperator= (const ConsensusFeature &rhs)
 Assignment operator.
virtual ~ConsensusFeature ()
 Destructor.
Management of feature handles

void insert (const FeatureHandle &handle)
 Adds an feature handle into the consensus feature.
void insert (const HandleSetType &handle_set)
 Adds all feature handles in handle_set to this consensus feature.
void insert (UInt64 map_index, const Peak2D &element, UInt64 element_index)
 Creates a FeatureHandle and adds it.
void insert (UInt64 map_index, const BaseFeature &element)
 Creates a FeatureHandle and adds it.
const HandleSetTypegetFeatures () const
 Non-mutable access to the contained feature handles.
Accessors

DRange< 2 > getPositionRange () const
 Returns the position range of the contained elements.
DRange< 1 > getIntensityRange () const
 Returns the intensity range of the contained elements.

Private Attributes

std::vector< Ratioratios_

Detailed Description

A 2-dimensional consensus feature.

A consensus feature represents corresponding features in multiple feature maps. The corresponding features are represented a set of FeatureHandle instances. Each ConsensusFeature "contains" zero or more FeatureHandles.

See also:
ConsensusMap

Member Typedef Documentation

Type definitions.


Constructor & Destructor Documentation

Default constructor.

ConsensusFeature ( const ConsensusFeature rhs  ) 

Copy constructor.

ConsensusFeature ( const BaseFeature feature  )  [explicit]

Constructor from basic feature.

ConsensusFeature ( UInt64  map_index,
const Peak2D element,
UInt64  element_index 
)

Constructor with map and element index for a singleton consensus feature.

Sets the consensus feature position and intensity to the values of element as well.

ConsensusFeature ( UInt64  map_index,
const BaseFeature element 
)

Constructor with map index for a singleton consensus feature.

Sets the consensus feature position, intensity, charge, quality, and peptide identifications to the values of element as well.

virtual ~ConsensusFeature (  )  [virtual]

Destructor.


Member Function Documentation

void addRatio ( const Ratio r  ) 

Add a ratio.

Connects a ratio to the ConsensusFeature.

Note:
still experimental. consensusfeaturehandler will ignore it.
void computeConsensus (  ) 

Computes and updates the consensus position, intensity, and charge.

The position and intensity of the contained feature handles is averaged. The most frequent charge state wins, while the tie breaking prefers smaller (absolute) charges.

Note:
This method has to be called explicitly, after adding the feature handles.
void computeDechargeConsensus ( const FeatureMap<> &  fm,
bool  intensity_weighted_averaging = false 
)

Computes the uncharged parent RT & mass, assuming the handles are charge variants.

The position of the feature handles (decharged) is averaged (using intensity as weights if

Parameters:
intensity_weighted_averaging is true). Intensities are summed up. Charge is set to 0. Mass calculation: If the given features contain a metavalue "dc_charge_adduct_mass" then this will be used as adduct mass instead of weight(H+) * charge.
Note:
This method has to be called explicitly, after adding the feature handles.
Parameters:
fm Input feature map, which provides additional information on the features
intensity_weighted_averaging Use unweighted averaging (default) or weighted by intensity
void computeMonoisotopicConsensus (  ) 

Computes and updates the consensus position, intensity, and charge.

The m/z position is the lowest m/z value of the feature handles. The RT position and intensity of the contained feature handles is averaged. The most frequent charge state wins, while the tie breaking prefers smaller (absolute) charges.

Note:
This method has to be called explicitly, after adding the feature handles.
const HandleSetType& getFeatures (  )  const

Non-mutable access to the contained feature handles.

DRange<1> getIntensityRange (  )  const

Returns the intensity range of the contained elements.

DRange<2> getPositionRange (  )  const

Returns the position range of the contained elements.

std::vector<Ratio>& getRatios (  ) 

Get the ratio vector.

std::vector<Ratio> getRatios (  )  const

Get the ratio vector.

void insert ( const FeatureHandle handle  ) 

Adds an feature handle into the consensus feature.

Exceptions:
Exception::InvalidValue is thrown if a handle with the same map index and unique id already exists.
void insert ( const HandleSetType handle_set  ) 

Adds all feature handles in handle_set to this consensus feature.

void insert ( UInt64  map_index,
const BaseFeature element 
)

Creates a FeatureHandle and adds it.

Exceptions:
Exception::InvalidValue is thrown if a handle with the same map index and unique id already exists.
void insert ( UInt64  map_index,
const Peak2D element,
UInt64  element_index 
)

Creates a FeatureHandle and adds it.

Exceptions:
Exception::InvalidValue is thrown if a handle with the same map index and unique id already exists.
ConsensusFeature& operator= ( const ConsensusFeature rhs  ) 

Assignment operator.

void setRatios ( std::vector< Ratio > &  rs  ) 

Add a ratio vector.

Connects the ratios to the ConsensusFeature.

Note:
still experimental. consensusfeaturehandler will ignore it.

Member Data Documentation

std::vector<Ratio> ratios_ [private]

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:54 using doxygen 1.7.1