OpenMS
Loading...
Searching...
No Matches
FeatureMap.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Chris Bielow $
6// $Authors: Marc Sturm, Chris Bielow, Clemens Groepl $
7// --------------------------------------------------------------------------
8
9#pragma once
10
14
21
27
29#include <OpenMS/OpenMSConfig.h>
30
31#include <exception>
32
33namespace OpenMS
34{
35 class ProteinIdentification;
36 class PeptideIdentification;
37 class DataProcessing;
38
55
56
58 OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const AnnotationStatistics& ann);
59
74 class OPENMS_DLLAPI FeatureMap :
75 public MetaInfoInterface,
76 public RangeManagerContainer<RangeRT, RangeMZ, RangeIntensity>,
77 public DocumentIdentifier,
78 public ExposedVector<Feature>,
79 public UniqueIdInterface,
80 public UniqueIdIndexer<FeatureMap>,
81 public MapUtilities<FeatureMap>
82 {
83 public:
85
86 //@{
94
99
102
104 FeatureMap(const FeatureMap& source);
105
108
110 FeatureMap& operator=(const FeatureMap& rhs);
111
113 //FeatureMap& FeatureMap::operator=(FeatureMap&&);
114
116 ~FeatureMap() override;
118
120 bool operator==(const FeatureMap& rhs) const;
121
123 bool operator!=(const FeatureMap& rhs) const;
124
130 FeatureMap operator+(const FeatureMap& rhs) const;
131
144 FeatureMap& operator+=(const FeatureMap& rhs);
145
153 void sortByIntensity(bool reverse = false);
154
156 void sortByPosition();
157
159 void sortByRT();
160
162 void sortByMZ();
163
165 void sortByOverallQuality(bool reverse = false);
166
168
169 // Docu in base class
170 void updateRanges() override;
171
173 void swapFeaturesOnly(FeatureMap& from);
174
175 void swap(FeatureMap& from);
176
180 const std::vector<ProteinIdentification>& getProteinIdentifications() const;
181
183 std::vector<ProteinIdentification>& getProteinIdentifications();
184
186 void setProteinIdentifications(const std::vector<ProteinIdentification>& protein_identifications);
187
189 const ProteinIdentification* findProteinIdentification(const String& identifier) const;
190
192 ProteinIdentification* findProteinIdentification(const String& identifier);
193
195 const PeptideIdentificationList& getUnassignedPeptideIdentifications() const;
196
198 PeptideIdentificationList& getUnassignedPeptideIdentifications();
199
201 void setUnassignedPeptideIdentifications(const PeptideIdentificationList& unassigned_peptide_identifications);
203
205 const std::vector<DataProcessing>& getDataProcessing() const;
206
208 std::vector<DataProcessing>& getDataProcessing();
209
211 void setDataProcessing(const std::vector<DataProcessing>& processing_method);
212
214 void setPrimaryMSRunPath(const StringList& s);
215
218 void setPrimaryMSRunPath(const StringList& s, MSExperiment& e);
219
221 void getPrimaryMSRunPath(StringList& toFill) const;
222
228 void clear(bool clear_meta_data = true);
229
242 template <typename Type>
243 Size applyMemberFunction(Size (Type::* member_function)())
244 {
245 Size assignments = 0;
246 assignments += ((*this).*member_function)();
247 for (Iterator iter = this->begin(); iter != this->end(); ++iter)
248 {
249 assignments += iter->applyMemberFunction(member_function);
250 }
251 return assignments;
252 }
253
255 template <typename Type>
256 Size applyMemberFunction(Size (Type::* member_function)() const) const
257 {
258 Size assignments = 0;
259 assignments += ((*this).*member_function)();
260 for (ConstIterator iter = this->begin(); iter != this->end(); ++iter)
261 {
262 assignments += iter->applyMemberFunction(member_function);
263 }
264 return assignments;
265 }
266
268
271
278 std::set<IdentificationData::ObservationMatchRef> getUnassignedIDMatches() const;
279
282
286
287protected:
289 std::vector<ProteinIdentification> protein_identifications_;
290
293
295 std::vector<DataProcessing> data_processing_;
296
299 };
300
301 OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const FeatureMap& map);
302
303} // namespace OpenMS
#define EXPOSED_VECTOR_INTERFACE(InnerElement)
Macro to expose common dependent types, such as iterator in the derived class.
Definition ExposedVector.h:26
AnnotationState
state of identification, use getAnnotationState() to query it
Definition BaseFeature.h:47
Description of the applied preprocessing steps.
Definition DataProcessing.h:28
Manage source document information.
Definition DocumentIdentifier.h:30
Definition ExposedVector.h:62
typename VecMember::iterator iterator
Definition ExposedVector.h:68
typename VecMember::const_iterator const_iterator
Definition ExposedVector.h:69
typename VecMember::reverse_iterator reverse_iterator
Definition ExposedVector.h:70
typename VecMember::const_reverse_iterator const_reverse_iterator
Definition ExposedVector.h:71
A container for features.
Definition FeatureMap.h:82
const_reverse_iterator ConstReverseIterator
Definition FeatureMap.h:92
reverse_iterator ReverseIterator
Definition FeatureMap.h:91
std::vector< DataProcessing > data_processing_
applied data processing
Definition FeatureMap.h:295
const_iterator ConstIterator
Definition FeatureMap.h:90
IdentificationData id_data_
general identification results (peptides/proteins, RNA, compounds)
Definition FeatureMap.h:298
const IdentificationData & getIdentificationData() const
Immutable access to the contained identification data.
IdentificationData & getIdentificationData()
Mutable access to the contained identification data.
AnnotationStatistics getAnnotationStatistics() const
std::vector< ProteinIdentification > protein_identifications_
protein identifications
Definition FeatureMap.h:289
std::set< IdentificationData::ObservationMatchRef > getUnassignedIDMatches() const
Return observation matches (e.g. PSMs) from the identification data that are not assigned to any feat...
PeptideIdentificationList unassigned_peptide_identifications_
peptide identifications not matched to a specific feature
Definition FeatureMap.h:292
Size applyMemberFunction(Size(Type::*member_function)() const) const
The "const" variant.
Definition FeatureMap.h:256
An LC-MS feature.
Definition Feature.h:46
Definition IdentificationData.h:87
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
Utilities for Feature and ConsensusMap.
Definition MapUtilities.h:25
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition MetaInfoInterface.h:36
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Representation of a protein identification run.
Definition ProteinIdentification.h:54
Definition RangeManager.h:889
Handles the management of a multidimensional range, e.g. RangeMZ and RangeIntensity for spectra.
Definition RangeManager.h:568
A more convenient string class.
Definition String.h:34
A base class for containers with elements derived from UniqueIdInterface. This adds functionality to ...
Definition UniqueIdIndexer.h:41
A base class defining a common interface for all classes having a unique id.
Definition UniqueIdInterface.h:25
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
std::vector< String > StringList
Vector of String.
Definition ListUtils.h:44
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
STL namespace.
Definition FeatureMap.h:42
AnnotationStatistics(const AnnotationStatistics &rhs)
std::vector< Size > states
count each state, indexing by BaseFeature::AnnotationState
Definition FeatureMap.h:43
AnnotationStatistics & operator=(const AnnotationStatistics &rhs)
bool operator==(const AnnotationStatistics &rhs) const
AnnotationStatistics & operator+=(BaseFeature::AnnotationState state)
Definition RangeManager.h:420
Definition RangeManager.h:358
Definition RangeManager.h:295