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

Channel ratios of MS1-labeled (SILAC, Dimethyl, ...) data, aggregated as medians of ratios. More...

#include <MS1LabeledWorkflow/MS1LabeledRatioQuantifier.h>

Inheritance diagram for MS1LabeledRatioQuantifier:
DefaultParamHandler

Classes

struct  ChannelRatio
 One channel ratio of one peptide or protein group, at (fraction group, channel) grain. More...
 

Public Member Functions

 MS1LabeledRatioQuantifier ()
 
void run (ConsensusMap &consensus, const ExperimentalDesign &design, ProteinIdentification &proteins)
 Compute the ratios of consensus and annotate features and protein groups with them.
 
const std::map< AASequence, std::vector< ChannelRatio > > & getPeptideRatios () const
 Peptide ratios of the last run(), by peptide identity.
 
const std::map< std::string, std::vector< ChannelRatio > > & getProteinGroupRatios () const
 Protein group ratios of the last run(), by the group's leading accession.
 
- 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.
 

Static Public Attributes

static const std::string TARGETED_RUNS = "MS1Label:targeted_runs"
 Meta value (StringList) of a consensus feature: the runs (file basenames) in which it was measured by targeted quantification.
 
static const std::string REQUANTIFIED_RUNS = "MS1Label:requantified_runs"
 
static const std::string REQUANTIFIED_LABELS = "MS1Label:requantified_labels"
 

Static Protected Member Functions

static double median_ (std::vector< double > &values)
 Median of values (which is sorted in the process); NaN if empty.
 

Protected Attributes

std::map< AASequence, std::vector< ChannelRatio > > peptide_ratios_
 
std::map< std::string, std::vector< ChannelRatio > > protein_group_ratios_
 
- 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.
 
- Protected Member Functions inherited from DefaultParamHandler
virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method.
 
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor.
 

Detailed Description

Channel ratios of MS1-labeled (SILAC, Dimethyl, ...) data, aggregated as medians of ratios.

A labeled experiment measures its channels in one run, so the quantity of interest is their ratio, and the ratio of a peptide multiplet is measured far better than either of its channel intensities: both channels see the same elution, the same ionization and the same instrument state. This class therefore aggregates ratios, the way MaxQuant does, rather than dividing aggregated intensities:

  • evidence ratio: per multiplet and run, the intensity of a channel divided by the intensity of the reference channel (channel 1, the light one, by default). Only positive intensities take part: a channel completed with a zero-intensity dummy feature (the peptide is absent) or a not-quantifiable one contributes no ratio, since neither 0 nor infinity is a measurement of a ratio. The reference channel is reported as the 1.0 it is by construction, so that every annotation covers the complete set of channels (light, medium and heavy of a triplex, say) – but only where another channel was measured against it, since a multiplet seen in the reference channel alone is no measurement of a ratio either.
  • peptide ratio: the median of the evidence ratios of one peptide within one fraction group (a fraction group is one labeled sample, measured in one or several fractions).
  • protein group ratio: the median of the peptide ratios of the group's peptides, again per fraction group, reported only when at least min_ratio_count peptides contribute (MaxQuant's "min. ratio count"). The threshold applies separately to each comparison. The reference/reference value is included only alongside a passing comparison in that fraction group. The number of contributing peptides is reported alongside.
  • normalized ratio (normalize, on by default): every ratio divided by the median peptide ratio of its (fraction group, channel), i.e. the assumption that most peptides do not change. Medians are equivariant under that division, so normalizing the peptide ratios and re-aggregating gives the same protein ratios as dividing the protein ratios directly. With normalize off, no normalized values are written at all.

