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

FeatureMap< FeatureT > Class Template Reference
[Kernel]

A container for features. More...

#include <OpenMS/KERNEL/FeatureMap.h>

Inheritance diagram for FeatureMap< FeatureT >:
RangeManager< 2 > DocumentIdentifier UniqueIdInterface UniqueIdIndexer< FeatureMap< FeatureT > >

List of all members.

Public Types

Type definitions

typedef FeatureT FeatureType
typedef RangeManager< 2 > RangeManagerType
typedef std::vector< FeatureTypeBase
typedef Base::iterator Iterator
typedef Base::const_iterator ConstIterator
typedef Base::reverse_iterator ReverseIterator
typedef
Base::const_reverse_iterator 
ConstReverseIterator
typedef FeatureTypeReference
typedef const FeatureTypeConstReference

Public Member Functions

FeatureMapoperator= (const FeatureMap &rhs)
 Assignment operator.
bool operator== (const FeatureMap &rhs) const
 Equality operator.
bool operator!= (const FeatureMap &rhs) const
 Equality operator.
FeatureMap operator+ (const FeatureMap &rhs) const
 Joins two feature maps.
FeatureMapoperator+= (const FeatureMap &rhs)
 Add one feature map to another.
void updateRanges ()
void swap (FeatureMap &from)
 Swaps the content of this map with the content of from.
const std::vector
< ProteinIdentification > & 
getProteinIdentifications () const
 non-mutable access to the protein identifications
std::vector
< ProteinIdentification > & 
getProteinIdentifications ()
 mutable access to the protein identifications
void setProteinIdentifications (const std::vector< ProteinIdentification > &protein_identifications)
 sets the protein identifications
const std::vector
< PeptideIdentification > & 
getUnassignedPeptideIdentifications () const
 non-mutable access to the unassigned peptide identifications
std::vector
< PeptideIdentification > & 
getUnassignedPeptideIdentifications ()
 mutable access to the unassigned peptide identifications
void setUnassignedPeptideIdentifications (const std::vector< PeptideIdentification > &unassigned_peptide_identifications)
 sets the unassigned peptide identifications
const std::vector
< DataProcessing > & 
getDataProcessing () const
 returns a const reference to the description of the applied data processing
std::vector< DataProcessing > & getDataProcessing ()
 returns a mutable reference to the description of the applied data processing
void setDataProcessing (const std::vector< DataProcessing > &processing_method)
 sets the description of the applied data processing
void clear (bool clear_meta_data=true)
 Clears all data and meta data.
template<typename Type >
Size applyMemberFunction (Size(Type::*member_function)())
 Applies a member function of Type to the container itself and all features (including subordinates). The returned values are accumulated.
template<typename Type >
Size applyMemberFunction (Size(Type::*member_function)() const) const
 The "const" variant.
Constructors and Destructor

 FeatureMap ()
 Default constructor.
 FeatureMap (const FeatureMap &source)
 Copy constructor.
virtual ~FeatureMap ()
 Destructor.
Sorting.

These simplified sorting methods are supported in addition to the standard sorting methods of std::vector.

void sortByIntensity (bool reverse=false)
 Sorts the peaks according to ascending intensity.
void sortByPosition ()
 Sort features by position. Lexicographical comparison (first RT then m/z) is done.
void sortByRT ()
 Sort features by RT position.
void sortByMZ ()
 Sort features by m/z position.
void sortByOverallQuality (bool reverse=false)
 Sort features by ascending overall quality.

Protected Attributes

std::vector
< ProteinIdentification
protein_identifications_
 protein identifications
std::vector
< PeptideIdentification
unassigned_peptide_identifications_
 peptide identifications not matched to a specific feature
std::vector< DataProcessingdata_processing_
 applied data processing

Detailed Description

template<typename FeatureT = Feature>
class OpenMS::FeatureMap< FeatureT >

A container for features.

A map is a container holding 2-dimensional features, which in turn represent chemical entities (peptides, proteins, etc.) found in a 2-dimensional experiment.

Maps are implemented as vectors of features and have basically the same interface as an STL vector has (model of Random Access Container and Back Insertion Sequence).

Feature maps are typically created from peak data of 2D runs through the FeatureFinder.


Member Typedef Documentation

typedef std::vector<FeatureType> Base
typedef Base::const_iterator ConstIterator
typedef const FeatureType& ConstReference
typedef Base::const_reverse_iterator ConstReverseIterator
typedef Base::iterator Iterator
typedef Base::reverse_iterator ReverseIterator

