OpenMS  2.5.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-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: 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");
111  MSExperiment& getCentroidedExperiment();
112 
116  MSExperiment getBlacklist();
117 
118 protected:
126  void updateWhiteMSExperiment_();
127 
138  int checkForSignificantPeak_(double mz, double mz_tolerance, MSExperiment::ConstIterator& it_rt, double intensity_first_peak) const;
139 
155  bool filterPeakPositions_(const MSSpectrum::ConstIterator& it_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 
164  void blacklistPeak_(const MultiplexFilteredPeak& peak);
165 
176  void blacklistPeak_(const MultiplexFilteredPeak& peak, unsigned pattern_idx);
177 
189  bool filterAveragineModel_(const MultiplexIsotopicPeakPattern& pattern, const MultiplexFilteredPeak& peak) const;
190 
203  bool filterPeptideCorrelation_(const MultiplexIsotopicPeakPattern& pattern, const MultiplexFilteredPeak& peak) const;
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 
OpenMS::MultiplexFiltering::isotopes_per_peptide_min_
size_t isotopes_per_peptide_min_
minimum number of isotopic peaks per peptide
Definition: MultiplexFiltering.h:235
CubicSpline2d.h
OpenMS::MultiplexFiltering::mz_tolerance_unit_in_ppm_
bool mz_tolerance_unit_in_ppm_
unit for m/z shift tolerance (ppm - true, Da - false)
Definition: MultiplexFiltering.h:260
OpenMS::MultiplexFiltering::averagine_type_
String averagine_type_
type of averagine to use
Definition: MultiplexFiltering.h:281
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::MultiplexIsotopicPeakPattern
data structure for pattern of isotopic peaks
Definition: MultiplexIsotopicPeakPattern.h:54
OpenMS::MultiplexFiltering::exp_centroided_
MSExperiment exp_centroided_
centroided experimental data
Definition: MultiplexFiltering.h:208
OpenMS::MultiplexFiltering::exp_centroided_white_
MSExperiment exp_centroided_white_
"white" centroided experimental data
Definition: MultiplexFiltering.h:220
OpenMS::MultiplexFiltering::rt_band_
double rt_band_
RT range used for filtering.
Definition: MultiplexFiltering.h:250
MultiplexFilteredPeak.h
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::ProgressLogger
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
ProgressLogger.h
OpenMS::MultiplexFiltering::peptide_similarity_
double peptide_similarity_
peptide similarity
Definition: MultiplexFiltering.h:265
OpenMS::MultiplexFiltering::averagine_similarity_
double averagine_similarity_
averagine similarity
Definition: MultiplexFiltering.h:270
BaseFeature.h
MultiplexIsotopicPeakPattern.h
OpenMS::MultiplexFiltering::averagine_similarity_scaling_
double averagine_similarity_scaling_
averagine similarity scaling
Definition: MultiplexFiltering.h:275
OpenMS::MultiplexFiltering::intensity_cutoff_
double intensity_cutoff_
intensity cutoff
Definition: MultiplexFiltering.h:245
OpenMS::MultiplexFilteredPeak
data structure storing a single peak that passed all filters
Definition: MultiplexFilteredPeak.h:70
MSExperiment.h
OpenMS::MultiplexFiltering::isotopes_per_peptide_max_
size_t isotopes_per_peptide_max_
maximum number of isotopic peaks per peptide
Definition: MultiplexFiltering.h:240
OpenMS::MultiplexFiltering::patterns_
std::vector< MultiplexIsotopicPeakPattern > patterns_
list of peak patterns
Definition: MultiplexFiltering.h:230
OpenMS::MultiplexFiltering::blacklist_
std::vector< std::vector< int > > blacklist_
auxiliary structs for blacklisting
Definition: MultiplexFiltering.h:213
OpenMS::MSExperiment::ConstIterator
std::vector< SpectrumType >::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSExperiment.h:113
PeakPickerHiRes.h
OpenMS::MSSpectrum::ConstIterator
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:104
OpenMS::MultiplexFiltering::White2Original
std::vector< std::map< int, int > > White2Original
index mapping from a 'white' experiment to its original experiment
Definition: MultiplexFiltering.h:88
StandardTypes.h
OpenMS::MultiplexFiltering
base class for filtering centroided and profile data for peak patterns
Definition: MultiplexFiltering.h:73
OpenMS::MultiplexFiltering::exp_centroided_mapping_
White2Original exp_centroided_mapping_
mapping of peak indices from a 'white' experiment <exp_centroided_white_> to its original experiment ...
Definition: MultiplexFiltering.h:225
OpenMS::MultiplexFiltering::mz_tolerance_
double mz_tolerance_
m/z shift tolerance
Definition: MultiplexFiltering.h:255