File: deprecation_check.inc

package info (click to toggle)
python-pymzml 2.5.2%2Brepack1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 27,792 kB
  • sloc: python: 6,495; pascal: 341; makefile: 233; sh: 30
file content (43 lines) | stat: -rwxr-xr-x 1,002 bytes parent folder | download | duplicates (3)
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
.. code-block:: python

	#!/usr/bin/env python3
	
	import os
	
	import pymzml
	
	
	def main():
	    """
	    Testscript to highlight the function name changes in the Spectrum class.
	
	    Note:
	        Please adjust any old scripts to the new syntax.
	
	    usage:
	
	        ./deprecation_check.py
	
	    """
	
	    example_file = os.path.join(
	        os.path.dirname(__file__), os.pardir, "tests", "data", "example.mzML"
	    )
	    run = pymzml.run.Reader(example_file)
	    spectrum_list = []
	    for pos, spectrum in enumerate(run):
	        spectrum_list.append(spectrum)
	        spectrum.hasPeak((813.19073486))
	        spectrum.extremeValues("mz")
	        spectrum.hasOverlappingPeak(813.19073486)
	        spectrum.highestPeaks(1)
	        spectrum.estimatedNoiseLevel()
	        spectrum.removeNoise()
	        spectrum.transformMZ(813.19073486)
	        if pos == 1:
	            spectrum.similarityTo(spectrum_list[0])
	            break
	
	
	if __name__ == "__main__":
	    main()