OpenMS
Loading...
Searching...
No Matches
MultiplexResolverAlgorithm Class Reference

Completes peptide multiplets and resolves quant/ID conflicts within them. More...

#include <OpenMS/FEATUREFINDER/MultiplexResolverAlgorithm.h>

Inheritance diagram for MultiplexResolverAlgorithm:
DefaultParamHandler

Public Member Functions

 MultiplexResolverAlgorithm ()
 Constructor; registers the algorithm and labels parameter sections.
 
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.
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const std::string &name)
 Constructor with name that is displayed in error messages.
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor.
 
virtual ~DefaultParamHandler ()
 Destructor.
 
DefaultParamHandler & operator= (const DefaultParamHandler &rhs)
 Assignment operator.
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator.
 
void setParameters (const Param &param)
 Sets the parameters.
 
const Param & getParameters () const
 Non-mutable access to the parameters.
 
const Param & getDefaults () const
 Non-mutable access to the default parameters.
 
const std::string & getName () const
 Non-mutable access to the name.
 
void setName (const std::string &name)
 Mutable access to the name.
 
const std::vector< std::string > & getSubsections () const
 Non-mutable access to the registered subsections.
 

Protected Member Functions

bool matchDeltaMasses_ (const ConsensusFeature &consensus, 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.
 
int findMatchingPattern_ (const ConsensusFeature &consensus, 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.
 
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?
 
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.
 
void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method.
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor.
 

Static Protected Member Functions

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)
 
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.
 
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
 

Protected Attributes

double mass_tolerance_ = 0.1
 Mass tolerance in Da for matching detected to theoretical mass shifts.
 
double mz_tolerance_ = 10.0
 m/z tolerance in ppm for the blacklist check
 
double rt_tolerance_ = 5.0
 RT tolerance in seconds for the blacklist check.
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters.
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes!
 
std::vector< std::string > subsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes!
 
std::string error_name_
 Name that is displayed in error messages during the parameter checking.
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;.
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;.
 

Additional Inherited Members

- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const std::string &key_prefix="")
 Writes all parameters to meta values.
 

Detailed Description

Completes peptide multiplets and resolves quant/ID conflicts within them.

Tools such as FeatureFinderMultiplexAlgorithm detect peptide feature multiplets (pairs, triplets, ...) in MS1-labeled data (SILAC, Dimethyl, ...). Once the multiplets carry peptide sequences (e.g. via IDMapper), this class consolidates quantitative and sequence information in two steps:

  • Multiplets whose observed mass shifts contradict the labels found in the annotated sequence are moved to a conflict map. Example: a sequence carrying a single Arg10 label mapped to the light feature of a SILAC triplet - either the feature detection or the sequence is wrong.
  • Incomplete multiplets (e.g. only the heavy partner of a pair was detected) are completed with dummy features. A dummy feature gets intensity 0 when nothing was blacklisted around its position during feature detection (the peptide is absent), and NaN (not quantifiable) when the region was blacklisted, i.e. another feature overlaps with it.

Only the first peptide identification of a consensus feature is taken into account, so the map should have been reduced to one identification per feature (IDConflictResolverAlgorithm::resolve()) first. Multiplets without sequence annotation are written to the conflict map unchanged.

The identifications must carry the map index of the feature handle they were mapped to in the meta value map_index (IDMapper with annotate_ids_with_subelements). When a multiplet is completed, the new map index of the identified feature is recorded in the meta value map_index of the first peptide hit.

Parameters: section algorithm holds the label specification and tolerances, section labels the mass shift of every known label (see MultiplexDeltaMassesGenerator).

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
algorithm:labels string[][Lys8,Arg10]  Labels used for labelling the samples. [...] specifies the labels for a single sample. For example

