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

Classes

struct  OwnerCheckCounts_
 What the owner-aware blacklist check found in resolve(), for its log. More...
 

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.
 
std::vector< bool > checkIdentifications (const ConsensusFeature &consensus) const
 Which peptide identifications of consensus agree with its detected mass shifts?
 
std::vector< double > expectedChannelMZs (const AASequence &sequence, int charge, Size &position) const
 Where the peptide of sequence appears in every channel.
 
- 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

MultiplexDeltaMassesGenerator createGenerator_ () const
 The generator of the theoretical mass-shift patterns, as configured in the sections algorithm and labels.
 
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.
 
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, const std::vector< std::vector< std::string > > &samples, 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? (anonymous blacklist: the first peak at or above each position)
 
bool isReservedByOther_ (const MSExperiment &blacklist, double rt, double mz, size_t charge, const ConsensusFeature &consensus, const OwnerPeptides &peptides, OwnerCheckCounts_ &counts) const
 Is a peak reserved by another multiplet within the m/z tolerance of one of the first three isotopes at this position?
 
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 OwnerPeptides *peptides=nullptr, OwnerCheckCounts_ *counts=nullptr) 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 bool matchesResidues_ (const std::vector< MultiplexDeltaMasses::DeltaMass > &pattern, const AASequence &sequence, const std::vector< std::vector< std::string > > &samples)
 Does every channel of pattern label exactly the residues sequence has?
 
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.
 
bool use_blacklist_owners_ = false
 Use the owners of blacklisted peaks, if recorded ('algorithm:use_blacklist_owners')
 
- 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;.
 

Owners of blacklisted peaks

FeatureFinderMultiplexAlgorithm records which feature reserved each blacklisted peak, as two integer data arrays aligned with the peaks of each blacklist spectrum: owner_unique_id_high and owner_unique_id_low, the upper and lower 32 bits of the feature's unique id (an integer data array holds 32-bit values). 0 in both means that no reported feature owns the peak (the multiplets it was reserved for were dropped after it was reserved). The arrays survive mzML files (as non-standard data arrays).

enum class  OwnerRelation {
  ORPHAN , OWN , SAME_PEPTIDE , UNIDENTIFIED ,
  OTHER_PEPTIDE
}
 How the owner of a blacklisted peak relates to a multiplet. More...
 
using OwnerPeptides = std::unordered_map< UInt64, std::string >
 Peptide (as compared by classifyBlacklistOwner()) of each detected channel of the identified multiplets of a map, by unique id.
 
OwnerPeptides ownerPeptides (const ConsensusMap &multiplets) const
 The peptide of every detected channel (feature handle with a unique id) of the identified multiplets in multiplets.
 
std::string peptideKey (const PeptideHit &hit, int charge) const
 The peptide of hit at charge charge, as ownerPeptides() names it (the sequence without the labels, and the charge)
 
static bool hasBlacklistOwners (const MSExperiment &blacklist)
 
static UInt64 blacklistOwner (const MSSpectrum &spectrum, Size peak_index)
 The unique id of the feature that reserved peak peak_index of spectrum (UniqueIdInterface::INVALID if none, or if not recorded)
 
static void setBlacklistOwners (MSSpectrum &spectrum, const std::vector< UInt64 > &owners)
 Record owners (one unique id per peak, INVALID if none) as the owners of the peaks of spectrum.
 
static OwnerRelation classifyBlacklistOwner (UInt64 owner, const ConsensusFeature &consensus, const OwnerPeptides &peptides)
 How the feature owner, which reserved a blacklisted peak, relates to the multiplet consensus.
 
static OwnerRelation classifyBlacklistOwner (UInt64 owner, const std::string &peptide, const OwnerPeptides &peptides)
 How the feature owner, which reserved a blacklisted peak, relates to the peptide peptide (of an identification without a multiplet)
 
