comparison msmetaenhancer_wrapper.py @ 2:8338640d8676 draft

"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/msmetaenhancer commit fc4fc95ed79d03b2f8d075d0df27d75eb93c58ea"
author recetox
date Mon, 25 Apr 2022 06:29:43 +0000
parents ce612a11b455
children f387ebd6b734
comparison
equal deleted inserted replaced
1:b50c2e941cae 2:8338640d8676
1 import argparse 1 import argparse
2 import asyncio 2 import asyncio
3 import sys 3 import sys
4 4
5 5 from matchms import set_matchms_logger_level
6 from MSMetaEnhancer import Application 6 from MSMetaEnhancer import Application
7 7
8 8
9 def main(argv): 9 def main(argv):
10 parser = argparse.ArgumentParser(description="Annotate MSP file.") 10 parser = argparse.ArgumentParser(description="Annotate MSP file.")
14 parser.add_argument("--log_file", type=str, help="Path to log with details of the annotation process.") 14 parser.add_argument("--log_file", type=str, help="Path to log with details of the annotation process.")
15 args = parser.parse_args() 15 args = parser.parse_args()
16 16
17 app = Application(log_file=args.log_file) 17 app = Application(log_file=args.log_file)
18 18
19 # set matchms logging level to avoid extensive messages in stdout while reading file
20 set_matchms_logger_level("ERROR")
19 # import .msp file 21 # import .msp file
20 app.load_spectra(args.input_file, file_format='msp') 22 app.load_spectra(args.input_file, file_format='msp')
23
24 # set matchms logging level back to warning
25 set_matchms_logger_level("WARNING")
21 26
22 # curate given metadata 27 # curate given metadata
23 app.curate_spectra() 28 app.curate_spectra()
24 29
25 # specify requested services and jobs 30 # specify requested services and jobs