Mercurial > repos > iuc > data_manager_fetch_busco
comparison data_manager/extract.py @ 7:8ef19ca5d289 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_fetch_busco/ commit 32f1099f18b41bf1efd1a039daf732809c77269e
author | iuc |
---|---|
date | Tue, 22 Apr 2025 13:11:57 +0000 |
parents | 709faa13c793 |
children |
comparison
equal
deleted
inserted
replaced
6:709faa13c793 | 7:8ef19ca5d289 |
---|---|
1 import json | |
2 import os | |
3 import re | |
4 import sys | |
5 | |
6 busco_db = os.path.join(sys.argv[1], "lineages") | |
7 busco_db_value = sys.argv[2] | |
8 dmjson = sys.argv[3] | |
9 | |
10 content = [] | |
11 for d in os.scandir(busco_db): | |
12 if not d.is_dir(): | |
13 continue | |
14 if not os.path.exists(os.path.join(d, "dataset.cfg")): | |
15 continue | |
16 name = re.sub(r"_odb\d+", "", d.name) | |
17 name = name.replace("_", " ").capitalize() | |
18 content.append({'value': d.name, 'name': name, 'db_value': busco_db_value}) | |
19 | |
20 with open(dmjson, "w") as fh: | |
21 json.dump({"data_tables": {"busco_database_options": content}}, fh) | |
22 | |
23 print(f'{len(content)} x busco_db\n') |