Mercurial > repos > iuc > data_manager_fetch_busco
comparison data_manager/extract.py @ 5:6ab91825be22 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_fetch_busco/ commit d46d2ec37b9b8f08d58472978c51b4c46e7ed18c
author | iuc |
---|---|
date | Fri, 04 Apr 2025 10:12:43 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4:828d961faea7 | 5:6ab91825be22 |
---|---|
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') |