Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Attributes | List of all members
FeatureMap< FeatureT > Class Template Reference

A container for features. More...

#include <OpenMS/KERNEL/FeatureMap.h>

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

Public Types

Type definitions
typedef std::vector< FeatureTprivvec
 
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 Types inherited from RangeManager< 2 >
enum  
 Dimension of the position range. More...
 
typedef DRange< D > PositionRangeType
 Position range type. More...
 
typedef DPosition< D > PositionType
 Position Type. More...
 
typedef DRange< 1 > IntensityRangeType
 Intensity range type. More...
 
- Public Types inherited from UniqueIdInterface
enum  { INVALID = 0 }
 This is the invalid unique id (cast it to a UInt64 if you like) More...
 
- Public Types inherited from UniqueIdIndexer< FeatureMap< FeatureT > >
typedef boost::unordered_map
< UInt64, Size
UniqueIdMap
 

Public Member Functions

FeatureMapoperator= (const FeatureMap &rhs)
 Assignment operator. More...
 
bool operator== (const FeatureMap &rhs) const
 Equality operator. More...
 
bool operator!= (const FeatureMap &rhs) const
 Equality operator. More...
 
FeatureMap operator+ (const FeatureMap &rhs) const
 Joins two feature maps. More...
 
FeatureMapoperator+= (const FeatureMap &rhs)
 Add one feature map to another. More...
 
void updateRanges ()
 Updates minimum and maximum position/intensity. More...
 
void swapFeaturesOnly (FeatureMap &from)
 Swaps the feature content (plus its range information) of this map with the content of from. More...
 
void swap (FeatureMap &from)
 
const std::vector
< ProteinIdentification > & 
getProteinIdentifications () const
 non-mutable access to the protein identifications More...
 
std::vector
< ProteinIdentification > & 
getProteinIdentifications ()
 mutable access to the protein identifications More...
 
void setProteinIdentifications (const std::vector< ProteinIdentification > &protein_identifications)
 sets the protein identifications More...
 
const std::vector
< PeptideIdentification > & 
getUnassignedPeptideIdentifications () const
 non-mutable access to the unassigned peptide identifications More...
 
std::vector
< PeptideIdentification > & 
getUnassignedPeptideIdentifications ()
 mutable access to the unassigned peptide identifications More...
 
void setUnassignedPeptideIdentifications (const std::vector< PeptideIdentification > &unassigned_peptide_identifications)
 sets the unassigned peptide identifications More...
 
const std::vector
< DataProcessing > & 
getDataProcessing () const
 returns a const reference to the description of the applied data processing More...
 
std::vector< DataProcessing > & getDataProcessing ()
 returns a mutable reference to the description of the applied data processing More...
 
void setDataProcessing (const std::vector< DataProcessing > &processing_method)
 sets the description of the applied data processing More...
 
void clear (bool clear_meta_data=true)
 Clears all data and meta data. More...
 
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. More...
 
template<typename Type >
Size applyMemberFunction (Size(Type::*member_function)() const) const
 The "const" variant. More...
 
AnnotationStatistics getAnnotationStatistics () const
 
Constructors and Destructor
 FeatureMap ()
 Default constructor. More...
 
 FeatureMap (const FeatureMap &source)
 Copy constructor. More...
 
virtual ~FeatureMap ()
 Destructor. More...
 
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. More...
 
void sortByPosition ()
 Sort features by position. Lexicographical comparison (first RT then m/z) is done. More...
 
void sortByRT ()
 Sort features by RT position. More...
 
void sortByMZ ()
 Sort features by m/z position. More...
 
void sortByOverallQuality (bool reverse=false)
 Sort features by ascending overall quality. More...
 
- Public Member Functions inherited from RangeManager< 2 >
 RangeManager ()
 Default constructor. More...
 
 RangeManager (const RangeManager &rhs)
 Copy constructor. More...
 
virtual ~RangeManager ()
 Destructor. More...
 
RangeManageroperator= (const RangeManager &rhs)
 Assignment operator. More...
 
bool operator== (const RangeManager &rhs) const
 Equality operator. More...
 
bool operator!= (const RangeManager &rhs) const
 Equality operator. More...
 
const PositionTypegetMin () const
 Returns the minimum position. More...
 
const PositionTypegetMax () const
 Returns the maximum position. More...
 
DoubleReal getMinInt () const
 Returns the minimum intensity. More...
 
DoubleReal getMaxInt () const
 Returns the maximum intensity. More...
 
void clearRanges ()
 Resets the ranges. More...
 
- Public Member Functions inherited from DocumentIdentifier
 DocumentIdentifier ()
 default constructor More...
 
 DocumentIdentifier (const DocumentIdentifier &source)
 Copy constructor. More...
 
DocumentIdentifieroperator= (const DocumentIdentifier &source)
 Assignment operator. More...
 
bool operator== (const DocumentIdentifier &rhs) const
 Equality operator. More...
 
virtual ~DocumentIdentifier ()
 destructor More...
 
void setIdentifier (const String &id)
 set document identifier (e.g. an LSID) More...
 
const StringgetIdentifier () const
 retrieve document identifier (e.g. an LSID) More...
 
