OpenMS  2.5.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ExperimentalDesign Class Reference

Representation of the Experimental Design in OpenMS. Instances can be loaded via the ExperimentalDesignFile class. More...

#include <OpenMS/METADATA/ExperimentalDesign.h>

Classes

class  MSFileSectionEntry
 
class  SampleSection
 

Public Types

using MSFileSection = std::vector< MSFileSectionEntry >
 

Public Member Functions

 ExperimentalDesign ()=default
 
 ExperimentalDesign (const MSFileSection &msfile_section, const SampleSection &sample_section)
 
const MSFileSectiongetMSFileSection () const
 
void setMSFileSection (const MSFileSection &msfile_section)
 
const ExperimentalDesign::SampleSectiongetSampleSection () const
 
void setSampleSection (const SampleSection &sample_section)
 
std::map< std::vector< String >, std::set< unsigned > > getUniqueSampleRowToSampleMapping () const
 
std::map< unsigned, unsigned > getSampleToPrefractionationMapping () const
 
std::map< unsigned int, std::vector< String > > getFractionToMSFilesMapping () const
 return fraction index to file paths (ordered by fraction_group) More...
 
std::vector< std::vector< std::pair< String, unsigned > > > getConditionToPathLabelVector () const
 
std::map< std::vector< String >, std::set< unsigned > > getConditionToSampleMapping () const
 return a condition (unique combination of sample section values except replicate) to Sample index mapping More...
 
std::map< std::pair< String, unsigned >, unsigned > getPathLabelToPrefractionationMapping (bool use_basename_only) const
 
std::map< std::pair< String, unsigned >, unsigned > getPathLabelToConditionMapping (bool use_basename_only) const
 
std::map< unsigned, unsigned > getSampleToConditionMapping () const
 
std::map< std::pair< String, unsigned >, unsigned > getPathLabelToSampleMapping (bool use_basename_only) const
 return <file_path, label> to sample mapping More...
 
std::map< std::pair< String, unsigned >, unsigned > getPathLabelToFractionMapping (bool use_basename_only) const
 return <file_path, label> to fraction mapping More...
 
std::map< std::pair< String, unsigned >, unsigned > getPathLabelToFractionGroupMapping (bool use_basename_only) const
 return <file_path, label> to fraction_group mapping More...
 
unsigned getNumberOfSamples () const
 
unsigned getNumberOfFractions () const
 
unsigned getNumberOfLabels () const
 
unsigned getNumberOfMSFiles () const
 
unsigned getNumberOfFractionGroups () const
 
unsigned getSample (unsigned fraction_group, unsigned label=1)
 
bool isFractionated () const
 
bool sameNrOfMSFilesPerFraction () const
 

Static Public Member Functions

static ExperimentalDesign fromConsensusMap (const ConsensusMap &c)
 Extract experimental design from consensus map. More...
 
static ExperimentalDesign fromFeatureMap (const FeatureMap &f)
 Extract experimental design from feature map. More...
 
static ExperimentalDesign fromIdentifications (const std::vector< ProteinIdentification > &proteins)
 Extract experimental design from identifications. More...
 

Private Member Functions

std::vector< StringgetFileNames_ (bool basename) const
 
std::vector< unsigned > getLabels_ () const
 
std::vector< unsigned > getFractions_ () const
 
std::map< std::pair< String, unsigned >, unsigned > pathLabelMapper_ (bool, unsigned(*f)(const ExperimentalDesign::MSFileSectionEntry &)) const
 Generic Mapper (Path, Label) -> f(row) More...
 
void sort_ ()
 
void isValid_ ()
 

Static Private Member Functions

template<typename T >
static void errorIfAlreadyExists (std::set< T > &container, T &item, const String &message)
 

Private Attributes

MSFileSection msfile_section_
 
SampleSection sample_section_
 

Detailed Description

Representation of the Experimental Design in OpenMS. Instances can be loaded via the ExperimentalDesignFile class.

The experimental design in OpenMS consists of two sections: 1. FileSection captures the mapping of quantitative values to files and, optionally, to samples. 2. SampleSection captures the experimental factors and conditions associated with a sample.

The FileSection is mandatory while the SampleSection is optional and only required for downstream analysis.

Details on the FileSection:

To unambiguously map a single quantitative value we need to define: a. the label (e.g., label = 2 in the case of a heavy peptide in a light/heavy experiment) b. which spectra file did produce the result (e.g., path = "/data/SILAC_file.mzML") c. which fraction the file corresponds to (e.g., fraction = 1) d. a fraction group identifier that groups fractions (e.g., fraction_group = 1) Note: in the case of label-free data, the fraction group identifier has the same cardinality as the sample identifier. (e.) optionally, the sample that has been measured (e.g., sample = 1)

This information is defined in the FileSection and enables fraction aware data processing.

Details on the SampleSection:

To map a sample to conditions / factors we need to define: a. the sample ( e.g., sample = 1) b. multiple columns containing conditions / factors

Member Typedef Documentation

◆ MSFileSection

using MSFileSection = std::vector<MSFileSectionEntry>

Constructor & Destructor Documentation

◆ ExperimentalDesign() [1/2]

ExperimentalDesign ( )
default

◆ ExperimentalDesign() [2/2]

ExperimentalDesign ( const MSFileSection msfile_section,
const SampleSection sample_section 
)

