Mercurial > repos > iuc > data_manager_mapseq
comparison data_manager_fetch_mapseq_db.py @ 1:4cd97cc67061 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/ commit 373300c0508fc239fa6d1c8a0351fa9cbb9c0426
author | iuc |
---|---|
date | Sat, 23 Mar 2024 07:20:14 +0000 |
parents | dbf2735e8480 |
children | 23511530b8fd |
comparison
equal
deleted
inserted
replaced
0:dbf2735e8480 | 1:4cd97cc67061 |
---|---|
18 } | 18 } |
19 | 19 |
20 DB_names = { | 20 DB_names = { |
21 "mgnify_lsu": "MGnify LSU (v5.0.7) - silva_lsu-20200130", | 21 "mgnify_lsu": "MGnify LSU (v5.0.7) - silva_lsu-20200130", |
22 "mgnify_ssu": "MGnify SSU (v5.0.7) - silva_ssu-20200130", | 22 "mgnify_ssu": "MGnify SSU (v5.0.7) - silva_ssu-20200130", |
23 "mgnify_its_unite": "MGnify ITS ITSonedb (v5.0.7) - ITSoneDB-20200214", | 23 "mgnify_its_unite": "MGnify ITS UNITE (v5.0.7) - UNITE-20200214", |
24 "mgnify_its_itsonedb": "MGnify ITS UNITE (v5.0.7) - UNITE-20200214", | 24 "mgnify_its_itsonedb": "MGnify ITS ITSonedb (v5.0.7) - ITSoneDB-20200214", |
25 "test_lsu": "Trimmed LSU Test DB", | 25 "test_lsu": "Trimmed LSU Test DB", |
26 } | 26 } |
27 | 27 |
28 | 28 |
29 def download_untar_store(url, tmp_path, dest_path): | 29 def download_untar_store(url, tmp_path, dest_path): |
30 """ | 30 """ |
31 Download a tar.gz file containing one folder, | 31 Download a tar.gz file containing one folder, |
32 extract that folder and move the content inside dest_path | 32 extract that folder and move the content inside dest_path |
33 """ | 33 """ |
34 | 34 |
35 extract_path = os.path.join(tmp_path, "extract") | 35 extract_path = os.path.join(tmp_path, "extract") |
36 | 36 |
37 os.makedirs(tmp_path, exist_ok=True) | 37 os.makedirs(tmp_path, exist_ok=True) |
49 folder_path = os.path.join(extract_path, folder) | 49 folder_path = os.path.join(extract_path, folder) |
50 | 50 |
51 print(f"Copy data to {dest_path}") | 51 print(f"Copy data to {dest_path}") |
52 shutil.copytree(folder_path, dest_path) | 52 shutil.copytree(folder_path, dest_path) |
53 print("Done !") | 53 print("Done !") |
54 | 54 |
55 shutil.rmtree(tmp_path) | 55 shutil.rmtree(tmp_path) |
56 | 56 |
57 | 57 |
58 def main(): | 58 def main(): |
59 # Parse Command Line | 59 # Parse Command Line |
86 # output paths | 86 # output paths |
87 db_path = os.path.join(workdir, db_value) | 87 db_path = os.path.join(workdir, db_value) |
88 tmp_path = os.path.join(workdir, "tmp") | 88 tmp_path = os.path.join(workdir, "tmp") |
89 | 89 |
90 # create DB | 90 # create DB |
91 if args.test: | 91 if args.test: |
92 url = DB_paths["test_lsu"] | 92 url = DB_paths["test_lsu"] |
93 else: | 93 else: |
94 url = DB_paths[args.db_type] | 94 url = DB_paths[args.db_type] |
95 | 95 |
96 # download data | 96 # download data |