annotate data_manager/bracken_build_database.py @ 3:3c7d2c84cb09 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
author iuc
date Mon, 08 Nov 2021 15:51:51 +0000
parents fd5830f88314
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
1 #!/usr/bin/env python
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
2
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
3 from __future__ import print_function
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
4
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
5 import argparse
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
6 import errno
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
7 import json
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
8 import os
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
9 import subprocess
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
10 import uuid
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
11
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
12
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
13 DATA_TABLE_NAME = "bracken_databases"
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
14
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
15
3
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
16 def bracken_build_database(target_directory, bracken_build_args, database_name, prebuilt=False, data_table_name=DATA_TABLE_NAME):
0
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
17
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
18 database_value = str(uuid.uuid4())
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
19
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
20 database_name = database_name
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
21
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
22 database_path = os.path.join(bracken_build_args['kraken_database'], 'database' + str(bracken_build_args['read_len']) + 'mers.kmer_distrib')
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
23
3
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
24 if not prebuilt:
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
25 bracken_build_args_list = [
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
26 '-t', bracken_build_args['threads'],
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
27 '-k', bracken_build_args['kmer_len'],
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
28 '-l', bracken_build_args['read_len'],
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
29 '-d', bracken_build_args['kraken_database'],
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
30 ]
0
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
31
3
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
32 subprocess.check_call(['bracken-build'] + bracken_build_args_list)
0
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
33
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
34 data_table_entry = {
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
35 "data_tables": {
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
36 data_table_name: [
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
37 {
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
38 "value": database_value,
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
39 "name": database_name,
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
40 "path": database_path,
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
41 }
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
42 ]
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
43 }
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
44 }
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
45
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
46 return data_table_entry
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
47
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
48
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
49 def main():
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
50 parser = argparse.ArgumentParser()
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
51 parser.add_argument('data_manager_json')
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
52 parser.add_argument('--threads', dest='threads', default=1, help='threads')
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
53 parser.add_argument('--kmer-len', dest='kmer_len', help='K-mer length')
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
54 parser.add_argument('--read-len', dest='read_len', help='Read length')
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
55 parser.add_argument('--kraken-db', dest='kraken_database', help='Kraken Database')
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
56 parser.add_argument('--database-name', dest='database_name', help='Database Name')
3
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
57 parser.add_argument('--prebuilt', action='store_true', dest='prebuilt', help='Use pre-built DB')
0
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
58 args = parser.parse_args()
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
59
2
fd5830f88314 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents: 0
diff changeset
60 with open(args.data_manager_json) as fh:
fd5830f88314 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents: 0
diff changeset
61 data_manager_input = json.load(fh)
0
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
62
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
63 target_directory = data_manager_input['output_data'][0]['extra_files_path']
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
64
3
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
65 if args.prebuilt:
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
66 bracken_build_args = {
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
67 'threads': args.threads,
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
68 'read_len': args.read_len,
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
69 'kraken_database': args.kraken_database,
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
70 }
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
71 else:
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
72 bracken_build_args = {
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
73 'threads': args.threads,
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
74 'kmer_len': args.kmer_len,
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
75 'read_len': args.read_len,
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
76 'kraken_database': args.kraken_database,
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
77 }
0
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
78
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
79 try:
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
80 os.mkdir(target_directory)
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
81 except OSError as exc:
2
fd5830f88314 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents: 0
diff changeset
82 if exc.errno == errno.EEXIST and os.path.isdir(target_directory):
0
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
83 pass
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
84 else:
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
85 raise
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
86
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
87 data_manager_output = {}
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
88
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
89 data_manager_output = bracken_build_database(
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
90 target_directory,
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
91 bracken_build_args,
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
92 args.database_name,
3
3c7d2c84cb09 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 798f4c97da10258a9ab6c16903b169ce69a05523"
iuc
parents: 2
diff changeset
93 args.prebuilt,
0
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
94 )
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
95
2
fd5830f88314 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents: 0
diff changeset
96 with open(args.data_manager_json, 'w') as fh:
fd5830f88314 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents: 0
diff changeset
97 json.dump(data_manager_output, fh, sort_keys=True)
0
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
98
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
99
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
100 if __name__ == "__main__":
c2e4127fb5bf "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bracken_database/ commit 74e81c69c8806d98beb15a889741bcd702866ce3"
iuc
parents:
diff changeset
101 main()