This file is indexed.

/usr/share/doc/python-pymzml-doc/html/spec.html is in python-pymzml-doc 0.7.6-dfsg-4.

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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
<!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>4. Class Spectrum &#8212; pymzML 0.7.6 documentation</title>
    
    <link rel="stylesheet" href="_static/classic.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.6',
        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.6 documentation" href="index.html" />
    <link rel="next" title="5. OBO parser Class" href="obo.html" />
    <link rel="prev" title="3. Module Run" href="run.html" /> 
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <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="obo.html" title="5. OBO parser Class"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="run.html" title="3. Module Run"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">pymzML 0.7.6 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="module-spec">
<span id="class-spectrum"></span><h1>4. Class Spectrum<a class="headerlink" href="#module-spec" title="Permalink to this headline"></a></h1>
<p>The spectrum class offers a python object for mass spectrometry data.
The spectrum object holds the basic information on the spectrum and offers
methods to interrogate properties of the spectrum.
Data, i.e. mass over charge (m/z) and intensity decoding is performed on demand
and can be accessed via their properties, e.g. <a class="reference internal" href="#spec.Spectrum.peaks" title="spec.Spectrum.peaks"><code class="xref py py-attr docutils literal"><span class="pre">spec.Spectrum.peaks</span></code></a>.</p>
<p>The Spectrum class is used in the <code class="xref py py-class docutils literal"><span class="pre">run.Run</span></code> class.
There each spectrum is accessible as a spectrum object.</p>
<p>Theoretical spectra can also be created using the setter functions.
For example, m/z values, intensities, and peaks can be set by the
corresponding properties: <a class="reference internal" href="#spec.Spectrum.mz" title="spec.Spectrum.mz"><code class="xref py py-attr docutils literal"><span class="pre">spec.Spectrum.mz</span></code></a>,
<a class="reference internal" href="#spec.Spectrum.i" title="spec.Spectrum.i"><code class="xref py py-attr docutils literal"><span class="pre">spec.Spectrum.i</span></code></a>, <a class="reference internal" href="#spec.Spectrum.peaks" title="spec.Spectrum.peaks"><code class="xref py py-attr docutils literal"><span class="pre">spec.Spectrum.peaks</span></code></a>.</p>
<dl class="class">
<dt id="spec.Spectrum">
<em class="property">class </em><code class="descclassname">spec.</code><code class="descname">Spectrum</code><a class="headerlink" href="#spec.Spectrum" title="Permalink to this definition"></a></dt>
<dd><dl class="function">
<dt id="spec.Spectrum.__init__">
<code class="descname">__init__</code><span class="sig-paren">(</span><em>measuredPrecision = value*</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.__init__" title="Permalink to this definition"></a></dt>
<dd><p>Initializes a pymzml.spec.Spectrum class.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>measuredPrecision</strong> (<em>float</em>) &#8211; in m/z, mandatory</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.xmlTree">
<code class="descname">xmlTree</code><a class="headerlink" href="#spec.Spectrum.xmlTree" title="Permalink to this definition"></a></dt>
<dd><p>xmlTree property returns an iterator over the original
xmlTree structure the spectrum was initilized with.</p>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">xmlTree</span><span class="p">:</span>
<span class="gp">... </span>  <span class="nb">print</span><span class="p">(</span> <span class="n">element</span><span class="p">,</span> <span class="n">element</span><span class="o">.</span><span class="n">tag</span><span class="p">,</span> <span class="n">element</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="p">)</span>
</pre></div>
</div>
<p>please refer to the xml documentation of Python and cElementTree
for more details.</p>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.mz">
<code class="descname">mz</code><a class="headerlink" href="#spec.Spectrum.mz" title="Permalink to this definition"></a></dt>
<dd><p>Returns the list of m/z values. If the m/z values are encoded, the
function <code class="xref py py-func docutils literal"><span class="pre">_decode()</span></code> is used to decode the encoded data.</p>
<p>The mz property can also be setted, e.g. for theoretical data.
However, it is recommended to use the peaks property to set mz and
intesity tuples at same time.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Returns a list of mz from the actual analysed spectrum</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.i">
<code class="descname">i</code><a class="headerlink" href="#spec.Spectrum.i" title="Permalink to this definition"></a></dt>
<dd><p>Returns the list of the intensity values.
If the intensity values are encoded, the function <code class="xref py py-func docutils literal"><span class="pre">_decode()</span></code>
is used to decode the encoded data.</p>
<p>The i property can also be setted, e.g. for theoretical data.However, it
is recommended to use the peaks property to set mz and intesity tuples
at same time.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Returns a list of intensity values from the actual analysed
spectrum.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.peaks">
<code class="descname">peaks</code><a class="headerlink" href="#spec.Spectrum.peaks" title="Permalink to this definition"></a></dt>
<dd><p>Returns the list of peaks of the spectrum as tuples (m/z, intensity).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list of tuples</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Returns list of tuples (m/z, intensity)</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pymzml</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">run</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">spectra</span><span class="o">.</span><span class="n">mzMl</span><span class="o">.</span><span class="n">gz</span><span class="p">,</span> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="k">for</span> <span class="n">mz</span><span class="p">,</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">peaks</span><span class="p">:</span>
<span class="gp">... </span>        <span class="nb">print</span><span class="p">(</span><span class="n">mz</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The peaks property can also be setted, e.g. for theoretical data.
It requires a list of mz/intensity tuples.</p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.centroidedPeaks">
<code class="descname">centroidedPeaks</code><a class="headerlink" href="#spec.Spectrum.centroidedPeaks" title="Permalink to this definition"></a></dt>
<dd><p>Returns the centroided version of a profile spectrum. Performs a Gauss
fit to determine centroided mz and intensities, if the spectrum is in
measured profile mode.
Returns a list of tuples of fitted m/z-intesity values. If the spectrum
peaks are already centroided, these peaks are returned.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list of tuples</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Returns list of tuples (m/z, intensity)</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pymzml</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">run</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">spectra</span><span class="o">.</span><span class="n">mzMl</span><span class="o">.</span><span class="n">gz</span><span class="p">,</span> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="k">for</span> <span class="n">mz</span><span class="p">,</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">centroidedPeaks</span><span class="p">:</span>
<span class="gp">... </span>        <span class="nb">print</span><span class="p">(</span><span class="n">mz</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.reprofiledPeaks">
<code class="descname">reprofiledPeaks</code><a class="headerlink" href="#spec.Spectrum.reprofiledPeaks" title="Permalink to this definition"></a></dt>
<dd><p>Returns the reprofiled version of a centroided spectrum.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list of reprofiled mz,i tuples</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Reprofiled peaks as tuple list</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pymzml</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">run</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">spectra</span><span class="o">.</span><span class="n">mzMl</span><span class="o">.</span><span class="n">gz</span><span class="p">,</span> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="k">for</span> <span class="n">mz</span><span class="p">,</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">reprofiledPeaks</span><span class="p">:</span>
<span class="gp">... </span>        <span class="nb">print</span><span class="p">(</span><span class="n">mz</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="attribute">
<dt>
<code class="descname">reprofiledPeaks</code></dt>
<dd><p>Returns the reprofiled version of a centroided spectrum.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list of reprofiled mz,i tuples</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Reprofiled peaks as tuple list</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pymzml</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">run</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">spectra</span><span class="o">.</span><span class="n">mzMl</span><span class="o">.</span><span class="n">gz</span><span class="p">,</span> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="k">for</span> <span class="n">mz</span><span class="p">,</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">reprofiledPeaks</span><span class="p">:</span>
<span class="gp">... </span>        <span class="nb">print</span><span class="p">(</span><span class="n">mz</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.measuredPrecision">
<code class="descname">measuredPrecision</code><a class="headerlink" href="#spec.Spectrum.measuredPrecision" title="Permalink to this definition"></a></dt>
<dd><p>Sets the measured and internal precision</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> (<em>float</em>) &#8211; measured precision (e.g. 5e-6)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.__add__">
<code class="descname">__add__</code><span class="sig-paren">(</span><em>otherSpec</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.__add__" title="Permalink to this definition"></a></dt>
<dd><p>Adds two pymzml spectra together.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>otherSpec</strong> (<em>object</em>) &#8211; Spectrum object</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pymzml</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">pymzml</span><span class="o">.</span><span class="n">spec</span><span class="o">.</span><span class="n">Spectrum</span><span class="p">(</span> <span class="n">measuredPrescision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span> <span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">file_to_read</span> <span class="o">=</span> <span class="s2">&quot;../mzML_example_files/xy.mzML.gz&quot;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">run</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">file_to_read</span> <span class="p">,</span> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span> <span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spec</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="n">s</span> <span class="o">+=</span> <span class="n">spec</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.__mul__">
<code class="descname">__mul__</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.__mul__" title="Permalink to this definition"></a></dt>
<dd><p>Multiplies each intensity with a float, i.e. scales the spectrum.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> (<em>float</em>) &#8211; Value to multiply the spectrum</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.__truediv__">
<code class="descname">__truediv__</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.__truediv__" title="Permalink to this definition"></a></dt>
<dd><p>Divides each intensity by a float, i.e. scales the spectrum.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>value</strong> (<em>float, int</em>) &#8211; Value to divide the spectrum</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.strip">
<code class="descname">strip</code><span class="sig-paren">(</span><em>scope='all'</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.strip" title="Permalink to this definition"></a></dt>
<dd><p>Reduces the size of the spectrum. Interesting if specs need to be added
or stored.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>scope</strong> (<em>string</em>) &#8211; accepts currently [&#8220;all&#8221;]</td>
</tr>
</tbody>
</table>
<p>&#8220;all&#8221; will remove the raw and profiled data and some internal lookup
tables as well.</p>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.extremeValues">
<code class="descname">extremeValues</code><span class="sig-paren">(</span><em>key</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.extremeValues" title="Permalink to this definition"></a></dt>
<dd><p>Find extreme values, minimal and maximum mz and intensity</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>key</strong> (<em>string</em>) &#8211; m/z : &#8220;mz&#8221; or  intensity : &#8220;i&#8221;</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">tuple</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">tuple of minimal and maximum m/z or intensity</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.reduce">
<code class="descname">reduce</code><span class="sig-paren">(</span><em>mzRange=(None</em>, <em>None)</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.reduce" title="Permalink to this definition"></a></dt>
<dd><p>Works on peaks and reduces spectrum to a m/z range.</p>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">run</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">file_to_read</span><span class="p">,</span> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spec</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="n">spec</span><span class="o">.</span><span class="n">reduce</span><span class="p">(</span> <span class="n">mzRange</span> <span class="o">=</span> <span class="p">(</span><span class="mi">100</span><span class="p">,</span><span class="mi">200</span><span class="p">)</span> <span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.deRef">
<code class="descname">deRef</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.deRef" title="Permalink to this definition"></a></dt>
<dd><p>Strip some heavy data and return deepcopy of spectrum.</p>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">run</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">file_to_read</span><span class="p">,</span> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spec</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="n">tmp</span> <span class="o">=</span> <span class="n">spec</span><span class="o">.</span><span class="n">deRef</span><span class="p">()</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.removeNoise">
<code class="descname">removeNoise</code><span class="sig-paren">(</span><em>mode='median'</em>, <em>noiseLevel=None</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.removeNoise" title="Permalink to this definition"></a></dt>
<dd><p>Function to remove noise from peaks, centroided peaks and reprofiled
peaks.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>mode</strong> (<em>string</em>) &#8211; define mode for removing noise. Default = &#8220;median&#8221;
(other modes: &#8220;mean&#8221;, &#8220;mad&#8221;)</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list of tuples</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Returns a list with tuples of m/z-intensity pairs above the
noise threshold</td>
</tr>
</tbody>
</table>
<p>mad &lt; median &lt; mean</p>
<p>Threshold is calculated over the mad/median/mean of all intensity values.
(mad = mean absolute deviation)</p>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pymzml</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">run</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">spectra</span><span class="o">.</span><span class="n">mzML</span><span class="o">.</span><span class="n">gz</span><span class="p">,</span> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="k">for</span> <span class="n">mz</span><span class="p">,</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">removeNoise</span><span class="p">(</span> <span class="n">mode</span> <span class="o">=</span> <span class="s1">&#39;mean&#39;</span><span class="p">):</span>
<span class="gp">... </span>        <span class="nb">print</span><span class="p">(</span><span class="n">mz</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.highestPeaks">
<code class="descname">highestPeaks</code><span class="sig-paren">(</span><em>n</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.highestPeaks" title="Permalink to this definition"></a></dt>
<dd><p>Function to retrieve the n-highest centroided peaks of the spectrum.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>n</strong> (<em>int</em>) &#8211; Number of n-highest peaks</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">list of centroided peaks (mz, intensity tuples)</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">run</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="s2">&quot;../mzML_example_files/deconvolution.mzML.gz&quot;</span><span class="p">,</span> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="k">if</span> <span class="n">spectrum</span><span class="p">[</span><span class="s2">&quot;ms level&quot;</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="n">spectrum</span><span class="p">[</span><span class="s2">&quot;id&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1770</span><span class="p">:</span>
<span class="gp">... </span>            <span class="k">for</span> <span class="n">mz</span><span class="p">,</span><span class="n">i</span> <span class="ow">in</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">highestPeaks</span><span class="p">(</span><span class="mi">5</span><span class="p">):</span>
<span class="gp">... </span>               <span class="nb">print</span><span class="p">(</span><span class="n">mz</span><span class="p">,</span><span class="n">i</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.estimatedNoiseLevel">
<code class="descname">estimatedNoiseLevel</code><span class="sig-paren">(</span><em>mode='median'</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.estimatedNoiseLevel" title="Permalink to this definition"></a></dt>
<dd><p>Calculates noise threshold for function <a class="reference internal" href="#spec.Spectrum.removeNoise" title="spec.Spectrum.removeNoise"><code class="xref py py-func docutils literal"><span class="pre">removeNoise()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.hasOverlappingPeak">
<code class="descname">hasOverlappingPeak</code><span class="sig-paren">(</span><em>mz</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.hasOverlappingPeak" title="Permalink to this definition"></a></dt>
<dd><p>Checks if a spetrum has more than one peak for a given m/z value and within the measured precision</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>mz</strong> (<em>float</em>) &#8211; m/z value which should be checked</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Returns <code class="docutils literal"><span class="pre">True</span></code> if a nearby peak is detected, otherwise <code class="docutils literal"><span class="pre">False</span></code></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.hasPeak">
<code class="descname">hasPeak</code><span class="sig-paren">(</span><em>mz2find</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.hasPeak" title="Permalink to this definition"></a></dt>
<dd><p>Checks if a Spectrum has a certain peak.
Needs a certain mz value as input and returns a list of peaks if a peak
is found in the spectrum, otherwise <code class="docutils literal"><span class="pre">[]</span></code> is returned.
Every peak is a tuple of m/z and intensity.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>mz2find</strong> (<em>float</em>) &#8211; mz value which should be found</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">m/z and intensity as tuple in list</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pymzml</span><span class="o">,</span> <span class="nn">get_example_file</span>
<span class="gp">&gt;&gt;&gt; </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="s1">&#39;deconvolution.mzML.gz&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">run</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> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="k">if</span> <span class="n">spectrum</span><span class="p">[</span><span class="s2">&quot;ms level&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
<span class="gp">... </span>            <span class="n">peak_to_find</span> <span class="o">=</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">hasPeak</span><span class="p">(</span><span class="mf">1016.5404</span><span class="p">)</span>
<span class="gp">... </span>            <span class="nb">print</span><span class="p">(</span><span class="n">peak_to_find</span><span class="p">)</span>
<span class="go">[(1016.5404, 19141.735187697403)]</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.hasDeconvolutedPeak">
<code class="descname">hasDeconvolutedPeak</code><span class="sig-paren">(</span><em>mass2find</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.hasDeconvolutedPeak" title="Permalink to this definition"></a></dt>
<dd><p>Checks if a deconvoluted spectrum contains a certain peak.
Needs a mass value as input and returns a list of peaks if a peak
is found in the spectrum. If the mass is not found <code class="docutils literal"><span class="pre">[]</span></code> is
returned.
Every peak is a tuple of m/z and intensity.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>mass2find</strong> (<em>float</em>) &#8211; mass value which should be found</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">mass and intensity as tuple in list if mass is found,
otherwise <code class="docutils literal"><span class="pre">[]</span></code></td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pymzml</span><span class="o">,</span> <span class="nn">get_example_file</span>
<span class="gp">&gt;&gt;&gt; </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="s1">&#39;deconvolution.mzML.gz&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">run</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> <span class="n">MS1_Precision</span> <span class="o">=</span> <span class="mi">5</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">,</span> <span class="n">MSn_Precision</span> <span class="o">=</span> <span class="mi">20</span><span class="n">e</span><span class="o">-</span><span class="mi">6</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">for</span> <span class="n">spectrum</span> <span class="ow">in</span> <span class="n">run</span><span class="p">:</span>
<span class="gp">... </span>    <span class="k">if</span> <span class="n">spectrum</span><span class="p">[</span><span class="s2">&quot;ms level&quot;</span><span class="p">]</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
<span class="gp">... </span>            <span class="n">peak_to_find</span> <span class="o">=</span> <span class="n">spectrum</span><span class="o">.</span><span class="n">hasDeconvolutedPeak</span><span class="p">(</span><span class="mf">1044.5804</span><span class="p">)</span>
<span class="gp">... </span>            <span class="nb">print</span><span class="p">(</span><span class="n">peak_to_find</span><span class="p">)</span>
<span class="go">[(1044.5596, 3809.4356300564586)]</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.similarityTo">
<code class="descname">similarityTo</code><span class="sig-paren">(</span><em>spec2</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.similarityTo" title="Permalink to this definition"></a></dt>
<dd><p>Compares two spectra and returns cosine</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>spec2</strong> (<em>pymzml.spec.Spectrum</em>) &#8211; another pymzml spectrum that is compated to the current spectrum.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">value between 0 and 1, i.e. the cosine between the two spectra.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">float</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Spectra data is transformed into an n-dimensional vector,
whereas mz values are binned in bins of 10 m/z and the intensities are added up.
Then the cosine is calculated between those two vectors.
The more similar the specs are, the closer the value is to 1.</p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.tmzSet">
<code class="descname">tmzSet</code><a class="headerlink" href="#spec.Spectrum.tmzSet" title="Permalink to this definition"></a></dt>
<dd><p>Create set out of transformed m/z values
(including all values in the defined imprecision).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">set</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.tmassSet">
<code class="descname">tmassSet</code><a class="headerlink" href="#spec.Spectrum.tmassSet" title="Permalink to this definition"></a></dt>
<dd><p>create a set out of transformed mass values
(including all values in the defined imprecision).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">set</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.transformedPeaks">
<code class="descname">transformedPeaks</code><a class="headerlink" href="#spec.Spectrum.transformedPeaks" title="Permalink to this definition"></a></dt>
<dd><p>m/z value is multiplied by the internal precision</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list of tuples</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Returns a list of peaks (tuples of mz and intensity). Float m/z
values are adjusted by the internal precision to integers.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.transformed_deconvolutedPeaks">
<code class="descname">transformed_deconvolutedPeaks</code><a class="headerlink" href="#spec.Spectrum.transformed_deconvolutedPeaks" title="Permalink to this definition"></a></dt>
<dd><p>Deconvoluted mz value is multiplied by the internal precision</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list of tuples</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Returns a list of peaks (tuples of mz and intensity). Float m/z
values are adjusted by the internal precision to integers.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spec.Spectrum.deconvolute_peaks">
<code class="descname">deconvolute_peaks</code><span class="sig-paren">(</span><em>ppmFactor=4</em>, <em>minCharge=1</em>, <em>maxCharge=8</em>, <em>maxNextPeaks=100</em>, <em>returnCharge=False</em>, <em>debug=False</em><span class="sig-paren">)</span><a class="headerlink" href="#spec.Spectrum.deconvolute_peaks" title="Permalink to this definition"></a></dt>
<dd><p>Calculating uncharged masses and returning deconvoluted peaks.</p>
<p>The deconvolution of spectra is done by first identifying isotope envelopes and
the charge state of this envelopes. The first peak of an isotope envelope is choosen
as the monoisotopic peak for which the mass is calculated from the m/z ratio.
Isotope envelopes are identified by searching the centroided spectrum for peaks
which show no preceding isotope peak within a specified mass accuracy. To be
sure, the measured mass accuracy is multiplied by a user adjustable factor
(<code class="docutils literal"><span class="pre">ppmFactor</span></code>). When the current peak meets the criteria with no preceding peaks, the
following peaks are analysed. The following peaks are considered to be part of
the isotope envelope, as long as they fit within the measured precision and
only one local maximum is present. The second local maximum is not considered
as the starting point of a new isotope envelope as one cannot be sure were this
isotope envelope starts. However, the last peak before the second local maximum
is considered to be part of the isotope envelope from the first local maximum,
as the intensity of this peak shouldn&#8217;t have a big influence on the whole
isotope envelope intensity.
The charge range for detecting isotope envelopes can be specified (<code class="docutils literal"><span class="pre">minCharge</span></code>,
<code class="docutils literal"><span class="pre">maxCharge</span></code>). An isotope envelope always gets the highest possible charge.
With the charge the mass can be calculated from the m/z value of the first peak
of the isotope envelope. The intensity of the deconvoluted peak results from
the sum of all isotope envelope peaks.
In a last step, deconvoluted peaks are grouped together within the measured
precision. This is necessary because isotope envelopes from the same fragment
but with different charge states can leed to slightly different deconvoluted
peaks.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>ppmFactor</strong> (<em>int</em>) &#8211; ppm factor (imprecision factor)</li>
<li><strong>minCharge</strong> (<em>int</em>) &#8211; minimum charge considered</li>
<li><strong>maxCharge</strong> (<em>int</em>) &#8211; maximum charge considered</li>
<li><strong>maxNextPeaks</strong> &#8211; maximum length for isotope envelope</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">tuple (mass, intensity)</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Deconvoluted peaks, mass (instead of m/z) and intensity are
returned</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="spec.Spectrum.deconvolutedPeaks">
<code class="descname">deconvolutedPeaks</code><a class="headerlink" href="#spec.Spectrum.deconvolutedPeaks" title="Permalink to this definition"></a></dt>
<dd><p>Calling <a class="reference internal" href="#spec.Spectrum.deconvolute_peaks" title="spec.Spectrum.deconvolute_peaks"><code class="xref py py-func docutils literal"><span class="pre">spec.Spectrum.deconvolute_peaks()</span></code></a> with standard
parameters, which calculates uncharged masses and returns deconvoluted
peaks.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of deconvoluted peaks (mass (instead of m/z) / intensity tuples)</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="run.html"
                        title="previous chapter">3. Module Run</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="obo.html"
                        title="next chapter">5. OBO parser Class</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/spec.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <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="obo.html" title="5. OBO parser Class"
             >next</a> |</li>
        <li class="right" >
          <a href="run.html" title="3. Module Run"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">pymzML 0.7.6 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2011-2016, Till Bald, Johannes Barth, Anna Niehues, Michael Specht, Michael Hippler, Christian Fufezan.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.6.
    </div>
  </body>
</html>