[][Lys8,Arg10] ... SILAC
[][Lys4,Arg6][Lys8,Arg10] ... triple-SILAC
[Dimethyl0][Dimethyl6] ... Dimethyl
[Dimethyl0][Dimethyl4][Dimethyl8] ... triple Dimethyl
[ICPL0][ICPL4][ICPL6][ICPL10] ... ICPL
algorithm:max_nr_labelled_aas int0 min: 0Maximum number of labelled amino acids per peptide, minus one. The algorithm searches for peptides with up to (this value + 1) labelled amino acids. For SILAC with trypsin digestion, this parameter corresponds to the maximum number of missed cleavages.
algorithm:mass_tolerance float0.1  Mass tolerance in Da for matching the mass shifts in the detected peptide multiplet to the theoretical mass shift pattern.
algorithm:mz_tolerance float10.0 min: 0.0m/z tolerance in ppm for checking if dummy feature vicinity was blacklisted.
algorithm:rt_tolerance float5.0 min: 0.0Retention time tolerance in seconds for checking if dummy feature vicinity was blacklisted.
labels:Arg6 float6.0201290268 min: 0.0Label:13C(6) | C(-6) 13C(6) | unimod @#188
labels:Arg10 float10.008268599999999 min: 0.0Label:13C(6)15N(4) | C(-6) 13C(6) N(-4) 15N(4) | unimod @#267
labels:Lys4 float4.0251069836 min: 0.0Label:2H(4) | H(-4) 2H(4) | unimod @#481
labels:Lys6 float6.0201290268 min: 0.0Label:13C(6) | C(-6) 13C(6) | unimod @#188
labels:Lys8 float8.0141988132 min: 0.0Label:13C(6)15N(2) | C(-6) 13C(6) N(-2) 15N(2) | unimod @#259
labels:Leu3 float3.01883 min: 0.0Label:2H(3) | H(-3) 2H(3) | unimod @#262
labels:Dimethyl0 float28.031300000000002 min: 0.0Dimethyl | H(4) C(2) | unimod @#36
labels:Dimethyl4 float32.056407 min: 0.0Dimethyl:2H(4) | 2H(4) C(2) | unimod @#199
labels:Dimethyl6 float34.063116999999998 min: 0.0Dimethyl:2H(4)13C(2) | 2H(4) 13C(2) | unimod @#510
labels:Dimethyl8 float36.075670000000002 min: 0.0Dimethyl:2H(6)13C(2) | H(-2) 2H(6) 13C(2) | unimod @#330
labels:ICPL0 float105.021463999999995 min: 0.0ICPL | H(3) C(6) N O | unimod @#365
labels:ICPL4 float109.046571 min: 0.0ICPL:2H(4) | H(-1) 2H(4) C(6) N O | unimod @#687
labels:ICPL6 float111.041593000000006 min: 0.0ICPL:13C(6) | H(3) 13C(6) N O | unimod @#364
labels:ICPL10 float115.066699999999997 min: 0.0ICPL:13C(6)2H(4) | H(-1) 2H(4) 13C(6) N O | unimod @#866

Note:
  • If a section name is documented, the documentation is displayed as tooltip.
  • Advanced parameter names are italic.

Constructor & Destructor Documentation

◆ MultiplexResolverAlgorithm()

Constructor; registers the algorithm and labels parameter sections.

Member Function Documentation

◆ completeConsensus_()

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
protected

Complete an incomplete multiplet with dummy features.

Parameters
[in]consensusPossibly incomplete multiplet
[in]patternMatching theoretical pattern
[in]delta_mass_matchedWhich delta masses of the pattern were matched
[in]index_label_setIndex within the pattern at which the label set was matched
[in]blacklistBlacklisted spectral peaks (may be empty)
Returns
The complete multiplet

◆ deltaMassFromMapIndex_()

static double deltaMassFromMapIndex_ ( const ConsensusFeature::HandleSetType &  feature_handles,
unsigned  idx 
)
staticprotected

Relative delta mass between the first feature handle and the handle with map index idx (NaN if absent)

◆ findMatchingPattern_()

