Representation of an experimental design in OpenMS. Instances can be loaded with 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 MSFileSection & | getMSFileSection () const |
void | setMSFileSection (const MSFileSection &msfile_section) |
const ExperimentalDesign::SampleSection & | getSampleSection () const |
void | setSampleSection (const SampleSection &sample_section) |
std::map< std::vector< String >, std::set< String > > | getUniqueSampleRowToSampleMapping () const |
std::map< String, 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< String, unsigned > | getSampleToConditionMapping () const |
std::map< std::pair< String, unsigned >, unsigned > | getPathLabelToSampleMapping (bool use_basename_only) const |
return <file_path, label> to sample index 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 |
Size | filterByBasenames (const std::set< String > &bns) |
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< String > | getFileNames_ (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_ |
Representation of an experimental design in OpenMS. Instances can be loaded with the ExperimentalDesignFile class.
Experimental designs can be provided in two formats: the one-table format and the two-table format.
The one-table format is simpler but slightly more redundant.
The one-table format consists of mandatory (file columns) and optional sample metadata (sample columns).
The mandatory file columns are Fraction_Group, Fraction, Spectra_Filepath and Label. These columns capture the mapping of quantitative values to files for label-free and multiplexed experiments and enables fraction-aware data processing.
For processing with MSstats, the optional sample columns are typically MSstats_Condition and MSstats_BioReplicate with an additional MSstats_Mixture column in the case of TMT labeling. They capture the experimental factors and conditions associated with a sample.
For details on the MSstats columns please refer to the MSstats manual for details (https://www.bioconductor.org/packages/release/bioc/vignettes/MSstats/inst/doc/MSstats.html).
Fraction_Group | Fraction | Spectra_Filepath | Label | MSstats_Condition | MSstats_BioReplicate |
---|---|---|---|---|---|
1 | 1 | UPS1_12500amol_R1.mzML | 1 | 12500 amol | 1 |
2 | 1 | UPS1_12500amol_R2.mzML | 1 | 12500 amol | 2 |
3 | 1 | UPS1_12500amol_R3.mzML | 1 | 12500 amol | 3 |
... | ... | ... | ... | ... | ... |
22 | 1 | UPS1_500amol_R1.mzML | 1 | 500 amol | 1 |
23 | 1 | UPS1_500amol_R2.mzML | 1 | 500 amol | 2 |
24 | 1 | UPS1_500amol_R3.mzML | 1 | 500 amol | 3 |
Alternatively, the experimental design can be specified with a file consisting of two tables whose headers are separated by a blank line. The two tables are:
The sample section consists of columns Sample, MSstats_Condition and MSstats_BioReplicate.
The content is the same as described for the one table format, except that the additional numeric sample column allows referencing between file and sample section.
Fraction_Group | Fraction | Spectra_Filepath | Label | Sample |
---|---|---|---|---|
1 | 1 | UPS1_12500amol_R1.mzML | 1 | 1 |
2 | 1 | UPS1_12500amol_R2.mzML | 1 | 2 |
... | ... | ... | ... | ... |
22 | 1 | UPS1_500amol_R1.mzML | 1 | 22 |
Sample | MSstats_Condition | MSstats_BioReplicate |
---|---|---|
1 | 12500 amol | 1 |
2 | 12500 amol | 2 |
... | ... | ... |
22 | 500 amol | 3 |
using MSFileSection = std::vector<MSFileSectionEntry> |
|
default |
ExperimentalDesign | ( | const MSFileSection & | msfile_section, |
const SampleSection & | sample_section | ||
) |
|
staticprivate |
filters the MSFileSection to only include a given subset of files whose basenames are given with bns
|
static |
Extract experimental design from consensus map.
|
static |
Extract experimental design from feature map.
|
static |
Extract experimental design from identifications.
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)
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
|
private |
|
private |
std::map<unsigned int, std::vector<String> > getFractionToMSFilesMapping | ( | ) | const |
return fraction index to file paths (ordered by fraction_group)
|
private |
const MSFileSection& getMSFileSection | ( | ) | const |
unsigned getNumberOfFractionGroups | ( | ) | const |
unsigned getNumberOfFractions | ( | ) | const |
unsigned getNumberOfLabels | ( | ) | const |
unsigned getNumberOfMSFiles | ( | ) | const |
unsigned getNumberOfSamples | ( | ) | const |
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.
std::map< std::pair< String, unsigned >, unsigned> getPathLabelToFractionGroupMapping | ( | bool | use_basename_only | ) | const |
return <file_path, label> to fraction_group mapping
std::map< std::pair< String, unsigned >, unsigned> getPathLabelToFractionMapping | ( | bool | use_basename_only | ) | const |
return <file_path, label> to fraction mapping
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.
std::map< std::pair< String, unsigned >, unsigned> getPathLabelToSampleMapping | ( | bool | use_basename_only | ) | const |
return <file_path, label> to sample index mapping
unsigned getSample | ( | unsigned | fraction_group, |
unsigned | label = 1 |
||
) |
const ExperimentalDesign::SampleSection& getSampleSection | ( | ) | const |
std::map<String, unsigned> getSampleToConditionMapping | ( | ) | const |
return Sample name 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.
std::map<String, unsigned> getSampleToPrefractionationMapping | ( | ) | const |
uses getUniqueSampleRowToSampleMapping to get the reversed map mapping sample ID to a real unique sample
returns a map from a sample section row to sample id for clustering duplicate sample rows (e.g. to find all fractions of the same "sample")
bool isFractionated | ( | ) | const |
|
private |
|
private |
Generic Mapper (Path, Label) -> f(row)
bool sameNrOfMSFilesPerFraction | ( | ) | const |
void setMSFileSection | ( | const MSFileSection & | msfile_section | ) |
void setSampleSection | ( | const SampleSection & | sample_section | ) |
|
private |
|
private |
|
private |