Mercurial > repos > iuc > data_manager_fetch_refseq
comparison data_manager/fetch_refseq.py @ 4:d58cad5baa70 draft default tip
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_fetch_refseq commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
author | iuc |
---|---|
date | Sun, 22 Nov 2020 12:49:04 +0000 |
parents | 8b91891ae805 |
children |
comparison
equal
deleted
inserted
replaced
3:f1e545aa76c7 | 4:d58cad5baa70 |
---|---|
139 args = parser.parse_args() | 139 args = parser.parse_args() |
140 | 140 |
141 division_names = args.division_names.split(',') | 141 division_names = args.division_names.split(',') |
142 mol_types = args.mol_types.split(',') | 142 mol_types = args.mol_types.split(',') |
143 if args.galaxy_datamanager_filename is not None: | 143 if args.galaxy_datamanager_filename is not None: |
144 dm_opts = json.loads(open(args.galaxy_datamanager_filename).read()) | 144 with open(args.galaxy_datamanager_filename) as fh: |
145 dm_opts = json.load(fh) | |
145 output_directory = dm_opts['output_data'][0]['extra_files_path'] # take the extra_files_path of the first output parameter | 146 output_directory = dm_opts['output_data'][0]['extra_files_path'] # take the extra_files_path of the first output parameter |
146 data_manager_dict = {} | 147 data_manager_dict = {} |
147 else: | 148 else: |
148 output_directory = args.output_directory | 149 output_directory = args.output_directory |
149 for division_name in division_names: | 150 for division_name in division_names: |
160 desc = 'RefSeq ' + division_name + ' Release ' + release_num + ' ' + mol_type + ' (' + today_str + ')' | 161 desc = 'RefSeq ' + division_name + ' Release ' + release_num + ' ' + mol_type + ' (' + today_str + ')' |
161 path = os.path.join(output_directory, fasta_files[i]) | 162 path = os.path.join(output_directory, fasta_files[i]) |
162 _add_data_table_entry(data_manager_dict=data_manager_dict, | 163 _add_data_table_entry(data_manager_dict=data_manager_dict, |
163 data_table_entry=dict(value=unique_key, dbkey=dbkey, name=desc, path=path), | 164 data_table_entry=dict(value=unique_key, dbkey=dbkey, name=desc, path=path), |
164 data_table_name='all_fasta') | 165 data_table_name='all_fasta') |
165 open(args.galaxy_datamanager_filename, 'w').write(json.dumps(data_manager_dict, sort_keys=True)) | 166 with open(args.galaxy_datamanager_filename, 'w') as fh: |
167 json.dump(data_manager_dict, fh, sort_keys=True) |