# HG changeset patch # User iuc # Date 1606049328 0 # Node ID 9de2fb1ce1fb1881641fbcfe4c0e0a5ffa289ffb # Parent d6acd5cd497bc1222f539444c63fbce13955a976 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_fetch_ncbi_taxonomy/ commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165" diff -r d6acd5cd497b -r 9de2fb1ce1fb data_manager/data_manager.py --- a/data_manager/data_manager.py Mon Jul 06 20:06:21 2020 -0400 +++ b/data_manager/data_manager.py Sun Nov 22 12:48:48 2020 +0000 @@ -5,12 +5,7 @@ import shutil import tarfile import zipfile -try: - # For Python 3.0 and later - from urllib.request import Request, urlopen -except ImportError: - # Fall back to Python 2 imports - from urllib2 import Request, urlopen +from urllib.request import Request, urlopen def url_download(url, workdir): @@ -50,14 +45,15 @@ data_manager_entry['name'] = args.name data_manager_entry['path'] = '.' data_manager_json = dict(data_tables=dict(ncbi_taxonomy=data_manager_entry)) - params = json.loads(open(args.output).read()) + with open(args.output) as fh: + params = json.load(fh) target_directory = params['output_data'][0]['extra_files_path'] os.mkdir(target_directory) output_path = os.path.abspath(os.path.join(os.getcwd(), 'taxonomy')) for filename in os.listdir(workdir): shutil.move(os.path.join(output_path, filename), target_directory) - with open(args.output, 'w') as out: - out.write(json.dumps(data_manager_json, sort_keys=True)) + with open(args.output, 'w') as fh: + json.dump(data_manager_json, fh, sort_keys=True) if __name__ == '__main__': diff -r d6acd5cd497b -r 9de2fb1ce1fb data_manager/ncbi_taxonomy_fetcher.xml --- a/data_manager/ncbi_taxonomy_fetcher.xml Mon Jul 06 20:06:21 2020 -0400 +++ b/data_manager/ncbi_taxonomy_fetcher.xml Sun Nov 22 12:48:48 2020 +0000 @@ -1,6 +1,9 @@ - + taxonomy downloader + + python + + + + + + + + + + Download a taxonomy dump from a provided URL. + The default URL is the latest dump from NCBI taxonomy. + diff -r d6acd5cd497b -r 9de2fb1ce1fb test-data/ncbi_taxonomy.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/ncbi_taxonomy.loc Sun Nov 22 12:48:48 2020 +0000 @@ -0,0 +1,5 @@ +# Tab separated fields where +# value is unique key +# name is descriptive name +# path is path to directory containing names.dmp and nodes.dmp files +#value name path diff -r d6acd5cd497b -r 9de2fb1ce1fb test-data/taxonomy.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/taxonomy.json Sun Nov 22 12:48:48 2020 +0000 @@ -0,0 +1,1 @@ +{"data_tables": {"ncbi_taxonomy": {"name": "tax_name", "path": ".", "value": "tax_name"}}} \ No newline at end of file diff -r d6acd5cd497b -r 9de2fb1ce1fb tool-data/ncbi_taxonomy.loc.sample --- a/tool-data/ncbi_taxonomy.loc.sample Mon Jul 06 20:06:21 2020 -0400 +++ b/tool-data/ncbi_taxonomy.loc.sample Sun Nov 22 12:48:48 2020 +0000 @@ -2,4 +2,4 @@ # value is unique key # name is descriptive name # path is path to directory containing names.dmp and nodes.dmp files -#value name path +#value name path diff -r d6acd5cd497b -r 9de2fb1ce1fb tool_data_table_conf.xml.test --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_data_table_conf.xml.test Sun Nov 22 12:48:48 2020 +0000 @@ -0,0 +1,8 @@ + + + + + value, name, path + +
+