Mercurial > repos > iuc > data_manager_build_kraken2_database
annotate data_manager/kraken2_build_database.py @ 12:90b4d4f0a3a4 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
author | iuc |
---|---|
date | Fri, 18 Oct 2024 17:08:15 +0000 |
parents | 9002633b4737 |
children | e9ee4d074d5d |
rev | line source |
---|---|
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
1 #!/usr/bin/env python |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
2 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
3 import argparse |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
4 import datetime |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
5 import errno |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
6 import json |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
7 import os |
12
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
8 import re |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
9 import shutil |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
10 import subprocess |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
11 import sys |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
12 import tarfile |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
13 from enum import Enum |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
14 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
15 try: |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
16 # Python3 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
17 from urllib.request import urlopen |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
18 from urllib.error import URLError |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
19 except ImportError: |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
20 from urllib2 import urlopen |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
21 from urllib2 import URLError |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
22 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
23 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
24 DATA_TABLE_NAME = "kraken2_databases" |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
25 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
26 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
27 class KrakenDatabaseTypes(Enum): |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
28 standard_local_build = 'standard_local_build' |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
29 standard_prebuilt = 'standard_prebuilt' |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
30 minikraken = 'minikraken' |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
31 special = 'special' |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
32 custom = 'custom' |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
33 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
34 def __str__(self): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
35 return self.value |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
36 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
37 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
38 class SpecialDatabaseTypes(Enum): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
39 rdp = 'rdp' |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
40 greengenes = 'greengenes' |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
41 silva = 'silva' |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
42 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
43 def __str__(self): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
44 return self.value |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
45 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
46 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
47 class Minikraken2Versions(Enum): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
48 v1 = 'v1' |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
49 v2 = 'v2' |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
50 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
51 def __str__(self): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
52 return self.value |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
53 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
54 |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
55 class StandardPrebuiltSizes(Enum): |
6
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
56 viral = "viral" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
57 minusb = "minusb" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
58 standard = "standard" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
59 standard_08gb = "standard_08gb" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
60 standard_16gb = "standard_16gb" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
61 pluspf = "pluspf" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
62 pluspf_08gb = "pluspf_08gb" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
63 pluspf_16gb = "pluspf_16gb" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
64 pluspfp = "pluspfp" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
65 pluspfp_08gb = "pluspfp_08gb" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
66 pluspfp_16gb = "pluspfp_16gb" |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
67 |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
68 def __str__(self): |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
69 return self.value |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
70 |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
71 |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
72 def kraken2_build_standard(kraken2_args, target_directory, data_table_name=DATA_TABLE_NAME): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
73 now = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H%M%SZ") |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
74 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
75 database_value = "_".join([ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
76 now, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
77 "standard", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
78 "kmer-len", str(kraken2_args["kmer_len"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
79 "minimizer-len", str(kraken2_args["minimizer_len"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
80 "minimizer-spaces", str(kraken2_args["minimizer_spaces"]), |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
81 "load-factor", str(kraken2_args["load_factor"]), |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
82 ]) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
83 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
84 database_name = " ".join([ |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
85 "Standard (Local Build)", |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
86 "(Created:", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
87 now + ",", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
88 "kmer-len=" + str(kraken2_args["kmer_len"]) + ",", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
89 "minimizer-len=" + str(kraken2_args["minimizer_len"]) + ",", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
90 "minimizer-spaces=" + str(kraken2_args["minimizer_spaces"]) + ")", |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
91 "load-factor", str(kraken2_args["load_factor"]), |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
92 ]) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
93 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
94 database_path = database_value |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
95 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
96 args = [ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
97 '--threads', str(kraken2_args["threads"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
98 '--standard', |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
99 '--kmer-len', str(kraken2_args["kmer_len"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
100 '--minimizer-len', str(kraken2_args["minimizer_len"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
101 '--minimizer-spaces', str(kraken2_args["minimizer_spaces"]), |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
102 '--load-factor', str(kraken2_args["load_factor"]), |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
103 '--db', database_path |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
104 ] |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
105 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
106 subprocess.check_call(['kraken2-build'] + args, cwd=target_directory) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
107 |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
108 if kraken2_args["clean"]: |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
109 args = [ |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
110 '--threads', str(kraken2_args["threads"]), |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
111 '--clean', |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
112 '--db', database_path |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
113 ] |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
114 |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
115 subprocess.check_call(['kraken2-build'] + args, cwd=target_directory) |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
116 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
117 data_table_entry = { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
118 'data_tables': { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
119 data_table_name: [ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
120 { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
121 "value": database_value, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
122 "name": database_name, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
123 "path": database_path, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
124 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
125 ] |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
126 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
127 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
128 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
129 return data_table_entry |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
130 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
131 |
6
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
132 def kraken2_build_standard_prebuilt(prebuilt_db, prebuilt_date, target_directory, data_table_name=DATA_TABLE_NAME): |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
133 |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
134 now = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H%M%SZ") |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
135 |
6
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
136 prebuild_name = { |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
137 'viral': "Viral", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
138 'minusb': "MinusB (archaea, viral, plasmid, human, UniVec_Core)", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
139 'standard': "Standard-Full (archaea, bacteria, viral, plasmid, human,UniVec_Core)", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
140 'standard_08gb': "Standard-8 (Standard with DB capped at 8 GB)", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
141 'standard_16gb': "Standard-16 (Standard with DB capped at 16 GB)", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
142 'pluspf': "PlusPF (Standard plus protozoa and fungi)", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
143 'pluspf_08gb': "PlusPF-8 (PlusPF with DB capped at 8 GB)", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
144 'pluspf_16gb': "PlusPF-16 (PlusPF with DB capped at 16 GB)", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
145 'pluspfp': "PlusPFP (Standard plus protozoa, fungi and plant)", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
146 'pluspfp_08gb': "PlusPFP-8 (PlusPFP with DB capped at 8 GB)", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
147 'pluspfp_16gb': "PlusPFP-16 (PlusPFP with DB capped at 16 GB)" |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
148 } |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
149 |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
150 database_value = "_".join([ |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
151 now, |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
152 "standard_prebuilt", |
6
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
153 prebuilt_db, |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
154 prebuilt_date |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
155 ]) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
156 |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
157 database_name = " ".join([ |
6
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
158 "Prebuilt Refseq indexes: ", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
159 prebuild_name[prebuilt_db], |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
160 "(Version: ", |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
161 prebuilt_date, |
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
162 "- Downloaded:", |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
163 now + ")" |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
164 ]) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
165 |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
166 database_path = database_value |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
167 |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
168 # we may need to let the user choose the date when new DBs are posted. |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
169 date_url_str = prebuilt_date.replace('-', '') |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
170 # download the pre-built database |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
171 try: |
6
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
172 download_url = 'https://genome-idx.s3.amazonaws.com/kraken/k2_%s_%s.tar.gz' % (prebuilt_db, date_url_str) |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
173 src = urlopen(download_url) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
174 except URLError as e: |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
175 print('url: ' + download_url, file=sys.stderr) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
176 print(e, file=sys.stderr) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
177 exit(1) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
178 |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
179 with open('tmp_data.tar.gz', 'wb') as dst: |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
180 shutil.copyfileobj(src, dst) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
181 # unpack the downloaded archive to the target directory |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
182 with tarfile.open('tmp_data.tar.gz', 'r:gz') as fh: |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
183 for member in fh.getmembers(): |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
184 if member.isreg(): |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
185 member.name = os.path.basename(member.name) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
186 fh.extract(member, os.path.join(target_directory, database_path)) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
187 |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
188 data_table_entry = { |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
189 'data_tables': { |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
190 data_table_name: [ |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
191 { |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
192 "value": database_value, |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
193 "name": database_name, |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
194 "path": database_path, |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
195 } |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
196 ] |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
197 } |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
198 } |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
199 |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
200 return data_table_entry |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
201 |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
202 |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
203 def kraken2_build_minikraken(minikraken2_version, target_directory, data_table_name=DATA_TABLE_NAME): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
204 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
205 now = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H%M%SZ") |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
206 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
207 database_value = "_".join([ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
208 now, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
209 "minikraken2", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
210 minikraken2_version, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
211 "8GB", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
212 ]) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
213 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
214 database_name = " ".join([ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
215 "Minikraken2", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
216 minikraken2_version, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
217 "(Created:", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
218 now + ")" |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
219 ]) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
220 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
221 database_path = database_value |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
222 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
223 # download the minikraken2 data |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
224 try: |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
225 download_url = 'https://genome-idx.s3.amazonaws.com/kraken/minikraken2_%s_8GB_201904.tgz' % minikraken2_version |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
226 src = urlopen(download_url) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
227 except URLError as e: |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
228 print('url: ' + download_url, file=sys.stderr) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
229 print(e, file=sys.stderr) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
230 exit(1) |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
231 |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
232 with open('tmp_data.tar.gz', 'wb') as dst: |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
233 shutil.copyfileobj(src, dst) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
234 # unpack the downloaded archive to the target directory |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
235 with tarfile.open('tmp_data.tar.gz', 'r:gz') as fh: |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
236 for member in fh.getmembers(): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
237 if member.isreg(): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
238 member.name = os.path.basename(member.name) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
239 fh.extract(member, os.path.join(target_directory, database_path)) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
240 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
241 data_table_entry = { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
242 'data_tables': { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
243 data_table_name: [ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
244 { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
245 "value": database_value, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
246 "name": database_name, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
247 "path": database_path, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
248 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
249 ] |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
250 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
251 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
252 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
253 return data_table_entry |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
254 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
255 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
256 def kraken2_build_special(kraken2_args, target_directory, data_table_name=DATA_TABLE_NAME): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
257 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
258 now = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H%M%SZ") |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
259 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
260 special_database_names = { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
261 "rdp": "RDP", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
262 "greengenes": "Greengenes", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
263 "silva": "Silva", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
264 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
265 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
266 database_value = "_".join([ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
267 now, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
268 kraken2_args["special_database_type"], |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
269 "kmer-len", str(kraken2_args["kmer_len"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
270 "minimizer-len", str(kraken2_args["minimizer_len"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
271 "minimizer-spaces", str(kraken2_args["minimizer_spaces"]), |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
272 "load-factor", str(kraken2_args["load_factor"]), |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
273 ]) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
274 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
275 database_name = " ".join([ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
276 special_database_names[kraken2_args["special_database_type"]], |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
277 "(Created:", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
278 now + ",", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
279 "kmer-len=" + str(kraken2_args["kmer_len"]) + ",", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
280 "minimizer-len=" + str(kraken2_args["minimizer_len"]) + ",", |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
281 "minimizer-spaces=" + str(kraken2_args["minimizer_spaces"]) + ")", |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
282 "load-factor=" + str(kraken2_args["load_factor"]) + ")", |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
283 ]) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
284 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
285 database_path = database_value |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
286 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
287 args = [ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
288 '--threads', str(kraken2_args["threads"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
289 '--special', kraken2_args["special_database_type"], |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
290 '--kmer-len', str(kraken2_args["kmer_len"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
291 '--minimizer-len', str(kraken2_args["minimizer_len"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
292 '--minimizer-spaces', str(kraken2_args["minimizer_spaces"]), |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
293 '--load-factor', str(kraken2_args["load_factor"]), |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
294 '--db', database_path |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
295 ] |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
296 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
297 subprocess.check_call(['kraken2-build'] + args, cwd=target_directory) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
298 |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
299 if kraken2_args["clean"]: |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
300 args = [ |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
301 '--threads', str(kraken2_args["threads"]), |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
302 '--clean', |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
303 '--db', database_path |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
304 ] |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
305 |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
306 subprocess.check_call(['kraken2-build'] + args, cwd=target_directory) |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
307 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
308 data_table_entry = { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
309 'data_tables': { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
310 data_table_name: [ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
311 { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
312 "value": database_value, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
313 "name": database_name, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
314 "path": database_path, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
315 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
316 ] |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
317 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
318 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
319 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
320 return data_table_entry |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
321 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
322 |
12
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
323 def kraken2_build_custom(kraken2_args, custom_database_name, custom_source_info, target_directory, data_table_name=DATA_TABLE_NAME): |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
324 now = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H%M%SZ") |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
325 |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
326 database_value = "_".join([ |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
327 now, |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
328 re.sub(r'[^\w_.-]+', '_', custom_database_name).strip('_'), |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
329 "kmer-len", str(kraken2_args["kmer_len"]), |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
330 "minimizer-len", str(kraken2_args["minimizer_len"]), |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
331 "minimizer-spaces", str(kraken2_args["minimizer_spaces"]), |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
332 "load-factor", str(kraken2_args["load_factor"]), |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
333 ]) |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
334 |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
335 database_name = " ".join([ |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
336 custom_database_name, |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
337 "(" + custom_source_info + ",", |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
338 "kmer-len=" + str(kraken2_args["kmer_len"]) + ",", |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
339 "minimizer-len=" + str(kraken2_args["minimizer_len"]) + ",", |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
340 "minimizer-spaces=" + str(kraken2_args["minimizer_spaces"]) + ",", |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
341 "load-factor=" + str(kraken2_args["load_factor"]) + ")", |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
342 ]) |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
343 |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
344 database_path = database_value |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
345 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
346 args = [ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
347 '--threads', str(kraken2_args["threads"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
348 '--download-taxonomy', |
12
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
349 '--db', database_path, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
350 ] |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
351 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
352 if kraken2_args['skip_maps']: |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
353 args.append('--skip-maps') |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
354 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
355 subprocess.check_call(['kraken2-build'] + args, cwd=target_directory) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
356 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
357 args = [ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
358 '--threads', str(kraken2_args["threads"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
359 '--add-to-library', kraken2_args["custom_fasta"], |
12
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
360 '--db', database_path, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
361 ] |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
362 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
363 subprocess.check_call(['kraken2-build'] + args, cwd=target_directory) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
364 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
365 args = [ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
366 '--threads', str(kraken2_args["threads"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
367 '--build', |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
368 '--kmer-len', str(kraken2_args["kmer_len"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
369 '--minimizer-len', str(kraken2_args["minimizer_len"]), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
370 '--minimizer-spaces', str(kraken2_args["minimizer_spaces"]), |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
371 '--load-factor', str(kraken2_args["load_factor"]), |
12
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
372 '--db', database_path, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
373 ] |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
374 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
375 subprocess.check_call(['kraken2-build'] + args, cwd=target_directory) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
376 |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
377 if kraken2_args["clean"]: |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
378 args = [ |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
379 '--threads', str(kraken2_args["threads"]), |
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
380 '--clean', |
12
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
381 '--db', database_path, |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
382 ] |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
383 |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
384 subprocess.check_call(['kraken2-build'] + args, cwd=target_directory) |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
385 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
386 data_table_entry = { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
387 'data_tables': { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
388 data_table_name: [ |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
389 { |
12
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
390 "value": database_value, |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
391 "name": database_name, |
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
392 "path": database_path, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
393 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
394 ] |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
395 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
396 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
397 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
398 return data_table_entry |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
399 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
400 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
401 def main(): |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
402 parser = argparse.ArgumentParser() |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
403 parser.add_argument('data_manager_json') |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
404 parser.add_argument('--kmer-len', dest='kmer_len', type=int, default=35, help='kmer length') |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
405 parser.add_argument('--minimizer-len', dest='minimizer_len', type=int, default=31, help='minimizer length') |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
406 parser.add_argument('--minimizer-spaces', dest='minimizer_spaces', default=6, help='minimizer spaces') |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
407 parser.add_argument('--load-factor', dest='load_factor', type=float, default=0.7, help='load factor') |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
408 parser.add_argument('--threads', dest='threads', default=1, help='threads') |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
409 parser.add_argument('--database-type', dest='database_type', type=KrakenDatabaseTypes, choices=list(KrakenDatabaseTypes), required=True, help='type of kraken database to build') |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
410 parser.add_argument('--minikraken2-version', dest='minikraken2_version', type=Minikraken2Versions, choices=list(Minikraken2Versions), help='MiniKraken2 version (only applies to --database-type minikraken)') |
6
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
411 parser.add_argument('--prebuilt-db', dest='prebuilt_db', type=StandardPrebuiltSizes, choices=list(StandardPrebuiltSizes), help='Prebuilt database to download. Only applies to --database-type standard_prebuilt.') |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
412 parser.add_argument('--prebuilt-date', dest='prebuilt_date', help='Database build date (YYYY-MM-DD). Only applies to --database-type standard_prebuilt.') |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
413 parser.add_argument('--special-database-type', dest='special_database_type', type=SpecialDatabaseTypes, choices=list(SpecialDatabaseTypes), help='type of special database to build (only applies to --database-type special)') |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
414 parser.add_argument('--custom-fasta', dest='custom_fasta', help='fasta file for custom database (only applies to --database-type custom)') |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
415 parser.add_argument('--custom-database-name', dest='custom_database_name', help='Name for custom database (only applies to --database-type custom)') |
12
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
416 parser.add_argument('--custom-source-info', dest='custom_source_info', help='Description of how this build has been sourced (only applies to --database-type custom)') |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
417 parser.add_argument('--skip-maps', dest='skip_maps', action='store_true', help='') |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
418 parser.add_argument('--clean', dest='clean', action='store_true', help='Clean up extra files') |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
419 args = parser.parse_args() |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
420 |
3
19b6a2f0dbe2
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents:
2
diff
changeset
|
421 with open(args.data_manager_json) as fh: |
19b6a2f0dbe2
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents:
2
diff
changeset
|
422 data_manager_input = json.load(fh) |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
423 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
424 target_directory = data_manager_input['output_data'][0]['extra_files_path'] |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
425 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
426 try: |
3
19b6a2f0dbe2
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents:
2
diff
changeset
|
427 os.mkdir(target_directory) |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
428 except OSError as exc: |
3
19b6a2f0dbe2
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents:
2
diff
changeset
|
429 if exc.errno == errno.EEXIST and os.path.isdir(target_directory): |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
430 pass |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
431 else: |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
432 raise |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
433 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
434 data_manager_output = {} |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
435 |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
436 if str(args.database_type) == 'standard_local_build': |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
437 kraken2_args = { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
438 "kmer_len": args.kmer_len, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
439 "minimizer_len": args.minimizer_len, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
440 "minimizer_spaces": args.minimizer_spaces, |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
441 "load_factor": args.load_factor, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
442 "threads": args.threads, |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
443 "clean": args.clean, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
444 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
445 data_manager_output = kraken2_build_standard( |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
446 kraken2_args, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
447 target_directory, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
448 ) |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
449 elif str(args.database_type) == 'standard_prebuilt': |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
450 data_manager_output = kraken2_build_standard_prebuilt( |
6
9002633b4737
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5d74f13e59c4a2862c108ac1a08c067b0cfb2d97
iuc
parents:
5
diff
changeset
|
451 str(args.prebuilt_db), |
5
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
452 str(args.prebuilt_date), |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
453 target_directory |
2f27f3b86827
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 648fe4911ce49173697f314d70e63e0de95b7e66"
iuc
parents:
4
diff
changeset
|
454 ) |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
455 elif str(args.database_type) == 'minikraken': |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
456 data_manager_output = kraken2_build_minikraken( |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
457 str(args.minikraken2_version), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
458 target_directory |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
459 ) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
460 elif str(args.database_type) == 'special': |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
461 kraken2_args = { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
462 "special_database_type": str(args.special_database_type), |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
463 "kmer_len": args.kmer_len, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
464 "minimizer_len": args.minimizer_len, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
465 "minimizer_spaces": args.minimizer_spaces, |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
466 "load_factor": args.load_factor, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
467 "threads": args.threads, |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
468 "clean": args.clean, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
469 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
470 data_manager_output = kraken2_build_special( |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
471 kraken2_args, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
472 target_directory, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
473 ) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
474 elif str(args.database_type) == 'custom': |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
475 kraken2_args = { |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
476 "custom_fasta": args.custom_fasta, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
477 "skip_maps": args.skip_maps, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
478 "kmer_len": args.kmer_len, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
479 "minimizer_len": args.minimizer_len, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
480 "minimizer_spaces": args.minimizer_spaces, |
4
0eebe086fd58
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit fed92935f1f0b52173d2fddbdd2bbf44e802b51e"
iuc
parents:
3
diff
changeset
|
481 "load_factor": args.load_factor, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
482 "threads": args.threads, |
1
6ba1ec5f86fc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 5f6f447482ad7e127af78204ffd583c51509a0be
iuc
parents:
0
diff
changeset
|
483 "clean": args.clean, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
484 } |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
485 data_manager_output = kraken2_build_custom( |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
486 kraken2_args, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
487 args.custom_database_name, |
12
90b4d4f0a3a4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 9835da32741d05d129a1a44835f66e32713770ad
iuc
parents:
6
diff
changeset
|
488 args.custom_source_info, |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
489 target_directory, |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
490 ) |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
491 else: |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
492 sys.exit("Invalid database type") |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
493 |
3
19b6a2f0dbe2
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents:
2
diff
changeset
|
494 with open(args.data_manager_json, 'w') as fh: |
19b6a2f0dbe2
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
iuc
parents:
2
diff
changeset
|
495 json.dump(data_manager_output, fh, sort_keys=True) |
0
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
496 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
497 |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
498 if __name__ == "__main__": |
e4cdf82de430
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff
changeset
|
499 main() |