File: tutorial_metadata.html

package info (click to toggle)
openms 1.11.1-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 436,688 kB
  • ctags: 150,907
  • sloc: cpp: 387,126; xml: 71,547; python: 7,764; ansic: 2,626; php: 2,499; sql: 737; ruby: 342; sh: 325; makefile: 128
file content (115 lines) | stat: -rw-r--r-- 7,151 bytes parent folder | download
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
104
105
106
107
108
109
110
111
112
113
114
115
<HTML>
<HEAD>
<TITLE>How meta data is stored</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> &nbsp;&middot;
<A href="classes.html">Classes</A> &nbsp;&middot;
<A href="annotated.html">Annotated Classes</A> &nbsp;&middot;
<A href="modules.html">Modules</A> &nbsp;&middot;
<A href="functions_func.html">Members</A> &nbsp;&middot;
<A href="namespaces.html">Namespaces</A> &nbsp;&middot;
<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">How meta data is stored </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The meta informations about an HPLC-MS experiment are stored in <em>ExperimentalSettings</em> and <em>SpectrumSettings</em>. All information that is not covered by these classes can be stored in the type-name-value datastructure <em>MetaInfo</em>. All classes described in this section can be found in the <em>METADATA</em> folder.</p>
<h1><a class="anchor" id="metadata_metainfo"></a>
MetaInfo</h1>
<p><em>DataValue</em> is a data structure that can store any numerical or string information. It also supports casting of the stored value back to its original type.</p>
<p><em>MetaInfo</em> is used to easily store information of any type, that does not fit into the the other classes. It implements type-name-value triplets. The main datastructure is an associative container that stores <em>DataValue</em> instances as values associated to string keys. Internally, the string keys are converted to integer keys for performance resaons i.e. a <em>map&lt;UInt,DataValue&gt;</em> is used.</p>
<p>The <em>MetaInfoRegistry</em> associates the string keys used in <em>MetaValue</em> with the integer values that are used for internal storage. The <em>MetaInfoRegistry</em> is a singleton.</p>
<p>If you want a class to have a <em>MetaInfo</em> member, simply derive it from <em>MetaInfoInterface</em>. This class provides a <em>MetaInfo</em> member and the interface to access it.</p>
<div class="image">
<img src="MetaInfo.png" alt="MetaInfo.png"/>
<div class="caption">
The classes involved in meta information storage</div></div>
 <p>The following example (Tutorial_MetaInfo.C) shows how to use <em>Metadata</em>. We can simply set values for the string keys, and <em>setMetaValue</em> registers these names automatically. In order to access the values, we can either use the registered name or the index of the name. The <em>getMetaValue</em> method returns a <em>DataValue</em>, which has to be casted to the right type. If you do not know the type, you can use the <em>DataValue::valueType()</em> method.  <div class="fragment"><div class="line"><a class="code" href="classInt.html">Int</a> <a class="code" href="RNPxl_8C.html#a217dbf8b442f20279ea00b898af96f52">main</a>()</div>
<div class="line">{</div>
<div class="line">  MetaInfoInterface info;</div>
<div class="line"></div>
<div class="line">  <span class="comment">//insert meta data</span></div>
<div class="line">  info.setMetaValue(<span class="stringliteral">&quot;color&quot;</span>, String(<span class="stringliteral">&quot;#ff0000&quot;</span>));</div>
<div class="line">  info.setMetaValue(<span class="stringliteral">&quot;id&quot;</span>, 112131415);</div>
<div class="line"></div>
<div class="line">  <span class="comment">//access id by index</span></div>
<div class="line">  <a class="code" href="group__Concept.html#gaba0996d26f7be2572973245b51852757">UInt</a> id_index = info.metaRegistry().getIndex(<span class="stringliteral">&quot;id&quot;</span>);</div>
<div class="line">  cout &lt;&lt; <span class="stringliteral">&quot;id   : &quot;</span> &lt;&lt; (<a class="code" href="group__Concept.html#gaba0996d26f7be2572973245b51852757">UInt</a>)(info.getMetaValue(id_index)) &lt;&lt; endl;</div>
<div class="line">  <span class="comment">//access color by name</span></div>
<div class="line">  cout &lt;&lt; <span class="stringliteral">&quot;color: &quot;</span> &lt;&lt; (String)(info.getMetaValue(<span class="stringliteral">&quot;color&quot;</span>)) &lt;&lt; endl;</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="metadata_experiment"></a>
Meta data of a map</h1>
<p>This class holds meta information about the experiment that is valid for the whole experiment:</p>
<ul>
<li>sample description</li>
<li>source files</li>
<li>contact persons</li>
<li>MS instrument</li>
<li>HPLC settings</li>
<li>protein identifications</li>
</ul>
<div class="image">
<img src="ExperimentalSettings.png" alt="ExperimentalSettings.png"/>
<div class="caption">
Map meta information</div></div>
 <h1><a class="anchor" id="metadata_spectrum"></a>
Meta data of a spectrum</h1>
<p>This class contains meta information about settings specific to one spectrum:</p>
<ul>
<li>spectrum-specific instrument settings</li>
<li>source file</li>
<li>information on the acquisition</li>
<li>precursor information (e.g. for MS/MS spectra)</li>
<li>product information (e.g. for SRM spectra)</li>
<li>processing performed on the data</li>
<li>peptide identifications</li>
</ul>
<div class="image">
<img src="SpectrumSettings.png" alt="SpectrumSettings.png"/>
<div class="caption">
Spectrum meta information</div></div>
 <h1><a class="anchor" id="metadata_peaks"></a>
Meta data associated to peaks</h1>
<p>If you want to annotate the peaks or raw data points in your spectra with meta information, there are three different ways to do this with different advantages and disadvantages.</p>
<p>If each peak is annotated with the same type of information (e.g. width of a peak):</p>
<ul>
<li>Use the meta data arrays provided by MSSpectrum (recommended)<ul>
<li>Advantages: Independent of peak type, information automatically stored in mzML files</li>
<li>Disadvantages: Information can be accessed through index only</li>
</ul>
</li>
<li>Derive a new peak type that contains members for the additional information<ul>
<li>Advantages: Very fast</li>
<li>Disadvantages: Information not automatically stored in mzML files, Custom peak type are not supported by all algorithms</li>
</ul>
</li>
</ul>
<p>If you need to annotate only a small subset of the peaks with meta information:</p>
<ul>
<li>Use the MetaInfoInterface of RichPeak1D<ul>
<li>Advantages: Each peak can be annotated with individual information</li>
<li>Disadvantages: Quite slow, Information not automatically stored in mzML files </li>
</ul>
</li>
</ul>
</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>