diff --git a/steps/filter_ms_group.cwl b/steps/filter_ms_group.cwl index 73ae7909954bb9b8db05402f1affe570e694a3b1..83c41c61b8b443ea06dc1e9c3c140eb3ba9ec701 100644 --- a/steps/filter_ms_group.cwl +++ b/steps/filter_ms_group.cwl @@ -21,19 +21,16 @@ outputs: - id: output type: Directory[] outputBinding: - loadContents: true - glob: 'selected_ms.json' - outputEval: '$(JSON.parse(self[0].contents))' + glob: $(runtime.outdir)/cwl.output.json + outputEval: $(self.output) - id: selected_ms type: string[] outputBinding: - loadContents: true - glob: 'out.json' - outputEval: $(JSON.parse(self[0].contents).selected_ms) + glob: $(runtime.outdir)/cwl.output.json + outputEval: $(self.selected_ms) label: filter_ms_group requirements: - - class: InlineJavascriptRequirement - class: InitialWorkDirRequirement listing: - entryname: filter_ms_group.py @@ -50,23 +47,18 @@ requirements: ms_by_name = { ms.split(os.path.sep)[-1]: {'class':'Directory', 'path': ms} for ms in ms_list} - output_file = 'selected_ms.json' - with open(json_file, 'r') as f_stream: selected_ms = json.load(f_stream)[group_id] selected_ms = [os.path.basename(ms_name) for ms_name in selected_ms] - cwl_output = {'selected_ms': selected_ms} + selected_ms_names = [ms_by_name[ms_name] for ms_name in selected_ms + if ms_name != 'dummy.ms'] + cwl_output = {'selected_ms': selected_ms, + 'output': selected_ms_names} - with open('./out.json', 'w') as fp: + with open('./cwl.output.json', 'w') as fp: json.dump(cwl_output, fp) - selected_ms = [ms_by_name[ms_name] for ms_name in selected_ms if ms_name != 'dummy.ms'] - - - with open(output_file, 'w') as f_stream: - json.dump(selected_ms, f_stream) - hints: - class: InitialWorkDirRequirement listing: