/usr/share/doc/python-mzml-doc/html/obo.html is in python-mzml-doc 0.7.4-dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>5. OBO parser Class — pymzML 0.7.4 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.7.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="pymzML 0.7.4 documentation" href="index.html" />
<link rel="next" title="6. Plotting functions" href="plot.html" />
<link rel="prev" title="4. Class Spectrum" href="spec.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="plot.html" title="6. Plotting functions"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="spec.html" title="4. Class Spectrum"
accesskey="P">previous</a> |</li>
<li><a href="index.html">pymzML 0.7.4 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-obo">
<span id="obo-parser-class"></span><h1>5. OBO parser Class<a class="headerlink" href="#module-obo" title="Permalink to this headline">¶</a></h1>
<p>Class to parse the obo file and set up the accessions library</p>
<p>The OBO parse has been designed to convert MS:xxxxx tags to their appropriate
names. A minimal set of MS acession is used in pymzml, but additional accessions
can easily added, using the extraAccession parameter during
<a class="reference internal" href="run.html#run.Reader" title="run.Reader"><tt class="xref py py-class docutils literal"><span class="pre">run.Reader</span></tt></a> initialization.</p>
<p>The obo translator is used internally to associate names with MS:xxxxxxx tags.</p>
<p>The oboTranslator Class generates a dictionary and several lookup tables.
e.g.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pymzml.obo</span> <span class="kn">import</span> <span class="n">oboTranslator</span> <span class="k">as</span> <span class="n">OT</span>
<span class="gp">>>> </span><span class="n">translator</span> <span class="o">=</span> <span class="n">OT</span><span class="p">()</span>
<span class="gp">>>> </span><span class="nb">len</span><span class="p">(</span><span class="n">translator</span><span class="o">.</span><span class="n">id</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span> <span class="c"># Numer of parsed entries</span>
<span class="go">737</span>
<span class="gp">>>> </span><span class="n">translator</span><span class="p">[</span><span class="s">'MS:1000127'</span><span class="p">]</span>
<span class="go">'centroid mass spectrum'</span>
<span class="gp">>>> </span><span class="n">translator</span><span class="p">[</span><span class="s">'positive scan'</span><span class="p">]</span>
<span class="go">{'is_a': 'MS:1000465 ! scan polarity', 'id': 'MS:1000130', 'def': '"Polarity </span>
<span class="go">of the scan is positive." [PSI:MS]', 'name': 'positive scan'}</span>
<span class="gp">>>> </span><span class="n">translator</span><span class="p">[</span><span class="s">'scan'</span><span class="p">]</span>
<span class="go">{'relationship': 'part_of MS:0000000 ! Proteomics Standards Initiative Mass </span>
<span class="go">Spectrometry Ontology', 'id': 'MS:1000441', 'def': '"Function or process of </span>
<span class="go">the mass spectrometer where it records a spectrum." [PSI:MS]', 'name': </span>
<span class="go">'scan'}</span>
<span class="gp">>>> </span><span class="n">translator</span><span class="p">[</span><span class="s">'unit'</span><span class="p">]</span>
<span class="go">{'relationship': 'part_of MS:0000000 ! Proteomics Standards Initiative Mass </span>
<span class="go">Spectrometry Ontology', 'id': 'MS:1000460', 'def': '"Terms to describe </span>
<span class="go">units." [PSI:MS]', 'name': 'unit'}</span>
</pre></div>
</div>
<p>pymzML comes with the queryOBO.py script that can be used to interogate the OBO
file.</p>
<div class="highlight-python"><pre>$ ./example_scripts/queryOBO.py "scan time"
MS:1000016
scan time
"The time taken for an acquisition by scanning analyzers." [PSI:MS]
Is a: MS:1000503 ! scan attribute
$ </pre>
</div>
<div class="section" id="accessing-specific-obo-ms-tags">
<h2>5.1. Accessing specific OBO MS tags<a class="headerlink" href="#accessing-specific-obo-ms-tags" title="Permalink to this headline">¶</a></h2>
<p>This section describes how to access some common MS tags by their names as they
are defined in the OBO file.</p>
<p>First pymzML is imported and the run is defined.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">example_file</span> <span class="o">=</span> <span class="n">get_example_file</span><span class="o">.</span><span class="n">open_example</span><span class="p">(</span><span class="s">'dta_example.mzML'</span><span class="p">)</span>
<span class="gp">>>> </span><span class="kn">import</span> <span class="nn">pymzml</span>
<span class="gp">>>> </span><span class="n">msrun</span> <span class="o">=</span> <span class="n">pymzml</span><span class="o">.</span><span class="n">run</span><span class="o">.</span><span class="n">Reader</span><span class="p">(</span><span class="n">example_file</span><span class="p">)</span>
</pre></div>
</div>
<p>Now, we can fetch specific imformations from the spectrum object.</p>
<p>MS level:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">msrun</span><span class="p">:</span>
<span class="gp">... </span> <span class="k">print</span><span class="p">(</span><span class="n">spectrum</span><span class="p">[</span><span class="s">'ms level'</span><span class="p">])</span>
</pre></div>
</div>
<p>Total Ion current:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">msrun</span><span class="p">:</span>
<span class="gp">... </span> <span class="k">print</span><span class="p">(</span><span class="n">spectrum</span><span class="p">[</span><span class="s">'total ion current'</span><span class="p">])</span>
</pre></div>
</div>
<p>Furthermore we can also check for presence of parameters, therefore the
proprties of the spectrum.</p>
<p>Differentiation of e.g. HCD and CID fractionation:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">msrun</span><span class="p">:</span>
<span class="gp">... </span> <span class="k">if</span> <span class="n">spctrum</span><span class="p">[</span><span class="s">'ms level'</span><span class="p">]</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
<span class="gp">... </span> <span class="k">if</span> <span class="s">'collision-induced dissociation'</span> <span class="ow">in</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="gp">... </span> <span class="k">print</span><span class="p">(</span><span class="s">'Spectrum {0} is a CID spectrum'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">spectrum</span><span class="p">[</span><span class="s">'id'</span><span class="p">]))</span>
<span class="gp">... </span> <span class="k">elif</span> <span class="s">'high-energy collision-induced dissociation'</span> <span class="ow">in</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="gp">... </span> <span class="k">print</span><span class="p">(</span><span class="s">'Spectrum {0} is a HCD spectrum'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">spectrum</span><span class="p">[</span><span class="s">'id'</span><span class="p">]))</span>
</pre></div>
</div>
</div>
<div class="section" id="minimal-accession-set">
<h2>5.2. Minimal accession set<a class="headerlink" href="#minimal-accession-set" title="Permalink to this headline">¶</a></h2>
<p>The following dictionary shows the minimal accession necessary to run pymzML.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">MIN_REQ</span> <span class="o">=</span> <span class="p">[</span>
<span class="c">#</span>
<span class="c">#!NOTE! exact names will be extracted of current OBO File, comments are just an orientation</span>
<span class="c"># pymzml comes with a little script (queryOBO.py) to query the obo file</span>
<span class="c">#</span>
<span class="c"># $ ./example_scripts/queryOBO.py "scan time"</span>
<span class="c"># MS:1000016</span>
<span class="c"># scan time</span>
<span class="c"># "The time taken for an acquisition by scanning analyzers." [PSI:MS]</span>
<span class="c"># Is a: MS:1000503 ! scan attribute</span>
<span class="c">#</span>
<span class="p">(</span><span class="s">'MS:1000016'</span><span class="p">,[</span><span class="s">'value'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"scan time"</span>
<span class="c"># -> Could also be ['value','unitName'] to retrieve a</span>
<span class="c"># tuple of time and unit by calling spectrum['scan time']</span>
<span class="p">(</span><span class="s">'MS:1000040'</span><span class="p">,[</span><span class="s">'value'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"m/z"</span>
<span class="p">(</span><span class="s">'MS:1000041'</span><span class="p">,[</span><span class="s">'value'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"charge state"</span>
<span class="p">(</span><span class="s">'MS:1000127'</span><span class="p">,[</span><span class="s">'name'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"centroid spectrum"</span>
<span class="p">(</span><span class="s">'MS:1000128'</span><span class="p">,[</span><span class="s">'name'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"profile spectrum"</span>
<span class="p">(</span><span class="s">'MS:1000133'</span><span class="p">,[</span><span class="s">'name'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"collision-induced dissociation"</span>
<span class="p">(</span><span class="s">'MS:1000285'</span><span class="p">,[</span><span class="s">'value'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"total ion current"</span>
<span class="p">(</span><span class="s">'MS:1000422'</span><span class="p">,[</span><span class="s">'name'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"high-energy collision-induced dissociation"</span>
<span class="p">(</span><span class="s">'MS:1000511'</span><span class="p">,[</span><span class="s">'value'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"ms level"</span>
<span class="p">(</span><span class="s">'MS:1000512'</span><span class="p">,[</span><span class="s">'value'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"filter string"</span>
<span class="p">(</span><span class="s">'MS:1000514'</span><span class="p">,[</span><span class="s">'name'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"m/z array"</span>
<span class="p">(</span><span class="s">'MS:1000515'</span><span class="p">,[</span><span class="s">'name'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"intensity array"</span>
<span class="p">(</span><span class="s">'MS:1000521'</span><span class="p">,[</span><span class="s">'name'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"32-bit float"</span>
<span class="p">(</span><span class="s">'MS:1000523'</span><span class="p">,[</span><span class="s">'name'</span><span class="p">]</span> <span class="p">),</span> <span class="c">#"64-bit float"</span>
<span class="p">(</span><span class="s">'MS:1000744'</span><span class="p">,[</span><span class="s">'value'</span><span class="p">]</span> <span class="p">),</span> <span class="c"># legacy precursor mz value ...</span>
<span class="p">]</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">5. OBO parser Class</a><ul>
<li><a class="reference internal" href="#accessing-specific-obo-ms-tags">5.1. Accessing specific OBO MS tags</a></li>
<li><a class="reference internal" href="#minimal-accession-set">5.2. Minimal accession set</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="spec.html"
title="previous chapter">4. Class Spectrum</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="plot.html"
title="next chapter">6. Plotting functions</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/obo.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="plot.html" title="6. Plotting functions"
>next</a> |</li>
<li class="right" >
<a href="spec.html" title="4. Class Spectrum"
>previous</a> |</li>
<li><a href="index.html">pymzML 0.7.4 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2011, Till Bald, Johannes Barth, Anna Niehues, Michael Specht, Michael Hippler, Christian Fufezan.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>
|