static bool isForeign (OwnerRelation relation)
 Does a peak reserved by an owner of this relation belong to another multiplet? (UNIDENTIFIED, SAME_PEPTIDE, OTHER_PEPTIDE)
 

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.

With algorithm:use_blacklist_owners, and a blacklist that records who reserved each peak (hasBlacklistOwners(), as FeatureFinderMultiplexAlgorithm writes it), only peaks reserved by another multiplet make a channel not quantifiable (isForeign()): peaks of the multiplet's own channels (their isotopes) and of no reported feature (a pattern the detection dropped later) do not. A dummy feature of intensity 0 then means that no other multiplet occupies its position, not that the peptide is absent, so the caller has to measure it (MS1LabeledWorkflow re-quantifies such channels). All blacklisted peaks within the m/z tolerance count, on either side of the expected positions, and channels that MS1LabeledWorkflow added for an identification (intensity 0, no unique id) are checked like dummy features. Otherwise (the default) the owners are ignored: a dummy feature is not quantifiable if the first blacklisted peak at or above one of its expected positions is within the tolerance, and added channels are not checked.

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. checkIdentifications() tells beforehand which of several identifications agree with a multiplet, so that the reduction can prefer one of those over a better-scoring one that would make the multiplet a conflict. 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.
algorithm:use_blacklist_owners stringfalse true, falseFor a blacklist that records which feature reserved each peak (FeatureFinderMultiplex -out_blacklist).
true: a missing channel is not quantifiable (NaN) only if a peak reserved by another multiplet lies at its expected position, and channels added for an identification (intensity 0, no feature id) are checked the same way. Peaks of the multiplet's own channels (their isotopes) or of no reported feature (a pattern the detection dropped; FeatureFinderMultiplex records only the first and the last pattern that reserved a peak) leave it at 0, which then means 'not occupied', not 'absent': use this only if such channels are measured afterwards (as MS1LabeledWorkflow re-quantifies them).
false: the owners are ignored, every blacklisted peak counts.
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.

Class Documentation

◆ OpenMS::MultiplexResolverAlgorithm::OwnerCheckCounts_

struct OpenMS::MultiplexResolverAlgorithm::OwnerCheckCounts_

What the owner-aware blacklist check found in resolve(), for its log.

Class Members
Size added = 0 channels added for an identification checked
Size added_vetoed = 0 added channels found not quantifiable
Size anonymous = 0 dummy features the check without owners finds blacklisted
Size dummies = 0 dummy features checked
Size dummies_vetoed = 0 dummy features found not quantifiable
Size orphan = 0 ... with a peak of no reported feature
Size other_peptide = 0 not quantifiable: a peak reserved by another identified peptide
Size own = 0 ... of these, with a peak of the multiplet's own channels
Size same_peptide = 0 not quantifiable: a peak reserved by another multiplet of the same peptide (no other peptide)
Size unidentified = 0 not quantifiable: peaks reserved by unidentified multiplets only
Size usable = 0 reserved peaks, but none foreign

Member Typedef Documentation

◆ OwnerPeptides

using OwnerPeptides = std::unordered_map<UInt64, std::string>

Peptide (as compared by classifyBlacklistOwner()) of each detected channel of the identified multiplets of a map, by unique id.

Member Enumeration Documentation

◆ OwnerRelation

enum class OwnerRelation
strong

How the owner of a blacklisted peak relates to a multiplet.

Enumerator
ORPHAN 

no reported feature owns the peak

OWN 

a detected channel of the multiplet itself

SAME_PEPTIDE 

a channel of another multiplet identified as the same peptide (and charge)

UNIDENTIFIED 

a channel of an unidentified multiplet (or of none in the map)

OTHER_PEPTIDE 

a channel of a multiplet identified as another peptide

Constructor & Destructor Documentation

◆ MultiplexResolverAlgorithm()

Constructor; registers the algorithm and labels parameter sections.

Member Function Documentation

◆ blacklistOwner()