Constructor & Destructor Documentation

FeatureMap (  )  [inline]

Default constructor.

FeatureMap ( const FeatureMap< FeatureT > &  source  )  [inline]

Copy constructor.

virtual ~FeatureMap (  )  [inline, virtual]

Destructor.


Member Function Documentation

Size applyMemberFunction ( Size(Type::*)()  member_function  )  [inline]

Applies a member function of Type to the container itself and all features (including subordinates). The returned values are accumulated.

Example: The following will print the number of features with invalid unique ids (plus 1 if the container has an invalid UID as well):

      FeatureMap<> fm;
      (...)
      std::cout << fm.applyMemberFunction(&UniqueIdInterface::hasInvalidUniqueId) << std::endl;

See e.g. UniqueIdInterface for what else can be done this way.

Size applyMemberFunction ( Size(Type::*)() const   member_function  )  const [inline]

The "const" variant.

void clear ( bool  clear_meta_data = true  )  [inline]

Clears all data and meta data.

Parameters:
clear_meta_data If true, all meta data is cleared in addition to the data.

Referenced by FeatureMap< Feature >::clear(), ConsensusMap::convert(), and FeatureFinder::run().

const std::vector<DataProcessing>& getDataProcessing (  )  const [inline]

returns a const reference to the description of the applied data processing

Referenced by TOPPBase::addDataProcessing_(), and IDMapper::annotate().

std::vector<DataProcessing>& getDataProcessing (  )  [inline]

returns a mutable reference to the description of the applied data processing

const std::vector<ProteinIdentification>& getProteinIdentifications (  )  const [inline]

non-mutable access to the protein identifications

Referenced by MetaDataBrowser::add(), IDMapper::annotate(), ConsensusMap::convert(), and MRMFeatureFinderScoring::pickExperiment().

std::vector<ProteinIdentification>& getProteinIdentifications (  )  [inline]

mutable access to the protein identifications

const std::vector<PeptideIdentification>& getUnassignedPeptideIdentifications (  )  const [inline]

non-mutable access to the unassigned peptide identifications

Referenced by MetaDataBrowser::add(), IDMapper::annotate(), and ConsensusMap::convert().

std::vector<PeptideIdentification>& getUnassignedPeptideIdentifications (  )  [inline]

mutable access to the unassigned peptide identifications

bool operator!= ( const FeatureMap< FeatureT > &  rhs  )  const [inline]

Equality operator.

FeatureMap operator+ ( const FeatureMap< FeatureT > &  rhs  )  const [inline]

Joins two feature maps.

Features are merged into one container (see operator+= for details).

FeatureMap& operator+= ( const FeatureMap< FeatureT > &  rhs  )  [inline]

Add one feature map to another.

Features are merged into one container, simply by appending. UnassignedPeptides and ProteinIdentifications are appended. Information on DocumentIdentifier, UniqueIdInterface (of container only) are reset to default.

For conflicting UID's, new UID's will be assigned.

Parameters:
rhs The feature to add to this one.
FeatureMap& operator= ( const FeatureMap< FeatureT > &  rhs  )  [inline]
bool operator== ( const FeatureMap< FeatureT > &  rhs  )  const [inline]
void setDataProcessing ( const std::vector< DataProcessing > &  processing_method  )  [inline]

sets the description of the applied data processing

void setProteinIdentifications ( const std::vector< ProteinIdentification > &  protein_identifications  )  [inline]

sets the protein identifications

Referenced by ConsensusMap::convert().

void setUnassignedPeptideIdentifications ( const std::vector< PeptideIdentification > &  unassigned_peptide_identifications  )  [inline]

sets the unassigned peptide identifications

Referenced by ConsensusMap::convert().

void sortByIntensity ( bool  reverse = false  )  [inline]

Sorts the peaks according to ascending intensity.

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

void sortByMZ (  )  [inline]

Sort features by m/z position.

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

void sortByOverallQuality ( bool  reverse = false  )  [inline]

Sort features by ascending overall quality.

void sortByPosition (  )  [inline]

Sort features by position. Lexicographical comparison (first RT then m/z) is done.

void sortByRT (  )  [inline]

Sort features by RT position.

void swap ( FeatureMap< FeatureT > &  from  )  [inline]

Swaps the content of this map with the content of from.

Referenced by FeatureMap< Feature >::swap().

void updateRanges (  )  [inline]

Member Data Documentation


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