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

#include <OpenMS/FORMAT/ProteinGroupArrowExport_impl.h>

Public Member Functions

 QuantificationUnits ()=default
 
 QuantificationUnits (const ExperimentalDesign &design, const std::set< std::pair< std::string, unsigned > > &known_cells)
 
bool empty () const
 
bool inconsistent () const
 A design assigning one (run, label) to several samples; the rows would be wrong.
 
const std::string & ambiguousLabel () const
 Non-empty when one label of a unit means several samples; the row cannot be written.
 
const std::string & raggedUnit () const
 Non-empty when a unit's runs do not all carry every label it publishes.
 
const std::set< std::string > & droppedRuns () const
 Design files the ConsensusMap has no column header for, left out of every unit.
 
const std::string & missingCell () const
 Non-empty when a run that IS in the map lacks a header for a label the design declares.
 
const std::string & invalidSample () const
 Non-empty when a design row refers outside its sample section.
 
const std::string & runInSeveralGroups () const
 Non-empty when one run is assigned to multiple fraction groups.
 
const std::vector< QuantUnit > & units () const
 
size_t indexOf (const std::string &run) const
 Index of the unit containing run, or units().size() when the design does not list it.
 
template<typename LabelFor >
bool resolveLabels (LabelFor label_for, const std::string &context)
 

Private Attributes

std::vector< QuantUnit > units_
 
std::unordered_map< std::string, size_t > unit_of_run_
 
std::set< std::string > dropped_runs_
 
std::string missing_cell_
 
std::string ambiguous_label_
 
std::string ragged_unit_
 
std::string invalid_sample_
 
std::string run_in_several_groups_
 
bool inconsistent_ = false
 

Detailed Description

The quantification units of an experimental design, indexed by run name.

Active QPX 1.1 defines OpenMS fraction_group as grouped_runs: all files in one fraction group form one quantity, and label is the orthogonal channel dimension. A sample may occur in several fraction groups (technical replicates or a shared reference) without joining them. PeptideAndProteinQuant preserves quantities at exactly this grain before protein aggregation.

Constructor & Destructor Documentation

◆ QuantificationUnits() [1/2]

QuantificationUnits ( )
default

◆ QuantificationUnits() [2/2]

QuantificationUnits ( const ExperimentalDesign &  design,
const std::set< std::pair< std::string, unsigned > > &  known_cells 
)
inline
Parameters
designthe design that drove quantification
known_cellsthe (QPX run name, label) cells the ConsensusMap has a column header for. A design row for a file that is not in the map contributed nothing, so naming it in grouped_runs would claim an aggregation that did not happen – and would put a run in the pg view that the psm and feature views cannot join to.

The set holds CELLS, not runs, because the two absences mean different things:

  • a run with NO cell at all is simply not part of this map – a design listing files beyond the current input, which ProteomicsLFQ produces routinely by filtering the design by basename. Dropped, with a diagnostic.
  • a run that IS present but whose declared label has no header means the design and the data disagree about the channel layout – a TMT10-shaped design against a 6-plex map, say. Reading that cell would invent an intensity label ("LFQ" for channel 1, otherwise the bare channel number) that joins to nothing, so it is recorded and refused instead.

< this run's label -> sample

References QuantificationUnits::ambiguous_label_, QuantUnit::channels, QuantificationUnits::dropped_runs_, QuantUnit::fraction_group, ExperimentalDesign::getMSFileSection(), ExperimentalDesign::getNumberOfSamples(), QuantificationUnits::inconsistent_, QuantificationUnits::invalid_sample_, QuantificationUnits::missing_cell_, OpenMS::ArrowIOHelpers::qpxRunFileName(), QuantificationUnits::ragged_unit_, QuantificationUnits::run_in_several_groups_, QuantUnit::runs, QuantificationUnits::unit_of_run_, and QuantificationUnits::units_.

Member Function Documentation

◆ ambiguousLabel()

const std::string & ambiguousLabel ( ) const
inline

Non-empty when one label of a unit means several samples; the row cannot be written.

References QuantificationUnits::ambiguous_label_.

◆ droppedRuns()

const std::set< std::string > & droppedRuns ( ) const
inline

Design files the ConsensusMap has no column header for, left out of every unit.

References QuantificationUnits::dropped_runs_.

◆ empty()

bool empty ( ) const
inline

◆ inconsistent()

bool inconsistent ( ) const
inline

A design assigning one (run, label) to several samples; the rows would be wrong.

References QuantificationUnits::inconsistent_.

◆ indexOf()

size_t indexOf ( const std::string &  run) const
inline

Index of the unit containing run, or units().size() when the design does not list it.

References QuantificationUnits::unit_of_run_, and QuantificationUnits::units_.

◆ invalidSample()

const std::string & invalidSample ( ) const
inline

Non-empty when a design row refers outside its sample section.

References QuantificationUnits::invalid_sample_.

◆ missingCell()

const std::string & missingCell ( ) const
inline

Non-empty when a run that IS in the map lacks a header for a label the design declares.

References QuantificationUnits::missing_cell_.

◆ raggedUnit()

const std::string & raggedUnit ( ) const
inline

Non-empty when a unit's runs do not all carry every label it publishes.

References QuantificationUnits::ragged_unit_.

◆ resolveLabels()

template<typename LabelFor >
bool resolveLabels ( LabelFor  label_for,
const std::string &  context 
)
inline

Fill in every channel's QPX intensity label from label_for(run, channel_number).

Every run in a fraction group must agree on the canonical QPX label for a numeric channel.

Returns
false if a channel cannot be named, two runs disagree, or two channels resolve to the same QPX label; the caller must refuse.

References OPENMS_LOG_ERROR, and QuantificationUnits::units_.

◆ runInSeveralGroups()

const std::string & runInSeveralGroups ( ) const
inline

Non-empty when one run is assigned to multiple fraction groups.

References QuantificationUnits::run_in_several_groups_.

◆ units()

const std::vector< QuantUnit > & units ( ) const
inline

Member Data Documentation

◆ ambiguous_label_

std::string ambiguous_label_
private

◆ dropped_runs_

std::set<std::string> dropped_runs_
private

◆ inconsistent_

bool inconsistent_ = false
private

◆ invalid_sample_

std::string invalid_sample_
private

◆ missing_cell_

std::string missing_cell_
private

◆ ragged_unit_

std::string ragged_unit_
private

◆ run_in_several_groups_

std::string run_in_several_groups_
private

◆ unit_of_run_

std::unordered_map<std::string, size_t> unit_of_run_
private

◆ units_