static UInt64 blacklistOwner ( const MSSpectrum &  spectrum,
Size  peak_index 
)
static

The unique id of the feature that reserved peak peak_index of spectrum (UniqueIdInterface::INVALID if none, or if not recorded)

◆ checkIdentifications()

std::vector< bool > checkIdentifications ( const ConsensusFeature &  consensus) const

Which peptide identifications of consensus agree with its detected mass shifts?

This is the check resolve() applies to the (first) identification of a multiplet, for every identification: the label set of its first peptide hit has to occur in a theoretical pattern whose mass shifts explain every detected feature, relative to the feature named by the identification's map_index. Use it to choose, among several identifications mapped onto one multiplet, one that does not turn the multiplet into a conflict.

Returns
One flag per peptide identification of consensus, in order. Identifications without hits, without map_index, or whose map_index names no feature handle are not consistent.

◆ classifyBlacklistOwner() [1/2]

static OwnerRelation classifyBlacklistOwner ( UInt64  owner,
const ConsensusFeature &  consensus,
const OwnerPeptides &  peptides 
)
static

How the feature owner, which reserved a blacklisted peak, relates to the multiplet consensus.

Parameters
[in]ownerUnique id of the owner (blacklistOwner())
[in]consensusThe multiplet; its detected channels carry the unique ids of their features
[in]peptidesownerPeptides() of the map the multiplets were detected in (incl. consensus)

◆ classifyBlacklistOwner() [2/2]

static OwnerRelation classifyBlacklistOwner ( UInt64  owner,
const std::string &  peptide,
const OwnerPeptides &  peptides 
)
static

How the feature owner, which reserved a blacklisted peak, relates to the peptide peptide (of an identification without a multiplet)

As above, for a peptide that has no multiplet of its own (never OWN).

Parameters
[in]ownerUnique id of the owner (blacklistOwner())
[in]peptideThe peptide, as peptideKey() names it
[in]peptidesownerPeptides() of the map the multiplets were detected in

◆ 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 OwnerPeptides *  peptides = nullptr,
OwnerCheckCounts_ *  counts = nullptr 
) 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)
[in]peptidesIf not null, the owners of the blacklisted peaks are used and these are the ownerPeptides() of the map: owner-aware check of dummy features and of channels added for an identification
[in,out]countsCounts of the owner-aware check (used only with peptides)
Returns
The complete multiplet

◆ createGenerator_()

MultiplexDeltaMassesGenerator createGenerator_ ( ) const
protected

The generator of the theoretical mass-shift patterns, as configured in the sections algorithm and labels.

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

◆ expectedChannelMZs()

std::vector< double > expectedChannelMZs ( const AASequence &  sequence,
int  charge,
Size &  position 
) const

Where the peptide of sequence appears in every channel.

The theoretical pattern of the peptide is the one whose label set at some position equals the labels of sequence and whose channels label exactly the residues it has (see matchesResidues_()). Its mass shifts, relative to the position of sequence, give the m/z of the peptide at charge charge in every channel.

Parameters
[in]sequenceIdentified peptidoform, with its labels
[in]chargeCharge state (non-zero)
[out]positionPosition (channel) of sequence itself within the returned m/z values
Returns
The m/z per channel (pattern position), empty if no theoretical pattern fits sequence

