35 #ifndef OPENMS_KERNEL_CONSENSUSMAP_H
36 #define OPENMS_KERNEL_CONSENSUSMAP_H
61 private std::vector<ConsensusFeature>,
70 typedef std::vector<ConsensusFeature>
privvec;
73 using privvec::value_type;
74 using privvec::iterator;
75 using privvec::const_iterator;
76 using privvec::size_type;
77 using privvec::pointer;
78 using privvec::reference;
79 using privvec::const_reference;
80 using privvec::difference_type;
87 using privvec::resize;
89 using privvec::reserve;
90 using privvec::operator[];
94 using privvec::push_back;
104 FileDescription(
const FileDescription &);
119 typedef std::vector<ConsensusFeature>
Base;
123 typedef std::vector<ConsensusFeature>::iterator
Iterator;
163 OPENMS_DLLAPI
void clear(
bool clear_meta_data =
true);
229 template <
typename FeatureT>
235 if (n > input_map.size())
237 n = input_map.size();
240 output_map.
clear(
true);
241 output_map.reserve(n);
246 for (
UInt64 element_index = 0; element_index < n; ++element_index)
248 output_map.push_back(
ConsensusFeature(input_map_index, input_map[element_index]));
274 output_map.
clear(
true);
284 output_map.reserve(n);
285 std::vector<Peak2D> tmp;
286 tmp.reserve(input_map.
getSize());
291 std::partial_sort(tmp.begin(),
296 for (
Size element_index = 0; element_index < n; ++element_index)
320 std::vector<Peak2D> & input_map,
326 output_map.
clear(
true);
329 if (n > input_map.size())
331 n = input_map.size();
333 output_map.reserve(n);
335 std::partial_sort(input_map.begin(),
336 input_map.begin() + n,
340 for (
Size element_index = 0; element_index < n; ++element_index)
342 output_map.push_back(
ConsensusFeature(input_map_index, input_map[element_index], element_index));
359 template <
typename FeatureT>
361 const bool keep_uids,
364 output_map.
clear(
true);
365 output_map.resize(input_map.size());
366 output_map.DocumentIdentifier::operator=(input_map);
368 if (keep_uids) output_map.UniqueIdInterface::operator=(input_map);
374 for (
Size i = 0; i < input_map.size(); ++i)
378 f.BaseFeature::operator=(
c);
416 OPENMS_DLLAPI
void setDataProcessing(
const std::vector<DataProcessing> & processing_method);
437 template <
typename Type>
440 Size assignments = 0;
441 assignments += ((*this).*member_function)();
442 for (
Iterator iter = this->begin(); iter != this->end(); ++iter)
444 assignments += ((*iter).*member_function)();
450 template <
typename Type>
453 Size assignments = 0;
454 assignments += ((*this).*member_function)();
455 for (
ConstIterator iter = this->begin(); iter != this->end(); ++iter)
457 assignments += ((*iter).*member_function)();
499 #endif // OPENMS_KERNEL_CONSENSUSMAP_H
void setDataProcessing(const std::vector< DataProcessing > &processing_method)
sets the description of the applied data processing
std::vector< ConsensusFeature >::iterator Iterator
Mutable iterator.
Definition: ConsensusMap.h:123
void sortByMZ()
Sorts the peaks to m/z position.
const std::vector< ProteinIdentification > & getProteinIdentifications() const
non-mutable access to the protein identifications
void get2DData(Container &cont) const
Reads out a 2D Spectrum.
Definition: MSExperiment.h:248
A more convenient string class.
Definition: String.h:56
void clear(bool clear_meta_data=true)
Clears all data and meta data.
String label
Label e.g. 'heavy' and 'light' for ICAT, or 'sample1' and 'sample2' for label-free quantitation...
Definition: ConsensusMap.h:109
const std::vector< ProteinIdentification > & getProteinIdentifications() const
non-mutable access to the protein identifications
Definition: FeatureMap.h:410
std::vector< ConsensusFeature >::const_reverse_iterator ConstReverseIterator
Non-mutable reverse iterator.
Definition: ConsensusMap.h:129
Source file description for input files.
Definition: ConsensusMap.h:97
const std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
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).
Definition: ConsensusMap.h:360
A container for features.
Definition: FeatureMap.h:111
std::vector< PeptideIdentification > unassigned_peptide_identifications_
protein identifications
Definition: ConsensusMap.h:488
const FileDescriptions & getFileDescriptions() const
Non-mutable access to the file descriptions.
const std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
Definition: FeatureMap.h:428
UInt64 unique_id
Unique id of the file.
Definition: ConsensusMap.h:114
std::ostream & operator<<(std::ostream &os, const ItraqQuantifier::ItraqQuantifierStats &stats)
Size setUniqueId()
Assigns a new, valid unique id. Always returns 1.
Definition: UniqueIdInterface.h:150
ReverseComparator< Cmp > reverseComparator(Cmp const &cmp)
Make-function to create a ReverseComparator from another comparator without the need to specify the t...
Definition: ComparatorUtils.h:261
A container for consensus elements.
Definition: ConsensusMap.h:60
void sortByQuality(bool reverse=false)
Sorts the peaks according to ascending quality.
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.
Definition: ConsensusMap.h:438
std::vector< DataProcessing > data_processing_
applied data processing
Definition: ConsensusMap.h:491
void setExperimentType(const String &experiment_type)
Mutable access to the experiment type.
ConsensusMap()
Default constructor.
Log Stream Class.
Definition: LogStream.h:303
~ConsensusMap()
Destructor.
const String & getExperimentType() const
Non-mutable access to the experiment type.
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.
Definition: ConsensusMap.h:319
FileDescriptions file_description_
Map from index to file description.
Definition: ConsensusMap.h:479
std::vector< ConsensusFeature >::reverse_iterator ReverseIterator
Mutable reverse iterator.
Definition: ConsensusMap.h:127
void setProteinIdentifications(const std::vector< ProteinIdentification > &protein_identifications)
sets the protein identifications
Definition: FeatureMap.h:422
String experiment_type_
type of experiment (label-free, itraq, ...); see xsd schema
Definition: ConsensusMap.h:482
std::vector< ConsensusFeature > Base
Definition: ConsensusMap.h:119
void sortByMaps()
Sorts with respect to the sets of maps covered by the consensus features (lexicographically).
A base class for random access containers for classes derived from UniqueIdInterface that adds functi...
Definition: UniqueIdIndexer.h:63
void setFileDescriptions(const FileDescriptions &file_description)
Mutable access to the file descriptions.
RangeManager< 2 > RangeManagerType
Definition: ConsensusMap.h:120
An LC-MS feature.
Definition: Feature.h:66
void setUnassignedPeptideIdentifications(const std::vector< PeptideIdentification > &unassigned_peptide_identifications)
sets the unassigned peptide identifications
OPENMS_UINT64_TYPE UInt64
Unsigned integer type (64bit)
Definition: Types.h:75
A base class defining a common interface for all classes having a unique id.
Definition: UniqueIdInterface.h:51
const std::vector< DataProcessing > & getDataProcessing() const
returns a const reference to the description of the applied data processing
Representation of a mass spectrometry experiment.
Definition: MSExperiment.h:68
std::vector< ProteinIdentification > protein_identifications_
protein identifications
Definition: ConsensusMap.h:485
Map< UInt64, FileDescription > FileDescriptions
Definition: ConsensusMap.h:121
ConsensusMap & operator=(const ConsensusMap &source)
Assignment operator.
static void convert(UInt64 const input_map_index, MSExperiment<> &input_map, ConsensusMap &output_map, Size n=-1)
Similar to convert for FeatureMaps.
Definition: ConsensusMap.h:269
UInt64 getSize() const
returns the total number of peaks
Definition: MSExperiment.h:555
void sortBySize()
Sorts with respect to the size (number of elements)
void updateRanges()
Updates minimum and maximum position/intensity.
Definition: FeatureMap.h:343
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
std::vector< ConsensusFeature > privvec
Definition: ConsensusMap.h:70
void swap(ConsensusMap &from)
Swaps the content of this map with the content of from.
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.
Definition: ConsensusMap.h:230
bool isMapConsistent(Logger::LogStream *stream=0) const
checks if the given maps are unique and all FeatureHandles actually refer to a registered map ...
bool operator==(const ConsensusMap &rhs) const
Equality operator.
bool operator!=(const ConsensusMap &rhs) const
Equality operator.
void sortByPosition()
Lexicographically sorts the peaks by their position (First RT then m/z).
Handles the managment of a position and intensity range.
Definition: RangeManager.h:48
void updateRanges()
Updates minimum and maximum position/intensity.
virtual void updateRanges()
Updates minimum and maximum position/intensity.
Definition: MSExperiment.h:403
std::vector< ConsensusFeature >::const_iterator ConstIterator
Non-mutable iterator.
Definition: ConsensusMap.h:125
String filename
File name of the file.
Definition: ConsensusMap.h:107
Size size
Number of elements (features, peaks, ...). This is e.g. used to check for correct element indices whe...
Definition: ConsensusMap.h:112
void setProteinIdentifications(const std::vector< ProteinIdentification > &protein_identifications)
sets the protein identifications
void sortByRT()
Sorts the peaks to RT position.
ConsensusMap & operator+=(const ConsensusMap &rhs)
Add one consensus map to another.
UInt64 getUniqueId() const
Non-mutable access to unique id - returns the unique id.
Definition: UniqueIdInterface.h:109
void clear(bool clear_meta_data=true)
Clears all data and meta data.
Definition: FeatureMap.h:468
Manage source document information.
Definition: DocumentIdentifier.h:56
A 2-dimensional consensus feature.
Definition: ConsensusFeature.h:59
void sortByIntensity(bool reverse=false)
Sorts the peaks according to ascending intensity.
void setUnassignedPeptideIdentifications(const std::vector< PeptideIdentification > &unassigned_peptide_identifications)
sets the unassigned peptide identifications
Definition: FeatureMap.h:440
Size applyMemberFunction(Size(Type::*member_function)() const) const
The "const" variant.
Definition: ConsensusMap.h:451