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 
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 
113 protected:
121  void updateWhiteMSExperiment_();
122 
133  int checkForSignificantPeak_(double mz, double mz_tolerance, MSExperiment::ConstIterator& it_rt, double intensity_first_peak) const;
134 
150  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;
151 
159  void blacklistPeak_(const MultiplexFilteredPeak& peak);
160 
171  void blacklistPeak_(const MultiplexFilteredPeak& peak, unsigned pattern_idx);
172 
184  bool filterAveragineModel_(const MultiplexIsotopicPeakPattern& pattern, const MultiplexFilteredPeak& peak) const;
185 
198  bool filterPeptideCorrelation_(const MultiplexIsotopicPeakPattern& pattern, const MultiplexFilteredPeak& peak) const;
199 
204 
208  std::vector<std::vector<int> > blacklist_;
209 
216 
221 
225  std::vector<MultiplexIsotopicPeakPattern> patterns_;
226 
231 
236 
241 
245  double rt_band_;
246 
251 
256 
261 
266 
271 
276 
277  };
278 
279 }
280 
double rt_band_
RT range used for filtering.
Definition: MultiplexFiltering.h:245
double mz_tolerance_
m/z shift tolerance
Definition: MultiplexFiltering.h:250
std::vector< std::map< int, int > > White2Original
index mapping from a &#39;white&#39; experiment to its original experiment
Definition: MultiplexFiltering.h:88
data structure for pattern of isotopic peaks
Definition: MultiplexIsotopicPeakPattern.h:54
A more convenient string class.
Definition: String.h:58
std::vector< SpectrumType >::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSExperiment.h:113
MSExperiment exp_centroided_
centroided experimental data
Definition: MultiplexFiltering.h:203
double averagine_similarity_
averagine similarity
Definition: MultiplexFiltering.h:265
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
data structure storing a single peak that passed all filters
Definition: MultiplexFilteredPeak.h:70
bool mz_tolerance_unit_in_ppm_
unit for m/z shift tolerance (ppm - true, Da - false)
Definition: MultiplexFiltering.h:255
double peptide_similarity_
peptide similarity
Definition: MultiplexFiltering.h:260
MSExperiment exp_centroided_white_
"white" centroided experimental data
Definition: MultiplexFiltering.h:215
size_t isotopes_per_peptide_min_
minimum number of isotopic peaks per peptide
Definition: MultiplexFiltering.h:230
double intensity_cutoff_
intensity cutoff
Definition: MultiplexFiltering.h:240
base class for filtering centroided and profile data for peak patterns
Definition: MultiplexFiltering.h:73
std::vector< MultiplexIsotopicPeakPattern > patterns_
list of peak patterns
Definition: MultiplexFiltering.h:225
White2Original exp_centroided_mapping_
mapping of peak indices from a &#39;white&#39; experiment <exp_centroided_white_> to its original experiment ...
Definition: MultiplexFiltering.h:220
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
String averagine_type_
type of averagine to use
Definition: MultiplexFiltering.h:275
double averagine_similarity_scaling_
averagine similarity scaling
Definition: MultiplexFiltering.h:270
std::vector< std::vector< int > > blacklist_
auxiliary structs for blacklisting
Definition: MultiplexFiltering.h:208
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:104
size_t isotopes_per_peptide_max_
maximum number of isotopic peaks per peptide
Definition: MultiplexFiltering.h:235