| OpenMS 2.5.0

DIAHelper.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: Hannes Roest $
32 // $Authors: Witold Wolski, Hannes Roest $
33 // --------------------------------------------------------------------------
34
35 #pragma once
36
37 #include <OpenMS/CHEMISTRY/AASequence.h>
38 #include <OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h>
39
40 #include <vector>
41
42 namespace OpenMS
43 {
44 class TheoreticalSpectrumGenerator;
45 namespace DIAHelpers
46 {
47
51
64 OPENMS_DLLAPI bool integrateWindow(const OpenSwath::SpectrumPtr spectrum, double mz_start,
65 double mz_end, double& mz, double& intensity, bool centroided = false);
66
70 OPENMS_DLLAPI void integrateWindows(const OpenSwath::SpectrumPtr spectrum,
71 const std::vector<double>& windows_center,
72 double width,
73 std::vector<double>& integrated_windows_intensity,
74 std::vector<double>& integrated_windows_mz,
75 bool remove_zero = false);
76
86 OPENMS_DLLAPI void integrateDriftSpectrum(OpenSwath::SpectrumPtr spectrum,
87 double mz_start,
88 double mz_end,
89 double & im,
90 double & intensity,
91 double drift_start,
92 double drift_end);
93
97 OPENMS_DLLAPI void adjustExtractionWindow(double& right, double& left, const double& mz_extract_window, const bool& mz_extraction_ppm);
98
100 OPENMS_DLLAPI void getBYSeries(const AASequence& a,
101 std::vector<double>& bseries,
102 std::vector<double>& yseries,
103 TheoreticalSpectrumGenerator const * g,
104 UInt charge = 1u);
105
107 OPENMS_DLLAPI void getTheorMasses(const AASequence& a,
108 std::vector<double>& masses,
109 TheoreticalSpectrumGenerator const * g,
110 UInt charge = 1u);
111
113 OPENMS_DLLAPI void getAveragineIsotopeDistribution(const double product_mz,
114 std::vector<std::pair<double, double> >& isotopesSpec,
115 const double charge = 1.,
116 const int nr_isotopes = 4,
117 const double mannmass = 1.00048);
118
120 OPENMS_DLLAPI void simulateSpectrumFromAASequence(const AASequence& aa,
121 std::vector<double>& firstIsotopeMasses, //[out]
122 std::vector<std::pair<double, double> >& isotopeMasses, //[out]
123 TheoreticalSpectrumGenerator const * g,
124 double charge = 1.);
125
127 OPENMS_DLLAPI void modifyMassesByCharge(const std::vector<std::pair<double, double> >& masses,
128 std::vector<std::pair<double, double> >& modmass,
129 double charge = 1.);
130
132 OPENMS_DLLAPI void addPreisotopeWeights(const std::vector<double>& firstIsotopeMasses,
133 std::vector<std::pair<double, double> >& isotopeSpec, // output
134 UInt nrpeaks = 2, //nr of pre-isotope peaks
135 double preIsotopePeaksWeight = -0.5, // weight of pre-isotope peaks
136 double mannmass = 1.000482, //
137 double charge = 1.);
138
140 OPENMS_DLLAPI void addIsotopes2Spec(const std::vector<std::pair<double, double> >& spec,
141 std::vector<std::pair<double, double> >& isotopeMasses, //[out]
142 double charge = 1.);
143
145 OPENMS_DLLAPI void sortByFirst(std::vector<std::pair<double, double> >& tmp);
147 OPENMS_DLLAPI void extractFirst(const std::vector<std::pair<double, double> >& peaks, std::vector<double>& mass);
149 OPENMS_DLLAPI void extractSecond(const std::vector<std::pair<double, double> >& peaks, std::vector<double>& mass);
150
152 }
153 }
154
OpenMS::DIAHelpers::extractFirst
void extractFirst(const std::vector< std::pair< double, double > > &peaks, std::vector< double > &mass)
extract first from vector of pairs
DataStructures.h
OpenMS::DIAHelpers::extractSecond
void extractSecond(const std::vector< std::pair< double, double > > &peaks, std::vector< double > &mass)
extract second from vector of pairs
OpenMS::DIAHelpers::integrateWindows
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, bool remove_zero=false)
Integrate intensities in a spectrum from start to end.
AASequence.h
OpenMS::DIAHelpers::adjustExtractionWindow
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.
OpenMS::DIAHelpers::addIsotopes2Spec
void addIsotopes2Spec(const std::vector< std::pair< double, double > > &spec, std::vector< std::pair< double, double > > &isotopeMasses, double charge=1.)
given an experimental spectrum add isotope pattern.
OpenMS::DIAHelpers::getTheorMasses
void getTheorMasses(const AASequence &a, std::vector< double > &masses, TheoreticalSpectrumGenerator const *g, UInt charge=1u)
for SWATH – get the theoretical b and y series masses for a sequence
OpenMS::AASequence
Representation of a peptide/protein sequence.
Definition: AASequence.h:113
OpenMS::DIAHelpers::getAveragineIsotopeDistribution
void getAveragineIsotopeDistribution(const double product_mz, std::vector< std::pair< double, double > > &isotopesSpec, const double charge=1., const int nr_isotopes=4, const double mannmass=1.00048)
get averagine distribution given mass
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::DIAHelpers::modifyMassesByCharge
void modifyMassesByCharge(const std::vector< std::pair< double, double > > &masses, std::vector< std::pair< double, double > > &modmass, double charge=1.)
modify masses by charge
OpenMS::DIAHelpers::addPreisotopeWeights
void addPreisotopeWeights(const std::vector< double > &firstIsotopeMasses, std::vector< std::pair< double, double > > &isotopeSpec, UInt nrpeaks=2, double preIsotopePeaksWeight=-0.5, double mannmass=1.000482, double charge=1.)
add negative pre-isotope weights to spectrum
OpenMS::UInt
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
OpenMS::DIAHelpers::integrateDriftSpectrum
void integrateDriftSpectrum(OpenSwath::SpectrumPtr spectrum, double mz_start, double mz_end, double &im, double &intensity, double drift_start, double drift_end)
Integrate intensity in an ion mobility spectrum from start to end.
OpenSwath::SpectrumPtr
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:292
OpenMS::TheoreticalSpectrumGenerator
Generates theoretical spectra for peptides with various options.
Definition: TheoreticalSpectrumGenerator.h:67
OpenMS::DIAHelpers::simulateSpectrumFromAASequence
void simulateSpectrumFromAASequence(const AASequence &aa, std::vector< double > &firstIsotopeMasses, std::vector< std::pair< double, double > > &isotopeMasses, TheoreticalSpectrumGenerator const *g, double charge=1.)
simulate spectrum from AASequence
OpenMS::DIAHelpers::sortByFirst
void sortByFirst(std::vector< std::pair< double, double > > &tmp)
sorts vector of pairs by first
OpenMS::DIAHelpers::getBYSeries
void getBYSeries(const AASequence &a, std::vector< double > &bseries, std::vector< double > &yseries, TheoreticalSpectrumGenerator const *g, UInt charge=1u)
compute the b and y series masses for a given AASequence
OpenMS::DIAHelpers::integrateWindow
bool integrateWindow(const OpenSwath::SpectrumPtr spectrum, double mz_start, double mz_end, double &mz, double &intensity, bool centroided=false)
Helper functions for the DIA scoring of OpenSWATH.