Debian Codegraph @

docs/source/code_inc/deprecation_check.inc

raw
1 .. code-block:: python
2
3 #!/usr/bin/env python3
4
5 import os
6
7 import pymzml
8
9
10 def main():
11 """
12 Testscript to highlight the function name changes in the Spectrum class.
13
14 Note:
15 Please adjust any old scripts to the new syntax.
16
17 usage:
18
19 ./deprecation_check.py
20
21 """
22
23 example_file = os.path.join(
24 os.path.dirname(__file__), os.pardir, "tests", "data", "example.mzML"
25 )
26 run = pymzml.run.Reader(example_file)
27 spectrum_list = []
28 for pos, spectrum in enumerate(run):
29 spectrum_list.append(spectrum)
30 spectrum.hasPeak((813.19073486))
31 spectrum.extremeValues("mz")
32 spectrum.hasOverlappingPeak(813.19073486)
33 spectrum.highestPeaks(1)
34 spectrum.estimatedNoiseLevel()
35 spectrum.removeNoise()
36 spectrum.transformMZ(813.19073486)
37 if pos == 1:
38 spectrum.similarityTo(spectrum_list[0])
39 break
40
41
42 if __name__ == "__main__":
43 main()