| OpenMS 2.5.0

FeatureFinderAlgorithmPickedHelperStructs.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg $
32 // $Authors: Marc Sturm, Stephan Aiche $
33 // --------------------------------------------------------------------------
34
35 #pragma once
36
37 #include <OpenMS/CONCEPT/Types.h>
38 #include <OpenMS/CONCEPT/Exception.h>
39
40 #include <OpenMS/DATASTRUCTURES/ConvexHull2D.h>
41 #include <OpenMS/KERNEL/Peak1D.h>
42
43 #include <vector>
44 #include <list>
45 #include <cmath>
46
47 namespace OpenMS
48 {
49
56 struct OPENMS_DLLAPI FeatureFinderAlgorithmPickedHelperStructs
57 {
58
62 struct OPENMS_DLLAPI Seed
63 {
65 Size spectrum;
67 Size peak;
69 float intensity;
70
72 bool operator<(const Seed& rhs) const;
73
74 };
75
79 struct OPENMS_DLLAPI MassTrace
80 {
82 const Peak1D* max_peak;
84 double max_rt;
85
87 double theoretical_int;
88
90 std::vector<std::pair<double, const Peak1D*> > peaks;
91
93 ConvexHull2D getConvexhull() const;
94
96 void updateMaximum();
97
99 double getAvgMZ() const;
100
102 bool isValid() const;
103
104 };
105
109 struct OPENMS_DLLAPI MassTraces :
110 private std::vector<MassTrace>
111 {
112 typedef std::vector<MassTrace> privvec;
113
114 // public exports of used methods
115 using privvec::size;
116 using privvec::at;
117 using privvec::reserve;
118 using privvec::push_back;
119 using privvec::operator[];
120 using privvec::back;
121 using privvec::clear;
122 using privvec::begin;
123 using privvec::end;
124 typedef privvec::iterator iterator;
125 typedef privvec::const_iterator const_iterator;
126
128 MassTraces();
129
131 Size getPeakCount() const;
132
134 bool isValid(double seed_mz, double trace_tolerance);
135
141 Size getTheoreticalmaxPosition() const;
142
144 void updateBaseline();
145
151 std::pair<double, double> getRTBounds() const;
152
162 void computeIntensityProfile(std::list<std::pair<double, double> >& intensity_profile) const;
163
165 Size max_trace;
167 double baseline;
168 };
169
173 struct OPENMS_DLLAPI TheoreticalIsotopePattern
174 {
176 std::vector<double> intensity;
178 Size optional_begin;
180 Size optional_end;
182 double max;
184 Size trimmed_left;
186 Size size() const;
187
188 };
189
193 struct OPENMS_DLLAPI IsotopePattern
194 {
196 std::vector<SignedSize> peak;
198 std::vector<Size> spectrum;
200 std::vector<double> intensity;
202 std::vector<double> mz_score;
204 std::vector<double> theoretical_mz;
206 TheoreticalIsotopePattern theoretical_pattern;
207
209 explicit IsotopePattern(Size size);
210
211 };
212
213 };
214 }
215
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTraces::max_trace
Size max_trace
Maximum intensity trace.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:165
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTraces
Helper struct for a collection of mass traces used in FeatureFinderAlgorithmPicked.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:109
OpenMS::operator<
bool operator<(const MultiplexDeltaMasses &dm1, const MultiplexDeltaMasses &dm2)
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::TheoreticalIsotopePattern::intensity
std::vector< double > intensity
Vector of intensity contributions.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:176
IsotopePattern
pair< double, vector< double > > IsotopePattern
Definition: MetaProSIP.cpp:85
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::TheoreticalIsotopePattern::trimmed_left
Size trimmed_left
The number of isotopes trimmed on the left side. This is needed to reconstruct the monoisotopic peak...
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:184
Exception.h
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::IsotopePattern::theoretical_pattern
TheoreticalIsotopePattern theoretical_pattern
Theoretical isotope pattern.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:206
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::TheoreticalIsotopePattern::optional_end
Size optional_end
Number of optional peaks at the end of the pattern.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:180
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::Seed::spectrum
Size spectrum
Spectrum index.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:65
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::IsotopePattern
Helper structure for a found isotope pattern used in FeatureFinderAlgorithmPicked.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:193
Peak1D.h
Types.h
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTrace::peaks
std::vector< std::pair< double, const Peak1D * > > peaks
Contained peaks (pair of RT and pointer to peak)
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:90
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTrace
Helper struct for mass traces used in FeatureFinderAlgorithmPicked.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:79
OpenMS::FeatureFinderAlgorithmPickedHelperStructs
Wrapper struct for all the classes needed by the FeatureFinderAlgorithmPicked and the associated clas...
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:56
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::TheoreticalIsotopePattern::max
double max
The maximum intensity contribution before scaling the pattern to 1.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:182
OpenMS::Peak1D
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTraces::privvec
std::vector< MassTrace > privvec
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:112
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::TheoreticalIsotopePattern
Helper structure for a theoretical isotope pattern used in FeatureFinderAlgorithmPicked.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:173
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::IsotopePattern::peak
std::vector< SignedSize > peak
Peak index (-1 if peak was not found, -2 if it was removed to improve the isotope fit) ...
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:196
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::Seed
Helper structure for seeds used in FeatureFinderAlgorithmPicked.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:62
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTrace::max_rt
double max_rt
RT of maximum peak.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:84
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTrace::max_peak
const Peak1D * max_peak
Maximum peak pointer.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:82
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::IsotopePattern::theoretical_mz
std::vector< double > theoretical_mz
Theoretical m/z value of the isotope peak.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:204
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTraces::baseline
double baseline
Estimated baseline in the region of the feature (used for the fit)
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:167
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::IsotopePattern::intensity
std::vector< double > intensity
Peak intensity (0 if peak index is -1 or -2)
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:200
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTrace::theoretical_int
double theoretical_int
Theoretical intensity value (scaled to [0,1])
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:87
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::Seed::peak
Size peak
Peak index.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:67
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::IsotopePattern::mz_score
std::vector< double > mz_score
m/z score of peak (0 if peak index is -1 or -2)
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:202
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::Seed::intensity
float intensity
Intensity.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:69
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::IsotopePattern::spectrum
std::vector< Size > spectrum
Spectrum index (undefined if peak index is -1 or -2)
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:198
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::TheoreticalIsotopePattern::optional_begin
Size optional_begin
Number of optional peaks at the beginning of the pattern.
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:178
ConvexHull2D.h
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTraces::iterator
privvec::iterator iterator
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:124
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::ConvexHull2D
A 2-dimensional hull representation in [counter]clockwise direction - depending on axis labelling...
Definition: ConvexHull2D.h:72
OpenMS::FeatureFinderAlgorithmPickedHelperStructs::MassTraces::const_iterator
privvec::const_iterator const_iterator
Definition: FeatureFinderAlgorithmPickedHelperStructs.h:125