1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
<HTML>
<HEAD>
<TITLE>Feature grouping</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
<LINK HREF="style_ini.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A href="index.html">Home</A> ·
<A href="classes.html">Classes</A> ·
<A href="annotated.html">Annotated Classes</A> ·
<A href="modules.html">Modules</A> ·
<A href="functions_func.html">Members</A> ·
<A href="namespaces.html">Namespaces</A> ·
<A href="pages.html">Related Pages</A>
<HR style="height:1px; border:none; border-top:1px solid #c0c0c0;">
<!-- Generated by Doxygen 1.8.5 -->
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Feature grouping </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Based on the features found during the <a class="el" href="tutorial_transformations.html#transformations_ff">Feature detection</a>, 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.</p>
<p>The classes described in this section can be found in the <em>ANALYSIS/MAPMATCHING</em> folder.</p>
<p>All feature grouping algorithms are derived from the common base class <em>FeatureGroupingAlgorithm</em> 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.</p>
<h1><a class="anchor" id="tutorial_featuregrouping_unlabeled"></a>
Feature grouping for label-free quantitation</h1>
<p>The first example shows the label-free quantitation (Tutorial_Unlabeled.C):</p>
<p>First, we load two feature maps: <div class="fragment"><div class="line"><span class="keywordtype">int</span> <a class="code" href="RNPxl_8C.html#a217dbf8b442f20279ea00b898af96f52">main</a>(<span class="keywordtype">int</span> argc, <span class="keyword">const</span> <span class="keywordtype">char</span>** argv)</div>
<div class="line">{</div>
<div class="line"> <span class="keywordflow">if</span> (argc < 2) <span class="keywordflow">return</span> 1;</div>
<div class="line"> <span class="comment">// the path to the data should be given on the command line</span></div>
<div class="line"> String tutorial_data_path(argv[1]);</div>
<div class="line"> </div>
<div class="line"> vector<FeatureMap<> > maps;</div>
<div class="line"> maps.resize(2);</div>
<div class="line"></div>
<div class="line"> FeatureXMLFile feature_file;</div>
<div class="line"> feature_file.load(tutorial_data_path + <span class="stringliteral">"/data/Tutorial_Unlabeled_1.featureXML"</span>, maps[0]);</div>
<div class="line"> feature_file.load(tutorial_data_path + <span class="stringliteral">"/data/Tutorial_Unlabeled_2.featureXML"</span>, maps[1]);</div>
</div><!-- fragment --></p>
<p>In order to write the a valid output file, we need to set the input file names and sizes. <div class="fragment"><div class="line"></div>
<div class="line"> ConsensusMap out;</div>
<div class="line"> out.getFileDescriptions()[0].filename = <span class="stringliteral">"/data/Tutorial_Unlabeled_1.featureXML"</span>;</div>
<div class="line"> out.getFileDescriptions()[0].size = maps[0].size();</div>
<div class="line"> out.getFileDescriptions()[1].filename = <span class="stringliteral">"/data/Tutorial_Unlabeled_2.featureXML"</span>;</div>
<div class="line"> out.getFileDescriptions()[1].size = maps[1].size();</div>
</div><!-- fragment --></p>
<p>Then, we instanciate the algorithm and group the features: <div class="fragment"><div class="line"></div>
<div class="line"> FeatureGroupingAlgorithmUnlabeled algorithm;</div>
<div class="line"> <span class="comment">// ... set parameters</span></div>
<div class="line"> algorithm.group(maps, out);</div>
</div><!-- fragment --></p>
<p>Finally, we store the grouped features in a consensusXML file. <div class="fragment"><div class="line"> ConsensusXMLFile consensus_file;</div>
<div class="line"> consensus_file.store(<span class="stringliteral">"Tutorial_Unlabeled.consensusXML"</span>, out);</div>
<div class="line"></div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">} <span class="comment">//end of main</span></div>
</div><!-- fragment --></p>
<h1><a class="anchor" id="tutorial_featuregrouping_labeled"></a>
Feature grouping for isotope-labeled quantitation</h1>
<p>The second example shows the isotope-labeled quantitation (Tutorial_Labeled.C):</p>
<p>First, we load the feature map: <div class="fragment"><div class="line"><span class="keywordtype">int</span> <a class="code" href="RNPxl_8C.html#a217dbf8b442f20279ea00b898af96f52">main</a>(<span class="keywordtype">int</span> argc, <span class="keyword">const</span> <span class="keywordtype">char</span>** argv)</div>
<div class="line">{</div>
<div class="line"> <span class="keywordflow">if</span> (argc < 2) <span class="keywordflow">return</span> 1;</div>
<div class="line"> <span class="comment">// the path to the data should be given on the command line</span></div>
<div class="line"> String tutorial_data_path(argv[1]);</div>
<div class="line"> </div>
<div class="line"> vector<FeatureMap<> > maps;</div>
<div class="line"> maps.resize(1);</div>
<div class="line"></div>
<div class="line"> FeatureXMLFile feature_file;</div>
<div class="line"> feature_file.load(tutorial_data_path + <span class="stringliteral">"/data/Tutorial_Labeled.featureXML"</span>, maps[0]);</div>
</div><!-- fragment --></p>
<p>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: <div class="fragment"><div class="line"> ConsensusMap out;</div>
<div class="line"> out.getFileDescriptions()[0].filename = <span class="stringliteral">"data/Tutorial_Labeled.featureXML"</span>;</div>
<div class="line"> out.getFileDescriptions()[0].size = maps[0].size();</div>
<div class="line"> out.getFileDescriptions()[0].label = <span class="stringliteral">"light"</span>;</div>
<div class="line"> out.getFileDescriptions()[1].filename = <span class="stringliteral">"data/Tutorial_Labeled.featureXML"</span>;</div>
<div class="line"> out.getFileDescriptions()[1].size = maps[0].size();</div>
<div class="line"> out.getFileDescriptions()[1].label = <span class="stringliteral">"heavy"</span>;</div>
</div><!-- fragment --></p>
<p>Then, we instanciate the algorithm and group the features: <div class="fragment"><div class="line"></div>
<div class="line"> FeatureGroupingAlgorithmLabeled algorithm;</div>
<div class="line"> <span class="comment">// ... set parameters</span></div>
<div class="line"> algorithm.group(maps, out);</div>
</div><!-- fragment --></p>
<p>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. <div class="fragment"><div class="line"> ConsensusXMLFile consensus_file;</div>
<div class="line"> consensus_file.store(<span class="stringliteral">"Tutorial_Labeled.consensusXML"</span>, out);</div>
<div class="line"></div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">} <span class="comment">//end of main</span></div>
</div><!-- fragment --> </p>
</div></div><!-- contents -->
<HR style="height:1px; border:none; border-top:1px solid #c0c0c0;">
<TABLE width="100%" border="0">
<TR>
<TD><font color="#c0c0c0">OpenMS / TOPP release 1.11.1</font></TD>
<TD align="right"><font color="#c0c0c0">Documentation generated on Thu Nov 14 2013 11:19:24 using doxygen 1.8.5</font></TD>
</TR>
</TABLE>
</BODY>
</HTML>
|