OpenMS
MultiplexFiltering Class Reference

base class for filtering centroided and profile data for peak patterns More...

#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/MultiplexFiltering.h>

Inheritance diagram for MultiplexFiltering:
[legend]
Collaboration diagram for MultiplexFiltering:
[legend]

Public Types

typedef std::vector< std::map< int, int > > White2Original
 index mapping from a 'white' experiment to its original experiment More...
 
- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 

Public Member Functions

 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 More...
 
MSExperimentgetCentroidedExperiment ()
 returns the intensity-filtered, centroided spectral data More...
 
MSExperiment getBlacklist ()
 returns the blacklisted, centroided peaks More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress (UInt64 bytes_processed=0) const
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Protected Member Functions

void updateWhiteMSExperiment_ ()
 construct an MS experiment from exp_centroided_ containing peaks which have not been previously blacklisted in blacklist_ More...
 
int checkForSignificantPeak_ (double mz, double mz_tolerance, MSExperiment::ConstIterator &it_rt, double intensity_first_peak) const
 check for significant peak More...
 
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 More...
 
void blacklistPeak_ (const MultiplexFilteredPeak &peak)
 blacklist this peak More...
 
void blacklistPeak_ (const MultiplexFilteredPeak &peak, unsigned pattern_idx)
 blacklist this peak More...
 
bool filterAveragineModel_ (const MultiplexIsotopicPeakPattern &pattern, const MultiplexFilteredPeak &peak) const
 check if the satellite peaks conform with the averagine model More...
 
bool filterPeptideCorrelation_ (const MultiplexIsotopicPeakPattern &pattern, const MultiplexFilteredPeak &peak) const
 check if corresponding satellite peaks of different peptides show a good correlation More...
 

Protected Attributes

MSExperiment exp_centroided_
 centroided experimental data More...
 
std::vector< std::vector< int > > blacklist_
 auxiliary structs for blacklisting More...
 
MSExperiment exp_centroided_white_
 "white" centroided experimental data More...
 
White2Original exp_centroided_mapping_
 mapping of peak indices from a 'white' experiment exp_centroided_white_ to its original experiment exp_centroided_ More...
 
std::vector< MultiplexIsotopicPeakPatternpatterns_
 list of peak patterns More...
 
size_t isotopes_per_peptide_min_
 minimum number of isotopic peaks per peptide More...
 
size_t isotopes_per_peptide_max_
 maximum number of isotopic peaks per peptide More...
 
double intensity_cutoff_
 intensity cutoff More...
 
double rt_band_
 RT range used for filtering. More...
 
double mz_tolerance_
 m/z shift tolerance More...
 
bool mz_tolerance_unit_in_ppm_
 unit for m/z shift tolerance (ppm - true, Da - false) More...
 
double peptide_similarity_
 peptide similarity More...
 
double averagine_similarity_
 averagine similarity More...
 
double averagine_similarity_scaling_
 averagine similarity scaling More...
 
String averagine_type_
 type of averagine to use More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 

Additional Inherited Members

- Static Protected Member Functions inherited from ProgressLogger
static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. More...
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

base class for filtering centroided and profile data for peak patterns

The algorithm searches for patterns of multiple peptides in the data. The peptides appear as characteristic patterns of isotopic peaks in MS1 spectra. We first search the centroided data, and optionally in a second step the spline interpolated profile data. For each peak pattern the algorithm generates a filter result.

The algorithm differs slightly for centroided and profile input data. This base class comprises code common to both. The two child classes MultiplexFilteringCentroided and MultiplexFilteringProfile contain specific functions and the primary filter() method.

See also
MultiplexIsotopicPeakPattern
MultiplexFilteredMSExperiment
MultiplexFilteringCentroided
MultiplexFilteringProfile

Member Typedef Documentation

◆ White2Original

typedef std::vector<std::map<int, int> > White2Original

index mapping from a 'white' experiment to its original experiment

An MSExperiment contains a set of spectra each containing a number of peaks. In the course of the filtering, some peaks are blacklisted since they are identified to belong to a certain pattern i.e. peptide. An experiment in which blacklisted peaks are removed is called 'white'. White spectra contain fewer peaks than their corresponding primary spectra. Consequently, their indices are shifted. The type maps a peak index in a 'white' spectrum back to its original spectrum.

Constructor & Destructor Documentation

◆ MultiplexFiltering()

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

Parameters
exp_centroidedexperimental data in centroid mode
patternspatterns of isotopic peaks to be searched for
isotopes_per_peptide_minminimum number of isotopic peaks in peptides
isotopes_per_peptide_maxmaximum number of isotopic peaks in peptides
intensity_cutoffintensity cutoff
rt_bandRT range used for filtering
mz_toleranceerror margin in m/z for matching expected patterns to experimental data
mz_tolerance_unitunit for mz_tolerance, ppm (true), Da (false)
peptide_similaritysimilarity score for two peptides in the same multiplet
averagine_similaritysimilarity score for peptide isotope pattern and averagine model
averagine_similarity_scalingscaling factor x for the averagine similarity parameter p when detecting peptide singlets. With p' = p + x(1-p).

Member Function Documentation

◆ blacklistPeak_() [1/2]

void blacklistPeak_ ( const MultiplexFilteredPeak peak)
protected

