OpenMS
Loading...
Searching...
No Matches
DIAHelper.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: Hannes Roest $
6// $Authors: Witold Wolski, Hannes Roest $
7// --------------------------------------------------------------------------
8
9#pragma once
10
15#include <vector>
16namespace OpenMS
17{
18 struct RangeMZ;
19 struct RangeMobility;
20 class TheoreticalSpectrumGenerator;
21 namespace DIAHelpers
22 {
27
36 OPENMS_DLLAPI bool integrateWindow(const OpenSwath::SpectrumPtr& spectrum,
37 double& mz, double& im, double& intensity, const RangeMZ& mz_range, const RangeMobility& im_range, bool centroided = false);
38
46 OPENMS_DLLAPI bool integrateWindow(const SpectrumSequence& spectrum,
47 double& mz, double& im, double& intensity, const RangeMZ& mz_range, const RangeMobility& im_range, bool centroided = false);
48
61 OPENMS_DLLAPI void integrateWindows(const OpenSwath::SpectrumPtr& spectrum,
62 const std::vector<double>& windows_center,
63 double width,
64 std::vector<double>& integrated_windows_intensity,
65 std::vector<double>& integrated_windows_mz,
66 std::vector<double>& integrated_windows_im,
67 const RangeMobility& im_range,
68 bool remove_zero = false);
69
70
83 OPENMS_DLLAPI void integrateWindows(const SpectrumSequence& spectrum,
84 const std::vector<double>& windows_center,
85 double width,
86 std::vector<double>& integrated_windows_intensity,
87 std::vector<double>& integrated_windows_mz,
88 std::vector<double>& integrated_windows_im,
89 const RangeMobility& im_range,
90 bool remove_zero = false);
94 OPENMS_DLLAPI void adjustExtractionWindow(double& right, double& left, const double& mz_extract_window, const bool& mz_extraction_ppm);
95
97 OPENMS_DLLAPI void getBYSeries(const AASequence& a,
98 std::vector<double>& bseries,
99 std::vector<double>& yseries,
101 int charge = 1);
102
104 OPENMS_DLLAPI void getTheorMasses(const AASequence& a,
105 std::vector<double>& masses,
107 int charge = 1);
108
119 OPENMS_DLLAPI const IsotopeDistribution& averagineIsotopeDistribution(double average_weight, int nr_isotopes);
120
122 OPENMS_DLLAPI void getAveragineIsotopeDistribution(const double product_mz,
123 std::vector<std::pair<double, double> >& isotopes_spec,
124 const int charge = 1,
125 const int nr_isotopes = 4,
126 const double mannmass = 1.00048);
127
129 OPENMS_DLLAPI void simulateSpectrumFromAASequence(const AASequence& aa,
130 std::vector<double>& first_isotope_masses, //[out]
131 std::vector<std::pair<double, double> >& isotope_masses, //[out]
133 int charge = 1);
134
136 OPENMS_DLLAPI void addPreisotopeWeights(const std::vector<double>& first_isotope_masses,
137 std::vector<std::pair<double, double> >& isotope_spec, // output
138 UInt nr_peaks = 2, //nr of pre-isotope peaks
139 double pre_isotope_peaks_weight = -0.5, // weight of pre-isotope peaks
140 double mannmass = 1.000482, //
141 int charge = 1);
142
144 OPENMS_DLLAPI void addPreisotopeWeights(double mz,
145 std::vector<std::pair<double, double> >& isotope_spec, // output
146 UInt nr_peaks = 2, //nr of pre-isotope peaks
147 double pre_isotope_peaks_weight = -0.5, // weight of pre-isotope peaks
148 double mannmass = 1.000482, //
149 int charge = 1);
150
153 OPENMS_DLLAPI void addIsotopes2Spec(const std::vector<std::pair<double, double> >& spec,
154 std::vector<std::pair<double, double> >& isotope_masses, //[out]
155 Size nr_isotopes, int charge = 1);
156
159 OPENMS_DLLAPI void addSinglePeakIsotopes2Spec(double mz, double ity,
160 std::vector<std::pair<double, double> >& isotope_masses, //[out]
161 Size nr_isotopes, int charge);
162
164 OPENMS_DLLAPI void sortByFirst(std::vector<std::pair<double, double> >& tmp);
166 OPENMS_DLLAPI void extractFirst(const std::vector<std::pair<double, double> >& peaks, std::vector<double>& mass);
168 OPENMS_DLLAPI void extractSecond(const std::vector<std::pair<double, double> >& peaks, std::vector<double>& mass);
169
176 OPENMS_DLLAPI RangeMZ createMZRangePPM(double mz_ref, double dia_extraction_window, const bool ppm);
177
178
182 OPENMS_DLLAPI void integrateWindow_(const OpenSwath::SpectrumPtr& spectrum,
183 double & mz,
184 double & im,
185 double & intensity,
186 const RangeMZ & mz_range,
187 const RangeMobility & im_range,
188 bool centroided);
189 }
190
192} //namespace OpenMS
193
Definition AASequence.h:96
Definition IsotopeDistribution.h:40
Generates theoretical spectra for peptides with various options.
Definition TheoreticalSpectrumGenerator.h:45
unsigned int UInt
Unsigned integer type.
Definition Types.h:64
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
void extractFirst(const std::vector< std::pair< double, double > > &peaks, std::vector< double > &mass)
extract first from vector of pairs
void integrateWindows(const OpenSwath::SpectrumPtr &spectrum, const std::vector< double > &windows_center, double width, std::vector< double > &integrated_windows_intensity, std::vector< double > &integrated_windows_mz, std::vector< double > &integrated_windows_im, const RangeMobility &im_range, bool remove_zero=false)
Integrate intensities in a spectrum in range im_range (if defined) for multiple windows.
const IsotopeDistribution & averagineIsotopeDistribution(double average_weight, int nr_isotopes)
The averagine isotope distribution of a peptide of average_weight, with nr_isotopes isotopes.
void addPreisotopeWeights(const std::vector< double > &first_isotope_masses, std::vector< std::pair< double, double > > &isotope_spec, UInt nr_peaks=2, double pre_isotope_peaks_weight=-0.5, double mannmass=1.000482, int charge=1)
add (potentially negative) pre-isotope weights to spectrum
void sortByFirst(std::vector< std::pair< double, double > > &tmp)
sorts vector of pairs by first
void addIsotopes2Spec(const std::vector< std::pair< double, double > > &spec, std::vector< std::pair< double, double > > &isotope_masses, Size nr_isotopes, int charge=1)
RangeMZ createMZRangePPM(double mz_ref, double dia_extraction_window, const bool ppm)
optionally convert a DIA extraction window from ppm to m/z
void integrateWindow_(const OpenSwath::SpectrumPtr &spectrum, double &mz, double &im, double &intensity, const RangeMZ &mz_range, const RangeMobility &im_range, bool centroided)
Helper function for integrating a spectrum.
void adjustExtractionWindow(double &right, double &left, const double &mz_extract_window, const bool &mz_extraction_ppm)
Adjust left/right window based on window and whether its ppm or not.
void extractSecond(const std::vector< std::pair< double, double > > &peaks, std::vector< double > &mass)
extract second from vector of pairs
void addSinglePeakIsotopes2Spec(double mz, double ity, std::vector< std::pair< double, double > > &isotope_masses, Size nr_isotopes, int charge)
void simulateSpectrumFromAASequence(const AASequence &aa, std::vector< double > &first_isotope_masses, std::vector< std::pair< double, double > > &isotope_masses, TheoreticalSpectrumGenerator const *g, int charge=1)
simulate spectrum from AASequence
void getAveragineIsotopeDistribution(const double product_mz, std::vector< std::pair< double, double > > &isotopes_spec, const int charge=1, const int nr_isotopes=4, const double mannmass=1.00048)
get averagine distribution given mass
bool integrateWindow(const OpenSwath::SpectrumPtr &spectrum, double &mz, double &im, double &intensity, const RangeMZ &mz_range, const RangeMobility &im_range, bool centroided=false)
Helper functions for the DIA scoring of OpenSWATH.
void getTheorMasses(const AASequence &a, std::vector< double > &masses, TheoreticalSpectrumGenerator const *g, int charge=1)
for SWATH – get the theoretical b and y series masses for a sequence
void getBYSeries(const AASequence &a, std::vector< double > &bseries, std::vector< double > &yseries, TheoreticalSpectrumGenerator const *g, int charge=1)
compute the b and y series masses for a given AASequence
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::vector< OpenSwath::SpectrumPtr > SpectrumSequence
a vector of spectrum pointers that DIA scores can operate on, allows for clever integration of only t...
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:20
std::shared_ptr< Spectrum > SpectrumPtr
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:291
Definition RangeManager.h:358
Definition RangeManager.h:482