OpenMS
MRMFeature.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Roest $
6 // $Authors: Hannes Roest $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/KERNEL/Feature.h>
13 
14 namespace OpenMS
15 {
24  class OPENMS_DLLAPI MRMFeature :
25  public Feature
26  {
27 public:
28 
30 
31  typedef std::vector<Feature> FeatureListType;
34 
36 
37  MRMFeature();
39 
41  MRMFeature(const MRMFeature &rhs);
42 
44  MRMFeature(MRMFeature &&rhs) = default;
45 
48 
50  MRMFeature& operator=(MRMFeature&&) & = default;
51 
53  ~MRMFeature() override;
55 
57 
58 
60  const OpenSwath_Scores & getScores() const;
61 
64 
66  Feature & getFeature(const String& key);
67 
69  const Feature & getFeature(const String& key) const;
70 
72  void setScores(const OpenSwath_Scores & scores);
73 
75  void addScore(const String & score_name, double score);
76 
78  void addFeature(const Feature & feature, const String& key);
79 
80  void addFeature(Feature && feature, const String& key);
81 
83  const std::vector<Feature> & getFeatures() const;
84 
86  void getFeatureIDs(std::vector<String> & result) const;
87 
89  void addPrecursorFeature(const Feature & feature, const String& key);
90 
91  void addPrecursorFeature(Feature && feature, const String& key);
92 
94  void getPrecursorFeatureIDs(std::vector<String> & result) const;
95 
98 
100  const Feature & getPrecursorFeature(const String& key) const;
101 
102  void IDScoresAsMetaValue(bool decoy, const OpenSwath_Ind_Scores& idscores);
104 
105 protected:
106 
108 
110 
113 
115  std::map<String, int> feature_map_;
116 
118  std::map<String, int> precursor_feature_map_;
119 
120  };
121 }
122 
123 
An LC-MS feature.
Definition: Feature.h:46
A multi-chromatogram MRM feature.
Definition: MRMFeature.h:26
OpenSwath_Scores & getScores()
get all peakgroup scores
void addFeature(Feature &&feature, const String &key)
std::vector< Feature > FeatureListType
Type definitions.
Definition: MRMFeature.h:32
const OpenSwath_Scores & getScores() const
get all peakgroup scores
Feature & getPrecursorFeature(const String &key)
get a specified precursor feature
const Feature & getFeature(const String &key) const
get a specified feature (const)
void getPrecursorFeatureIDs(std::vector< String > &result) const
get a list of IDs of available precursor features
OpenSwath_Scores pg_scores_
peak group scores
Definition: MRMFeature.h:112
void addPrecursorFeature(Feature &&feature, const String &key)
Feature & getFeature(const String &key)
get a specified feature
const Feature & getPrecursorFeature(const String &key) const
get a specified precursor feature (const)
MRMFeature & operator=(MRMFeature &&) &=default
Move assignment operator.
~MRMFeature() override
Destructor.
MRMFeature(MRMFeature &&rhs)=default
Move constructor.
MRMFeature & operator=(const MRMFeature &rhs)
Assignment operator.
std::map< String, int > precursor_feature_map_
map native ids to the precursor features
Definition: MRMFeature.h:118
void setScores(const OpenSwath_Scores &scores)
set all peakgroup scores
void addScore(const String &score_name, double score)
set a single peakgroup score
const std::vector< Feature > & getFeatures() const
get a list of features
MRMFeature(const MRMFeature &rhs)
Copy constructor.
void addFeature(const Feature &feature, const String &key)
Adds an feature from a single chromatogram into the feature.
std::map< String, int > feature_map_
map native ids to the features
Definition: MRMFeature.h:115
void addPrecursorFeature(const Feature &feature, const String &key)
Adds a precursor feature from a single chromatogram into the feature.
void getFeatureIDs(std::vector< String > &result) const
get a list of IDs of available features
FeatureListType features_
Definition: MRMFeature.h:107
void IDScoresAsMetaValue(bool decoy, const OpenSwath_Ind_Scores &idscores)
FeatureListType precursor_features_
Definition: MRMFeature.h:109
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Definition: OpenSwathScores.h:172
A structure to hold the different scores computed by OpenSWATH.
Definition: OpenSwathScores.h:57