Mercurial > repos > galaxyp > maxquant
comparison modify_mqpar.py @ 15:97a7f34fcb6a draft
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/maxquant commit 641b1d3af3b589a861cde2dc2f8803c9b79df7be"
author | galaxyp |
---|---|
date | Wed, 11 Aug 2021 09:24:23 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
14:e42225f8a659 | 15:97a7f34fcb6a |
---|---|
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') |