comparison data_manager/vsnp_excel_fetcher.py @ 1:b819e969b5d9 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_vsnp_excel commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
author iuc
date Sun, 22 Nov 2020 12:55:17 +0000
parents 25811bd45c44
children
comparison
equal deleted inserted replaced
0:25811bd45c44 1:b819e969b5d9
33 33
34 34
35 def download(dbkey, name, url, out_file): 35 def download(dbkey, name, url, out_file):
36 36
37 with open(out_file) as fh: 37 with open(out_file) as fh:
38 params = json.loads(fh.read()) 38 params = json.load(fh)
39 39
40 workdir = params['output_data'][0]['extra_files_path'] 40 workdir = params['output_data'][0]['extra_files_path']
41 os.makedirs(workdir) 41 os.makedirs(workdir)
42 file_path = url_download(url, workdir) 42 file_path = url_download(url, workdir)
43 entry_name = os.path.basename(file_path) 43 entry_name = os.path.basename(file_path)
49 data_manager_entry['path'] = file_path 49 data_manager_entry['path'] = file_path
50 data_manager_entry['description'] = "Excel file for %s" % name 50 data_manager_entry['description'] = "Excel file for %s" % name
51 data_manager_json["data_tables"]["vsnp_excel"] = data_manager_entry 51 data_manager_json["data_tables"]["vsnp_excel"] = data_manager_entry
52 52
53 with open(out_file, 'w') as fh: 53 with open(out_file, 'w') as fh:
54 fh.write(json.dumps(data_manager_json, sort_keys=True)) 54 json.dump(data_manager_json, fh, sort_keys=True)
55 55
56 56
57 parser = argparse.ArgumentParser() 57 parser = argparse.ArgumentParser()
58 58
59 parser.add_argument('--dbkey', dest='dbkey', help='Genome reference dbkey') 59 parser.add_argument('--dbkey', dest='dbkey', help='Genome reference dbkey')