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
|
<HTML>
<HEAD>
<TITLE>Chemistry</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">Chemistry </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Especially for peptide/protein identification, a lot of data and data structures for chemical entities are needed. <a class="el" href="namespaceOpenMS.html" title="Main OpenMS namespace. ">OpenMS</a> offers classes for elements, formulas, peptides, etc. The classes described in this section can be found in the <em>CHEMISTRY</em> folder.</p>
<h1><a class="anchor" id="Elements"></a>
Elements</h1>
<p>There is a representation of Elements implemented in OpenMS. The correcsponding class is named <em>Element</em>. This class stores the relevant information about an element. The handling of the Elements is done by the class ElementDB, which is implemented as a singleton. This means there is only one instance of the class in OpenMS. This is straightforward because the Elements do not change during execution. Data stored in an Element spans its name, symbol, atomic weight, and isotope distribution beside others.</p>
<p>Example (Tutorial_Element.C):</p>
<div class="fragment"></div><!-- fragment --></p>
<p>Elements can be accessed by the <em>ElementDB</em> class. As it is implemented as a singleton, only a pointer of the singleton can be used, via <em>getInstance()</em>. The example program writes the following output to the console.</p>
<div class="fragment"><div class="line">Carbon C 12 12.0107</div>
</div><!-- fragment --><h1><a class="anchor" id="EmpiricalFormula"></a>
EmpiricalFormula</h1>
<p>The Elements described in the section above can be combined to empirical formulas. Application are the exact weights of molecules, like peptides and their isotopic distributions. The class supports a large number of operations like addition and subtraction. A simple example is given in the next few lines of code.</p>
<p>Example (Tutorial_EmpiricalFormula.C):</p>
<div class="fragment"><div class="line"> EmpiricalFormula methanol(<span class="stringliteral">"CH3OH"</span>), water(<span class="stringliteral">"H2O"</span>);</div>
<div class="line"></div>
<div class="line"> EmpiricalFormula <a class="code" href="group__MathFunctionsStatistics.html#ga55edf7ee469b3d635c367d9c83fe87f5">sum</a> = methanol + water;</div>
<div class="line"></div>
<div class="line"> cout << sum << <span class="stringliteral">" "</span></div>
<div class="line"> << sum.getNumberOf(<span class="stringliteral">"Carbon"</span>) << <span class="stringliteral">" "</span></div>
<div class="line"> << sum.getAverageWeight() << endl;</div>
</div><!-- fragment --></p>
<p>Two instances of empirical formula are created. They are summed up, and some information about the new formula is printed to the terminal. The next lines show how to create and handle a isotopic distribution of a given formula.</p>
<p><div class="fragment"><div class="line"> IsotopeDistribution iso_dist = sum.getIsotopeDistribution(3);</div>
<div class="line"></div>
<div class="line"> <span class="keywordflow">for</span> (IsotopeDistribution::ConstIterator it = iso_dist.begin(); it != iso_dist.end(); ++it)</div>
<div class="line"> {</div>
<div class="line"> cout << it->first << <span class="stringliteral">" "</span> << it->second << endl;</div>
<div class="line"> }</div>
</div><!-- fragment --></p>
<p>The isotopic distribution can be simply accessed by the <em>getIsotopeDistribution()</em> function. The parameter of this function describes how many isotopes should be reported. In our case, 3 are enough, as the following numbers get very small. On larger molecules, or when one want to have the exact distribution, this number can be set much higher. The output of the code snipped might look like this.</p>
<div class="fragment"><div class="line">O2CH6 1 50.0571</div>
<div class="line">50 0.98387</div>
<div class="line">51 0.0120698</div>
<div class="line">52 0.00406</div>
</div><!-- fragment --><h1><a class="anchor" id="Residue"></a>
Residue</h1>
<p>A residue is represented in OpenMS by the class <em>Residue</em>. It provides a container for the amino acids as well as some functionality. The class is able to provide information such as the isotope distribution of the residue, the average and monoisotopic weight. The residues can be identified by their full name, their three letter abbreviation or the single letter abreviation. The residue can also be modified, which is implemented in the Modification class. Additional less frequently used parameters of a residue like the gas-phase basicity and pk values are also available.</p>
<p>Example (Tutorial_Residue.C):</p>
<div class="fragment"></div><!-- fragment --></p>
<p>This small example show how to create a instance of ResidueDB were all Residues are stored in. The amino acids themselves can be accessed via the getResidue function. ResidueDB reads its amino acid and modification data from share/OpenMS/CHEMISTRY/.</p>
<p>The output of the example would look like this</p>
<div class="fragment"><div class="line">Lysine LYS K 146.188</div>
</div><!-- fragment --><h1><a class="anchor" id="AASequence"></a>
AASequence</h1>
<p>This class handles the amino acid sequences in OpenMS. A string of amino acid residues can be turned into a instance of <em>AASequence</em> to provide some commonly used operations and data. The implementation supports mathematical operations like addition or subtraction. Also, average and mono isotopic weight and isotope distributions are accessible.</p>
<p>Weights, formulas and isotope distribution can be calculated depending on the charge state (additional proton count in case of positive ions) and ion type. Therefore, the class allows for a flexible handling of amino acid strings.</p>
<p>A very simple example of handling amino acid sequence with AASequence is given in the next few lines.</p>
<p>Example (Tutorial_AASequence.C):</p>
<div class="fragment"><div class="line"> AASequence seq(<span class="stringliteral">"DFPIANGER"</span>);</div>
<div class="line"></div>
<div class="line"> AASequence prefix(seq.getPrefix(4));</div>
<div class="line"> AASequence suffix(seq.getSuffix(5));</div>
<div class="line"></div>
<div class="line"> cout << seq << <span class="stringliteral">" "</span></div>
<div class="line"> << prefix << <span class="stringliteral">" "</span></div>
<div class="line"> << suffix << <span class="stringliteral">" "</span></div>
<div class="line"> << seq.getAverageWeight() << endl;</div>
</div><!-- fragment --></p>
<p>Not only the prefix, suffix and subsequence accession is supported, but also most of the features of EmpiricalFormulas and Residues given above. Additionally, a number of predicates like hasSuffix are supported. The output of the code snippet looks like this.</p>
<div class="fragment"><div class="line">DFPIANGER DFPI ANGER 1018.08</div>
</div><!-- fragment --><h1><a class="anchor" id="TheoreticalSpectrumGenerator"></a>
TheoreticalSpectrumGenerator</h1>
<p>This class implements a simple generator which generates tandem MS spectra from a given peptide charge combination. There are various options which influence the occurring ions and their intensities.</p>
<p>Example (Tutorial_TheoreticalSpectrumGenerator.C)</p>
<div class="fragment"><div class="line"> TheoreticalSpectrumGenerator tsg;</div>
<div class="line"> RichPeakSpectrum spec1, spec2;</div>
<div class="line"> AASequence peptide(<span class="stringliteral">"DFPIANGER"</span>);</div>
<div class="line"></div>
<div class="line"> tsg.addPeaks(spec1, peptide, Residue::YIon, 1);</div>
<div class="line"></div>
<div class="line"> tsg.getSpectrum(spec2, peptide, 2);</div>
<div class="line"></div>
<div class="line"> cout << <span class="stringliteral">"Spectrum 1 has "</span> << spec1.size() << <span class="stringliteral">" peaks. "</span> << endl;</div>
<div class="line"> cout << <span class="stringliteral">"Spectrum 2 has "</span> << spec2.size() << <span class="stringliteral">" peaks. "</span> << endl;</div>
</div><!-- fragment --></p>
<p>The example shows how to put peaks of a certain type, y-ions in this case, into a spectrum. Spectrum 2 is filled with a complete spectrum of all peaks (a-, b-, y-ions and losses). The TheoreticalSpectrumGenerator has many parameters which have a detailed description located in the class documentation. The output of the program looks like the following two lines.</p>
<div class="fragment"><div class="line">Spectrum 1 has 8 peaks.</div>
<div class="line">Spectrum 2 has 32 peaks.</div>
</div><!-- fragment --> </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>
|