OpenMS  2.4.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-2018.
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 
46 
47 #include <vector>
48 #include <algorithm>
49 #include <iostream>
50 
51 #include <boost/serialization/strong_typedef.hpp>
52 
53 namespace OpenMS
54 {
74  class OPENMS_DLLAPI MultiplexFiltering :
75  public ProgressLogger
76  {
77 public:
89  typedef std::vector<std::map<int, int> > White2Original;
90 
106  MultiplexFiltering(const MSExperiment& exp_picked, const std::vector<MultiplexIsotopicPeakPattern>& patterns, int isotopes_per_peptide_min,
107  int isotopes_per_peptide_max, double intensity_cutoff, double rt_band, double mz_tolerance, bool mz_tolerance_unit,
108  double peptide_similarity, double averagine_similarity, double averagine_similarity_scaling, String averagine_type="peptide");
109 
110 protected:
118  void updateWhiteMSExperiment_();
119 
130  bool checkForSignificantPeak_(double mz, double mz_tolerance, MSExperiment::ConstIterator& it_rt, double intensity_first_peak) const;
131 
147  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;
148 
156  void blacklistPeak_(const MultiplexFilteredPeak& peak);
157 
168  void blacklistPeak_(const MultiplexFilteredPeak& peak, unsigned pattern_idx);
169 
181  bool filterAveragineModel_(const MultiplexIsotopicPeakPattern& pattern, const MultiplexFilteredPeak& peak) const;
182 
195  bool filterPeptideCorrelation_(const MultiplexIsotopicPeakPattern& pattern, const MultiplexFilteredPeak& peak) const;
196 
201 
205  std::vector<std::vector<int> > blacklist_;
206 
213 
218 
222  std::vector<MultiplexIsotopicPeakPattern> patterns_;
223 
228 
233 
238 
242  double rt_band_;
243 
248 
253 
258 
263 
268 
273 
274  };
275 
276 }
277 
std::vector< MultiplexIsotopicPeakPattern > patterns_
list of peak patterns
Definition: MultiplexFiltering.h:222
String averagine_type_
type of averagine to use
Definition: MultiplexFiltering.h:272
A more convenient string class.
Definition: String.h:57
std::vector< std::map< int, int > > White2Original
index mapping from a &#39;white&#39; experiment to its original experiment
Definition: MultiplexFiltering.h:89
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:103
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
double intensity_cutoff_
intensity cutoff
Definition: MultiplexFiltering.h:237
double peptide_similarity_
peptide similarity
Definition: MultiplexFiltering.h:257
double averagine_similarity_
averagine similarity
Definition: MultiplexFiltering.h:262
White2Original exp_picked_mapping_
mapping of peak indices from a &#39;white&#39; experiment <exp_picked_white_> to its original experiment <exp...
Definition: MultiplexFiltering.h:217
bool mz_tolerance_unit_in_ppm_
unit for m/z shift tolerance (ppm - true, Da - false)
Definition: MultiplexFiltering.h:252
data structure for pattern of isotopic peaks
Definition: MultiplexIsotopicPeakPattern.h:54
double mz_tolerance_
m/z shift tolerance
Definition: MultiplexFiltering.h:247
double rt_band_
RT range used for filtering.
Definition: MultiplexFiltering.h:242
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
data structure storing a single peak that passed all filters
Definition: MultiplexFilteredPeak.h:70
std::vector< SpectrumType >::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSExperiment.h:113
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
double averagine_similarity_scaling_
averagine similarity scaling
Definition: MultiplexFiltering.h:267
MSExperiment exp_picked_
centroided experimental data
Definition: MultiplexFiltering.h:200
size_t isotopes_per_peptide_min_
minimum number of isotopic peaks per peptide
Definition: MultiplexFiltering.h:227
MSExperiment exp_picked_white_
"white" centroided experimental data
Definition: MultiplexFiltering.h:212
base class for filtering centroided and profile data for peak patterns
Definition: MultiplexFiltering.h:74
std::vector< std::vector< int > > blacklist_
auxiliary structs for blacklisting
Definition: MultiplexFiltering.h:205
size_t isotopes_per_peptide_max_
maximum number of isotopic peaks per peptide
Definition: MultiplexFiltering.h:232