OpenMS  2.8.0
MultiplexFiltering.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-2021.
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: Lars Nilse $
32 // $Authors: Lars Nilse $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
45 
46 #include <vector>
47 #include <algorithm>
48 #include <iostream>
49 
50 #include <boost/serialization/strong_typedef.hpp>
51 
52 namespace OpenMS
53 {
73  class OPENMS_DLLAPI MultiplexFiltering :
74  public ProgressLogger
75  {
76 public:
88  typedef std::vector<std::map<int, int> > White2Original;
89 
105  MultiplexFiltering(const MSExperiment& exp_centroided, const std::vector<MultiplexIsotopicPeakPattern>& patterns, int isotopes_per_peptide_min,
106  int isotopes_per_peptide_max, double intensity_cutoff, double rt_band, double mz_tolerance, bool mz_tolerance_unit,
107  double peptide_similarity, double averagine_similarity, double averagine_similarity_scaling, String averagine_type="peptide");
112 
117 
118 protected:
127 
138  int checkForSignificantPeak_(double mz, double mz_tolerance, MSExperiment::ConstIterator& it_rt, double intensity_first_peak) const;
139 
155  bool filterPeakPositions_(double mz, const MSExperiment::ConstIterator& it_rt_begin, const MSExperiment::ConstIterator& it_rt_band_begin, const MSExperiment::ConstIterator& it_rt_band_end, const MultiplexIsotopicPeakPattern& pattern, MultiplexFilteredPeak& peak) const;
156 
165 
176  void blacklistPeak_(const MultiplexFilteredPeak& peak, unsigned pattern_idx);
177 
190 
204 
209 
213  std::vector<std::vector<int> > blacklist_;
214 
221 
226 
230  std::vector<MultiplexIsotopicPeakPattern> patterns_;
231 
236 
241 
246 
250  double rt_band_;
251 
256 
261 
266 
271 
276 
282 
283  };
284 
285 }
286 
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:73
std::vector< SpectrumType >::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSExperiment.h:106
data structure storing a single peak that passed all filters
Definition: MultiplexFilteredPeak.h:71
base class for filtering centroided and profile data for peak patterns
Definition: MultiplexFiltering.h:75
bool filterPeptideCorrelation_(const MultiplexIsotopicPeakPattern &pattern, const MultiplexFilteredPeak &peak) const
check if corresponding satellite peaks of different peptides show a good correlation
MSExperiment exp_centroided_white_
"white" centroided experimental data
Definition: MultiplexFiltering.h:220
double rt_band_
RT range used for filtering.
Definition: MultiplexFiltering.h:250
MSExperiment exp_centroided_
centroided experimental data
Definition: MultiplexFiltering.h:208
double peptide_similarity_
peptide similarity
Definition: MultiplexFiltering.h:265
double averagine_similarity_
averagine similarity
Definition: MultiplexFiltering.h:270
int checkForSignificantPeak_(double mz, double mz_tolerance, MSExperiment::ConstIterator &it_rt, double intensity_first_peak) const
check for significant peak
size_t isotopes_per_peptide_max_
maximum number of isotopic peaks per peptide
Definition: MultiplexFiltering.h:240
White2Original exp_centroided_mapping_
mapping of peak indices from a 'white' experiment exp_centroided_white_ to its original experiment ex...
Definition: MultiplexFiltering.h:225
double averagine_similarity_scaling_
averagine similarity scaling
Definition: MultiplexFiltering.h:275
bool filterAveragineModel_(const MultiplexIsotopicPeakPattern &pattern, const MultiplexFilteredPeak &peak) const
check if the satellite peaks conform with the averagine model
std::vector< MultiplexIsotopicPeakPattern > patterns_
list of peak patterns
Definition: MultiplexFiltering.h:230
MSExperiment getBlacklist()
returns the blacklisted, centroided peaks
std::vector< std::map< int, int > > White2Original
index mapping from a 'white' experiment to its original experiment
Definition: MultiplexFiltering.h:88
double mz_tolerance_
m/z shift tolerance
Definition: MultiplexFiltering.h:255
void blacklistPeak_(const MultiplexFilteredPeak &peak, unsigned pattern_idx)
blacklist this peak
size_t isotopes_per_peptide_min_
minimum number of isotopic peaks per peptide
Definition: MultiplexFiltering.h:235
String averagine_type_
type of averagine to use
Definition: MultiplexFiltering.h:281
void blacklistPeak_(const MultiplexFilteredPeak &peak)
blacklist this peak
bool filterPeakPositions_(double mz, const MSExperiment::ConstIterator &it_rt_begin, const MSExperiment::ConstIterator &it_rt_band_begin, const MSExperiment::ConstIterator &it_rt_band_end, const MultiplexIsotopicPeakPattern &pattern, MultiplexFilteredPeak &peak) const
check if there are enough peaks in the RT band to form the pattern
bool mz_tolerance_unit_in_ppm_
unit for m/z shift tolerance (ppm - true, Da - false)
Definition: MultiplexFiltering.h:260
double intensity_cutoff_
intensity cutoff
Definition: MultiplexFiltering.h:245
std::vector< std::vector< int > > blacklist_
auxiliary structs for blacklisting
Definition: MultiplexFiltering.h:213
MultiplexFiltering(const MSExperiment &exp_centroided, const std::vector< MultiplexIsotopicPeakPattern > &patterns, int isotopes_per_peptide_min, int isotopes_per_peptide_max, double intensity_cutoff, double rt_band, double mz_tolerance, bool mz_tolerance_unit, double peptide_similarity, double averagine_similarity, double averagine_similarity_scaling, String averagine_type="peptide")
constructor
void updateWhiteMSExperiment_()
construct an MS experiment from exp_centroided_ containing peaks which have not been previously black...
MSExperiment & getCentroidedExperiment()
returns the intensity-filtered, centroided spectral data
data structure for pattern of isotopic peaks
Definition: MultiplexIsotopicPeakPattern.h:55
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:53
A more convenient string class.
Definition: String.h:60
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47