OpenMS
MultiplexFiltering.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Lars Nilse $
6 // $Authors: Lars Nilse $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
19 
20 #include <vector>
21 #include <algorithm>
22 #include <iostream>
23 
24 #include <boost/serialization/strong_typedef.hpp>
25 
26 namespace OpenMS
27 {
47  class OPENMS_DLLAPI MultiplexFiltering :
48  public ProgressLogger
49  {
50 public:
62  typedef std::vector<std::map<int, int> > White2Original;
63 
79  MultiplexFiltering(const MSExperiment& exp_centroided, const std::vector<MultiplexIsotopicPeakPattern>& patterns, int isotopes_per_peptide_min,
80  int isotopes_per_peptide_max, double intensity_cutoff, double rt_band, double mz_tolerance, bool mz_tolerance_unit,
81  double peptide_similarity, double averagine_similarity, double averagine_similarity_scaling, String averagine_type="peptide");
86 
91 
92 protected:
101 
112  int checkForSignificantPeak_(double mz, double mz_tolerance, MSExperiment::ConstIterator& it_rt, double intensity_first_peak) const;
113 
129  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;
130 
139 
150  void blacklistPeak_(const MultiplexFilteredPeak& peak, unsigned pattern_idx);
151 
164 
178 
183 
187  std::vector<std::vector<int> > blacklist_;
188 
195 
200 
204  std::vector<MultiplexIsotopicPeakPattern> patterns_;
205 
210 
215 
220 
224  double rt_band_;
225 
230 
235 
240 
245 
250 
256 
257  };
258 
259 }
260 
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
std::vector< SpectrumType >::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSExperiment.h:79
data structure storing a single peak that passed all filters
Definition: MultiplexFilteredPeak.h:44
base class for filtering centroided and profile data for peak patterns
Definition: MultiplexFiltering.h:49
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:194
double rt_band_
RT range used for filtering.
Definition: MultiplexFiltering.h:224
MSExperiment exp_centroided_
centroided experimental data
Definition: MultiplexFiltering.h:182
double peptide_similarity_
peptide similarity
Definition: MultiplexFiltering.h:239
double averagine_similarity_
averagine similarity
Definition: MultiplexFiltering.h:244
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:214
White2Original exp_centroided_mapping_
mapping of peak indices from a 'white' experiment exp_centroided_white_ to its original experiment ex...
Definition: MultiplexFiltering.h:199
double averagine_similarity_scaling_
averagine similarity scaling
Definition: MultiplexFiltering.h:249
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:204
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:62
double mz_tolerance_
m/z shift tolerance
Definition: MultiplexFiltering.h:229
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:209
String averagine_type_
type of averagine to use
Definition: MultiplexFiltering.h:255
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:234
double intensity_cutoff_
intensity cutoff
Definition: MultiplexFiltering.h:219
std::vector< std::vector< int > > blacklist_
auxiliary structs for blacklisting
Definition: MultiplexFiltering.h:187
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:29
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:27
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22