# HG changeset patch
# User iuc
# Date 1718910838 0
# Node ID 97b1b5ad1cda003f3eff12d312cfd2778ee83354
# Parent baceff842902bc802d2b771e9fe7d8f2496ab161
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_bakta_database commit e0ce56ac52cff0e8f85e546440d28ca46853b11d
diff -r baceff842902 -r 97b1b5ad1cda data_manager/bakta_build_database.py
--- a/data_manager/bakta_build_database.py Wed Jun 05 14:20:59 2024 +0000
+++ b/data_manager/bakta_build_database.py Thu Jun 20 19:13:58 2024 +0000
@@ -135,13 +135,9 @@
try:
with bakta_path.open("wb") as fh_out, requests.get(
self.db_url, stream=True) as resp:
- total_length = resp.headers.get("content-length")
- if total_length is None: # no content length header
- for data in resp.iter_content(chunk_size=1024 * 1024):
- fh_out.write(data)
- else:
- for data in resp.iter_content(chunk_size=1024 * 1024):
- fh_out.write(data)
+ # total_length = resp.headers.get("content-length")
+ for data in resp.iter_content(chunk_size=1024 * 1024):
+ fh_out.write(data)
print(f"Download bakta database {self.db_version}")
self.tarball_path = bakta_path
except IOError:
@@ -158,12 +154,19 @@
) as tar_file:
tar_file.extractall(path=db_path)
print(f"Untar the database in {db_path}")
-
- if not self.test_mode:
- self.move_files(db_path=db_path)
-
except OSError:
sys.exit(f"ERROR: Could not extract {self.tar_name} " f"to {db_path}")
+ if not self.test_mode:
+ self.move_files(db_path=db_path)
+ self.db_dir = db_path.resolve()
+
+ def delete_folder(self, path):
+ for sub in path.iterdir():
+ if sub.is_dir() and sub.name != "latest":
+ self.delete_folder(sub)
+ else:
+ sub.unlink()
+ path.rmdir()
def move_files(self, db_path):
if db_path.joinpath("db-light").is_dir():
@@ -173,9 +176,9 @@
output_dir = db_path
for file in input_dir.iterdir():
if file.is_file(): # to avoid moving amrfinder-plus folder
- input = input_dir.joinpath(file)
- output = output_dir.joinpath(file)
- input.rename(output)
+ output = output_dir.joinpath(file.name)
+ file.rename(output)
+ self.delete_folder(input_dir)
def calc_md5_sum(self, buffer_size=1048576):
tarball_path = Path(self.db_dir).joinpath(self.tar_name)
diff -r baceff842902 -r 97b1b5ad1cda data_manager/bakta_build_database.xml
--- a/data_manager/bakta_build_database.xml Wed Jun 05 14:20:59 2024 +0000
+++ b/data_manager/bakta_build_database.xml Thu Jun 20 19:13:58 2024 +0000
@@ -68,6 +68,19 @@
+
+
+
+
+
+
diff -r baceff842902 -r 97b1b5ad1cda data_manager/macro.xml
--- a/data_manager/macro.xml Wed Jun 05 14:20:59 2024 +0000
+++ b/data_manager/macro.xml Thu Jun 20 19:13:58 2024 +0000
@@ -2,7 +2,7 @@
1.9.3
2.27.1
3.8
- 0
+ 1
21.05
diff -r baceff842902 -r 97b1b5ad1cda test-data/bakta_test.loc
--- a/test-data/bakta_test.loc Wed Jun 05 14:20:59 2024 +0000
+++ b/test-data/bakta_test.loc Thu Jun 20 19:13:58 2024 +0000
@@ -1,34 +1,4 @@
-V1.0_2022-10-12 7197299 1.4 bakta-db
-V5.0_2023-06-08 8021027 1.8 bakta-db
-V5.0light_2023-06-08 8021027 1.8 bakta-db
-V1.0_2022-10-12 7197299 1.4 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpmw3oj2pm/galaxy-dev/tool-data/bakta_database/7197299
-V5.0light_2023-06-08 8021027 1.8 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpmw3oj2pm/galaxy-dev/tool-data/bakta_database/8021027
-V1.0_2022-10-12 7197299 1.4 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpe_k2ghko/galaxy-dev/tool-data/bakta_database/7197299
-V5.0light_2023-06-08 8021027 1.8 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpe_k2ghko/galaxy-dev/tool-data/bakta_database/8021027
-V1.0_2020-11-20 4247253 0.3 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpfggmpn80/galaxy-dev/tool-data/bakta_database/4247253
-V1.0_2020-11-20 4247253 0.3 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpcp1hbj74/galaxy-dev/tool-data/bakta_database/4247253
-V5.0light_2023-02-20 7669534 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpcp1hbj74/galaxy-dev/tool-data/bakta_database/7669534
-V1.0_2020-11-20 4247253 0.3 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpch1mha23/galaxy-dev/tool-data/bakta_database/4247253
-V5.1_2024-01-19 10522951 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpch1mha23/galaxy-dev/tool-data/bakta_database/10522951
-V5.0light_2023-02-20 7669534 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpch1mha23/galaxy-dev/tool-data/bakta_database/7669534
-V1.0_2020-11-20 4247253 0.3 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpdntg5lkb/galaxy-dev/tool-data/bakta_database/4247253
-V5.1light_2024-01-19 10522951 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpdntg5lkb/galaxy-dev/tool-data/bakta_database/10522951
-V5.0light_2023-02-20 7669534 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpdntg5lkb/galaxy-dev/tool-data/bakta_database/7669534
-V1.0_2020-11-20 4247253 0.3 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmp2dxsmaz6/galaxy-dev/tool-data/bakta_database/4247253
-V5.0light_2023-02-20 7669534 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmp2dxsmaz6/galaxy-dev/tool-data/bakta_database/7669534
-V5.1light_2024-01-19 10522951 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpxo577qsb/galaxy-dev/tool-data/bakta_database/10522951
-V5.0light_2023-02-20 7669534 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpxo577qsb/galaxy-dev/tool-data/bakta_database/7669534
-V1.0_2020-11-20 4247253 0.3 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpw560binc/galaxy-dev/tool-data/bakta_database/4247253
-V5.1light_2024-01-19 10522951 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpw560binc/galaxy-dev/tool-data/bakta_database/10522951
-V5.0light_2023-02-20 7669534 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpw560binc/galaxy-dev/tool-data/bakta_database/7669534
-V1.0_2020-11-20 4247253 0.3 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpaehfoqch/galaxy-dev/tool-data/bakta_database/4247253
-V5.0light_2023-02-20 7669534 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpaehfoqch/galaxy-dev/tool-data/bakta_database/7669534
-V1.0_2020-11-20 4247253 0.3 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpj53k33oy/galaxy-dev/tool-data/bakta_database/4247253
-V5.1light_2024-01-19 10522951 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpj53k33oy/galaxy-dev/tool-data/bakta_database/10522951
-V5.0light_2023-02-20 7669534 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpj53k33oy/galaxy-dev/tool-data/bakta_database/7669534
-V1.0_2022-10-12 7197299 1.4 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpdn_di5v_/galaxy-dev/tool-data/bakta_database/7197299
-V5.1light_2024-01-19 11371737 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpdn_di5v_/galaxy-dev/tool-data/bakta_database/11371737
-V5.0light_2023-06-08 8021027 1.8 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmpdn_di5v_/galaxy-dev/tool-data/bakta_database/8021027
-V1.0_2022-10-12 7197299 1.4 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmp7n51m5jb/galaxy-dev/tool-data/bakta_database/7197299
-V5.1light_2024-01-19 11371737 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmp7n51m5jb/galaxy-dev/tool-data/bakta_database/11371737
-V5.0light_2023-06-08 8021027 1.8 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmp7n51m5jb/galaxy-dev/tool-data/bakta_database/8021027
+V1.0_2022-10-12 7197299 1.4 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmp4iv55h8k/galaxy-dev/tool-data/bakta_database/7197299
+V5.1light_2024-01-19 11371737 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmp4iv55h8k/galaxy-dev/tool-data/bakta_database/11371737
+V5.0light_2023-06-08 8021027 1.8 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmp4iv55h8k/galaxy-dev/tool-data/bakta_database/8021027
+V5.1light_2024-01-19 10522951 1.7 /private/var/folders/7j/21czvpk170zcyjdbqrp0hmsh0000gn/T/tmp4iv55h8k/galaxy-dev/tool-data/bakta_database/10522951