A container for consensus elements. More...
#include <OpenMS/KERNEL/ConsensusMap.h>
Classes | |
struct | FileDescription |
Source file description for input files. More... | |
Public Types | |
typedef std::vector < ConsensusFeature > | privvec |
Type definitions | |
typedef std::vector < ConsensusFeature > | Base |
typedef RangeManager< 2 > | RangeManagerType |
typedef Map< UInt64, FileDescription > | FileDescriptions |
typedef std::vector < ConsensusFeature >::iterator | Iterator |
Mutable iterator. More... | |
typedef std::vector < ConsensusFeature > ::const_iterator | ConstIterator |
Non-mutable iterator. More... | |
typedef std::vector < ConsensusFeature > ::reverse_iterator | ReverseIterator |
Mutable reverse iterator. More... | |
typedef std::vector < ConsensusFeature > ::const_reverse_iterator | ConstReverseIterator |
Non-mutable reverse iterator. More... | |
![]() | |
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... | |
![]() | |
enum | { INVALID = 0 } |
This is the invalid unique id (cast it to a UInt64 if you like) More... | |
![]() | |
typedef boost::unordered_map < UInt64, Size > | UniqueIdMap |
Public Member Functions | |
ConsensusMap () | |
Default constructor. More... | |
ConsensusMap (const ConsensusMap &source) | |
Copy constructor. More... | |
~ConsensusMap () | |
Destructor. More... | |
ConsensusMap (Base::size_type n) | |
Creates a ConsensusMap with n elements. More... | |
ConsensusMap & | operator= (const ConsensusMap &source) |
Assignment operator. More... | |
ConsensusMap & | operator+= (const ConsensusMap &rhs) |
Add one consensus map to another. More... | |
void | clear (bool clear_meta_data=true) |
Clears all data and meta data. More... | |
const FileDescriptions & | getFileDescriptions () const |
Non-mutable access to the file descriptions. More... | |
FileDescriptions & | getFileDescriptions () |
Mutable access to the file descriptions. More... | |
void | setFileDescriptions (const FileDescriptions &file_description) |
Mutable access to the file descriptions. More... | |
const String & | getExperimentType () const |
Non-mutable access to the experiment type. More... | |
void | setExperimentType (const String &experiment_type) |
Mutable access to the experiment type. More... | |
void | updateRanges () |
Updates minimum and maximum position/intensity. More... | |
void | swap (ConsensusMap &from) |
Swaps the content of this map with the content of from . More... | |
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... | |
bool | operator== (const ConsensusMap &rhs) const |
Equality operator. More... | |
bool | operator!= (const ConsensusMap &rhs) const |
Equality operator. More... | |
template<typename Type > | |
Size | applyMemberFunction (Size(Type::*member_function)()) |
Applies a member function of Type to the container itself and all consensus features. The returned values are accumulated. More... | |
template<typename Type > | |
Size | applyMemberFunction (Size(Type::*member_function)() const) const |
The "const" variant. More... | |
bool | isMapConsistent (Logger::LogStream *stream=0) const |
checks if the given maps are unique and all FeatureHandles actually refer to a registered map More... | |
Sorting. | |
These specialized sorting methods are supported in addition to the standard sorting methods of std::vector. All use stable sorting. | |
void | sortByIntensity (bool reverse=false) |
Sorts the peaks according to ascending intensity. More... | |
void | sortByRT () |
Sorts the peaks to RT position. More... | |
void | sortByMZ () |
Sorts the peaks to m/z position. More... | |
void | sortByPosition () |
Lexicographically sorts the peaks by their position (First RT then m/z). More... | |
void | sortByQuality (bool reverse=false) |
Sorts the peaks according to ascending quality. More... | |
void | sortBySize () |
Sorts with respect to the size (number of elements) More... | |
void | sortByMaps () |
Sorts with respect to the sets of maps covered by the consensus features (lexicographically). More... | |
![]() | |
MetaInfoInterface () | |
constructor More... | |
MetaInfoInterface (const MetaInfoInterface &rhs) | |
copy constructor More... | |
~MetaInfoInterface () | |
destructor More... | |
MetaInfoInterface & | operator= (const MetaInfoInterface &rhs) |
assignment operator More... | |
bool | operator== (const MetaInfoInterface &rhs) const |
Equality operator. More... | |
bool | operator!= (const MetaInfoInterface &rhs) const |
Equality operator. More... | |
const DataValue & | getMetaValue (const String &name) const |
returns the value corresponding to a string More... | |
const DataValue & | getMetaValue (UInt index) const |
returns the value corresponding to an index More... | |
bool | metaValueExists (const String &name) const |
returns if this MetaInfo is set More... | |
bool | metaValueExists (UInt index) const |
returns if this MetaInfo is set 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 | 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... | |
![]() | |
RangeManager () | |
Default constructor. More... | |
RangeManager (const RangeManager &rhs) | |
Copy constructor. More... | |
virtual | ~RangeManager () |
Destructor. More... | |
RangeManager & | operator= (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 PositionType & | getMin () const |
Returns the minimum position. More... | |
const PositionType & | getMax () 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... | |
![]() | |
DocumentIdentifier () | |
default constructor More... | |
DocumentIdentifier (const DocumentIdentifier &source) | |
Copy constructor. More... | |
DocumentIdentifier & | operator= (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 String & | getIdentifier () 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 String & | getLoadedFilePath () 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::Type & | getLoadedFileType () const |
get the file_type (e.g. featureXML, consensusXML, mzData, mzXML, mzML, ...) of the file loaded from More... | |
![]() | |
UniqueIdInterface () | |
Default constructor - the unique id will be invalid More... | |
UniqueIdInterface (const UniqueIdInterface &rhs) | |
Copy constructor - copies the unique id. More... | |
UniqueIdInterface & | operator= (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... | |
![]() | |
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... | |
Static Public Member Functions | |
template<typename FeatureT > | |
static void | convert (UInt64 const input_map_index, FeatureMap< FeatureT > const &input_map, ConsensusMap &output_map, Size n=-1) |
Convert a FeatureMap (of any feature type) to a ConsensusMap. More... | |
static void | convert (UInt64 const input_map_index, MSExperiment<> &input_map, ConsensusMap &output_map, Size n=-1) |
Similar to convert for FeatureMaps. More... | |
static void | convert (UInt64 const input_map_index, std::vector< Peak2D > &input_map, ConsensusMap &output_map, Size n=-1) |
Convert a vector of 2D Peaks (Peak2D) into a ConsensusMap. More... | |
template<typename FeatureT > | |
static void | convert (ConsensusMap const &input_map, const bool keep_uids, FeatureMap< FeatureT > &output_map) |
Convert a ConsensusMap to a FeatureMap (of any feature type). More... | |
![]() | |
static MetaInfoRegistry & | metaRegistry () |
retuns a reference to the MetaInfoRegistry More... | |
![]() | |
static bool | isValid (UInt64 unique_id) |
Returns true if the unique_id is valid, false otherwise. More... | |
Protected Attributes | |
FileDescriptions | file_description_ |
Map from index to file description. More... | |
String | experiment_type_ |
type of experiment (label-free, itraq, ...); see xsd schema More... | |
std::vector < ProteinIdentification > | protein_identifications_ |
protein identifications More... | |
std::vector < PeptideIdentification > | unassigned_peptide_identifications_ |
protein identifications More... | |
std::vector< DataProcessing > | data_processing_ |
applied data processing More... | |
![]() | |
MetaInfo * | meta_ |
pointer to the MetaInfo object. 0 by default More... | |
![]() | |
IntensityRangeType | int_range_ |
Intensity range (1-dimensional) More... | |
PositionRangeType | pos_range_ |
Position range (D-dimensional) More... | |
![]() | |
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... | |
![]() | |
UInt64 | unique_id_ |
the unique id More... | |
![]() | |
UniqueIdMap | uniqueid_to_index_ |
hash map from unique id to index of features More... | |
Additional Inherited Members | |
![]() | |
void | createIfNotExists_ () |
creates the MetaInfo object if it does not exist More... | |
![]() | |
void | updateRanges_ (const PeakIteratorType &begin, const PeakIteratorType &end) |
Updates the range using data points in the iterator range. More... | |
![]() | |
const ConsensusMap & | getBase_ () const |
A little helper to get access to the base (!) class RandomAccessContainer. More... | |
ConsensusMap & | getBase_ () |
A little helper to get access to the base (!) class RandomAccessContainer. More... | |
![]() | |
T | elements |
STL member. More... | |
A container for consensus elements.
A ConsensusMap is a container holding 2-dimensional consensus elements (ConsensusFeature) which in turn represent combined elements of 2-dimensional experiments. The map is implemented as a vector of elements.
The map indices used in the consensus features should be registered in this class.
typedef std::vector<ConsensusFeature> Base |
typedef std::vector<ConsensusFeature>::const_iterator ConstIterator |
Non-mutable iterator.
typedef std::vector<ConsensusFeature>::const_reverse_iterator ConstReverseIterator |
Non-mutable reverse iterator.
typedef Map<UInt64, FileDescription> FileDescriptions |
typedef std::vector<ConsensusFeature>::iterator Iterator |
Mutable iterator.
typedef std::vector<ConsensusFeature> privvec |
typedef RangeManager<2> RangeManagerType |
typedef std::vector<ConsensusFeature>::reverse_iterator ReverseIterator |
Mutable reverse iterator.
ConsensusMap | ( | ) |
Default constructor.
ConsensusMap | ( | const ConsensusMap & | source | ) |
Copy constructor.
~ConsensusMap | ( | ) |
Destructor.
|
explicit |
Creates a ConsensusMap with n elements.
Applies a member function of Type to the container itself and all consensus features. 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::writeConsensus().
void clear | ( | bool | clear_meta_data = true | ) |
Clears all data and meta data.
clear_meta_data | If true, all meta data is cleared in addition to the data. |
Referenced by ConsensusMap::convert().
|
inlinestatic |
Convert a FeatureMap (of any feature type) to a ConsensusMap.
Each ConsensusFeature contains a map index, so this has to be given as well. The previous content of output_map
is cleared. An arguable design decision is that the unique id of the FeatureMap is copied (!) to the ConsensusMap, because that is the way it is meant to be used in the algorithms.
Only the first (!) n
elements are copied. (This parameter exists mainly for compatibility with convert
for MSExperiments. To use it in a meaningful way, apply one of the sorting methods to input_map
beforehand.)
input_map_index | The index of the input map. |
input_map | The container to be converted. |
output_map | The resulting ConsensusMap. |
n | The maximum number of elements to be copied. |
References ConsensusMap::clear(), ConsensusMap::getFileDescriptions(), FeatureMap< FeatureT >::getProteinIdentifications(), FeatureMap< FeatureT >::getUnassignedPeptideIdentifications(), UniqueIdInterface::getUniqueId(), ConsensusMap::setProteinIdentifications(), ConsensusMap::setUnassignedPeptideIdentifications(), UniqueIdInterface::setUniqueId(), and ConsensusMap::updateRanges().
Referenced by FeatureGroupingAlgorithmUnlabeled::setReference(), and MapAlignmentAlgorithmPoseClustering::setReference().
|
inlinestatic |
Similar to convert
for FeatureMaps.
Only the n
most intense elements are copied.
Currently MSExperiment<> does not have a unique id but ConsensusMap has one, so we assign a new one here.
input_map_index | The index of the input map. |
input_map | The input map to be converted. |
output_map | The resulting ConsensusMap. |
n | The maximum number of elements to be copied. |
References ConsensusMap::clear(), MSExperiment< PeakT, ChromatogramPeakT >::get2DData(), ConsensusMap::getFileDescriptions(), MSExperiment< PeakT, ChromatogramPeakT >::getSize(), OpenMS::reverseComparator(), UniqueIdInterface::setUniqueId(), ConsensusMap::updateRanges(), and MSExperiment< PeakT, ChromatogramPeakT >::updateRanges().
|
inlinestatic |
Convert a vector of 2D Peaks (Peak2D) into a ConsensusMap.
Only the n
most intense elements are copied.
Note: a new unique ID is generated for the consensus map.
input_map_index | The index of the input map. |
input_map | The input map to be converted. |
output_map | The resulting ConsensusMap. |
n | The maximum number of elements to be copied. |
References ConsensusMap::clear(), ConsensusMap::getFileDescriptions(), OpenMS::reverseComparator(), UniqueIdInterface::setUniqueId(), and ConsensusMap::updateRanges().
|
inlinestatic |
Convert a ConsensusMap to a FeatureMap (of any feature type).
The previous content of output_map is cleared. UID's of the elements and the container is copied if the keep_uids
flag is set.
input_map | The container to be converted. |
keep_uids | Shall the UID's of the elements and the container be kept or created anew |
output_map | The resulting ConsensusMap. |
References OpenMS::Constants::c, FeatureMap< FeatureT >::clear(), ConsensusMap::getProteinIdentifications(), ConsensusMap::getUnassignedPeptideIdentifications(), FeatureMap< FeatureT >::setProteinIdentifications(), FeatureMap< FeatureT >::setUnassignedPeptideIdentifications(), UniqueIdInterface::setUniqueId(), and FeatureMap< FeatureT >::updateRanges().
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
const String& getExperimentType | ( | ) | const |
Non-mutable access to the experiment type.
const FileDescriptions& getFileDescriptions | ( | ) | const |
Non-mutable access to the file descriptions.
Referenced by ConsensusMap::convert().
FileDescriptions& getFileDescriptions | ( | ) |
Mutable access to the file descriptions.
const std::vector<ProteinIdentification>& getProteinIdentifications | ( | ) | const |
non-mutable access to the protein identifications
Referenced by ConsensusMap::convert().
std::vector<ProteinIdentification>& getProteinIdentifications | ( | ) |
mutable access to the protein identifications
const std::vector<PeptideIdentification>& getUnassignedPeptideIdentifications | ( | ) | const |
non-mutable access to the unassigned peptide identifications
Referenced by ConsensusMap::convert().
std::vector<PeptideIdentification>& getUnassignedPeptideIdentifications | ( | ) |
mutable access to the unassigned peptide identifications
bool isMapConsistent | ( | Logger::LogStream * | stream = 0 | ) | const |
checks if the given maps are unique and all FeatureHandles actually refer to a registered map
To avoid inconsistencies in map IDs and make sure the maps are unique in terms of name+label
If you want some verbose output, provide a stream.
: alternative to this method we could check the features while they are added to the map directly, but
bool operator!= | ( | const ConsensusMap & | rhs | ) | const |
Equality operator.
ConsensusMap& operator+= | ( | const ConsensusMap & | rhs | ) |
Add one consensus map to another.
Consensus elements are merged into one container, simply by appending. ConsensusElementLists are appended. Information on map lists ......
rhs | The consensus map. |
ConsensusMap& operator= | ( | const ConsensusMap & | source | ) |
Assignment operator.
bool operator== | ( | const ConsensusMap & | rhs | ) | const |
Equality operator.
void setDataProcessing | ( | const std::vector< DataProcessing > & | processing_method | ) |
sets the description of the applied data processing
void setExperimentType | ( | const String & | experiment_type | ) |
Mutable access to the experiment type.
Referenced by SILACAnalyzer::writeConsensus().
void setFileDescriptions | ( | const FileDescriptions & | file_description | ) |
Mutable access to the file descriptions.
void setProteinIdentifications | ( | const std::vector< ProteinIdentification > & | protein_identifications | ) |
sets the protein identifications
Referenced by ConsensusMap::convert().
void setUnassignedPeptideIdentifications | ( | const std::vector< PeptideIdentification > & | unassigned_peptide_identifications | ) |
sets the unassigned peptide identifications
Referenced by ConsensusMap::convert().
void sortByIntensity | ( | bool | reverse = false | ) |
Sorts the peaks according to ascending intensity.
void sortByMaps | ( | ) |
Sorts with respect to the sets of maps covered by the consensus features (lexicographically).
void sortByMZ | ( | ) |
Sorts the peaks to m/z position.
void sortByPosition | ( | ) |
Lexicographically sorts the peaks by their position (First RT then m/z).
Referenced by SILACAnalyzer::writeConsensus().
void sortByQuality | ( | bool | reverse = false | ) |
Sorts the peaks according to ascending quality.
void sortByRT | ( | ) |
Sorts the peaks to RT position.
void sortBySize | ( | ) |
Sorts with respect to the size (number of elements)
void swap | ( | ConsensusMap & | from | ) |
Swaps the content of this map with the content of from
.
|
virtual |
Updates minimum and maximum position/intensity.
This method is usually implemented by calling clearRanges() and updateRanges_().
Implements RangeManager< 2 >.
Referenced by ConsensusMap::convert().
|
protected |
applied data processing
|
protected |
type of experiment (label-free, itraq, ...); see xsd schema
|
protected |
Map from index to file description.
|
protected |
protein identifications
|
protected |
protein identifications
OpenMS / TOPP release 1.11.1 | Documentation generated on Thu Nov 14 2013 11:19:31 using doxygen 1.8.5 |