Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Feature grouping

Based on the features found during the Feature detection, quantitation can be performed. OpenMS offers a number of feature grouping algorithms. The take one or several feature maps and group feature in one map or across maps, depending on the algorithm.

The classes described in this section can be found in the ANALYSIS/MAPMATCHING folder.

All feature grouping algorithms are derived from the common base class FeatureGroupingAlgorithm and, thus, share a common interface. Currently two algorithms are implemented. One for isotope-labeled experiments with two labels and another for label-free quantitation.

Feature grouping for label-free quantitation

The first example shows the label-free quantitation (Tutorial_Unlabeled.cpp):

First, we load two feature maps:

int main(int argc, const char** argv)
{
if (argc < 2) return 1;
// the path to the data should be given on the command line
String tutorial_data_path(argv[1]);
vector<FeatureMap > maps;
maps.resize(2);
FeatureXMLFile feature_file;
feature_file.load(tutorial_data_path + "/data/Tutorial_Unlabeled_1.featureXML", maps[0]);
feature_file.load(tutorial_data_path + "/data/Tutorial_Unlabeled_2.featureXML", maps[1]);

In order to write the a valid output file, we need to set the input file names and sizes.

ConsensusMap out;
out.getFileDescriptions()[0].filename = "/data/Tutorial_Unlabeled_1.featureXML";
out.getFileDescriptions()[0].size = maps[0].size();
out.getFileDescriptions()[1].filename = "/data/Tutorial_Unlabeled_2.featureXML";
out.getFileDescriptions()[1].size = maps[1].size();

Then, we instantiate the algorithm and group the features:

FeatureGroupingAlgorithmUnlabeled algorithm;
// ... set parameters
algorithm.group(maps, out);

Finally, we store the grouped features in a consensusXML file.

ConsensusXMLFile consensus_file;
consensus_file.store("Tutorial_Unlabeled.consensusXML", out);
return 0;
} //end of main

Feature grouping for isotope-labeled quantitation

The second example shows the isotope-labeled quantitation (Tutorial_Labeled.cpp):

First, we load the feature map:

int main(int argc, const char** argv)
{
if (argc < 2) return 1;
// the path to the data should be given on the command line
String tutorial_data_path(argv[1]);
vector<FeatureMap > maps;
maps.resize(1);
FeatureXMLFile feature_file;
feature_file.load(tutorial_data_path + "/data/Tutorial_Labeled.featureXML", maps[0]);

The isotope-labeled quantitation finds two types of features in the same map (heavy and light variant). So we add two map descriptions with the same file name to the output and set the labels accordingly:

ConsensusMap out;
out.getFileDescriptions()[0].filename = "data/Tutorial_Labeled.featureXML";
out.getFileDescriptions()[0].size = maps[0].size();
out.getFileDescriptions()[0].label = "light";
out.getFileDescriptions()[1].filename = "data/Tutorial_Labeled.featureXML";
out.getFileDescriptions()[1].size = maps[0].size();
out.getFileDescriptions()[1].label = "heavy";

Then, we instantiate the algorithm and group the features:

FeatureGroupingAlgorithmLabeled algorithm;
// ... set parameters
algorithm.group(maps, out);

Finally, we store the grouped features in a consensusXML file. In order to write a valid file, we need to set the input file names and sizes.

ConsensusXMLFile consensus_file;
consensus_file.store("Tutorial_Labeled.consensusXML", out);
return 0;
} //end of main


OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:05 using doxygen 1.8.13