Evidences of targeted quantification (MS1LabeledWorkflow's '-targeted_quantification': the runs a feature lists in its meta value MS1Label:targeted_runs) only stand in where nothing else was measured. Their values are less accurate at extreme ratios, so they must not change a ratio that is reported without them:

  • a peptide ratio (per fraction group and channel) is the median of the peptide's other evidences of that channel in that fraction group; only where it has none does it get the median of its targeted ones (e.g. the heavy channel of a triplex peptide whose detected multiplets lack it).
  • a protein group ratio is the median of the group's other peptide ratios if these reach min_ratio_count; otherwise the peptide ratios of targeted quantification are added, which can lift the group over the threshold.
  • a normalization factor is the median of the peptide ratios measured without targeted quantification, if the (fraction group, channel) has any.

A ratio is therefore not the ratio of the abundances that PeptideAndProteinQuant reports: that one is a ratio of per-channel aggregates, which is a different statistic (it weights peptides by their intensity, and a single intense peptide can dominate it). Both are useful and both are reported by MaxQuant; this class provides the ratio-of-ratios one.

Ratios are annotated where they belong:

  • on every consensus feature, as the parallel meta values MS1Label:evidence_ratio_run (StringList), MS1Label:evidence_ratio_channel (IntList) and MS1Label:evidence_ratio (DoubleList) for its own evidence ratios, and MS1Label:peptide_ratio_fraction_group, MS1Label:peptide_ratio_channel, MS1Label:peptide_ratio, MS1Label:peptide_ratio_normalized and MS1Label:peptide_ratio_count for the ratios of its peptide
  • on every indistinguishable protein group, as the parallel data arrays fraction_group_level_ratio_fraction_group, fraction_group_level_ratio_label and fraction_group_level_ratio_count (integer) plus fraction_group_level_ratio and fraction_group_level_ratio_normalized (float), next to the abundance arrays that PeptideAndProteinQuant writes. A second run() replaces them.
  • if any evidence comes from targeted quantification: how many of the contributing ratios do, as MS1Label:peptide_ratio_targeted_count on the features and the integer array fraction_group_level_ratio_targeted_count on the protein groups (parallel to the counts above).
  • if any channel was re-quantified (the (run, channel) pairs a feature lists in its meta values MS1Label:requantified_runs and MS1Label:requantified_labels): how many of the contributing ratios rest on re-quantified channels, as MS1Label:peptide_ratio_requantified_count (evidences whose channel or reference channel was re-quantified) and fraction_group_level_ratio_requantified_count (peptide ratios all of whose evidences were). Re-quantified values are less accurate at extreme ratios than detected ones (they are measured where the detection found no pattern), so these counts allow filtering them.

A peptide counts for the group that covers every protein it references; peptides shared between groups count for none (a razor assignment, if wanted, rewrites the references during inference).

Part of the MS1LabeledWorkflow tool rather than of the library: the aggregation rules it implements are those of that workflow, and its parameters are the tool's ratios section.


Class Documentation

◆ OpenMS::MS1LabeledRatioQuantifier::ChannelRatio

struct OpenMS::MS1LabeledRatioQuantifier::ChannelRatio

One channel ratio of one peptide or protein group, at (fraction group, channel) grain.

Class Members
unsigned channel = 0 Channel in the numerator (1-based label of the experimental design; the denominator is the reference channel)
Size count = 0 Number of contributing ratios (evidences for a peptide, peptides for a protein group)
unsigned fraction_group = 0 Fraction group the ratio was measured in (1-based)
double normalized_ratio = 0.0 ratio divided by the median peptide ratio of this (fraction group, channel)
double ratio = 0.0 Median of the contributing ratios.
Size requantified_count = 0

Of count, the ratios that rest on re-quantified channels: for a peptide, the evidences whose channel or reference channel was re-quantified; for a protein group, the peptide ratios all of whose evidences were

Size targeted_count = 0 Of count, the ratios that come from targeted quantification (a peptide ratio has either all or none)

Constructor & Destructor Documentation

◆ MS1LabeledRatioQuantifier()

Member Function Documentation

◆ getPeptideRatios()

const std::map< AASequence, std::vector< MS1LabeledRatioQuantifier::ChannelRatio > > & getPeptideRatios ( ) const

Peptide ratios of the last run(), by peptide identity.

References MS1LabeledRatioQuantifier::peptide_ratios_.

◆ getProteinGroupRatios()

const std::map< std::string, std::vector< MS1LabeledRatioQuantifier::ChannelRatio > > & getProteinGroupRatios ( ) const

Protein group ratios of the last run(), by the group's leading accession.

References MS1LabeledRatioQuantifier::protein_group_ratios_.

◆ median_()

double median_ ( std::vector< double > &  values)
staticprotected

Median of values (which is sorted in the process); NaN if empty.

Referenced by MS1LabeledRatioQuantifier::run().

◆ run()

void run ( ConsensusMap &  consensus,
const ExperimentalDesign &  design,
ProteinIdentification &  proteins 
)

Compute the ratios of consensus and annotate features and protein groups with them.

Parameters
[in,out]consensusLinked multiplets, one column per (run, channel); features are annotated with their evidence ratios
[in]designThe experimental design; supplies the fraction group of every run
[in,out]proteinsThe inferred identification run whose indistinguishable groups are annotated

References ProteinIdentification::ProteinGroup::accessions, File::basename(), MS1LabeledRatioQuantifier::ChannelRatio::channel, MS1LabeledRatioQuantifier::ChannelRatio::count, AASequence::empty(), PeptideHit::extractProteinAccessionsSet(), MS1LabeledRatioQuantifier::ChannelRatio::fraction_group, ConsensusMap::getColumnHeaders(), ConsensusMap::getExperimentType(), ProteinIdentification::ProteinGroup::getFloatDataArrays(), ProteinIdentification::getIndistinguishableProteins(), ProteinIdentification::ProteinGroup::getIntegerDataArrays(), ExperimentalDesign::getMSFileSection(), PeptideHit::getSequence(), ConsensusMap::getUnassignedPeptideIdentifications(), Param::getValue(), MS1LabeledRatioQuantifier::median_(), MS1LabeledRatioQuantifier::ChannelRatio::normalized_ratio, OPENMS_LOG_INFO, DefaultParamHandler::param_, MS1LabeledRatioQuantifier::peptide_ratios_, MS1LabeledRatioQuantifier::protein_group_ratios_, MS1LabeledRatioQuantifier::ChannelRatio::ratio, MS1LabeledRatioQuantifier::ChannelRatio::requantified_count, MS1LabeledRatioQuantifier::REQUANTIFIED_LABELS, MS1LabeledRatioQuantifier::REQUANTIFIED_RUNS, MS1LabeledRatioQuantifier::run(), MetaInfoDescription::setName(), MS1LabeledRatioQuantifier::ChannelRatio::targeted_count, MS1LabeledRatioQuantifier::TARGETED_RUNS, and ParamValue::toBool().

Referenced by MS1LabeledRatioQuantifier::run().

Member Data Documentation

◆ peptide_ratios_

std::map<AASequence, std::vector<ChannelRatio> > peptide_ratios_
protected

◆ protein_group_ratios_

std::map<std::string, std::vector<ChannelRatio> > protein_group_ratios_
protected

◆ REQUANTIFIED_LABELS

const std::string REQUANTIFIED_LABELS = "MS1Label:requantified_labels"
inlinestatic

◆ REQUANTIFIED_RUNS

const std::string REQUANTIFIED_RUNS = "MS1Label:requantified_runs"
inlinestatic

Parallel meta values (StringList, IntList) of a consensus feature: the runs (file basenames) and channels (labels) whose channel was not detected but re-quantified at its expected position (MS1LabeledWorkflow's '-requantify')

Referenced by MS1LabeledRatioQuantifier::run().

◆ TARGETED_RUNS

const std::string TARGETED_RUNS = "MS1Label:targeted_runs"
inlinestatic

Meta value (StringList) of a consensus feature: the runs (file basenames) in which it was measured by targeted quantification.

Referenced by MS1LabeledRatioQuantifier::run().