void swap (DocumentIdentifier &from)
 exchange content with from More...
 
void setLoadedFilePath (const String &file_name)
 set the file_name_ according to absolute path of the file loaded from preferably done whilst loading More...
 
const StringgetLoadedFilePath () const
 get the file_name_ which is the absolute path to the file loaded from More...
 
void setLoadedFileType (const String &file_name)
 set the file_type according to the type of the file loaded from (see FileHandler::Type) preferably done whilst loading More...
 
const FileTypes::TypegetLoadedFileType () const
 get the file_type (e.g. featureXML, consensusXML, mzData, mzXML, mzML, ...) of the file loaded from More...
 
- Public Member Functions inherited from UniqueIdInterface
 UniqueIdInterface ()
 Default constructor - the unique id will be invalid More...
 
 UniqueIdInterface (const UniqueIdInterface &rhs)
 Copy constructor - copies the unique id. More...
 
UniqueIdInterfaceoperator= (UniqueIdInterface const &rhs)
 Assignment operator - copies the unique id. More...
 
 ~UniqueIdInterface ()
 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...
 
- Public Member Functions inherited from UniqueIdIndexer< FeatureMap< FeatureT > >
Size uniqueIdToIndex (UInt64 unique_id) const
 Returns the index of the feature with the given unique id, or Size(-1) if none exists in this random access container. More...
 
void updateUniqueIdToIndex () const
 Updates the hash map from unique id to index. More...
 
Size resolveUniqueIdConflicts ()
 Assign new UID's to doubly occurring UID's. More...
 
void swap (UniqueIdIndexer &rhs)
 Swap. More...
 

Protected Attributes

std::vector
< ProteinIdentification
protein_identifications_
 protein identifications More...
 
std::vector
< PeptideIdentification
unassigned_peptide_identifications_
 peptide identifications not matched to a specific feature More...
 
std::vector< DataProcessingdata_processing_
 applied data processing More...
 
- Protected Attributes inherited from RangeManager< 2 >
IntensityRangeType int_range_
 Intensity range (1-dimensional) More...
 
PositionRangeType pos_range_
 Position range (D-dimensional) More...
 
- Protected Attributes inherited from DocumentIdentifier
String id_
 the ID (e.g. LSID) More...
 
String file_path_
 the path to the loaded file More...
 
FileTypes::Type file_type_
 the type of the loaded file More...
 
- Protected Attributes inherited from UniqueIdInterface
UInt64 unique_id_
 the unique id More...
 
- Protected Attributes inherited from UniqueIdIndexer< FeatureMap< FeatureT > >
UniqueIdMap uniqueid_to_index_
 hash map from unique id to index of features More...
 

Additional Inherited Members

- 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 RangeManager< 2 >
void updateRanges_ (const PeakIteratorType &begin, const PeakIteratorType &end)
 Updates the range using data points in the iterator range. More...
 
- Protected Member Functions inherited from UniqueIdIndexer< FeatureMap< FeatureT > >
const FeatureMap< FeatureT > & getBase_ () const
 A little helper to get access to the base (!) class RandomAccessContainer. More...
 
FeatureMap< FeatureT > & getBase_ ()
 A little helper to get access to the base (!) class RandomAccessContainer. More...
 
- Private Attributes inherited from vector< T >
elements
 STL member. More...
 

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 std::vector<FeatureT> privvec
typedef Base::reverse_iterator ReverseIterator

Constructor & Destructor Documentation

FeatureMap ( )
inline

Default constructor.

FeatureMap ( const FeatureMap< FeatureT > &  source)
inline

Copy constructor.

virtual ~FeatureMap ( )
inlinevirtual

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):

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

Referenced by SILACAnalyzer::writeFeatures().

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_dataIf true, all meta data is cleared in addition to the data.

Referenced by ConsensusMap::convert(), and FeatureFinder::run().

AnnotationStatistics getAnnotationStatistics ( ) const
inline

Referenced by IDMapper::annotate().

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
rhsThe feature to add to this one.
FeatureMap& operator= ( const FeatureMap< FeatureT > &  rhs)
inline

Assignment operator.

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

Equality operator.

Referenced by FeatureMap< OpenMS::Feature >::operator!=().

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.

Referenced by SILACAnalyzer::writeFeatures().

void sortByRT ( )
inline

Sort features by RT position.

void swap ( FeatureMap< FeatureT > &  from)
inline
void swapFeaturesOnly ( FeatureMap< FeatureT > &  from)
inline

Swaps the feature content (plus its range information) of this map with the content of from.

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run(), and FeatureMap< OpenMS::Feature >::swap().

void updateRanges ( )
inlinevirtual

Updates minimum and maximum position/intensity.

This method is usually implemented by calling clearRanges() and updateRanges_().

Implements RangeManager< 2 >.

Referenced by ConsensusMap::convert().

Member Data Documentation

std::vector<DataProcessing> data_processing_
protected
std::vector<ProteinIdentification> protein_identifications_
protected
std::vector<PeptideIdentification> unassigned_peptide_identifications_
protected

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:32 using doxygen 1.8.5