Mercurial > repos > iuc > data_manager_fetch_busco
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data_manager/extract.py Fri Apr 04 10:12:43 2025 +0000 @@ -0,0 +1,23 @@ +import json +import os +import re +import sys + +busco_db = os.path.join(sys.argv[1], "lineages") +busco_db_value = sys.argv[2] +dmjson = sys.argv[3] + +content = [] +for d in os.scandir(busco_db): + if not d.is_dir(): + continue + if not os.path.exists(os.path.join(d, "dataset.cfg")): + continue + name = re.sub(r"_odb\d+", "", d.name) + name = name.replace("_", " ").capitalize() + content.append({'value': d.name, 'name': name, 'db_value': busco_db_value}) + +with open(dmjson, "w") as fh: + json.dump({"data_tables": {"busco_database_options": content}}, fh) + +print(f'{len(content)} x busco_db\n')