Mercurial > repos > iuc > data_manager_selection_background
comparison data_manager/data_manager_selection_background.py @ 3:10ac95ec81d9 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_selection_background commit bbba39ae993250a1e7301965b03c12621513775e"
author | iuc |
---|---|
date | Wed, 25 Aug 2021 21:07:59 +0000 |
parents | e4f07770b340 |
children |
comparison
equal
deleted
inserted
replaced
2:e4f07770b340 | 3:10ac95ec81d9 |
---|---|
109 parser.add_argument('--label', dest='label', action='store', required=True, help='Label to display') | 109 parser.add_argument('--label', dest='label', action='store', required=True, help='Label to display') |
110 parser.add_argument('--uri', dest='uri', action='store', help='URI for the sequences') | 110 parser.add_argument('--uri', dest='uri', action='store', help='URI for the sequences') |
111 parser.add_argument('--dataset', dest='dataset', action='store', help='Path for the sequences') | 111 parser.add_argument('--dataset', dest='dataset', action='store', help='Path for the sequences') |
112 | 112 |
113 args = parser.parse_args() | 113 args = parser.parse_args() |
114 | 114 dbkey = str(args.dbkey) |
115 work_dir = os.getcwd() | |
116 | 115 |
117 if args.uri is not None: | 116 if args.uri is not None: |
118 background_fasta = url_download(args.uri) | 117 background_fasta = url_download(args.uri) |
119 else: | 118 else: |
120 background_fasta = args.dataset | 119 background_fasta = args.dataset |
121 | 120 |
122 table_entry = '%s.fa' % args.dbkey | 121 with open(args.output) as fh: |
123 shutil.copy(background_fasta, os.path.join(work_dir, table_entry)) | 122 params = json.load(fh) |
123 target_directory = params['output_data'][0]['extra_files_path'] | |
124 os.makedirs(target_directory, exist_ok=True) | |
125 table_entry = '%s.fa' % dbkey | |
126 shutil.copy(background_fasta, os.path.join(target_directory, table_entry)) | |
124 | 127 |
125 # Update Data Manager JSON and write to file | 128 # Update Data Manager JSON and write to file |
126 data_manager_entry = { | 129 data_manager_entry = { |
127 'data_tables': { | 130 'data_tables': { |
128 'selection_background': {'value': args.dbkey, 'label': args.label, 'path': table_entry} | 131 'selection_background': {'value': dbkey, 'label': args.label, 'path': table_entry} |
129 } | 132 } |
130 } | 133 } |
131 | 134 |
132 with open(os.path.join(args.output), 'w+') as fh: | 135 with open(os.path.join(args.output), 'w+') as fh: |
133 json.dump(data_manager_entry, fh, sort_keys=True) | 136 json.dump(data_manager_entry, fh, sort_keys=True) |