OpenMS
Loading...
Searching...
No Matches
MultiplexResolverAlgorithm.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Lars Nilse, Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
15
16#include <map>
17#include <string>
18#include <vector>
19
20namespace OpenMS
21{
22 class AASequence;
23 class MultiplexDeltaMassesGenerator;
24
59 {
60 public:
63
82 void resolve(const ConsensusMap& map_in, ConsensusMap& map_out, ConsensusMap& map_conflicts,
83 const MSExperiment& blacklist = MSExperiment()) const;
84
97 std::vector<bool> checkIdentifications(const ConsensusFeature& consensus) const;
98
112 std::vector<double> expectedChannelMZs(const AASequence& sequence, int charge, Size& position) const;
113
114 protected:
117
119 static double deltaMassFromMapIndex_(const ConsensusFeature::HandleSetType& feature_handles, unsigned idx);
120
129 static double matchLabelSet_(const std::vector<MultiplexDeltaMasses::DeltaMass>& pattern,
130 const MultiplexDeltaMasses::LabelSet& label_set, int& index_label_set);
131
142 bool matchDeltaMasses_(const ConsensusFeature& consensus, double detected_delta_mass_at_label_set,
143 const std::vector<MultiplexDeltaMasses::DeltaMass>& pattern,
144 double theoretical_delta_mass_at_label_set, std::vector<bool>& delta_mass_matched) const;
145
158 int findMatchingPattern_(const ConsensusFeature& consensus, double detected_delta_mass_at_label_set,
159 const AASequence& sequence, const MultiplexDeltaMasses::LabelSet& label_set,
160 const std::vector<MultiplexDeltaMasses>& theoretical_patterns,
161 std::vector<bool>& delta_mass_matched, int& index_label_set) const;
162
173 static bool matchesResidues_(const std::vector<MultiplexDeltaMasses::DeltaMass>& pattern, const AASequence& sequence);
174
176 static double findNewMZ_(double mz, int charge, const std::vector<MultiplexDeltaMasses::DeltaMass>& pattern,
177 const std::vector<bool>& delta_mass_matched);
178
180 bool isBlacklisted_(const MSExperiment& blacklist, double rt, double mz, size_t charge, const ConsensusFeature& consensus) const;
181
192 ConsensusFeature completeConsensus_(const ConsensusFeature& consensus, const std::vector<MultiplexDeltaMasses::DeltaMass>& pattern,
193 const std::vector<bool>& delta_mass_matched, int index_label_set,
194 const MSExperiment& blacklist) const;
195
197 double mass_tolerance_ = 0.1;
199 double mz_tolerance_ = 10.0;
201 double rt_tolerance_ = 5.0;
202
203 void updateMembers_() override;
204 };
205} // namespace OpenMS
Definition AASequence.h:96
A consensus feature spanning multiple LC-MS/MS experiments.
Definition ConsensusFeature.h:45
std::set< FeatureHandle, FeatureHandle::IndexLess > HandleSetType
Type definitions.
Definition ConsensusFeature.h:49
A container for consensus elements.
Definition ConsensusMap.h:67
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
generates complete list of all possible mass shifts due to isotopic labelling
Definition MultiplexDeltaMassesGenerator.h:36
std::multiset< std::string > LabelSet
set of labels associated with a mass shift
Definition MultiplexDeltaMasses.h:46
Completes peptide multiplets and resolves quant/ID conflicts within them.
Definition MultiplexResolverAlgorithm.h:59
void resolve(const ConsensusMap &map_in, ConsensusMap &map_out, ConsensusMap &map_conflicts, const MSExperiment &blacklist=MSExperiment()) const
Split the annotated multiplets of map_in into resolved and conflicting ones.
std::vector< double > expectedChannelMZs(const AASequence &sequence, int charge, Size &position) const
Where the peptide of sequence appears in every channel.
std::vector< bool > checkIdentifications(const ConsensusFeature &consensus) const
Which peptide identifications of consensus agree with its detected mass shifts?
bool isBlacklisted_(const MSExperiment &blacklist, double rt, double mz, size_t charge, const ConsensusFeature &consensus) const
Is one of the first three isotopes of a (dummy) feature at this position blacklisted?
static double matchLabelSet_(const std::vector< MultiplexDeltaMasses::DeltaMass > &pattern, const MultiplexDeltaMasses::LabelSet &label_set, int &index_label_set)
Mass shift of the theoretical pattern whose label set equals label_set.
int findMatchingPattern_(const ConsensusFeature &consensus, double detected_delta_mass_at_label_set, const AASequence &sequence, const MultiplexDeltaMasses::LabelSet &label_set, const std::vector< MultiplexDeltaMasses > &theoretical_patterns, std::vector< bool > &delta_mass_matched, int &index_label_set) const
Find the theoretical delta mass pattern matching the detected one.
ConsensusFeature completeConsensus_(const ConsensusFeature &consensus, const std::vector< MultiplexDeltaMasses::DeltaMass > &pattern, const std::vector< bool > &delta_mass_matched, int index_label_set, const MSExperiment &blacklist) const
Complete an incomplete multiplet with dummy features.
MultiplexDeltaMassesGenerator createGenerator_() const
The generator of the theoretical mass-shift patterns, as configured in the sections algorithm and lab...
static double findNewMZ_(double mz, int charge, const std::vector< MultiplexDeltaMasses::DeltaMass > &pattern, const std::vector< bool > &delta_mass_matched)
m/z of the lightest peptide of the complete multiplet, given the incomplete one at mz
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
static bool matchesResidues_(const std::vector< MultiplexDeltaMasses::DeltaMass > &pattern, const AASequence &sequence)
Does every channel of pattern label as many residues as sequence has?
static double deltaMassFromMapIndex_(const ConsensusFeature::HandleSetType &feature_handles, unsigned idx)
Relative delta mass between the first feature handle and the handle with map index idx (NaN if absent...
MultiplexResolverAlgorithm()
Constructor; registers the algorithm and labels parameter sections.
bool matchDeltaMasses_(const ConsensusFeature &consensus, double detected_delta_mass_at_label_set, const std::vector< MultiplexDeltaMasses::DeltaMass > &pattern, double theoretical_delta_mass_at_label_set, std::vector< bool > &delta_mass_matched) const
Check whether all delta masses of the detected pattern match one of the theoretical pattern.
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19