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
13
20
26
28#include <OpenMS/OpenMSConfig.h>
29
30namespace OpenMS
31{
32 class MSExperiment;
33 class PeptideIdentification;
34
51
52
54 OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const AnnotationStatistics& ann);
55
70 class OPENMS_DLLAPI FeatureMap :
71 public MetaInfoInterface,
72 public RangeManagerContainer<RangeRT, RangeMZ, RangeIntensity>,
73 public DocumentIdentifier,
74 public ExposedVector<Feature>,
75 public UniqueIdInterface,
76 public UniqueIdIndexer<FeatureMap>,
77 public MapUtilities<FeatureMap>
78 {
79 public:
81
82 //@{
90
95
98
100 FeatureMap(const FeatureMap& source);
101
104
106 FeatureMap& operator=(const FeatureMap& rhs);
107
109 //FeatureMap& FeatureMap::operator=(FeatureMap&&);
110
112 ~FeatureMap() override;
114
116 bool operator==(const FeatureMap& rhs) const;
117
119 bool operator!=(const FeatureMap& rhs) const;
120
126 FeatureMap operator+(const FeatureMap& rhs) const;
127
140 FeatureMap& operator+=(const FeatureMap& rhs);
141
149 void sortByIntensity(bool reverse = false);
150
152 void sortByPosition();
153
155 void sortByRT();
156
158 void sortByMZ();
159
161 void sortByOverallQuality(bool reverse = false);
162
164
165 // Docu in base class
166 void updateRanges() override;
167
169 void swapFeaturesOnly(FeatureMap& from);
170
171 void swap(FeatureMap& from);
172
176 const std::vector<ProteinIdentification>& getProteinIdentifications() const;
177
179 std::vector<ProteinIdentification>& getProteinIdentifications();
180
182 void setProteinIdentifications(const std::vector<ProteinIdentification>& protein_identifications);
183
185 const ProteinIdentification* findProteinIdentification(const String& identifier) const;
186
188 ProteinIdentification* findProteinIdentification(const String& identifier);
189
191 const PeptideIdentificationList& getUnassignedPeptideIdentifications() const;
192
194 PeptideIdentificationList& getUnassignedPeptideIdentifications();
195
197 void setUnassignedPeptideIdentifications(const PeptideIdentificationList& unassigned_peptide_identifications);
199
201 const std::vector<DataProcessing>& getDataProcessing() const;
202
204 std::vector<DataProcessing>& getDataProcessing();
205
207 void setDataProcessing(const std::vector<DataProcessing>& processing_method);
208
210 void setPrimaryMSRunPath(const StringList& s);
211
214 void setPrimaryMSRunPath(const StringList& s, MSExperiment& e);
215
217 void getPrimaryMSRunPath(StringList& toFill) const;
218
224 void clear(bool clear_meta_data = true);
225
238 template <typename Type>
239 Size applyMemberFunction(Size (Type::* member_function)())
240 {
241 Size assignments = 0;
242 assignments += ((*this).*member_function)();
243 for (Iterator iter = this->begin(); iter != this->end(); ++iter)
244 {
245 assignments += iter->applyMemberFunction(member_function);
246 }
247 return assignments;
248 }
249
251 template <typename Type>
252 Size applyMemberFunction(Size (Type::* member_function)() const) const
253 {
254 Size assignments = 0;
255 assignments += ((*this).*member_function)();
256 for (ConstIterator iter = this->begin(); iter != this->end(); ++iter)
257 {
258 assignments += iter->applyMemberFunction(member_function);
259 }
260 return assignments;
261 }
262
264
267
274 std::set<IdentificationData::ObservationMatchRef> getUnassignedIDMatches() const;
275
278
282
283protected:
285 std::vector<ProteinIdentification> protein_identifications_;
286
289
291 std::vector<DataProcessing> data_processing_;
292
295 };
296
297 OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const FeatureMap& map);
298
299} // 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:78
const_reverse_iterator ConstReverseIterator
Definition FeatureMap.h:88
reverse_iterator ReverseIterator
Definition FeatureMap.h:87
std::vector< DataProcessing > data_processing_
applied data processing
Definition FeatureMap.h:291
const_iterator ConstIterator
Definition FeatureMap.h:86
IdentificationData id_data_
general identification results (peptides/proteins, RNA, compounds)
Definition FeatureMap.h:294
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:285
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:288
Size applyMemberFunction(Size(Type::*member_function)() const) const
The "const" variant.
Definition FeatureMap.h:252
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:55
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:32
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:38
AnnotationStatistics(const AnnotationStatistics &rhs)
std::vector< Size > states
count each state, indexing by BaseFeature::AnnotationState
Definition FeatureMap.h:39
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