annotate data_manager/kraken2_build_database.py @ 14:8c533e19b697 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 66be7bc4e07926c3645ba87f78702f2267fad7b3
author iuc
date Fri, 13 Dec 2024 21:18:31 +0000
parents e9ee4d074d5d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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'
13
e9ee4d074d5d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit bb6d9b53b197610c5dbbb40c8ab590761755d91a
iuc
parents: 12
diff changeset
31 special_prebuilt = 'special_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
32 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
33 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
34
e4cdf82de430 planemo 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 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
36 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
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
e4cdf82de430 planemo 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 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
40 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
41 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
42 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
43
e4cdf82de430 planemo 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 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
45 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
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
e4cdf82de430 planemo 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 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
49 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
50 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
51
e4cdf82de430 planemo 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 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
53 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
54
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
55
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
56 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
57 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
58 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
59 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
60 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
61 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
62 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
63 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
64 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
65 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
66 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
67 pluspfp_16gb = "pluspfp_16gb"
13
e9ee4d074d5d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit bb6d9b53b197610c5dbbb40c8ab590761755d91a
iuc
parents: 12
diff changeset
68 eupathdb48 = "eupathdb48"
14
8c533e19b697 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 66be7bc4e07926c3645ba87f78702f2267fad7b3
iuc
parents: 13
diff changeset
69 core_nt = "core_nt"
8c533e19b697 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 66be7bc4e07926c3645ba87f78702f2267fad7b3
iuc
parents: 13
diff changeset
70 gtdb_genome_reps = "gtdb_genome_reps"
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
71
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
72 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
73 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
74
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
75
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
76 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
77 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
78
e4cdf82de430 planemo 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 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
80 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
81 "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
82 "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
83 "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
84 "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
85 "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
86 ])
e4cdf82de430 planemo 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
e4cdf82de430 planemo 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 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
89 "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
90 "(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
91 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
92 "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
93 "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
94 "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
95 "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
96 ])
e4cdf82de430 planemo 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
e4cdf82de430 planemo 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 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
99
e4cdf82de430 planemo 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 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
101 '--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
102 '--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
103 '--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
104 '--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
105 '--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
106 '--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
107 '--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
108 ]
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
109
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
110 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
111
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
112 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
113 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
114 '--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
115 '--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
116 '--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
117 ]
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
118
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
119 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
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 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
122 '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
123 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
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 "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
126 "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
127 "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
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 ]
e4cdf82de430 planemo 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 }
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
132
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
133 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
134
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
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 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
137
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
138 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
139
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
140 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
141 '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
142 '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
143 '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
144 '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
145 '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
146 '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
147 '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
148 '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
149 '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
150 'pluspfp_08gb': "PlusPFP-8 (PlusPFP with DB capped at 8 GB)",
13
e9ee4d074d5d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit bb6d9b53b197610c5dbbb40c8ab590761755d91a
iuc
parents: 12
diff changeset
151 'pluspfp_16gb': "PlusPFP-16 (PlusPFP with DB capped at 16 GB)",
e9ee4d074d5d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit bb6d9b53b197610c5dbbb40c8ab590761755d91a
iuc
parents: 12
diff changeset
152 'eupathdb48': "EuPathDB-46",
14
8c533e19b697 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 66be7bc4e07926c3645ba87f78702f2267fad7b3
iuc
parents: 13
diff changeset
153 'core_nt': "core_nt (Very large collection, inclusive of GenBank, RefSeq, TPA and PDB)",
8c533e19b697 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 66be7bc4e07926c3645ba87f78702f2267fad7b3
iuc
parents: 13
diff changeset
154 'gtdb_genome_reps': "GTDB v220 (Bacterial and archaeal)",
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
155 }
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
156
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
157 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
158 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
159 "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
160 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
161 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
162 ])
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
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 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
165 "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
166 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
167 "(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
168 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
169 "- 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
170 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
171 ])
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
172
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 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
174
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 # 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
176 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
177 # 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
178 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
179 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
180 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
181 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
182 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
183 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
184 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
185
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 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
187 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
188 # 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
189 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
190 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
191 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
192 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
193 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
194
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 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
196 '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
197 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
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 "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
200 "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
201 "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
202 }
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
203 ]
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
204 }
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
205 }
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
206
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
207 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
208
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
209
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
210 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
211
e4cdf82de430 planemo 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 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
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_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
215 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
216 "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
217 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
218 "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
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_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
222 "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
223 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
224 "(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
225 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
226 ])
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
227
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
228 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
229
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
230 # 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
231 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
232 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
233 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
234 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
235 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
236 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
237 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
238
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
239 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
240 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
241 # 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
242 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
243 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
244 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
245 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
246 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
247
e4cdf82de430 planemo 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 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
249 '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
250 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
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 "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
253 "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
254 "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
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 ]
e4cdf82de430 planemo 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 }
e4cdf82de430 planemo 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 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
261
e4cdf82de430 planemo 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
e4cdf82de430 planemo 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 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
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 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
266
e4cdf82de430 planemo 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 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
268 "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
269 "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
270 "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
271 }
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
272
e4cdf82de430 planemo 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 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
274 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
275 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
276 "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
277 "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
278 "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
279 "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
280 ])
e4cdf82de430 planemo 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
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
282 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
283 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
284 "(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
285 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
286 "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
287 "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
288 "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
289 "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
290 ])
e4cdf82de430 planemo 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
e4cdf82de430 planemo 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 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
293
e4cdf82de430 planemo 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 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
295 '--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
296 '--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
297 '--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
298 '--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
299 '--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
300 '--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
301 '--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
302 ]
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
303
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
304 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
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 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
307 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
308 '--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
309 '--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
310 '--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
311 ]
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
312
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
313 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
314
e4cdf82de430 planemo 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 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
316 '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
317 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
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 "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
320 "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
321 "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
322 }
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
323 ]
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
324 }
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
325 }
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
326
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
327 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
328
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
329
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
330 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
331 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
332
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 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
334 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
335 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
336 "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
337 "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
338 "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
339 "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
340 ])
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
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 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
343 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
344 "(" + 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
345 "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
346 "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
347 "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
348 "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
349 ])
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
350
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
351 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
352
e4cdf82de430 planemo 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 = [
e4cdf82de430 planemo 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 '--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
355 '--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
356 '--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
357 ]
e4cdf82de430 planemo 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
e4cdf82de430 planemo 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 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
360 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
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 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
363
e4cdf82de430 planemo 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 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
365 '--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
366 '--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
367 '--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
368 ]
e4cdf82de430 planemo 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
e4cdf82de430 planemo 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 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
371
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
372 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
373 '--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
374 '--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
375 '--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
376 '--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
377 '--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
378 '--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
379 '--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
380 ]
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
381
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
382 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
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 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
385 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
386 '--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
387 '--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
388 '--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
389 ]
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
390
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
391 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
392
e4cdf82de430 planemo 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 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
394 '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
395 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
396 {
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
397 "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
398 "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
399 "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
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 ]
e4cdf82de430 planemo 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 }
e4cdf82de430 planemo 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 }
e4cdf82de430 planemo 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
e4cdf82de430 planemo 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 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
406
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
407
e4cdf82de430 planemo 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 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
409 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
410 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
411 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
412 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
413 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
414 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
415 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
416 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
417 parser.add_argument('--minikraken2-version', dest='minikraken2_version', type=Minikraken2Versions, choices=list(Minikraken2Versions), help='MiniKraken2 version (only applies to --database-type minikraken)')
13
e9ee4d074d5d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit bb6d9b53b197610c5dbbb40c8ab590761755d91a
iuc
parents: 12
diff changeset
418 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 or special_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
419 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
420 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
421 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
422 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
423 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
424 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
425 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
426 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
427
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
428 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
429 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
430
e4cdf82de430 planemo 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 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
432
e4cdf82de430 planemo 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 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
434 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
435 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
436 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
437 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
438 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
439 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
440
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
441 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
442
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
443 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
444 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
445 "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
446 "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
447 "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
448 "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
449 "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
450 "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
451 }
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
452 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
453 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
454 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
455 )
13
e9ee4d074d5d planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit bb6d9b53b197610c5dbbb40c8ab590761755d91a
iuc
parents: 12
diff changeset
456 elif str(args.database_type) in ('standard_prebuilt', 'special_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
457 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
458 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
459 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
460 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
461 )
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
462 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
463 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
464 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
465 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
466 )
e4cdf82de430 planemo 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 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
468 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
469 "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
470 "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
471 "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
472 "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
473 "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
474 "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
475 "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
476 }
e4cdf82de430 planemo 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 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
478 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
479 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
480 )
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
481 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
482 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
483 "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
484 "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
485 "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
486 "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
487 "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
488 "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
489 "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
490 "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
491 }
e4cdf82de430 planemo 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 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
493 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
494 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
495 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
496 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
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 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
499 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
500
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
501 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
502 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
503
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
504
e4cdf82de430 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken2_database/ commit 30d1a86d5c8a3fa434e24ff915f85f51e514ceb2
iuc
parents:
diff changeset
505 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
506 main()