◆ findMatchingPattern_()

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,
const std::vector< std::vector< std::string > > &  samples,
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]detected_delta_mass_at_label_setDetected mass shift of the identified feature (relative to the first feature)
[in]sequenceSequence annotated to the detected pattern
[in]label_setLabel set extracted from sequence
[in]theoretical_patternsAll theoretical patterns
[in]samplesLabels of every sample (MultiplexDeltaMassesGenerator::getSamplesLabelsList())
[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

◆ hasBlacklistOwners()

static bool hasBlacklistOwners ( const MSExperiment &  blacklist)
static

Does every spectrum of blacklist that has peaks record their owners (and is there a peak)?

◆ 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? (anonymous blacklist: the first peak at or above each position)

◆ isForeign()

static bool isForeign ( OwnerRelation  relation)
static

Does a peak reserved by an owner of this relation belong to another multiplet? (UNIDENTIFIED, SAME_PEPTIDE, OTHER_PEPTIDE)

Such a peak makes a missing channel at its position not quantifiable, and a channel must not use it. Another multiplet of the same peptide (e.g. its missing channel, detected on its own) is quantified itself: measuring the channel from its peaks would count them twice.

◆ isReservedByOther_()

bool isReservedByOther_ ( const MSExperiment &  blacklist,
double  rt,
double  mz,
size_t  charge,
const ConsensusFeature &  consensus,
const OwnerPeptides &  peptides,
OwnerCheckCounts_ &  counts 
) const
protected

Is a peak reserved by another multiplet within the m/z tolerance of one of the first three isotopes at this position?

The owner-aware check of a (dummy or added) channel of consensus: every blacklisted peak in the RT and m/z tolerance counts (both sides), and only foreign owners (isForeign()) make the channel not quantifiable.

◆ matchDeltaMasses_()

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
protected

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

Parameters
[in]consensusDetected pattern
[in]detected_delta_mass_at_label_setDetected mass shift of the identified feature (relative to the first feature)
[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

◆ matchesResidues_()

static bool matchesResidues_ ( const std::vector< MultiplexDeltaMasses::DeltaMass > &  pattern,
const AASequence &  sequence,
const std::vector< std::vector< std::string > > &  samples 
)
staticprotected

Does every channel of pattern label exactly the residues sequence has?

Metabolic labels (SILAC Lys/Arg, Leu3) sit on every residue of their kind, so in a pattern that fits the peptide, each channel carries one Lys label per K, one Arg label per R and one Leu label per L, for every residue kind its sample labels - none if the peptide has no residue of that kind. The sample of a channel is the one in samples whose labels include all labels of the channel. E.g. with samples [][Lys8,Arg10], a peptide with one K and one R fits only the pattern whose heavy channel carries Lys8 and Arg10, not the one carrying Lys8 alone. This tells the pattern of an unlabelled identification, whose label set ("no_label") occurs in every pattern. Unlabelled channels impose nothing, and other labels (Dimethyl, ICPL, plain mass shifts) are not counted.

Parameters
[in]patternTheoretical pattern
[in]sequenceIdentified peptidoform
[in]samplesLabels of every sample (MultiplexDeltaMassesGenerator::getSamplesLabelsList())

◆ 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

◆ ownerPeptides()

OwnerPeptides ownerPeptides ( const ConsensusMap &  multiplets) const

The peptide of every detected channel (feature handle with a unique id) of the identified multiplets in multiplets.

A multiplet's peptide is that of its first identification: the sequence without the labels of section algorithm:labels (other modifications kept) and the charge of the multiplet. So the label states of a peptide share it, while another sequence of the same composition or another modification state does not.

◆ peptideKey()

std::string peptideKey ( const PeptideHit &  hit,
int  charge 
) const

The peptide of hit at charge charge, as ownerPeptides() names it (the sequence without the labels, and the charge)

◆ 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. If its owners are used (algorithm:use_blacklist_owners and hasBlacklistOwners()), the feature handles of map_in must carry the unique ids of their features, as FeatureFinderMultiplexAlgorithm::getConsensusMap() does.
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

◆ setBlacklistOwners()

static void setBlacklistOwners ( MSSpectrum &  spectrum,
const std::vector< UInt64 > &  owners 
)
static

Record owners (one unique id per peak, INVALID if none) as the owners of the peaks of spectrum.

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

◆ use_blacklist_owners_

bool use_blacklist_owners_ = false
protected

Use the owners of blacklisted peaks, if recorded ('algorithm:use_blacklist_owners')