comparison modify_mqpar.py @ 3:2d67fb758956 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/maxquant commit da342a782ccc391b87fb4fead956b7b3cbd21258"
author galaxyp
date Sat, 11 Apr 2020 11:50:09 -0400
parents
children
comparison
equal deleted inserted replaced
2:3fc2116ac6d9 3:2d67fb758956
1 "Modify a given mqpar.xml to run Galaxy MaxQuant with it."
2
3 import argparse
4 import os
5
6 from mqparam import MQParam
7
8 parser = argparse.ArgumentParser()
9
10 arguments = ('--infiles',
11 '--version',
12 '--num_threads',
13 '--substitution_rx',
14 '--fasta_files',
15 '--description_parse_rule',
16 '--identifier_parse_rule',
17 'mqpar')
18
19 for arg in arguments:
20 parser.add_argument(arg)
21
22 args = parser.parse_args()
23
24 mqpar_out = os.path.join(os.getcwd(), 'mqpar.xml')
25 infiles = [os.path.join(os.getcwd(), f) for f in args.infiles.split(',')]
26 mqparam = MQParam(args.mqpar, None, substitution_rx=args.substitution_rx)
27 if mqparam.version != args.version:
28 raise Exception('mqpar version is ' + mqparam.version + '. Tool uses version {}.'.format(args.version))
29 mqparam.translate(infiles)
30 mqparam.add_fasta_files(args.fasta_files.split(','),
31 {'identifierParseRule': args.identifier_parse_rule,
32 'descriptionParseRule': args.description_parse_rule})
33 mqparam.set_simple_param('numThreads', args.num_threads)
34 mqparam.write('mqpar.xml')