int findMatchingPattern_ ( const ConsensusFeature &  consensus,
const MultiplexDeltaMasses::LabelSet &  label_set,
const std::vector< MultiplexDeltaMasses > &  theoretical_patterns,
std::vector< bool > &  delta_mass_matched,
int &  index_label_set 
) const
protected

Find the theoretical delta mass pattern matching the detected one.

Parameters
[in]consensusDetected pattern
[in]label_setLabel set extracted from the sequence annotated to the detected pattern
[in]theoretical_patternsAll theoretical patterns
[out]delta_mass_matchedWhich delta masses of the matching pattern were matched
[out]index_label_setIndex within the matching pattern at which the label set was matched
Returns
Index of the matching pattern, or -1

◆ findNewMZ_()

static double findNewMZ_ ( double  mz,
int  charge,
const std::vector< MultiplexDeltaMasses::DeltaMass > &  pattern,
const std::vector< bool > &  delta_mass_matched 
)
staticprotected

m/z of the lightest peptide of the complete multiplet, given the incomplete one at mz

◆ isBlacklisted_()

bool isBlacklisted_ ( const MSExperiment &  blacklist,
double  rt,
double  mz,
size_t  charge,
const ConsensusFeature &  consensus 
) const
protected

Is one of the first three isotopes of a (dummy) feature at this position blacklisted?

◆ matchDeltaMasses_()

bool matchDeltaMasses_ ( const ConsensusFeature &  consensus,
const std::vector< MultiplexDeltaMasses::DeltaMass > &  pattern,
double  theoretical_delta_mass_at_label_set,
std::vector< bool > &  delta_mass_matched 
) const
protected

Check whether all delta masses of the detected pattern match one of the theoretical pattern.

Parameters
[in]consensusDetected pattern
[in]patternTheoretical pattern
[in]theoretical_delta_mass_at_label_setTheoretical mass shift at which the label set was matched
[out]delta_mass_matchedWhich delta masses of the theoretical pattern were matched
Returns
true if every detected delta mass has a theoretical counterpart within the mass tolerance

◆ matchLabelSet_()

static double matchLabelSet_ ( const std::vector< MultiplexDeltaMasses::DeltaMass > &  pattern,
const MultiplexDeltaMasses::LabelSet &  label_set,
int &  index_label_set 
)
staticprotected

Mass shift of the theoretical pattern whose label set equals label_set.

Parameters
[in]patternTheoretical pattern
[in]label_setLabel set of the detected pattern
[out]index_label_setIndex within the pattern at which the label set was matched
Returns
Mass shift at the match, or NaN if no delta mass carries this label set

◆ resolve()

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.

map_out and map_conflicts inherit the meta data of map_in (column headers, protein identifications, unassigned peptide identifications, data processing) and receive the consensus features that could resp. could not be matched to a theoretical mass-shift pattern. Both output maps get fresh unique ids for their features, and the column header sizes of map_out are set to its number of features.

Parameters
[in]map_inMultiplets with (at most one) peptide identification each
[out]map_outComplete, consistent multiplets; cleared first
[out]map_conflictsMultiplets without identification or with conflicting quant/ID information; cleared first
[in]blacklistSpectral peaks blacklisted during feature detection (FeatureFinderMultiplexAlgorithm::getBlacklist()). Used to decide whether a dummy feature is absent (intensity 0) or not quantifiable (NaN). May be empty.
Exceptions
Exception::MissingInformationif an identified feature lacks the map_index meta value
Exception::InvalidValueif the map_index does not name a feature handle of the consensus feature

◆ updateMembers_()

void updateMembers_ ( )
overrideprotectedvirtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ mass_tolerance_

double mass_tolerance_ = 0.1
protected

Mass tolerance in Da for matching detected to theoretical mass shifts.

◆ mz_tolerance_

double mz_tolerance_ = 10.0
protected

m/z tolerance in ppm for the blacklist check

◆ rt_tolerance_

double rt_tolerance_ = 5.0
protected

RT tolerance in seconds for the blacklist check.