blacklist this peak

Blacklist all satellites associated with this peak.

Parameters
peakpeak to be blacklisted

◆ blacklistPeak_() [2/2]

void blacklistPeak_ ( const MultiplexFilteredPeak peak,
unsigned  pattern_idx 
)
protected

blacklist this peak

Each of the satellites is associated with a specific mass trace. We blacklist all peaks in these mass traces (even if they are not a satellite) extending them by a margin rt_band_.

Parameters
peakpeak to be blacklisted
pattern_idxindex of the pattern in patterns_

◆ checkForSignificantPeak_()

int checkForSignificantPeak_ ( double  mz,
double  mz_tolerance,
MSExperiment::ConstIterator it_rt,
double  intensity_first_peak 
) const
protected

check for significant peak

Parameters
mzposition where the peak is expected
mz_tolerancem/z tolerance within the peak may lie
it_rtpointer to the spectrum
intensity_first_peakintensity to compare to
Returns
-1 (if there is no significant peak), or peak index mz_idx (if there is a significant peak)

◆ filterAveragineModel_()

bool filterAveragineModel_ ( const MultiplexIsotopicPeakPattern pattern,
const MultiplexFilteredPeak peak 
) const
protected

check if the satellite peaks conform with the averagine model

Check if the intensities of the satellite peaks correlate with the peak intensities of the averagine model. We check both Pearson and Spearman rank correlation.

Parameters
patternm/z pattern to search for
peakpeak with set of satellite peaks
Returns
boolean if this filter was passed i.e. the correlation coefficient is greater than averagine_similarity_

◆ filterPeakPositions_()

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
protected

check if there are enough peaks in the RT band to form the pattern

Checks if there are peaks at m/z positions corresponding to the pattern and that the primary peak position is not blacklisted.

Parameters
it_mzm/z iterator of the primary peak
it_rt_beginRT iterator of the very first spectrum of the experiment (needed to determine indices)
it_rt_band_beginRT iterator of the first spectrum in the RT band
it_rt_band_endRT iterator of the spectrum after the last spectrum in the RT band
patternm/z pattern to search for
peakfilter result output
Returns
boolean if this filter was passed i.e. there are isotopes_per_peptide_min_ or more mass traces which form the pattern.

◆ filterPeptideCorrelation_()

bool filterPeptideCorrelation_ ( const MultiplexIsotopicPeakPattern pattern,
const MultiplexFilteredPeak peak 
) const
protected

check if corresponding satellite peaks of different peptides show a good correlation

Different peptides in the same multiplet have the same amino acid sequence and should therefore exhibit very similar isotope distributions. The filter checks if satellite peaks corresponding to different isotopes in different peptide features show a strong correlation. The filter is of course ignored for singlet feature detection.

Parameters
patternm/z pattern to search for
peakpeak with set of satellite peaks
Returns
boolean if this filter was passed i.e. the correlation coefficient is greater than peptide_similarity_

◆ getBlacklist()

MSExperiment getBlacklist ( )

returns the blacklisted, centroided peaks

◆ getCentroidedExperiment()

MSExperiment& getCentroidedExperiment ( )

returns the intensity-filtered, centroided spectral data

◆ updateWhiteMSExperiment_()

void updateWhiteMSExperiment_ ( )
protected

construct an MS experiment from exp_centroided_ containing peaks which have not been previously blacklisted in blacklist_

In addition, construct an index mapping of 'white' peak positions to their position in the corresponding, original spectrum.

Member Data Documentation

◆ averagine_similarity_

double averagine_similarity_
protected

averagine similarity

◆ averagine_similarity_scaling_

double averagine_similarity_scaling_
protected

averagine similarity scaling

◆ averagine_type_

String averagine_type_
protected

type of averagine to use

◆ blacklist_

std::vector<std::vector<int> > blacklist_
protected

auxiliary structs for blacklisting

◆ exp_centroided_

MSExperiment exp_centroided_
protected

centroided experimental data

◆ exp_centroided_mapping_

White2Original exp_centroided_mapping_
protected

mapping of peak indices from a 'white' experiment exp_centroided_white_ to its original experiment exp_centroided_

◆ exp_centroided_white_

MSExperiment exp_centroided_white_
protected

"white" centroided experimental data

subset of all peaks of exp_centroided_ which are not blacklisted in blacklist_

◆ intensity_cutoff_

double intensity_cutoff_
protected

intensity cutoff

◆ isotopes_per_peptide_max_

size_t isotopes_per_peptide_max_
protected

maximum number of isotopic peaks per peptide

◆ isotopes_per_peptide_min_

size_t isotopes_per_peptide_min_
protected

minimum number of isotopic peaks per peptide

◆ mz_tolerance_

double mz_tolerance_
protected

m/z shift tolerance

◆ mz_tolerance_unit_in_ppm_

bool mz_tolerance_unit_in_ppm_
protected

unit for m/z shift tolerance (ppm - true, Da - false)

◆ patterns_

std::vector<MultiplexIsotopicPeakPattern> patterns_
protected

list of peak patterns

◆ peptide_similarity_

double peptide_similarity_
protected

peptide similarity

◆ rt_band_

double rt_band_
protected

RT range used for filtering.