Mercurial > repos > devteam > data_manager_build_kraken_database
view data_manager/make_json.py @ 7:5b0724200665 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_build_kraken_database/ commit 20cfde679c4064cea8a0b64763ddd5e092af7eab
author | iuc |
---|---|
date | Tue, 17 Jul 2018 12:12:00 -0400 (2018-07-17) |
parents | 6f0294046f41 |
children | 1d616842e1db |
line wrap: on
line source
import argparse import json import os import shutil def main(args): data_manager_entry = {} data_manager_entry['value'] = args.database.lower() data_manager_entry['name'] = args.database data_manager_entry['path'] = '.' data_manager_json = dict(data_tables=dict(kraken_databases=data_manager_entry)) params = json.loads(open(args.output).read()) target_directory = params['output_data'][0]['extra_files_path'] os.mkdir(target_directory) output_path = os.path.join(os.getcwd(), 'kraken-database') for filename in os.listdir(output_path): shutil.move(os.path.join(output_path, filename), target_directory) file(args.output, 'w').write(json.dumps(data_manager_json)) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Create data manager json.') parser.add_argument('--db', dest='database', action='store', help='Database name') parser.add_argument('--out', dest='output', action='store', help='JSON filename') args = parser.parse_args() main(args)