Member Function Documentation

◆ errorIfAlreadyExists()

static void errorIfAlreadyExists ( std::set< T > &  container,
T &  item,
const String message 
)
staticprivate

◆ fromConsensusMap()

static ExperimentalDesign fromConsensusMap ( const ConsensusMap c)
static

Extract experimental design from consensus map.

◆ fromFeatureMap()

static ExperimentalDesign fromFeatureMap ( const FeatureMap f)
static

Extract experimental design from feature map.

◆ fromIdentifications()

static ExperimentalDesign fromIdentifications ( const std::vector< ProteinIdentification > &  proteins)
static

Extract experimental design from identifications.

◆ getConditionToPathLabelVector()

std::vector<std::vector<std::pair<String, unsigned> > > getConditionToPathLabelVector ( ) const

return vector of filepath/label combinations that share the same conditions after removing replicate columns in the sample section (e.g. for merging across replicates)

◆ getConditionToSampleMapping()

std::map<std::vector<String>, std::set<unsigned> > getConditionToSampleMapping ( ) const

return a condition (unique combination of sample section values except replicate) to Sample index mapping

◆ getFileNames_()

std::vector< String > getFileNames_ ( bool  basename) const
private

◆ getFractions_()

std::vector<unsigned> getFractions_ ( ) const
private

◆ getFractionToMSFilesMapping()

std::map<unsigned int, std::vector<String> > getFractionToMSFilesMapping ( ) const

return fraction index to file paths (ordered by fraction_group)

◆ getLabels_()

std::vector<unsigned> getLabels_ ( ) const
private

◆ getMSFileSection()

const MSFileSection& getMSFileSection ( ) const

◆ getNumberOfFractionGroups()

unsigned getNumberOfFractionGroups ( ) const

◆ getNumberOfFractions()

unsigned getNumberOfFractions ( ) const

◆ getNumberOfLabels()

unsigned getNumberOfLabels ( ) const

◆ getNumberOfMSFiles()

unsigned getNumberOfMSFiles ( ) const

◆ getNumberOfSamples()

unsigned getNumberOfSamples ( ) const

◆ getPathLabelToConditionMapping()

std::map< std::pair< String, unsigned >, unsigned> getPathLabelToConditionMapping ( bool  use_basename_only) const

return <file_path, label> to condition mapping (a condition is a unique combination of all columns in the sample section, except for replicates.

◆ getPathLabelToFractionGroupMapping()

std::map< std::pair< String, unsigned >, unsigned> getPathLabelToFractionGroupMapping ( bool  use_basename_only) const

return <file_path, label> to fraction_group mapping

◆ getPathLabelToFractionMapping()

std::map< std::pair< String, unsigned >, unsigned> getPathLabelToFractionMapping ( bool  use_basename_only) const

return <file_path, label> to fraction mapping

◆ getPathLabelToPrefractionationMapping()

std::map< std::pair< String, unsigned >, unsigned> getPathLabelToPrefractionationMapping ( bool  use_basename_only) const

return <file_path, label> to prefractionation mapping (a prefractionation group is a unique combination of all columns in the sample section, except for replicates.

◆ getPathLabelToSampleMapping()

std::map< std::pair< String, unsigned >, unsigned> getPathLabelToSampleMapping ( bool  use_basename_only) const

return <file_path, label> to sample mapping

◆ getSample()

unsigned getSample ( unsigned  fraction_group,
unsigned  label = 1 
)

◆ getSampleSection()

const ExperimentalDesign::SampleSection& getSampleSection ( ) const

◆ getSampleToConditionMapping()

std::map<unsigned, unsigned> getSampleToConditionMapping ( ) const

return Sample index to condition mapping (a condition is a unique combination of all columns in the sample section, except for replicates. Numbering of conditions is alphabetical due to map.

◆ getSampleToPrefractionationMapping()

std::map<unsigned, unsigned> getSampleToPrefractionationMapping ( ) const

uses getUniqueSampleRowToSampleMapping to get the reversed map mapping sample ID to a real unique sample

◆ getUniqueSampleRowToSampleMapping()

std::map<std::vector<String>, std::set<unsigned> > getUniqueSampleRowToSampleMapping ( ) const

returns a map from a sample section row to sample id to cluster duplicate sample rows (e.g. to find all fractions of the same "sample")

◆ isFractionated()

bool isFractionated ( ) const
Returns
whether we have a fractionated design

◆ isValid_()

void isValid_ ( )
private

◆ pathLabelMapper_()

std::map< std::pair< String, unsigned >, unsigned> pathLabelMapper_ ( bool  ,
unsigned(*)(const ExperimentalDesign::MSFileSectionEntry &)  f 
) const
private

Generic Mapper (Path, Label) -> f(row)

◆ sameNrOfMSFilesPerFraction()

bool sameNrOfMSFilesPerFraction ( ) const
Returns
whether all fraction groups have the same number of fractions

◆ setMSFileSection()

void setMSFileSection ( const MSFileSection msfile_section)

◆ setSampleSection()

void setSampleSection ( const SampleSection sample_section)

◆ sort_()

void sort_ ( )
private

Member Data Documentation

◆ msfile_section_

MSFileSection msfile_section_
private

◆ sample_section_

SampleSection sample_section_
private