OpenMS  3.0.0
FLASHDeconvHelperStructs.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-2022.
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: Kyowon Jeong, Jihyung Kim $
32 // $Authors: Kyowon Jeong, Jihyung Kim $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
42 
43 namespace OpenMS
44 {
56  struct OPENMS_DLLAPI FLASHDeconvHelperStructs
57  {
59  class OPENMS_DLLAPI PrecalculatedAveragine
60  {
61  private:
63  std::vector<IsotopeDistribution> isotopes_;
65  std::vector<double> norms_;
67  std::vector<double> average_mono_mass_difference_;
69  std::vector<double> abundant_mono_mass_difference_;
71  std::vector<int> left_count_from_apex_;
73  std::vector<int> right_count_from_apex_;
75  std::vector<Size> apex_index_;
76 
82  double min_mass_;
84  Size massToIndex_(double mass) const;
85  public:
87  PrecalculatedAveragine() = default;
88 
97  PrecalculatedAveragine(double min_mass,
98  double max_mass,
99  double delta,
101  bool use_RNA_averagine);
102 
103 
106 
108  PrecalculatedAveragine(PrecalculatedAveragine&& other) noexcept = default;
109 
111  PrecalculatedAveragine& operator=(const PrecalculatedAveragine& pc) = default;
112 
114  PrecalculatedAveragine& operator=(PrecalculatedAveragine&& pc) noexcept = default;
115 
117  ~PrecalculatedAveragine() = default ;
118 
119 
121  IsotopeDistribution get(double mass) const;
122 
124  size_t getMaxIsotopeIndex() const;
125 
127  void setMaxIsotopeIndex(int index);
128 
130  Size getLeftCountFromApex(double mass) const;
131 
133  Size getRightCountFromApex(double mass) const;
134 
136  Size getApexIndex(double mass) const;
137 
139  Size getLastIndex(double mass) const;
140 
142  double getAverageMassDelta(double mass) const;
143 
145  double getMostAbundantMassDelta(double mass) const;
146  };
147 
149  struct OPENMS_DLLAPI MassFeature
150  {
151  public:
153  std::vector<float> per_charge_intensity;
154  std::vector<float> per_isotope_intensity;
156  int scan_number, rep_charge;
157  double avg_mass;
158  int min_charge, max_charge, charge_count;
159  double isotope_score, qscore;
160  double rep_mz;
161  };
162 
164  class OPENMS_DLLAPI LogMzPeak
165  {
166  public:
168  double mz = 0;
170  float intensity = 0;
172  double logMz = -1000;
174  double mass = .0;
176  int abs_charge = 0;
178  bool is_positive = true;
180  int isotopeIndex = -1;
181 
183  LogMzPeak() = default;
184 
189  explicit LogMzPeak(const Peak1D& peak, bool positive);
190 
192  LogMzPeak(const LogMzPeak& ) = default;
193 
195  ~LogMzPeak() = default;
196 
198  double getUnchargedMass();
199 
201  bool operator<(const LogMzPeak& a) const;
202  bool operator>(const LogMzPeak& a) const;
203  bool operator==(const LogMzPeak& other) const;
204  };
205 
211  static double getLogMz(double mz, bool positive);
212 
217  static float getChargeMass(bool positive_ioniziation_mode);
218  };
219 }
int iso_offset
Definition: FLASHDeconvHelperStructs.h:155
int min_charge
Definition: FLASHDeconvHelperStructs.h:158
Averagine patterns pre-calculated for speed up. Other variables are also calculated for fast cosine c...
Definition: FLASHDeconvHelperStructs.h:59
Isotope pattern generator for coarse isotope distributions.
Definition: CoarseIsotopePatternGenerator.h:103
std::vector< int > left_count_from_apex_
Isotope start indices: isotopes of the indices less than them have very low intensities.
Definition: FLASHDeconvHelperStructs.h:71
Definition: IsotopeDistribution.h:64
log transformed peak. After deconvolution, all necessary information from deconvolution such as charg...
Definition: FLASHDeconvHelperStructs.h:164
std::vector< int > right_count_from_apex_
Isotope end indices: isotopes of the indices larger than them have very low intensities.
Definition: FLASHDeconvHelperStructs.h:73
double mass_interval_
mass interval for calculation
Definition: FLASHDeconvHelperStructs.h:80
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::vector< double > average_mono_mass_difference_
mass differences between average mass and monoisotopic mass
Definition: FLASHDeconvHelperStructs.h:67
Size max_isotope_index_
max isotope index
Definition: FLASHDeconvHelperStructs.h:78
double avg_mass
Definition: FLASHDeconvHelperStructs.h:157
bool operator<(const MultiplexDeltaMasses &dm1, const MultiplexDeltaMasses &dm2)
double rep_mz
Definition: FLASHDeconvHelperStructs.h:160
double min_mass_
min mass for calculation
Definition: FLASHDeconvHelperStructs.h:82
Mass feature (Deconvolved masses in spectra are traced by Mass tracing to generate mass features - li...
Definition: FLASHDeconvHelperStructs.h:149
std::vector< float > per_isotope_intensity
Definition: FLASHDeconvHelperStructs.h:154
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:53
int scan_number
Definition: FLASHDeconvHelperStructs.h:156
std::vector< double > abundant_mono_mass_difference_
mass differences between most abundant mass and monoisotopic mass
Definition: FLASHDeconvHelperStructs.h:69
MassTrace mt
Definition: FLASHDeconvHelperStructs.h:152
std::vector< float > per_charge_intensity
Definition: FLASHDeconvHelperStructs.h:153
std::vector< Size > apex_index_
most abundant isotope index
Definition: FLASHDeconvHelperStructs.h:75
std::vector< IsotopeDistribution > isotopes_
isotope distributions for different (binned) masses
Definition: FLASHDeconvHelperStructs.h:63
double qscore
Definition: FLASHDeconvHelperStructs.h:159
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Wrapper struct for all the structs needed by the FLASHDeconv Three structures are defined: Precalcula...
Definition: FLASHDeconvHelperStructs.h:56
std::vector< double > norms_
L2 norms_ for masses.
Definition: FLASHDeconvHelperStructs.h:65
A container type that gathers peaks similar in m/z and moving along retention time.
Definition: MassTrace.h:61